Page 4 of 7

Re: Navigation Apps Auto turn on/off GPS

Posted: 30 Dec 2017 01:36
by tphg
syndromtr wrote:a workaround for non-rooted systems: (use at your own risk! - read below - you can add delays and modify it after trigger...)

flow name : gps off
Trigger : App Task Ended : com.google.android.apps.maps (you can add other software as well, which needs GPS on)

Action : Set System Setting :
Secure
location_mode
0

Action : Set System Setting :
Secure
location_providers_allowed
<blank> (keep it blank)

--------------

flow name : gps on
Trigger : App Task Started : com.google.android.apps.maps (you can add other software as well, which needs GPS on)

Action : Set System Setting :
Secure
location_mode
3

Action : Set System Setting :
Secure
location_providers_allowed
network,gps

--------------

on my system (lenovo k5 note-no root-android 6) secure variable "location_mode" is not present, but only this way it toggles GPS (that variable is from nexus). So, in action, Set System Setting, you need to type it manually as "secure" and give values 0 for off - 3 for on.

what happens: when google map starts, if you double swipe to see quick settings, you'll notice GPS is disabled. but it really works. tested with other navigation-compass apps...

feedback is welcome
Thank you for making this thread alive.
I have tried to make the flow based on your instruction but unfortunately it still could not work on my phone, and it stuck at step of "location_mode" with value 3.

Re: Navigation Apps Auto turn on/off GPS

Posted: 08 Mar 2018 07:08
by Desmanto
foogooa wrote:What about a https://mobile-spy-apps.com mobile recorder on Android?
It is possible to create it, but require a very long process. For a simple location variable logging, it just require 1 or 2 triggers with 1 script block. To sync the data, we can use periodic timer and upload the data to configured gdrive. Sending custom command can be done via sms or maybe whatsapp. But all require a very specific configuration on target device. It also depends on what are the things we want to log.

I ever think trying to create it. Since someone ever ask mea about it when I am still using tasker. It is easier now to do it in Automagic. But I still have at least 5 flows those I focus on. Will try to look at it when most of them have finished.

Re: Navigation Apps Auto turn on/off GPS

Posted: 28 Apr 2018 17:35
by Thierry2064
Hi all, I did not succeed in making the non-root version work on Galaxy s9. Did anyone else try on Samsung? Just to know if I do something wrong or if the phone does not allow it...
However thanks for posting

Re: Navigation Apps Auto turn on/off GPS

Posted: 28 Apr 2018 18:11
by Desmanto
Have you granted Automagic the write secure setting permission in PC via adb? If already and the set system setting is executed properly, it seems the device doesn't reread the setting immediately. Some device only reread the settings database when you open up the settings - app. If that so, you need to use launch app setting after you have change the value and switch back to the navigation app again. But it will distract you for a while.

Re: Navigation Apps Auto turn on/off GPS

Posted: 29 Apr 2018 00:36
by tphg
Desmanto wrote:Have you granted Automagic the write secure setting permission in PC via adb? If already and the set system setting is executed properly, it seems the device doesn't reread the setting immediately. Some device only reread the settings database when you open up the settings - app. If that so, you need to use launch app setting after you have change the value and switch back to the navigation app again. But it will distract you for a while.
By the way, please could you share the command for granting Automagic the write secure setting permission in PC via adb, as well as commands for other permissions.
Since the time using Automagic, I have not granted any permission for it via ADB, just granted what Automagic asked during using.
Thanks in advance, Desmanto.

Re: Navigation Apps Auto turn on/off GPS

Posted: 29 Apr 2018 06:50
by Desmanto
tphg wrote:By the way, please could you share the command for granting Automagic the write secure setting permission in PC via adb, as well as commands for other permissions.
Since the time using Automagic, I have not granted any permission for it via ADB, just granted what Automagic asked during using.
Thanks in advance, Desmanto.
For Write secure, It is already at my first post (in this thread). There is no other permission to grant anymore using adb, besides this write secure permission. Most of other permissions are granted thru the phone it self, or Automagic settings > Feature & Permissions.

Re: Navigation Apps Auto turn on/off GPS

Posted: 29 Apr 2018 21:49
by Thierry2064
Desmanto wrote:Have you granted Automagic the write secure setting permission in PC via adb? If already and the set system setting is executed properly, it seems the device doesn't reread the setting immediately. Some device only reread the settings database when you open up the settings - app. If that so, you need to use launch app setting after you have change the value and switch back to the navigation app again. But it will distract you for a while.
Yes I granted the permission. Maybe I did something wrong though, as the setting does not change even after opening setting app.

Re: Navigation Apps Auto turn on/off GPS

Posted: 30 Apr 2018 18:12
by Desmanto
Thierry2064 wrote: Yes I granted the permission. Maybe I did something wrong though, as the setting does not change even after opening setting app.
Try some other setting too, but be careful with values, as It may cause bootloop if set outside of the allowed value. Try Category : System, try something like volume_music_speaker and change it to a higher or lower value. Check (at volume setting) if it change the value after you execute it. Not all system setting can be changed using this method. And oh one more thing, try to go to app info of Automagic, and see if all permissions has been granted properly, especially Modify system setting.

Re: Navigation Apps Auto turn on/off GPS

Posted: 27 Jan 2019 22:25
by yxd0018
on lineageOs 16 = android 9, I don't see location_mode in system setting. Anyone can share gps on/off script based on app launched? Thanks.

Re: Navigation Apps Auto turn on/off GPS

Posted: 28 Jan 2019 17:31
by Desmanto
I don't have it anymore too. Starting from Oreo, the location_providers_allowed seems doesn't work anymore. I have to use root and use Set GPS State on/off. My location is on all the time, but at network mode. When using google maps and navigation apps, Set GPS State on will set it to high accuracy (using GPS). After 1 minute not using the maps, Set GPS state off will set it back to location battery saving mode. This happen from RR 6.2 Oreo 8.1 until now RR 7.0 Pie 9.0.