I am using UsageStatsManager
to get the history of app usage records in a particular day. The problem I have been facing is, for example, when user opens Facebook at 1:00pm, and at 1:01pm, he locks the screen, with facebook still in foreground, and unlocks the screen again at 2:00pm. The app usage API shows history of 1 hour usage of Facbook, whereas I want it to show just 1 minute. Is there any way I can disable the tracking when is the screen is inactive or disable the permission temporily. I am stuck and couldn't find any solution.
问问题
64 次