Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,007 Members 40,364 Now Online
XDA Developers Android and Mobile Development Forum

Tasker (how to disable maps & location provider)

Tip us?
 
Jimsilver73
Old
(Last edited by Jimsilver73; 19th January 2014 at 11:47 PM.)
#1  
Jimsilver73's Avatar
Senior Member - OP
Thanks Meter 864
Posts: 1,607
Join Date: Nov 2013
Location: Christchurch UK
Default Tasker (how to disable maps & location provider)

Disable google maps and location provider and enable them when you want rather than when google thinks you should

Required:
Tasker
Secure settings (free - but consider supporting through a donation because this makes tasker even more awesome)

How to:
Enable secure settings helper

Profile 1:
Profile: screen off & variable - Nav = 1
Task:
plugins/secure settings/maps disabled (user)
plugins/secure settings/location services disabled
variable set Nav to 0

Profile 2
Profile: apps/navigation & waze (or whatever other gps apps you use)
Task: GPS on - plugins/secure settings/GPS enabled
Exit task: GPS off - plugins/secure settings/GPS disabled

Tasker task (you need to use this when you want to use nav (or whatever GPS app)
Unfreeze maps
plugins/secure settings/GPS enabled
plugins/secure settings/location services enabled
task/wait 4 secs
plugins/secure settings/maps enabled
variable set - Nav to 1

I have created this how to because several members have shown interest when I have spoken about it - this is a very rough and ready guide and I'm not sure that there isn't a better way to take back control of maps/location services but this works for me and has done for quite some time. I am very happy for people to add their own suggestions to improve this concept or let me know if its not needed because it is posted else where -I searched and couldn't easily find anything.

I use other bits and bobs also and will include these as options as and when I get time to update this thread, I will also try to make this how to a bit prettier as I get time but for now the instructions suffice because they work.

I hope some people find this useful and if not don't use it

Feel free to ask questions here and I will do my best to help - I do this because so many kind XDA'ers have helped me so I like to try and give back what little I can
S4 i9505
My setup + links to very cool stuff
 

DualBootPatcherAndroid-7.0.0.r133 snapshot (link to latest)
(sharing1 set of apks between all ROMs)

Primary -
ROM: Shostock 7

Secondary -
ROM: Dandvh GPE
Kernel: Googymax3

Multi slot 1- (daily driver)
ROM: SlimSaberKat
Kernel: Alucard

Multi slot 2 -
ROM: MIUI KK
Kernel: Alucard

Multi slot 3 -
ROM: Merk ROM

Modem: XXUGNE8
Recovery: TWRP

ART vs Dalvik VM
Alucard kernel settings sharing thread

The Following 2 Users Say Thank You to Jimsilver73 For This Useful Post: [ Click to Expand ]
 
Jimsilver73
Old
#2  
Jimsilver73's Avatar
Senior Member - OP
Thanks Meter 864
Posts: 1,607
Join Date: Nov 2013
Location: Christchurch UK
reserved
S4 i9505
My setup + links to very cool stuff
 

DualBootPatcherAndroid-7.0.0.r133 snapshot (link to latest)
(sharing1 set of apks between all ROMs)

Primary -
ROM: Shostock 7

Secondary -
ROM: Dandvh GPE
Kernel: Googymax3

Multi slot 1- (daily driver)
ROM: SlimSaberKat
Kernel: Alucard

Multi slot 2 -
ROM: MIUI KK
Kernel: Alucard

Multi slot 3 -
ROM: Merk ROM

Modem: XXUGNE8
Recovery: TWRP

ART vs Dalvik VM
Alucard kernel settings sharing thread

 
doctordroid
Old
#3  
Senior Member
Thanks Meter 16
Posts: 168
Join Date: Sep 2010
So it's just not enough to turn off gps and location services?
 
Omen of Peace
Old
(Last edited by Omen of Peace; 23rd January 2014 at 08:47 PM.)
#4  
Junior Member
Thanks Meter 7
Posts: 18
Join Date: Dec 2013
I have something similar, yet different. I noticed that I would sometimes use Maps, switch to a different app briefly, then switch back, which caused the GPS to ping-pong inefficiently, so I added a little timer :
Context:
Map app
+
Screen On

Entry task ("Location On"):
Stop Location Off task
Secure Settings/Location Services enabled
Secure Settings/GPS enabled

Exit task ("Location Off"):
Wait 10s
Secure Settings/Location Services disabled
Secure Settings/GPS disabled

I realize my current version doesn't have the freezing, but I figured the timer (one should customize the time!) might be of interest. It's not too hard to mix and match the two.


Also, I recommend using the Disable Google Network Location Consent Xposed module with this. The alternative is using dpad to take care of the dialog that comes up when you activate Location Services:
Input action: Dpad, Right, 1
Input action: Dpad, Click/(Press?*) 1

*not sure about the English command in Tasker.
The Following User Says Thank You to Omen of Peace For This Useful Post: [ Click to Expand ]
 
Jimsilver73
Old
#5  
Jimsilver73's Avatar
Senior Member - OP
Thanks Meter 864
Posts: 1,607
Join Date: Nov 2013
Location: Christchurch UK
Quote:
Originally Posted by Omen of Peace View Post
I have something similar, yet different. I noticed that I would sometimes use Maps, switch to a different app briefly, then switch back, which caused the GPS to ping-pong inefficiently, so I added a little timer :
Context:
Map app
+
Screen On

Entry task ("Location On"):
Stop Location Off task
Secure Settings/Location Services enabled
Secure Settings/GPS enabled

Exit task ("Location Off"):
Wait 10s
Secure Settings/Location Services disabled
Secure Settings/GPS disabled

I realize my current version doesn't have the freezing, but I figured the timer (one should customize the time!) might be of interest. It's not too hard to mix and match the two.


Also, I recommend using the Disable Google Network Location Consent Xposed module with this. The alternative is using dpad to take care of the dialog that comes up when you activate Location Services:
Input action: Dpad, Right, 1
Input action: Dpad, Click/(Press?*) 1

*not sure about the English command in Tasker.
That's really interesting, I have had similar glitch and your method send to be a good solution using timer. I used to use xposed module pre 4.4 but km seems to change something and xposed disable network location consent do toast no longer works. I am really interested in your other solution - using Dpad - please could you expand on how to do this?
S4 i9505
My setup + links to very cool stuff
 

DualBootPatcherAndroid-7.0.0.r133 snapshot (link to latest)
(sharing1 set of apks between all ROMs)

Primary -
ROM: Shostock 7

Secondary -
ROM: Dandvh GPE
Kernel: Googymax3

Multi slot 1- (daily driver)
ROM: SlimSaberKat
Kernel: Alucard

Multi slot 2 -
ROM: MIUI KK
Kernel: Alucard

Multi slot 3 -
ROM: Merk ROM

Modem: XXUGNE8
Recovery: TWRP

ART vs Dalvik VM
Alucard kernel settings sharing thread

 
Omen of Peace
Old
(Last edited by Omen of Peace; 24th January 2014 at 11:09 PM.)
#6  
Junior Member
Thanks Meter 7
Posts: 18
Join Date: Dec 2013
Quote:
Originally Posted by Jimsilver73 View Post
That's really interesting, I have had similar glitch and your method send to be a good solution using timer. I used to use xposed module pre 4.4 but km seems to change something and xposed disable network location consent do toast no longer works. I am really interested in your other solution - using Dpad - please could you expand on how to do this?
Sure. I didn't invent it, I found it somewhere else.
If the dialog is still the same in 4.4, the button selected by default is the left one, but you want to click the right one.
So, in the task listing:
+ > Input > DPad > select Right in the menu,
go back to the task
+ > Input > DPad > select Click/Press in the menu

The text export for Location On:
Code:
Location On (64)
A1: Stop [ Avec erreur:eek:ff Tâche: ] Si [ %BATT < 6 ]
A2: Stop [ Avec erreur:eek:ff Tâche:Location Off ]
A3: Secure Settings [ Configuration:Location Services Enabled Paquet:com.intangibleobject.securesettings.plugin Nom:Secure Settings Délai (Secondes):0 ]
A4: Secure Settings [ Configuration:GPS Enabled Paquet:com.intangibleobject.securesettings.plugin Nom:Secure Settings Délai (Secondes):0 ]
A6: Dpad [ Bouton:Droite Horaires de répétition:1 ]
A7: Dpad [ Bouton:Appui Horaires de répétition:1 ]
edit: forget about the export above, it's localized (French) and it got mangled when I first posted it without the (code) tag.

The last two lines are only for people who don't/can't use the XPosed module. I seem to remember you need to be rooted to use Dpad.
(I don't trigger Location when the battery is weak, hence the A1 - I hadn't mentioned it.)
The Following User Says Thank You to Omen of Peace For This Useful Post: [ Click to Expand ]
 
E--Man
Old
#7  
Senior Member
Thanks Meter 19
Posts: 110
Join Date: May 2012
Does the Tasker mod above work with Android 4.2.1 or 4.3?

As far as I know the Secure Settings plugin only allows location services to be toggled on 4.4+.
 
sberk
Old
#8  
Junior Member
Thanks Meter 3
Posts: 22
Join Date: Jan 2014
Thanks
 
Jimsilver73
Old
(Last edited by Jimsilver73; 24th February 2014 at 06:57 PM.)
#9  
Jimsilver73's Avatar
Senior Member - OP
Thanks Meter 864
Posts: 1,607
Join Date: Nov 2013
Location: Christchurch UK
Quote:
Originally Posted by E--Man View Post
Does the Tasker mod above work with Android 4.2.1 or 4.3?

As far as I know the Secure Settings plugin only allows location services to be toggled on 4.4+.
It always used to work for me on 4.2.x onwards, don't know about 4.1 (that seems a very very long time ago now )

BTW: since kk has matured, and ROMs /kernels become much more stable I no longer have the need to kill maps/location provider since my system tends to take care of itself nicely with my set up and I always have plenty of power left over at the end of the day (not that much difference with everything being killed), actually I'm quite enjoying what Google has to offer nower days, it's quite useful . Maybe if I was ever going away and not be near a power source for some days I might consider locking it down tight.

Thought I'd just share this as I was really paranoid about Google power drain in the past until a dev whom I respect said she used to do the same but doesn't have the need anymore - I was amazed to see she she was right (at least for newer devices )
S4 i9505
My setup + links to very cool stuff
 

DualBootPatcherAndroid-7.0.0.r133 snapshot (link to latest)
(sharing1 set of apks between all ROMs)

Primary -
ROM: Shostock 7

Secondary -
ROM: Dandvh GPE
Kernel: Googymax3

Multi slot 1- (daily driver)
ROM: SlimSaberKat
Kernel: Alucard

Multi slot 2 -
ROM: MIUI KK
Kernel: Alucard

Multi slot 3 -
ROM: Merk ROM

Modem: XXUGNE8
Recovery: TWRP

ART vs Dalvik VM
Alucard kernel settings sharing thread


Tags
disable location provider and maps, secure settings, take control of google, tasker
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Automate Your Device with Sfen

Changing the profile of yourdevice manually is now long forgotten. Since the advent of Android automation … more

Galaxy Photo Screen Lock Displays a Photo Slideshow on Your Lock Screen

Being the most often looked at part of our devices UI, the lock … more

Boost the LG G3 Speaker and Headphone Volume

It seems like OEMs are stepping up their game, with regards to thequality of their devices sound … more

Forums Added for the HTC Desire 610 and LG G3 US Carrier Variants

We recently added two new sets of forums here on XDA. The first … more