Tasker and GPS Permissions

245 views
Skip to first unread message

billku

unread,
Jul 1, 2011, 2:13:00 PM7/1/11
to Tasker
Hi All --

New to Tasker, love it. Does anyone have any ideas for creating a
task that can automatically agree to the annoying GPS permission pop-
ups every time you enable GPS on the phone? The ones that ask whether
you're okay with data collection, etc. Obviously, I agree to it every
time and would love for tasker to just automatically press "agree" for
me. Or best yet, get rid of the pop-ups all together, though that's
probably more of a root question than a tasker question. Anyway,
thanks in advance for any and all help!

Bill

Bill Kunstler

unread,
Jul 1, 2011, 10:54:57 PM7/1/11
to Tasker

I forgot to add I have Samsung Droid charge running froyo.

Pent

unread,
Jul 2, 2011, 4:33:50 AM7/2/11
to Tasker
Hi Bill,
It's only going to (possibly) work if you have a rooted phone,
standard Android doesn't allow apps to interfere with each other.

Pent

billku

unread,
Jul 3, 2011, 12:32:17 AM7/3/11
to Tasker
Hi Pent! I do have a rooted phone. How would I go about using tasker
to automatically agree to those pesky GPS pop-ups?

Pent

unread,
Jul 3, 2011, 5:20:08 AM7/3/11
to Tasker
> Hi Pent!  I do have a rooted phone.  How would I go about using tasker
> to automatically agree to those pesky GPS pop-ups?

OK, the pressing of the buttons is easy, you just use the Input
category action Dpad to select the right button and then press it.

The problem is detecting the dialog.

For that, you want to try the event UI / New Window. Use first as the
action
'Flash %WIN' so you can see what the title of the window is. If it's
something useful, you can match against it in the New Window event
(see Pattern Matching in the userguide) and trigger your button
selection task from there.

Pent

billku

unread,
Jul 3, 2011, 1:52:49 PM7/3/11
to Tasker
Thanks so much! I am new to tasker so a lot of that is greek to me,
but I'm going to study up and see if I can figure it out! Again,
thanks!

billku

unread,
Jul 4, 2011, 8:05:58 PM7/4/11
to Tasker
Okay, Pent, I'm a little stymied. Can you tell me which sections in
the userguide I should be looking at to try and figure out the
implementations of which you're speaking? I have a "turn GPS on"
context set up already, but I don't know where to go from there. For
instance, I don't know what "Input category action dpad" means. And
you said that was the easy part :) Thanks so much for your help on
this...

UncleMike

unread,
Jul 5, 2011, 12:20:31 AM7/5/11
to tas...@googlegroups.com
I'm just jumping in here, but I have to ask so I can better understand... are you manually enabling GPS and being prompted for permission each time?

What context are you using for the "turn GPS on" context that you already have setup?  I think what Pent is saying is that your profile should have a context similar to:

Variable Value %WIN ~ <name of window>

And that the task should contain the following actions (from the Input category):

Dpad Right (or whatever moves the selection to the right spot for "Yes" or "OK")
Dpad Press

This should simulate selecting the appropriate option and pressing it.

As for the name of the Window, what I would do is create a Task Widget that has the following actions:

Wait 10 seconds
Flash %WIN

This will flash the name of the current window 10 seconds after you tap the widget.  Then, tap the widget, and enable GPS.  After 10 seconds Tasker should flash the name of the current Window.  Then you can plug that name into the above context and you're all set.

This assumes that the window name is available and useful.  If it's simply something like "confirm", then this could appear under other circumstances, and you'll want to use either a different or additional context to make sure your profile only activates at the right time.

billku

unread,
Jul 5, 2011, 4:55:25 PM7/5/11
to Tasker
I've set up a task so that any application that needs to use GPS turns
GPS on when it starts, like maps or camera apps that use geolocation.
The problem (if you can call it that) is that when tasker turns GPS
on, it's always accompanied by a permission window that lets me know
it's collecting info, etc, and asks me to either agree or cancel. I'd
like to just have that agree button automatically pushed each time. I
admit I'm not sure what you mean by this line: Variable Value %WIN ~
<name of window>. I hate to bug anyone, so if you can point out which
sections of the userguide I can read to figure this stuff out, that
would be great, I've had problems finding it myself. One other
question, the window comes up, and there are two buttons to push,
"Accept" in the lower right and "Cancel" in the lower left. So would
that be dpad right and then dpad press? Thanks so much for your help.

billku

unread,
Jul 5, 2011, 5:14:43 PM7/5/11
to Tasker
PS I tried to use the widget you suggested, and all it flashes on the
screen is "%WIN," not the name of the window.

On Jul 4, 9:20 pm, UncleMike <mquin...@metroconnectonline.com> wrote:

billku

