Loading api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -3760,8 +3760,8 @@ package android.app { method public void requestUsageTimeReport(android.app.PendingIntent); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); field public static final java.lang.String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; field public static final java.lang.String EXTRA_USAGE_REPORT_TIME = "android.time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; } public class AlarmManager { api/system-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -3853,8 +3853,8 @@ package android.app { method public void requestUsageTimeReport(android.app.PendingIntent); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); field public static final java.lang.String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; field public static final java.lang.String EXTRA_USAGE_REPORT_TIME = "android.time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; } public class AlarmManager { core/java/android/app/ActivityOptions.java +4 −4 Original line number Diff line number Diff line Loading @@ -41,16 +41,16 @@ public class ActivityOptions { /** * A long in the extras delivered by {@link #requestUsageTimeReport} that contains * the total time (in ms) the user spent in the app. * the total time (in ms) the user spent in the app flow. */ public static final String EXTRA_USAGE_REPORT_TIME = "android.time"; public static final String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; /** * A Bundle in the extras delivered by {@link #requestUsageTimeReport} that contains * detailed information about the time spent in each package associated with the app; * each key is a package name, whose value is a long containing the time (in ms). */ public static final String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; /** * The package name that created the options. Loading Loading @@ -915,7 +915,7 @@ public class ActivityOptions { /** * Ask the the system track that time the user spends in the app being launched, and * report it back once done. The report will be sent to the given receiver, with * the extras {@link #EXTRA_USAGE_REPORT_TIME} and {@link #EXTRA_USAGE_REPORT_PACKAGES} * the extras {@link #EXTRA_USAGE_TIME_REPORT} and {@link #EXTRA_USAGE_TIME_REPORT_PACKAGES} * filled in. * * <p>The time interval tracked is from launching this activity until the user leaves Loading services/core/java/com/android/server/am/AppTimeTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -80,12 +80,12 @@ public class AppTimeTracker { public void deliverResult(Context context) { stop(); Bundle extras = new Bundle(); extras.putLong(ActivityOptions.EXTRA_USAGE_REPORT_TIME, mTotalTime); extras.putLong(ActivityOptions.EXTRA_USAGE_TIME_REPORT, mTotalTime); Bundle pkgs = new Bundle(); for (int i=mPackageTimes.size()-1; i>=0; i--) { pkgs.putLong(mPackageTimes.keyAt(i), mPackageTimes.valueAt(i).value); } extras.putBundle(ActivityOptions.EXTRA_USAGE_REPORT_PACKAGES, pkgs); extras.putBundle(ActivityOptions.EXTRA_USAGE_TIME_REPORT_PACKAGES, pkgs); Intent fillinIntent = new Intent(); fillinIntent.putExtras(extras); try { Loading tests/ActivityTests/src/com/google/android/test/activity/TrackTimeReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class TrackTimeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Bundle data = intent.getExtras(); data.getLong(ActivityOptions.EXTRA_USAGE_REPORT_TIME); data.getLong(ActivityOptions.EXTRA_USAGE_TIME_REPORT); Log.i("ActivityTest", "Received time: " + data); } } Loading
api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -3760,8 +3760,8 @@ package android.app { method public void requestUsageTimeReport(android.app.PendingIntent); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); field public static final java.lang.String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; field public static final java.lang.String EXTRA_USAGE_REPORT_TIME = "android.time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; } public class AlarmManager {
api/system-current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -3853,8 +3853,8 @@ package android.app { method public void requestUsageTimeReport(android.app.PendingIntent); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); field public static final java.lang.String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; field public static final java.lang.String EXTRA_USAGE_REPORT_TIME = "android.time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; field public static final java.lang.String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; } public class AlarmManager {
core/java/android/app/ActivityOptions.java +4 −4 Original line number Diff line number Diff line Loading @@ -41,16 +41,16 @@ public class ActivityOptions { /** * A long in the extras delivered by {@link #requestUsageTimeReport} that contains * the total time (in ms) the user spent in the app. * the total time (in ms) the user spent in the app flow. */ public static final String EXTRA_USAGE_REPORT_TIME = "android.time"; public static final String EXTRA_USAGE_TIME_REPORT = "android.usage_time"; /** * A Bundle in the extras delivered by {@link #requestUsageTimeReport} that contains * detailed information about the time spent in each package associated with the app; * each key is a package name, whose value is a long containing the time (in ms). */ public static final String EXTRA_USAGE_REPORT_PACKAGES = "android.package"; public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; /** * The package name that created the options. Loading Loading @@ -915,7 +915,7 @@ public class ActivityOptions { /** * Ask the the system track that time the user spends in the app being launched, and * report it back once done. The report will be sent to the given receiver, with * the extras {@link #EXTRA_USAGE_REPORT_TIME} and {@link #EXTRA_USAGE_REPORT_PACKAGES} * the extras {@link #EXTRA_USAGE_TIME_REPORT} and {@link #EXTRA_USAGE_TIME_REPORT_PACKAGES} * filled in. * * <p>The time interval tracked is from launching this activity until the user leaves Loading
services/core/java/com/android/server/am/AppTimeTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -80,12 +80,12 @@ public class AppTimeTracker { public void deliverResult(Context context) { stop(); Bundle extras = new Bundle(); extras.putLong(ActivityOptions.EXTRA_USAGE_REPORT_TIME, mTotalTime); extras.putLong(ActivityOptions.EXTRA_USAGE_TIME_REPORT, mTotalTime); Bundle pkgs = new Bundle(); for (int i=mPackageTimes.size()-1; i>=0; i--) { pkgs.putLong(mPackageTimes.keyAt(i), mPackageTimes.valueAt(i).value); } extras.putBundle(ActivityOptions.EXTRA_USAGE_REPORT_PACKAGES, pkgs); extras.putBundle(ActivityOptions.EXTRA_USAGE_TIME_REPORT_PACKAGES, pkgs); Intent fillinIntent = new Intent(); fillinIntent.putExtras(extras); try { Loading
tests/ActivityTests/src/com/google/android/test/activity/TrackTimeReceiver.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class TrackTimeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Bundle data = intent.getExtras(); data.getLong(ActivityOptions.EXTRA_USAGE_REPORT_TIME); data.getLong(ActivityOptions.EXTRA_USAGE_TIME_REPORT); Log.i("ActivityTest", "Received time: " + data); } }