Enhance AppGatekeeper service

In this update, the following enhancements to AppGatekeeper service are made:

  1. the service is auto-restarted after AppGatekeeper is upgraded to a new version.
  2. the service now handles the case when user sets a new time and when the timezone changes. (This is implemented by checking if the service is running, and if it is, it will stop and restart the service)
  3. implements a better version of computing the time when the service is going to reset the apps usage time. (Note: there is a rare bug where the service saves the same apps usage time to the following day)

Note: To check if my service is running:

ActivityManager.getRunningAppProcesses is called to return list of RunningAppProcessInfo.

Then, find the one pinfo (RunningAppProcessInfo) that has the same processName as my service process name.

And check ((pinfo != null) && (pinfo.pid != 0) && (pinfo.importance < 400)) , if true, it is running.

The importance value of 400 corresponds to cached process not actively running.

Testing is done on Samsung Galaxy S3 and on Nexus 7.

App Gatekeeper (version 1.3.0) is released for the service update.

Past release:


blog comments powered by Disqus