unread,
Jul 5, 2011, 7:27:18 PM7/5/11
to Tasker
Hmm, I actually figured out how to add the "Dpad" tasks to the GPS
profile. When I test the tasks, the window pops up, tasker pushes the
"accept" button for me, and GPS is turned on. Great. Except when I
try it under actual circumstances, and start up "maps," the GPS
permission pops up and goes away, but GPS does not turn on, and it
doesn't seem like tasker is pressing the button. Weird, I don't
know what I'm doing wrong as it works when you're testing it, though
to be fair, all of this window recognition stuff you guys have been
talking about, I haven't done anything with that, it seemed like an
unnecessary step given the fact that it seemed to be working when you
press the test button as I've set it up...

UncleMike

unread,
Jul 5, 2011, 7:58:28 PM7/5/11
to tas...@googlegroups.com
If you're programatically (in Tasker) turning GPS on, then it shouldn't be necessary to detect the window, because you'll know when it's going to popup.  Detecting the window was more to save you some steps when manually enabling GPS.

Since you're getting just %WIN flashing, the window apparently doesn't have a name declared (I'm not sure if that's the right terminology), so there's really not anything you can do with that.

If the Dpad actions work during testing, it must be something different that's happening during actual use that is causing it to not work.  Can you post the details of the Task or Profile that you're using?  Maybe that will shed some light on things.

Bill Kunstler

unread,
Jul 6, 2011, 12:31:05 AM7/6/11
to Tasker
Here are the XML details:

<class cl="TaskerData" sr="">
<class cl="Profile" sr="prof2">
<nme>MAPS/GPS</nme>
<id>9999</id>
<class cl="AppContext" sr="con0" ve="2">
<label11>Layar</label11>
<cls9>com.google.android.stardroid.activities.SplashScreenActivity</
cls9>
<label12>Movies</label12>
<cls8>ymst.android.fxcamera.FxCameraTopActivity</cls8>
<label13>Navigation</label13>
<cls7>com.facebook.katana.LoginActivity</cls7>
<pkg20>com.truxmap</pkg20>
<label14>Photo illusion</label14>
<cls6>com.google.earth.EarthActivity</cls6>

<cls5>com.mufumbo.craigslist.notification.android.NotificationListing</
cls5>
<cls4>vStudio.Android.Camera360.GPhotoMain</cls4>
<cls3>com.androidillusion.cameraillusion.CameraActivity</cls3>
<label10>Latitude</label10>
<cls2>com.sec.android.app.camera.Camera</cls2>
<label19>Speed</label19>
<cls1>com.opentable.activity.Splash</cls1>
<cls0>com.google.android.maps.MapsActivity</cls0>
<label15>Places</label15>
<label16>Vignette</label16>
<label17>Where's My Droid</label17>
<label18>Yelp</label18>
<label7>Facebook</label7>
<label6>Earth</label6>
<label5>CraigsNotifica</label5>
<label4>Camera360</label4>
<label9>Google Sky Map</label9>
<label8>FxCamera</label8>
<label20>TruxMap</label20>
<cls17>com.alienmanfc6.wheresmyandroid.Main</cls17>
<cls18>com.yelp.android.ui.activities.RootActivity</cls18>
<cls19>com.steventroughtonsmith.speed.androidspeed</cls19>
<cls14>com.androidillusion.photoillusion.PhotoActivity</cls14>
<cls13>com.google.android.maps.driveabout.app.DestinationActivity</
cls13>
<cls16>uk.co.neilandtheresa.Vignette.Vignette</cls16>
<cls15>com.google.android.maps.PlacesActivity</cls15>
<cls10>com.google.android.maps.LatitudeActivity</cls10>
<cls12>net.flixster.android.MainActivity</cls12>
<cls11>com.layar.Main</cls11>
<pkg4>vStudio.Android.Camera360</pkg4>
<label0>Maps</label0>
<pkg19>com.steventroughtonsmith.speed</pkg19>
<pkg5>com.mufumbo.craigslist.notification.android</pkg5>
<label1>OpenTable</label1>
<pkg6>com.google.earth</pkg6>
<label2>Camera</label2>
<pkg7>com.facebook.katana</pkg7>
<label3>Camera Illusion</label3>
<pkg16>uk.co.neilandtheresa.Vignette</pkg16>
<pkg8>ymst.android.fxcamera</pkg8>
<pkg15>com.google.android.apps.maps</pkg15>
<pkg9>com.google.android.stardroid</pkg9>
<pkg18>com.yelp.android</pkg18>
<pkg17>com.alienmanfc6.wheresmyandroid</pkg17>
<pkg0>com.google.android.apps.maps</pkg0>
<pkg1>com.opentable</pkg1>
<pkg2>com.sec.android.app.camera</pkg2>
<pkg3>com.androidillusion.cameraillusion</pkg3>
<pkg11>com.layar</pkg11>
<pkg12>net.flixster.android</pkg12>
<pkg13>com.google.android.apps.maps</pkg13>
<pkg14>com.androidillusion.photoillusion</pkg14>
<cls20>com.truxmap.Menu</cls20>
<pkg10>com.google.android.apps.maps</pkg10>
</class>
<mid1>4</mid1>
<mid0>3</mid0>
</class>
<class cl="Task" sr="task3">
<nme>Auto-launch GPS</nme>
<id>3</id>
<class cl="Action" sr="act1">
<code>701</code>
<class cl="IntArg" sr="arg1">
<val>1</val>
</class>
<class cl="IntArg" sr="arg0">
<val>2</val>
</class>
</class>
<pri>10</pri>
<class cl="Action" sr="act0">
<class cl="IntArg" sr="arg0">
<val>1</val>
</class>
<code>332</code>
</class>
<class cl="Action" sr="act2">
<code>701</code>
<class cl="IntArg" sr="arg1">
<val>1</val>
</class>
<class cl="IntArg" sr="arg0">
<val>4</val>
</class>
</class>
</class>
<class cl="Task" sr="task4">
<nme>Shutdown GPS</nme>
<id>4</id>
<pri>10</pri>
<class cl="Action" sr="act0">
<class cl="IntArg" sr="arg0">
</class>
<code>332</code>
</class>
</class>
<tv>1.0.21u2</tv>
</class>

