History log of /frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/TrackTimeReceiver.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
67ba2c7fa25a635c640956ff3a5e64164cb23396 05-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21572679: API Review: ActivityOptions, usage time report

Change-Id: I62751e93e39f90d5d2ec725586880724f3edbbc7
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/TrackTimeReceiver.java
b5a380d409a1431a38db978864b9d85b689e3cce 21-May-2015 Dianne Hackborn <hackbod@google.com> Add API to track usage time of apps.

This adds a new ActivityOption for the caller to ask the
system to track the time the user is in the app it launches,
delivering the result when they are done.

The time interval tracked is from when the app launches the
activity until the user leaves that app's flow. They are
considered to stay in the flow as long as new activities
are being launched or returned to from the original flow,
even if they cross package or task boundaries. For example,
if the originator starts an activity to view an image, and
while there the user selects to share, which launches gmail
in a new task, and they complete the share, the time during
that entire operation will be included.

The user is considered to complete the operation once they
switch to another activity that is not part of the tracked
flow. For example, use the notification shade, launcher, or
recents to launch or switch to another app. Simply going
in to these navigation elements does not break the flow
(although the launcher and recents stops time tracking of
the session), it is the act of going somewhere else that
completes the tracking.

The data is delivered to the app through a PendingIntent,
which includes the total time the app was in the flow along
with a time break-down by app package.

Change-Id: If1cf8892d422c52ec5042eba0e15a8e7e8f83abf
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/TrackTimeReceiver.java