Merge "Unhiding APIs in UsageEvents for public use" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-15 01:08:33 +00:00
committed by Android (Google) Code Review
3 changed files with 12 additions and 10 deletions

View File

@@ -7419,12 +7419,14 @@ package android.app.usage {
method public int getEventType();
method public java.lang.String getPackageName();
method public java.lang.String getShortcutId();
method public int getStandbyBucket();
method public long getTimeStamp();
field public static final int CONFIGURATION_CHANGE = 5; // 0x5
field public static final int MOVE_TO_BACKGROUND = 2; // 0x2
field public static final int MOVE_TO_FOREGROUND = 1; // 0x1
field public static final int NONE = 0; // 0x0
field public static final int SHORTCUT_INVOCATION = 8; // 0x8
field public static final int STANDBY_BUCKET_CHANGED = 11; // 0xb
field public static final int USER_INTERACTION = 7; // 0x7
}

View File

@@ -719,10 +719,8 @@ package android.app.usage {
public static final class UsageEvents.Event {
method public java.lang.String getNotificationChannelId();
method public int getStandbyBucket();
field public static final int NOTIFICATION_INTERRUPTION = 12; // 0xc
field public static final int NOTIFICATION_SEEN = 10; // 0xa
field public static final int STANDBY_BUCKET_CHANGED = 11; // 0xb
}
public final class UsageStatsManager {

View File

@@ -109,11 +109,11 @@ public final class UsageEvents implements Parcelable {
public static final int NOTIFICATION_SEEN = 10;
/**
* An event type denoting a change in App Standby Bucket. Additional bucket information
* is contained in mBucketAndReason.
* @hide
* An event type denoting a change in App Standby Bucket. The new bucket can be
* retrieved by calling {@link #getStandbyBucket()}.
*
* @see UsageStatsManager#getAppStandbyBucket()
*/
@SystemApi
public static final int STANDBY_BUCKET_CHANGED = 11;
/**
@@ -254,8 +254,11 @@ public final class UsageEvents implements Parcelable {
/**
* The event type.
*
* See {@link #MOVE_TO_BACKGROUND}
* See {@link #MOVE_TO_FOREGROUND}
* @see #MOVE_TO_BACKGROUND
* @see #MOVE_TO_FOREGROUND
* @see #CONFIGURATION_CHANGE
* @see #USER_INTERACTION
* @see #STANDBY_BUCKET_CHANGED
*/
public int getEventType() {
return mEventType;
@@ -283,9 +286,8 @@ public final class UsageEvents implements Parcelable {
* Returns the standby bucket of the app, if the event is of type
* {@link #STANDBY_BUCKET_CHANGED}, otherwise returns 0.
* @return the standby bucket associated with the event.
* @hide
*
*/
@SystemApi
public int getStandbyBucket() {
return (mBucketAndReason & 0xFFFF0000) >>> 16;
}