Bill Kunstler

unread,
Jul 6, 2011, 12:24:29 AM7/6/11
to Tasker
Is this what you're asking for? By the way, it works here and there.
But for the most part, it doesn't turn gps on. By the way, thanks so
much for your help!

Profile: MAPS/GPS (2)
Application: Maps, OpenTable, Camera...
Enter: Auto-launch GPS (3)
A1: GPS [ Set:On ]
A2: Dpad [ Button:Left Repeat Times:1 ]
A3: Dpad [ Button:Press Repeat Times:1 ]

Exit: Shutdown GPS (4)
A1: GPS [ Set:Off ]


On Jul 5, 4:58 pm, UncleMike <mquin...@metroconnectonline.com> wrote:

Pent

unread,
Jul 6, 2011, 3:36:52 AM7/6/11
to Tasker
> Enter: Auto-launch GPS (3)
>         A1: GPS [ Set:On ]
>         A2: Dpad [ Button:Left Repeat Times:1 ]
>         A3: Dpad [ Button:Press Repeat Times:1 ]

The Dpad action is probably trying to do stuff before the window has
appeared.
Try putting a 2 second Wait in (if you can't get the window auto-
detection to work). BTW, the window auto detection requires that you
enable Tasker's accessibility service in Android accessibility
settings.

Pent

billku

unread,
Jul 6, 2011, 12:50:11 PM7/6/11
to Tasker
I don't think the time delay is the problem. With the delay added,
for some reason, the GPS pop-up comes on the screen and then
disappears very quickly without the button being pushed. Then the
dpad action takes place and it actually pushes the "+" button on the
tasker task window. So something in tasker is causing that GPS pop-up
to go away quickly without any of the buttons -- "Accept" or "Cancel"
-- being pushed. On the bright side, this is a replication of what's
happening when I try to actually use the task for real. On the
downside, now even the test of the task isn't working (as it did
before). Any thoughts? Thanks!

sayling

unread,
Jul 6, 2011, 6:47:57 PM7/6/11
to Tasker
Hopefully you'll get Gingerbread soon ;)
> > Pent- Hide quoted text -
>
> - Show quoted text -

UncleMike

unread,
Jul 6, 2011, 7:14:42 PM7/6/11
to tas...@googlegroups.com
Is it possible that in actual use, the appearance of the popup is causing the Application context to exit prematurely?  Try placing a few seconds delay in the exit task, prior to turning GPS off to see if that helps.

billku

unread,
Jul 8, 2011, 2:55:29 AM7/8/11
to Tasker
Still only works here and there, but thanks so much for trying, really
appreciate it. Very confusing...

Bill Kunstler

unread,
Jul 7, 2011, 4:47:19 PM7/7/11
to Tasker
I guess that's possible, though I don't understand what would cause
the pop-up to just go away without anything being selected.
Regardless, I tried your suggestion (while getting rid of the delay
before the Button press, which seemed to ruin everything), and
sometimes the profile works, most of the time it doesn't. Very very
odd. I continue to appreciate your help, though I understand if it's
time to give you. By the way, since someone mentioned it, why would
gingerbread help here?

On Jul 6, 4:14 pm, UncleMike <mquin...@metroconnectonline.com> wrote:

sayling

unread,
Jul 8, 2011, 1:33:16 PM7/8/11
to Tasker
Well, maybe it's just me, or maybe I've somehow ticked something that
has permanently accepted the condition, but on my Gingerbread Galaxy
S, GPS automatically switches on and off whenever it seems to be
needed, ie if I launch Google Latitude, Navigation, Places, Maps or do
a check in on Facebook.

billku

unread,
Jul 8, 2011, 2:25:57 PM7/8/11
to Tasker
Ah, maybe that's what the Gingerbread comment was about. That would
be great! I have a Charge, hopefully we'll be getting Gingerbread
sooner than later...
Reply all
Reply to author
Forward
0 new messages