Volevo condividere con voi un mio profilo per attivare e disattivare il GPS.
Non è niente di particolare ma si differenzia da tutti quelli che ho visto fino adesso per il semplice fatto di non interrompere la connessione GPS appena l'app che la utilizza viene anche solo minimizzata e non chiusa.
codice:
<TaskerData sr="" dvi="1" tv="4.3u3m">
<Profile sr="prof43" ve="2">
<cdate>1398442180544</cdate>
<clp>true</clp>
<edate>1398448389890</edate>
<id>43</id>
<mid0>26</mid0>
<nme>Accendi GPS</nme>
<App sr="con0" ve="2">
<cls0>com.google.android.maps.MapsActivity</cls0>
<cls1>com.fitnesskeeper.runkeeper.RunKeeperActivity</cls1>
<flags>2</flags>
<label0>Maps</label0>
<label1>RunKeeper</label1>
<pkg0>com.google.android.apps.maps</pkg0>
<pkg1>com.fitnesskeeper.runkeeper.pro</pkg1>
</App>
</Profile>
<Profile sr="prof47" ve="2">
<cdate>1398442377090</cdate>
<edate>1398448422285</edate>
<id>47</id>
<limit>true</limit>
<mid0>27</mid0>
<nme>Spegni GPS</nme>
<App sr="con0" ve="2">
<cls0>com.google.android.maps.MapsActivity</cls0>
<cls1>com.fitnesskeeper.runkeeper.RunKeeperActivity</cls1>
<flags>2</flags>
<label0>Maps</label0>
<label1>RunKeeper</label1>
<pin>true</pin>
<pkg0>com.google.android.apps.maps</pkg0>
<pkg1>com.fitnesskeeper.runkeeper.pro</pkg1>
</App>
<State sr="con1" ve="2">
<code>165</code>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%GPSCHECK</lhs>
<op>4</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</State>
</Profile>
<Profile sr="prof48" ve="2">
<cdate>1398446055197</cdate>
<clp>true</clp>
<edate>1398448397319</edate>
<id>48</id>
<limit>true</limit>
<mid0>49</mid0>
<mid1>50</mid1>
<nme>App GPS</nme>
<App sr="con0" ve="2">
<cls0>com.fitnesskeeper.runkeeper.RunKeeperActivity</cls0>
<cls1>com.google.android.maps.MapsActivity</cls1>
<flags>2</flags>
<label0>RunKeeper</label0>
<label1>Maps</label1>
<pkg0>com.fitnesskeeper.runkeeper.pro</pkg0>
<pkg1>com.google.android.apps.maps</pkg1>
</App>
</Profile>
<Project sr="proj0">
<cdate>1398446240908</cdate>
<name>GPS</name>
<pids>48,43,47</pids>
<tids>49,27,26,50</tids>
</Project>
<Task sr="task26">
<cdate>1396050400032</cdate>
<edate>1398448389890</edate>
<id>26</id>
<nme>GPS ON</nme>
<pri>10</pri>
<Action sr="act0" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">Spegni GPS</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act1" ve="5">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra.BLURB>Location Mode/High Accuracy</com.intangibleobject.securesettings.plugin.extra.BLURB>
<com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
<com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION>3</com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION-type>java.lang.Integer</com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra.SETTING>location_mode</com.intangibleobject.securesettings.plugin.extra.SETTING>
<com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Location Mode/High Accuracy</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="5">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="10"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act3" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">App GPS</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act4" ve="5">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="5"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act5" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">Spegni GPS</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act6" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">Accendi GPS</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
<Task sr="task27">
<cdate>1396050400032</cdate>
<edate>1398448422285</edate>
<id>27</id>
<nme>GPS OFF</nme>
<pri>10</pri>
<Action sr="act0" ve="5">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">GPS OFF</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act1" ve="5">
<code>11820</code>
<Bundle sr="arg0">
<Vals sr="val">
<com.intangibleobject.securesettings.plugin.extra.BLURB>Location Mode/Location Off</com.intangibleobject.securesettings.plugin.extra.BLURB>
<com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
<com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION>0</com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION>
<com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION-type>java.lang.Integer</com.intangibleobject.securesettings.plugin.extra.EXTRA_SPINNER_OPTION-type>
<com.intangibleobject.securesettings.plugin.extra.SETTING>location_mode</com.intangibleobject.securesettings.plugin.extra.SETTING>
<com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Location Mode/Location Off</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
<Str sr="arg2" ve="3">Secure Settings</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">Accendi GPS</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act3" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">App GPS</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act4" ve="5">
<code>159</code>
<Str sr="arg0" ve="3">Spegni GPS</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
<Task sr="task49">
<cdate>1398446077818</cdate>
<edate>1398448397319</edate>
<id>49</id>
<nme>Variabile GPS 1</nme>
<pri>10</pri>
<Action sr="act0" ve="5">
<code>547</code>
<Str sr="arg0" ve="3">%GPSCHECK</Str>
<Str sr="arg1" ve="3">1</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act1" ve="5">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">%GPSCHECK</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
<Task sr="task50">
<cdate>1398446077818</cdate>
<edate>1398448384700</edate>
<id>50</id>
<nme>Variabile GPS 0</nme>
<pri>10</pri>
<Action sr="act0" ve="5">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act1" ve="5">
<code>547</code>
<Str sr="arg0" ve="3">%GPSCHECK</Str>
<Str sr="arg1" ve="3">0</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="5">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">%GPSCHECK</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
</TaskerData>
Praticamente, una volta che avete minimizzato l'app che usa il GPS, avete 3 minuti di tempo per poterla riaprire prima che la connessione si disattivi.
Diciamo che è un "workaround" ma non ho trovato altri sistemi.
Per funzionare richiede il root e secure setting.
Le app preimpostate e il tempo a disposizione prima della disattivazione li potete cambiare molto semplicemente.
Se magari riuscite anche a migliorarlo postatelo