Search code examples
androidtasker

Using Android Tasker to override app settings


BACKGROUND:I'm in the process of writing a tasker application that tracks usage of other apps--it keeps track of the time that a reading app is open, for example.

In order to make sure that I'm actually reading and not just leaving the reading app open, I want to make the display timeout 30 seconds long.

ISSUE: The reading app locks the display so it never times out. How can I override the reading app settings to make my 30 second timeout take precedence?

I can't find anything out online because everyone is trying to do the opposite. However, everyone else's Tasker timeout seems to avoid conflicts naturally, so I'm not sure why mine is having issues.

Pseudo code:

Event: Reading app is active AND display is on

 Start time = current time

 Timeout save = system timeout

 Display->display timeout->30 seconds

Event: Reading app closes OR display is off

 Total time += current time - start time

 Display->display timeout->Timeout save

Solution

  • After extensive research, I have found that there is no way to override the setting. (At least not for the beginners like me)

    Google briefly made it possible to override app permissions in Android 4.3, but soon took that privilege away in a subsequent update. Pity.

    A cheap and dirty workaround that I came up with is to have a small dialog in a corner with a timer that counts down for your screen timeout. In the last 10 seconds, a button becomes visible which resets the timer and hides the button, or else the display is shut off. (This works for the purposes of MY app -- My intention was to make sure the user was interacting with a third-party reading app, and not just turning it on and walking away, as my app counts the amount of time the reading app is open and the display is on).

    @Tomaski - Unfortunately, the Secure Settings plugin doesn't have this power, although you are correct that its capabilities are greater than vanilla Tasker's.