Merge "hotspot2: update method name for timestamp related APIs" into oc-dev
diff --git a/api/current.txt b/api/current.txt
index 44b88a4..26f3451 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -1061,6 +1061,7 @@
field public static final int ratingBarStyleSmall = 16842877; // 0x101007d
field public static final int readPermission = 16842759; // 0x1010007
field public static final int recognitionService = 16843932; // 0x101049c
+ field public static final int recreateOnConfigChanges = 16844105; // 0x1010549
field public static final int recycleEnabled = 16844124; // 0x101055c
field public static final int relinquishTaskIdentity = 16843894; // 0x1010476
field public static final int reparent = 16843964; // 0x10104bc
@@ -1085,7 +1086,6 @@
field public static final int resizeable = 16843405; // 0x101028d
field public static final int resizeableActivity = 16844022; // 0x10104f6
field public static final int resource = 16842789; // 0x1010025
- field public static final int restartOnConfigChanges = 16844105; // 0x1010549
field public static final int restoreAnyVersion = 16843450; // 0x10102ba
field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d
field public static final int restrictedAccountType = 16843733; // 0x10103d5
@@ -1708,7 +1708,6 @@
field public static final int ic_notification_clear_all = 17301594; // 0x108005a
field public static final int ic_notification_overlay = 17301595; // 0x108005b
field public static final int ic_partial_secure = 17301596; // 0x108005c
- field public static final int ic_picture_in_picture = 17301685; // 0x10800b5
field public static final int ic_popup_disk_full = 17301597; // 0x108005d
field public static final int ic_popup_reminder = 17301598; // 0x108005e
field public static final int ic_popup_sync = 17301599; // 0x108005f
@@ -2829,7 +2828,7 @@
method public android.content.pm.ResolveInfo getResolveInfo();
method public java.lang.String getSettingsActivityName();
method public java.lang.String loadDescription(android.content.pm.PackageManager);
- method public java.lang.String loadSummary(android.content.pm.PackageManager);
+ method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager);
method public void writeToParcel(android.os.Parcel, int);
field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
@@ -3580,7 +3579,6 @@
method public boolean dispatchTrackballEvent(android.view.MotionEvent);
method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
method public deprecated void enterPictureInPictureMode();
- method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams);
method public <T extends android.view.View> T findViewById(int);
method public void finish();
@@ -3755,7 +3753,6 @@
method public void setImmersive(boolean);
method public void setIntent(android.content.Intent);
method public final void setMediaController(android.media.session.MediaController);
- method public void setPictureInPictureArgs(android.app.PictureInPictureArgs);
method public void setPictureInPictureParams(android.app.PictureInPictureParams);
method public final deprecated void setProgress(int);
method public final deprecated void setProgressBarIndeterminate(boolean);
@@ -3835,7 +3832,6 @@
method public int getLauncherLargeIconDensity();
method public int getLauncherLargeIconSize();
method public int getLockTaskModeState();
- method public static deprecated int getMaxNumPictureInPictureActions();
method public int getMemoryClass();
method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo);
method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo);
@@ -4972,7 +4968,6 @@
public class KeyguardManager {
method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
- method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
method public boolean inKeyguardRestrictedInputMode();
method public boolean isDeviceLocked();
@@ -5121,7 +5116,6 @@
method public android.app.Notification clone();
method public int describeContents();
method public int getBadgeIconType();
- method public java.lang.String getChannel();
method public java.lang.String getChannelId();
method public java.lang.String getGroup();
method public int getGroupAlertBehavior();
@@ -5130,7 +5124,6 @@
method public java.lang.String getShortcutId();
method public android.graphics.drawable.Icon getSmallIcon();
method public java.lang.String getSortKey();
- method public long getTimeout();
method public long getTimeoutAfter();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
@@ -5333,7 +5326,6 @@
method public android.app.Notification.Builder setAutoCancel(boolean);
method public android.app.Notification.Builder setBadgeIconType(int);
method public android.app.Notification.Builder setCategory(java.lang.String);
- method public android.app.Notification.Builder setChannel(java.lang.String);
method public android.app.Notification.Builder setChannelId(java.lang.String);
method public android.app.Notification.Builder setChronometerCountDown(boolean);
method public android.app.Notification.Builder setColor(int);
@@ -5378,7 +5370,6 @@
method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
- method public android.app.Notification.Builder setTimeout(long);
method public android.app.Notification.Builder setTimeoutAfter(long);
method public android.app.Notification.Builder setUsesChronometer(boolean);
method public deprecated android.app.Notification.Builder setVibrate(long[]);
@@ -5697,21 +5688,10 @@
method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle);
}
- public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams {
- ctor public deprecated PictureInPictureArgs();
- ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
- method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
- method public deprecated void setAspectRatio(float);
- method public deprecated void setSourceRectHint(android.graphics.Rect);
- }
-
- public class PictureInPictureParams implements android.os.Parcelable {
+ public final class PictureInPictureParams implements android.os.Parcelable {
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.app.PictureInPictureParams> CREATOR;
- field protected android.util.Rational mAspectRatio;
- field protected android.graphics.Rect mSourceRectHint;
- field protected java.util.List<android.app.RemoteAction> mUserActions;
}
public static class PictureInPictureParams.Builder {
@@ -9329,15 +9309,12 @@
field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP";
field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER";
- field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE";
field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED";
field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT";
field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
- field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
- field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
@@ -9541,7 +9518,6 @@
field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY";
field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM";
field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
- field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX";
field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT";
field public static final java.lang.String EXTRA_TITLE = "android.intent.extra.TITLE";
@@ -31601,7 +31577,7 @@
public class TestLooperManager {
method public void execute(android.os.Message);
- method public android.os.MessageQueue getQueue();
+ method public android.os.MessageQueue getMessageQueue();
method public boolean hasMessages(android.os.Handler, java.lang.Object, int);
method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable);
method public android.os.Message next();
@@ -37012,7 +36988,7 @@
public final class FillRequest implements android.os.Parcelable {
method public int describeContents();
method public android.os.Bundle getClientState();
- method public java.util.ArrayList<android.service.autofill.FillContext> getFillContexts();
+ method public java.util.List<android.service.autofill.FillContext> getFillContexts();
method public int getFlags();
method public int getId();
method public void writeToParcel(android.os.Parcel, int);
@@ -37994,7 +37970,6 @@
method public void onRangeStart(java.lang.String, int, int, int);
method public abstract void onStart(java.lang.String);
method public void onStop(java.lang.String, boolean);
- method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
}
public class Voice implements android.os.Parcelable {
@@ -40075,8 +40050,11 @@
method public static int getDefaultVoiceSubscriptionId();
method public boolean isNetworkRoaming(int);
method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
+ field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
+ field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
+ field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
}
@@ -47768,7 +47746,7 @@
method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
- field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
+ field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE";
}
public static abstract class AutofillManager.AutofillCallback {
diff --git a/api/removed.txt b/api/removed.txt
index 779ff7c..b0dad45 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -1,9 +1,59 @@
package android.app {
+ public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
+ method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
+ method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs);
+ }
+
+ public class ActivityManager {
+ method public static deprecated int getMaxNumPictureInPictureActions();
+ }
+
+ public class KeyguardManager {
+ method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+ }
+
public class Notification implements android.os.Parcelable {
+ method public deprecated java.lang.String getChannel();
+ method public deprecated long getTimeout();
method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
}
+ public static class Notification.Builder {
+ method public deprecated android.app.Notification.Builder setChannel(java.lang.String);
+ method public deprecated android.app.Notification.Builder setTimeout(long);
+ }
+
+ public static final class Notification.TvExtender implements android.app.Notification.Extender {
+ method public deprecated java.lang.String getChannel();
+ }
+
+ public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+ method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
+ method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
+ method public void copyOnlySet(android.app.PictureInPictureArgs);
+ method public java.util.List<android.app.RemoteAction> getActions();
+ method public float getAspectRatio();
+ method public android.util.Rational getAspectRatioRational();
+ method public android.graphics.Rect getSourceRectHint();
+ method public android.graphics.Rect getSourceRectHintInsets();
+ method public boolean hasSetActions();
+ method public boolean hasSetAspectRatio();
+ method public boolean hasSourceBoundsHint();
+ method public boolean hasSourceBoundsHintInsets();
+ method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
+ method public void truncateActions(int);
+ field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
+ }
+
+ public static class PictureInPictureArgs.Builder {
+ ctor public PictureInPictureArgs.Builder();
+ method public android.app.PictureInPictureArgs build();
+ method public android.app.PictureInPictureArgs.Builder setActions(java.util.List<android.app.RemoteAction>);
+ method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational);
+ method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect);
+ }
+
public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
method public deprecated void showAsNotification(android.content.Context);
}
@@ -221,6 +271,10 @@
ctor public RecoverySystem();
}
+ public class TestLooperManager {
+ method public deprecated android.os.MessageQueue getQueue();
+ }
+
public class UserManager {
method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle);
@@ -382,6 +436,14 @@
}
+package android.speech.tts {
+
+ public abstract class UtteranceProgressListener {
+ method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
+ }
+
+}
+
package android.test.mock {
public deprecated class MockPackageManager extends android.content.pm.PackageManager {
diff --git a/api/system-current.txt b/api/system-current.txt
index 7884b8b..9e234d0 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1182,6 +1182,7 @@
field public static final int ratingBarStyleSmall = 16842877; // 0x101007d
field public static final int readPermission = 16842759; // 0x1010007
field public static final int recognitionService = 16843932; // 0x101049c
+ field public static final int recreateOnConfigChanges = 16844105; // 0x1010549
field public static final int recycleEnabled = 16844124; // 0x101055c
field public static final int relinquishTaskIdentity = 16843894; // 0x1010476
field public static final int reparent = 16843964; // 0x10104bc
@@ -1208,7 +1209,6 @@
field public static final int resizeable = 16843405; // 0x101028d
field public static final int resizeableActivity = 16844022; // 0x10104f6
field public static final int resource = 16842789; // 0x1010025
- field public static final int restartOnConfigChanges = 16844105; // 0x1010549
field public static final int restoreAnyVersion = 16843450; // 0x10102ba
field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d
field public static final int restrictedAccountType = 16843733; // 0x10103d5
@@ -1835,7 +1835,6 @@
field public static final int ic_notification_clear_all = 17301594; // 0x108005a
field public static final int ic_notification_overlay = 17301595; // 0x108005b
field public static final int ic_partial_secure = 17301596; // 0x108005c
- field public static final int ic_picture_in_picture = 17301685; // 0x10800b5
field public static final int ic_popup_disk_full = 17301597; // 0x108005d
field public static final int ic_popup_reminder = 17301598; // 0x108005e
field public static final int ic_popup_sync = 17301599; // 0x108005f
@@ -2959,7 +2958,7 @@
method public android.content.pm.ResolveInfo getResolveInfo();
method public java.lang.String getSettingsActivityName();
method public java.lang.String loadDescription(android.content.pm.PackageManager);
- method public java.lang.String loadSummary(android.content.pm.PackageManager);
+ method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager);
method public void writeToParcel(android.os.Parcel, int);
field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
@@ -3713,7 +3712,6 @@
method public boolean dispatchTrackballEvent(android.view.MotionEvent);
method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
method public deprecated void enterPictureInPictureMode();
- method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams);
method public <T extends android.view.View> T findViewById(int);
method public void finish();
@@ -3891,7 +3889,6 @@
method public void setImmersive(boolean);
method public void setIntent(android.content.Intent);
method public final void setMediaController(android.media.session.MediaController);
- method public void setPictureInPictureArgs(android.app.PictureInPictureArgs);
method public void setPictureInPictureParams(android.app.PictureInPictureParams);
method public final deprecated void setProgress(int);
method public final deprecated void setProgressBarIndeterminate(boolean);
@@ -3978,7 +3975,6 @@
method public int getLauncherLargeIconDensity();
method public int getLauncherLargeIconSize();
method public int getLockTaskModeState();
- method public static deprecated int getMaxNumPictureInPictureActions();
method public int getMemoryClass();
method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo);
method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo);
@@ -5154,7 +5150,6 @@
public class KeyguardManager {
method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
- method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
method public boolean inKeyguardRestrictedInputMode();
method public boolean isDeviceLocked();
@@ -5303,7 +5298,6 @@
method public android.app.Notification clone();
method public int describeContents();
method public int getBadgeIconType();
- method public java.lang.String getChannel();
method public java.lang.String getChannelId();
method public java.lang.String getGroup();
method public int getGroupAlertBehavior();
@@ -5313,7 +5307,6 @@
method public java.lang.String getShortcutId();
method public android.graphics.drawable.Icon getSmallIcon();
method public java.lang.String getSortKey();
- method public long getTimeout();
method public long getTimeoutAfter();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
@@ -5519,7 +5512,6 @@
method public android.app.Notification.Builder setAutoCancel(boolean);
method public android.app.Notification.Builder setBadgeIconType(int);
method public android.app.Notification.Builder setCategory(java.lang.String);
- method public android.app.Notification.Builder setChannel(java.lang.String);
method public android.app.Notification.Builder setChannelId(java.lang.String);
method public android.app.Notification.Builder setChronometerCountDown(boolean);
method public android.app.Notification.Builder setColor(int);
@@ -5564,7 +5556,6 @@
method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
- method public android.app.Notification.Builder setTimeout(long);
method public android.app.Notification.Builder setTimeoutAfter(long);
method public android.app.Notification.Builder setUsesChronometer(boolean);
method public deprecated android.app.Notification.Builder setVibrate(long[]);
@@ -5669,7 +5660,6 @@
ctor public Notification.TvExtender();
ctor public Notification.TvExtender(android.app.Notification);
method public android.app.Notification.Builder extend(android.app.Notification.Builder);
- method public java.lang.String getChannel();
method public java.lang.String getChannelId();
method public android.app.PendingIntent getContentIntent();
method public android.app.PendingIntent getDeleteIntent();
@@ -5904,21 +5894,10 @@
method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle);
}
- public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams {
- ctor public deprecated PictureInPictureArgs();
- ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
- method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
- method public deprecated void setAspectRatio(float);
- method public deprecated void setSourceRectHint(android.graphics.Rect);
- }
-
- public class PictureInPictureParams implements android.os.Parcelable {
+ public final class PictureInPictureParams implements android.os.Parcelable {
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.app.PictureInPictureParams> CREATOR;
- field protected android.util.Rational mAspectRatio;
- field protected android.graphics.Rect mSourceRectHint;
- field protected java.util.List<android.app.RemoteAction> mUserActions;
}
public static class PictureInPictureParams.Builder {
@@ -9855,15 +9834,12 @@
field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP";
field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER";
- field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE";
field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED";
field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT";
field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
- field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
- field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
field public static final deprecated java.lang.String ACTION_DEVICE_INITIALIZATION_WIZARD = "android.intent.action.DEVICE_INITIALIZATION_WIZARD";
field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
@@ -10116,7 +10092,6 @@
field public static final java.lang.String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM";
field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
- field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX";
field public static final deprecated java.lang.String EXTRA_SYSTEM_ID = "systemId";
field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT";
@@ -34427,7 +34402,7 @@
public class TestLooperManager {
method public void execute(android.os.Message);
- method public android.os.MessageQueue getQueue();
+ method public android.os.MessageQueue getMessageQueue();
method public boolean hasMessages(android.os.Handler, java.lang.Object, int);
method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable);
method public android.os.Message next();
@@ -40136,7 +40111,7 @@
public final class FillRequest implements android.os.Parcelable {
method public int describeContents();
method public android.os.Bundle getClientState();
- method public java.util.ArrayList<android.service.autofill.FillContext> getFillContexts();
+ method public java.util.List<android.service.autofill.FillContext> getFillContexts();
method public int getFlags();
method public int getId();
method public void writeToParcel(android.os.Parcel, int);
@@ -41261,7 +41236,6 @@
method public void onRangeStart(java.lang.String, int, int, int);
method public abstract void onStart(java.lang.String);
method public void onStop(java.lang.String, boolean);
- method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
}
public class Voice implements android.os.Parcelable {
@@ -43562,8 +43536,11 @@
method public static int getDefaultVoiceSubscriptionId();
method public boolean isNetworkRoaming(int);
method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
+ field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
+ field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
+ field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
}
@@ -51365,7 +51342,7 @@
method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
- field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
+ field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE";
}
public static abstract class AutofillManager.AutofillCallback {
diff --git a/api/system-removed.txt b/api/system-removed.txt
index fe51248..2fd3039 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -1,9 +1,59 @@
package android.app {
+ public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
+ method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
+ method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs);
+ }
+
+ public class ActivityManager {
+ method public static deprecated int getMaxNumPictureInPictureActions();
+ }
+
+ public class KeyguardManager {
+ method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+ }
+
public class Notification implements android.os.Parcelable {
+ method public deprecated java.lang.String getChannel();
+ method public deprecated long getTimeout();
method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
}
+ public static class Notification.Builder {
+ method public deprecated android.app.Notification.Builder setChannel(java.lang.String);
+ method public deprecated android.app.Notification.Builder setTimeout(long);
+ }
+
+ public static final class Notification.TvExtender implements android.app.Notification.Extender {
+ method public deprecated java.lang.String getChannel();
+ }
+
+ public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+ method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
+ method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
+ method public void copyOnlySet(android.app.PictureInPictureArgs);
+ method public java.util.List<android.app.RemoteAction> getActions();
+ method public float getAspectRatio();
+ method public android.util.Rational getAspectRatioRational();
+ method public android.graphics.Rect getSourceRectHint();
+ method public android.graphics.Rect getSourceRectHintInsets();
+ method public boolean hasSetActions();
+ method public boolean hasSetAspectRatio();
+ method public boolean hasSourceBoundsHint();
+ method public boolean hasSourceBoundsHintInsets();
+ method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
+ method public void truncateActions(int);
+ field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
+ }
+
+ public static class PictureInPictureArgs.Builder {
+ ctor public PictureInPictureArgs.Builder();
+ method public android.app.PictureInPictureArgs build();
+ method public android.app.PictureInPictureArgs.Builder setActions(java.util.List<android.app.RemoteAction>);
+ method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational);
+ method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect);
+ }
+
public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
method public deprecated void showAsNotification(android.content.Context);
}
@@ -215,6 +265,10 @@
ctor public RecoverySystem();
}
+ public class TestLooperManager {
+ method public deprecated android.os.MessageQueue getQueue();
+ }
+
public class UserManager {
method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle);
@@ -376,6 +430,14 @@
}
+package android.speech.tts {
+
+ public abstract class UtteranceProgressListener {
+ method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
+ }
+
+}
+
package android.test.mock {
public deprecated class MockPackageManager extends android.content.pm.PackageManager {
diff --git a/api/test-current.txt b/api/test-current.txt
index 8243f70..693dd80 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1061,6 +1061,7 @@
field public static final int ratingBarStyleSmall = 16842877; // 0x101007d
field public static final int readPermission = 16842759; // 0x1010007
field public static final int recognitionService = 16843932; // 0x101049c
+ field public static final int recreateOnConfigChanges = 16844105; // 0x1010549
field public static final int recycleEnabled = 16844124; // 0x101055c
field public static final int relinquishTaskIdentity = 16843894; // 0x1010476
field public static final int reparent = 16843964; // 0x10104bc
@@ -1085,7 +1086,6 @@
field public static final int resizeable = 16843405; // 0x101028d
field public static final int resizeableActivity = 16844022; // 0x10104f6
field public static final int resource = 16842789; // 0x1010025
- field public static final int restartOnConfigChanges = 16844105; // 0x1010549
field public static final int restoreAnyVersion = 16843450; // 0x10102ba
field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d
field public static final int restrictedAccountType = 16843733; // 0x10103d5
@@ -1708,7 +1708,6 @@
field public static final int ic_notification_clear_all = 17301594; // 0x108005a
field public static final int ic_notification_overlay = 17301595; // 0x108005b
field public static final int ic_partial_secure = 17301596; // 0x108005c
- field public static final int ic_picture_in_picture = 17301685; // 0x10800b5
field public static final int ic_popup_disk_full = 17301597; // 0x108005d
field public static final int ic_popup_reminder = 17301598; // 0x108005e
field public static final int ic_popup_sync = 17301599; // 0x108005f
@@ -2829,7 +2828,7 @@
method public android.content.pm.ResolveInfo getResolveInfo();
method public java.lang.String getSettingsActivityName();
method public java.lang.String loadDescription(android.content.pm.PackageManager);
- method public java.lang.String loadSummary(android.content.pm.PackageManager);
+ method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager);
method public void writeToParcel(android.os.Parcel, int);
field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10
field public static final int CAPABILITY_CAN_PERFORM_GESTURES = 32; // 0x20
@@ -3582,7 +3581,6 @@
method public boolean dispatchTrackballEvent(android.view.MotionEvent);
method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
method public deprecated void enterPictureInPictureMode();
- method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams);
method public <T extends android.view.View> T findViewById(int);
method public void finish();
@@ -3757,7 +3755,6 @@
method public void setImmersive(boolean);
method public void setIntent(android.content.Intent);
method public final void setMediaController(android.media.session.MediaController);
- method public void setPictureInPictureArgs(android.app.PictureInPictureArgs);
method public void setPictureInPictureParams(android.app.PictureInPictureParams);
method public final deprecated void setProgress(int);
method public final deprecated void setProgressBarIndeterminate(boolean);
@@ -3838,7 +3835,6 @@
method public int getLauncherLargeIconDensity();
method public int getLauncherLargeIconSize();
method public int getLockTaskModeState();
- method public static deprecated int getMaxNumPictureInPictureActions();
method public int getMemoryClass();
method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo);
method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo);
@@ -4985,7 +4981,6 @@
public class KeyguardManager {
method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence);
- method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult);
method public boolean inKeyguardRestrictedInputMode();
method public boolean isDeviceLocked();
@@ -5134,7 +5129,6 @@
method public android.app.Notification clone();
method public int describeContents();
method public int getBadgeIconType();
- method public java.lang.String getChannel();
method public java.lang.String getChannelId();
method public java.lang.String getGroup();
method public int getGroupAlertBehavior();
@@ -5143,7 +5137,6 @@
method public java.lang.String getShortcutId();
method public android.graphics.drawable.Icon getSmallIcon();
method public java.lang.String getSortKey();
- method public long getTimeout();
method public long getTimeoutAfter();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
@@ -5346,7 +5339,6 @@
method public android.app.Notification.Builder setAutoCancel(boolean);
method public android.app.Notification.Builder setBadgeIconType(int);
method public android.app.Notification.Builder setCategory(java.lang.String);
- method public android.app.Notification.Builder setChannel(java.lang.String);
method public android.app.Notification.Builder setChannelId(java.lang.String);
method public android.app.Notification.Builder setChronometerCountDown(boolean);
method public android.app.Notification.Builder setColor(int);
@@ -5391,7 +5383,6 @@
method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
- method public android.app.Notification.Builder setTimeout(long);
method public android.app.Notification.Builder setTimeoutAfter(long);
method public android.app.Notification.Builder setUsesChronometer(boolean);
method public deprecated android.app.Notification.Builder setVibrate(long[]);
@@ -5711,21 +5702,10 @@
method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle);
}
- public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams {
- ctor public deprecated PictureInPictureArgs();
- ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
- method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
- method public deprecated void setAspectRatio(float);
- method public deprecated void setSourceRectHint(android.graphics.Rect);
- }
-
- public class PictureInPictureParams implements android.os.Parcelable {
+ public final class PictureInPictureParams implements android.os.Parcelable {
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.app.PictureInPictureParams> CREATOR;
- field protected android.util.Rational mAspectRatio;
- field protected android.graphics.Rect mSourceRectHint;
- field protected java.util.List<android.app.RemoteAction> mUserActions;
}
public static class PictureInPictureParams.Builder {
@@ -9363,15 +9343,12 @@
field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON";
field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP";
field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER";
- field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE";
field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS";
field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED";
field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT";
field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT";
field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED";
field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW";
- field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
- field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE";
field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW";
field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK";
@@ -9575,7 +9552,6 @@
field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY";
field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM";
field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
- field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX";
field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT";
field public static final java.lang.String EXTRA_TITLE = "android.intent.extra.TITLE";
@@ -31731,7 +31707,7 @@
public class TestLooperManager {
method public void execute(android.os.Message);
- method public android.os.MessageQueue getQueue();
+ method public android.os.MessageQueue getMessageQueue();
method public boolean hasMessages(android.os.Handler, java.lang.Object, int);
method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable);
method public android.os.Message next();
@@ -37166,7 +37142,7 @@
public final class FillRequest implements android.os.Parcelable {
method public int describeContents();
method public android.os.Bundle getClientState();
- method public java.util.ArrayList<android.service.autofill.FillContext> getFillContexts();
+ method public java.util.List<android.service.autofill.FillContext> getFillContexts();
method public int getFlags();
method public int getId();
method public void writeToParcel(android.os.Parcel, int);
@@ -38189,7 +38165,6 @@
method public void onRangeStart(java.lang.String, int, int, int);
method public abstract void onStart(java.lang.String);
method public void onStop(java.lang.String, boolean);
- method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
}
public class Voice implements android.os.Parcelable {
@@ -40270,8 +40245,11 @@
method public static int getDefaultVoiceSubscriptionId();
method public boolean isNetworkRoaming(int);
method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
+ field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
+ field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
+ field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
}
@@ -48147,7 +48125,7 @@
method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback);
field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT";
- field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE";
+ field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE";
}
public static abstract class AutofillManager.AutofillCallback {
diff --git a/api/test-removed.txt b/api/test-removed.txt
index 779ff7c..b0dad45 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -1,9 +1,59 @@
package android.app {
+ public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
+ method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs);
+ method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs);
+ }
+
+ public class ActivityManager {
+ method public static deprecated int getMaxNumPictureInPictureActions();
+ }
+
+ public class KeyguardManager {
+ method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler);
+ }
+
public class Notification implements android.os.Parcelable {
+ method public deprecated java.lang.String getChannel();
+ method public deprecated long getTimeout();
method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
}
+ public static class Notification.Builder {
+ method public deprecated android.app.Notification.Builder setChannel(java.lang.String);
+ method public deprecated android.app.Notification.Builder setTimeout(long);
+ }
+
+ public static final class Notification.TvExtender implements android.app.Notification.Extender {
+ method public deprecated java.lang.String getChannel();
+ }
+
+ public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+ method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
+ method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
+ method public void copyOnlySet(android.app.PictureInPictureArgs);
+ method public java.util.List<android.app.RemoteAction> getActions();
+ method public float getAspectRatio();
+ method public android.util.Rational getAspectRatioRational();
+ method public android.graphics.Rect getSourceRectHint();
+ method public android.graphics.Rect getSourceRectHintInsets();
+ method public boolean hasSetActions();
+ method public boolean hasSetAspectRatio();
+ method public boolean hasSourceBoundsHint();
+ method public boolean hasSourceBoundsHintInsets();
+ method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
+ method public void truncateActions(int);
+ field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
+ }
+
+ public static class PictureInPictureArgs.Builder {
+ ctor public PictureInPictureArgs.Builder();
+ method public android.app.PictureInPictureArgs build();
+ method public android.app.PictureInPictureArgs.Builder setActions(java.util.List<android.app.RemoteAction>);
+ method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational);
+ method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect);
+ }
+
public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
method public deprecated void showAsNotification(android.content.Context);
}
@@ -221,6 +271,10 @@
ctor public RecoverySystem();
}
+ public class TestLooperManager {
+ method public deprecated android.os.MessageQueue getQueue();
+ }
+
public class UserManager {
method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int);
method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle);
@@ -382,6 +436,14 @@
}
+package android.speech.tts {
+
+ public abstract class UtteranceProgressListener {
+ method public deprecated void onUtteranceRangeStart(java.lang.String, int, int);
+ }
+
+}
+
package android.test.mock {
public deprecated class MockPackageManager extends android.content.pm.PackageManager {
diff --git a/core/java/android/accessibilityservice/AccessibilityButtonController.java b/core/java/android/accessibilityservice/AccessibilityButtonController.java
index ee19768..a70085c 100644
--- a/core/java/android/accessibilityservice/AccessibilityButtonController.java
+++ b/core/java/android/accessibilityservice/AccessibilityButtonController.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Handler;
+import android.os.Looper;
import android.os.RemoteException;
import android.util.ArrayMap;
import android.util.Slog;
@@ -91,7 +92,7 @@
* @param callback the callback to add, must be non-null
*/
public void registerAccessibilityButtonCallback(@NonNull AccessibilityButtonCallback callback) {
- registerAccessibilityButtonCallback(callback, new Handler());
+ registerAccessibilityButtonCallback(callback, new Handler(Looper.getMainLooper()));
}
/**
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 70a6ce6..06a9b06 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -670,9 +670,10 @@
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
- * @return The localized summary.
+ * @return The localized summary if available, and {@code null} if a summary
+ * has not been provided.
*/
- public String loadSummary(PackageManager packageManager) {
+ public CharSequence loadSummary(PackageManager packageManager) {
if (mSummaryResId == 0) {
return mNonLocalizedSummary;
}
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index ab4f33d..4f6c0c9 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2050,20 +2050,10 @@
enterPictureInPictureMode(new PictureInPictureParams.Builder().build());
}
- /**
- * TO BE REMOVED
- */
+ /** @removed */
@Deprecated
public boolean enterPictureInPictureMode(@NonNull PictureInPictureArgs args) {
- try {
- if (args == null) {
- throw new IllegalArgumentException("Expected non-null picture-in-picture args");
- }
- updatePictureInPictureParamsForContentInsets(args);
- return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, args);
- } catch (RemoteException e) {
- return false;
- }
+ return enterPictureInPictureMode(PictureInPictureArgs.convert(args));
}
/**
@@ -2095,11 +2085,10 @@
}
}
- /**
- * TO BE REMOVED
- */
+ /** @removed */
+ @Deprecated
public void setPictureInPictureArgs(@NonNull PictureInPictureArgs args) {
- setPictureInPictureParams(args);
+ setPictureInPictureParams(PictureInPictureArgs.convert(args));
}
/**
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 6bc59fc..9af74ba 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1127,13 +1127,7 @@
com.android.internal.R.bool.config_supportsSplitScreenMultiWindow);
}
- /**
- * Return the number of actions that will be displayed in the picture-in-picture UI when the
- * user interacts with the activity currently in picture-in-picture mode. This number may change
- * if the global configuration changes (ie. if the device is plugged into an external display).
- *
- * TO BE REMOVED
- */
+ /** @removed */
@Deprecated
public static int getMaxNumPictureInPictureActions() {
return 3;
diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java
index 4de6e44..fcf0aab 100644
--- a/core/java/android/app/KeyguardManager.java
+++ b/core/java/android/app/KeyguardManager.java
@@ -362,28 +362,7 @@
}
}
- /**
- * If the device is currently locked (see {@link #isKeyguardLocked()}, requests the Keyguard to
- * be dismissed.
- * <p>
- * If the Keyguard is not secure or the device is currently in a trusted state, calling this
- * method will immediately dismiss the Keyguard without any user interaction.
- * <p>
- * If the Keyguard is secure and the device is not in a trusted state, this will bring up the
- * UI so the user can enter their credentials.
- *
- * @param activity The activity requesting the dismissal. The activity must be either visible
- * by using {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} or must be in a state in
- * which it would be visible if Keyguard would not be hiding it. If that's not
- * the case, the request will fail immediately and
- * {@link KeyguardDismissCallback#onDismissError} will be invoked.
- * @param callback The callback to be called if the request to dismiss Keyguard was successful
- * or {@code null} if the caller isn't interested in knowing the result.
- * @param handler The handler to invoke the callback on, or {@code null} to use the main
- * handler.
- *
- * TO BE REMOVED
- */
+ /** @removed */
@Deprecated
public void dismissKeyguard(@NonNull Activity activity,
@Nullable KeyguardDismissCallback callback, @Nullable Handler handler) {
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 28fe319..c8b8c6c 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -2494,9 +2494,8 @@
}
}
- /**
- * Returns the id of the channel this notification posts to.
- */
+ /** @removed */
+ @Deprecated
public String getChannel() {
return mChannelId;
}
@@ -2508,10 +2507,8 @@
return mChannelId;
}
- /**
- * Returns the time at which this notification should be canceled by the system, if it's not
- * canceled already.
- */
+ /** @removed */
+ @Deprecated
public long getTimeout() {
return mTimeout;
}
@@ -2811,9 +2808,8 @@
return this;
}
- /**
- * Specifies the channel the notification should be delivered on.
- */
+ /** @removed */
+ @Deprecated
public Builder setChannel(String channelId) {
mN.mChannelId = channelId;
return this;
@@ -2827,10 +2823,8 @@
return this;
}
- /**
- * Specifies a duration in milliseconds after which this notification should be canceled,
- * if it is not already canceled.
- */
+ /** @removed */
+ @Deprecated
public Builder setTimeout(long durationMs) {
mN.mTimeout = durationMs;
return this;
@@ -8040,9 +8034,8 @@
return this;
}
- /**
- * Returns the id of the channel this notification posts to on TV.
- */
+ /** @removed */
+ @Deprecated
public String getChannel() {
return mChannelId;
}
diff --git a/core/java/android/app/PictureInPictureArgs.java b/core/java/android/app/PictureInPictureArgs.java
index 63db86a..88e6b99 100644
--- a/core/java/android/app/PictureInPictureArgs.java
+++ b/core/java/android/app/PictureInPictureArgs.java
@@ -16,91 +16,314 @@
package android.app;
+import android.annotation.Nullable;
import android.graphics.Rect;
+import android.os.Parcel;
+import android.os.Parcelable;
import android.util.Rational;
import java.util.ArrayList;
import java.util.List;
-/**
- * TO BE REMOVED
- */
+/** @removed */
@Deprecated
-public final class PictureInPictureArgs extends PictureInPictureParams {
+public final class PictureInPictureArgs implements Parcelable {
/**
- * Creates a new set of picture-in-picture arguments.
- *
- * TODO: Remove once we remove PictureInPictureArgs.
+ * Builder class for {@link PictureInPictureArgs} objects.
*/
- @Deprecated
- public PictureInPictureArgs() {
- // Empty constructor
- }
+ public static class Builder {
- /**
- * Creates a new set of picture-in-picture arguments from the given {@param aspectRatio} and
- * {@param actions}.
- *
- * TODO: Remove once we remove PictureInPictureArgs.
- */
- @Deprecated
- public PictureInPictureArgs(float aspectRatio, List<RemoteAction> actions) {
- setAspectRatio(aspectRatio);
- if (actions != null) {
- setActions(actions);
+ @Nullable
+ private Rational mAspectRatio;
+
+ @Nullable
+ private List<RemoteAction> mUserActions;
+
+ @Nullable
+ private Rect mSourceRectHint;
+
+ /**
+ * Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and
+ * does not change upon device rotation.
+ *
+ * @param aspectRatio the new aspect ratio for the activity in picture-in-picture, must be
+ * between 2.39:1 and 1:2.39 (inclusive).
+ *
+ * @return this builder instance.
+ */
+ public Builder setAspectRatio(Rational aspectRatio) {
+ mAspectRatio = aspectRatio;
+ return this;
+ }
+
+ /**
+ * Sets the user actions. If there are more than
+ * {@link Activity#getMaxNumPictureInPictureActions()} actions, then the input list
+ * will be truncated to that number.
+ *
+ * @param actions the new actions to show in the picture-in-picture menu.
+ *
+ * @return this builder instance.
+ *
+ * @see RemoteAction
+ */
+ public Builder setActions(List<RemoteAction> actions) {
+ if (mUserActions != null) {
+ mUserActions = null;
+ }
+ if (actions != null) {
+ mUserActions = new ArrayList<>(actions);
+ }
+ return this;
+ }
+
+ /**
+ * Sets the source bounds hint. These bounds are only used when an activity first enters
+ * picture-in-picture, and describe the bounds in window coordinates of activity entering
+ * picture-in-picture that will be visible following the transition. For the best effect,
+ * these bounds should also match the aspect ratio in the arguments.
+ *
+ * @param launchBounds window-coordinate bounds indicating the area of the activity that
+ * will still be visible following the transition into picture-in-picture (eg. the video
+ * view bounds in a video player)
+ *
+ * @return this builder instance.
+ */
+ public Builder setSourceRectHint(Rect launchBounds) {
+ if (launchBounds == null) {
+ mSourceRectHint = null;
+ } else {
+ mSourceRectHint = new Rect(launchBounds);
+ }
+ return this;
+ }
+
+ public PictureInPictureArgs build() {
+ PictureInPictureArgs args = new PictureInPictureArgs(mAspectRatio, mUserActions,
+ mSourceRectHint);
+ return args;
}
}
/**
- * Sets the aspect ratio.
- *
- * @param aspectRatio the new aspect ratio for picture-in-picture, must be within 2.39:1 and
- * 1:2.39.
- *
- * TODO: Remove once we remove PictureInPictureArgs.
+ * The expected aspect ratio of the picture-in-picture.
*/
- @Deprecated
- public void setAspectRatio(float aspectRatio) {
- // Temporary workaround
- mAspectRatio = new Rational((int) (aspectRatio * 1000000000), 1000000000);
+ @Nullable
+ private Rational mAspectRatio;
+
+ /**
+ * The set of actions that are associated with this activity when in picture-in-picture.
+ */
+ @Nullable
+ private List<RemoteAction> mUserActions;
+
+ /**
+ * The source bounds hint used when entering picture-in-picture, relative to the window bounds.
+ * We can use this internally for the transition into picture-in-picture to ensure that a
+ * particular source rect is visible throughout the whole transition.
+ */
+ @Nullable
+ private Rect mSourceRectHint;
+
+ /**
+ * The content insets that are used with the source hint rect for the transition into PiP where
+ * the insets are removed at the beginning of the transition.
+ */
+ @Nullable
+ private Rect mSourceRectHintInsets;
+
+ private PictureInPictureArgs() {
+ }
+
+ private PictureInPictureArgs(Parcel in) {
+ if (in.readInt() != 0) {
+ mAspectRatio = new Rational(in.readInt(), in.readInt());
+ }
+ if (in.readInt() != 0) {
+ mUserActions = new ArrayList<>();
+ in.readParcelableList(mUserActions, RemoteAction.class.getClassLoader());
+ }
+ if (in.readInt() != 0) {
+ mSourceRectHint = Rect.CREATOR.createFromParcel(in);
+ }
+ if (in.readInt() != 0) {
+ mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in);
+ }
+ }
+
+ private PictureInPictureArgs(Rational aspectRatio, List<RemoteAction> actions,
+ Rect sourceRectHint) {
+ mAspectRatio = aspectRatio;
+ mUserActions = actions;
+ mSourceRectHint = sourceRectHint;
}
/**
- * Sets the user actions. If there are more than
- * {@link ActivityManager#getMaxNumPictureInPictureActions()} actions, then the input will be
- * truncated to that number.
- *
- * @param actions the new actions to show in the picture-in-picture menu.
- *
- * @see RemoteAction
- *
- * TODO: Remove once we remove PictureInPictureArgs.
+ * Copies the set parameters from the other picture-in-picture args.
+ * @hide
*/
- @Deprecated
- public void setActions(List<RemoteAction> actions) {
- if (mUserActions != null) {
- mUserActions = null;
+ public void copyOnlySet(PictureInPictureArgs otherArgs) {
+ if (otherArgs.hasSetAspectRatio()) {
+ mAspectRatio = otherArgs.mAspectRatio;
}
- if (actions != null) {
- mUserActions = new ArrayList<>(actions);
+ if (otherArgs.hasSetActions()) {
+ mUserActions = otherArgs.mUserActions;
+ }
+ if (otherArgs.hasSourceBoundsHint()) {
+ mSourceRectHint = new Rect(otherArgs.getSourceRectHint());
+ }
+ if (otherArgs.hasSourceBoundsHintInsets()) {
+ mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets());
}
}
/**
- * Sets the source bounds hint. These bounds are only used when an activity first enters
- * picture-in-picture, and describe the bounds in window coordinates of activity entering
- * picture-in-picture that will be visible following the transition. For the best effect, these
- * bounds should also match the aspect ratio in the arguments.
- *
- * TODO: Remove once we remove PictureInPictureArgs.
+ * @return the aspect ratio. If none is set, return 0.
+ * @hide
+ */
+ public float getAspectRatio() {
+ if (mAspectRatio != null) {
+ return mAspectRatio.floatValue();
+ }
+ return 0f;
+ }
+
+ /** {@hide} */
+ public Rational getAspectRatioRational() {
+ return mAspectRatio;
+ }
+
+ /**
+ * @return whether the aspect ratio is set.
+ * @hide
+ */
+ public boolean hasSetAspectRatio() {
+ return mAspectRatio != null;
+ }
+
+ /**
+ * @return the set of user actions.
+ * @hide
+ */
+ public List<RemoteAction> getActions() {
+ return mUserActions;
+ }
+
+ /**
+ * @return whether the user actions are set.
+ * @hide
+ */
+ public boolean hasSetActions() {
+ return mUserActions != null;
+ }
+
+ /**
+ * Truncates the set of actions to the given {@param size}.
+ * @hide
+ */
+ public void truncateActions(int size) {
+ if (hasSetActions()) {
+ mUserActions = mUserActions.subList(0, Math.min(mUserActions.size(), size));
+ }
+ }
+
+ /**
+ * Sets the insets to be used with the source rect hint bounds.
+ * @hide
*/
@Deprecated
- public void setSourceRectHint(Rect launchBounds) {
- if (launchBounds == null) {
- mSourceRectHint = null;
+ public void setSourceRectHintInsets(Rect insets) {
+ if (insets == null) {
+ mSourceRectHintInsets = null;
} else {
- mSourceRectHint = new Rect(launchBounds);
+ mSourceRectHintInsets = new Rect(insets);
}
}
-}
\ No newline at end of file
+
+ /**
+ * @return the source rect hint
+ * @hide
+ */
+ public Rect getSourceRectHint() {
+ return mSourceRectHint;
+ }
+
+ /**
+ * @return the source rect hint insets.
+ * @hide
+ */
+ public Rect getSourceRectHintInsets() {
+ return mSourceRectHintInsets;
+ }
+
+ /**
+ * @return whether there are launch bounds set
+ * @hide
+ */
+ public boolean hasSourceBoundsHint() {
+ return mSourceRectHint != null && !mSourceRectHint.isEmpty();
+ }
+
+ /**
+ * @return whether there are source rect hint insets set
+ * @hide
+ */
+ public boolean hasSourceBoundsHintInsets() {
+ return mSourceRectHintInsets != null;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel out, int flags) {
+ if (mAspectRatio != null) {
+ out.writeInt(1);
+ out.writeInt(mAspectRatio.getNumerator());
+ out.writeInt(mAspectRatio.getDenominator());
+ } else {
+ out.writeInt(0);
+ }
+ if (mUserActions != null) {
+ out.writeInt(1);
+ out.writeParcelableList(mUserActions, 0);
+ } else {
+ out.writeInt(0);
+ }
+ if (mSourceRectHint != null) {
+ out.writeInt(1);
+ mSourceRectHint.writeToParcel(out, 0);
+ } else {
+ out.writeInt(0);
+ }
+ if (mSourceRectHintInsets != null) {
+ out.writeInt(1);
+ mSourceRectHintInsets.writeToParcel(out, 0);
+ } else {
+ out.writeInt(0);
+ }
+ }
+
+ public static final Creator<PictureInPictureArgs> CREATOR =
+ new Creator<PictureInPictureArgs>() {
+ public PictureInPictureArgs createFromParcel(Parcel in) {
+ return new PictureInPictureArgs(in);
+ }
+ public PictureInPictureArgs[] newArray(int size) {
+ return new PictureInPictureArgs[size];
+ }
+ };
+
+ public static PictureInPictureArgs convert(PictureInPictureParams params) {
+ return new PictureInPictureArgs(params.getAspectRatioRational(), params.getActions(),
+ params.getSourceRectHint());
+ }
+
+ public static PictureInPictureParams convert(PictureInPictureArgs args) {
+ return new PictureInPictureParams(args.getAspectRatioRational(), args.getActions(),
+ args.getSourceRectHint());
+ }
+}
diff --git a/core/java/android/app/PictureInPictureParams.java b/core/java/android/app/PictureInPictureParams.java
index e1df33b..323a0fb 100644
--- a/core/java/android/app/PictureInPictureParams.java
+++ b/core/java/android/app/PictureInPictureParams.java
@@ -28,10 +28,8 @@
/**
* Represents a set of parameters used to initialize and update an Activity in picture-in-picture
* mode.
- *
- * TODO: Make this final after we remove PictureInPictureArgs
*/
-public class PictureInPictureParams implements Parcelable {
+public final class PictureInPictureParams implements Parcelable {
/**
* Builder class for {@link PictureInPictureParams} objects.
@@ -63,7 +61,7 @@
/**
* Sets the user actions. If there are more than
- * {@link ActivityManager#getMaxNumPictureInPictureActions()} actions, then the input list
+ * {@link Activity#getMaxNumPictureInPictureActions()} actions, then the input list
* will be truncated to that number.
*
* @param actions the new actions to show in the picture-in-picture menu.
@@ -120,25 +118,22 @@
/**
* The expected aspect ratio of the picture-in-picture.
*/
- // TODO: Make private once we removed PictureInPictureArgs
@Nullable
- protected Rational mAspectRatio;
+ private Rational mAspectRatio;
/**
* The set of actions that are associated with this activity when in picture-in-picture.
*/
- // TODO: Make private once we removed PictureInPictureArgs
@Nullable
- protected List<RemoteAction> mUserActions;
+ private List<RemoteAction> mUserActions;
/**
* The source bounds hint used when entering picture-in-picture, relative to the window bounds.
* We can use this internally for the transition into picture-in-picture to ensure that a
* particular source rect is visible throughout the whole transition.
*/
- // TODO: Make private once we removed PictureInPictureArgs
@Nullable
- protected Rect mSourceRectHint;
+ private Rect mSourceRectHint;
/**
* The content insets that are used with the source hint rect for the transition into PiP where
@@ -147,15 +142,12 @@
@Nullable
private Rect mSourceRectHintInsets;
- /**
- * TO BE REMOVED
- */
- @Deprecated
+ /** {@hide} */
PictureInPictureParams() {
- // TODO: Remove once we remove PictureInPictureArgs
}
- private PictureInPictureParams(Parcel in) {
+ /** {@hide} */
+ PictureInPictureParams(Parcel in) {
if (in.readInt() != 0) {
mAspectRatio = new Rational(in.readInt(), in.readInt());
}
@@ -171,7 +163,8 @@
}
}
- private PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions,
+ /** {@hide} */
+ PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions,
Rect sourceRectHint) {
mAspectRatio = aspectRatio;
mUserActions = actions;
@@ -208,6 +201,11 @@
return 0f;
}
+ /** @hide */
+ public Rational getAspectRatioRational() {
+ return mAspectRatio;
+ }
+
/**
* @return whether the aspect ratio is set.
* @hide
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index e013662..1d879e9 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1710,19 +1710,6 @@
public static final String ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE";
/**
- * Activity Action: Launch application uninstaller.
- * <p>
- * Input: The data must be a package: URI whose scheme specific part is
- * the package name of the current installed package to be uninstalled.
- * You can optionally supply {@link #EXTRA_RETURN_RESULT}.
- * <p>
- * Output: Nothing.
- * </p>
- */
- @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE";
-
- /**
* Specify whether the package should be uninstalled for all users.
* @hide because these should not be part of normal application flow.
*/
@@ -3398,32 +3385,6 @@
ACTION_DYNAMIC_SENSOR_CHANGED = "android.intent.action.DYNAMIC_SENSOR_CHANGED";
/**
- * Broadcast Action: The default subscription has changed. This has the following
- * extra values:</p>
- * The {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default subscription index
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
- = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
-
- /**
- * Broadcast Action: The default sms subscription has changed. This has the following
- * extra values:</p>
- * {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default sms
- * subscription index
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
- = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
-
- /**
- * Integer extra used with {@link #ACTION_DEFAULT_SUBSCRIPTION_CHANGED} and
- * {@link #ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} to indicate the subscription
- * which has changed.
- */
- public static final String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX";
-
- /**
* Deprecated - use ACTION_FACTORY_RESET instead.
* @hide
*/
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 1013177..9b0bab4 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -201,10 +201,10 @@
private static final String META_DATA_INSTANT_APPS = "instantapps.clients.allowed";
/**
- * Bit mask of all the valid bits that can be set in restartOnConfigChanges.
+ * Bit mask of all the valid bits that can be set in recreateOnConfigChanges.
* @hide
*/
- private static final int RESTART_ON_CONFIG_CHANGES_MASK =
+ private static final int RECREATE_ON_CONFIG_CHANGES_MASK =
ActivityInfo.CONFIG_MCC | ActivityInfo.CONFIG_MNC;
// These are the tags supported by child packages
@@ -4219,7 +4219,7 @@
ActivityManager.getDefaultAppRecentsLimitStatic());
a.info.configChanges = getActivityConfigChanges(
sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0),
- sa.getInt(R.styleable.AndroidManifestActivity_restartOnConfigChanges, 0));
+ sa.getInt(R.styleable.AndroidManifestActivity_recreateOnConfigChanges, 0));
a.info.softInputMode = sa.getInt(
R.styleable.AndroidManifestActivity_windowSoftInputMode, 0);
@@ -4523,13 +4523,13 @@
/**
* @param configChanges The bit mask of configChanges fetched from AndroidManifest.xml.
- * @param restartOnConfigChanges The bit mask restartOnConfigChanges fetched from
- * AndroidManifest.xml.
+ * @param recreateOnConfigChanges The bit mask recreateOnConfigChanges fetched from
+ * AndroidManifest.xml.
* @hide Exposed for unit testing only.
*/
@TestApi
- public static int getActivityConfigChanges(int configChanges, int restartOnConfigChanges) {
- return configChanges | ((~restartOnConfigChanges) & RESTART_ON_CONFIG_CHANGES_MASK);
+ public static int getActivityConfigChanges(int configChanges, int recreateOnConfigChanges) {
+ return configChanges | ((~recreateOnConfigChanges) & RECREATE_ON_CONFIG_CHANGES_MASK);
}
private void parseLayout(Resources res, AttributeSet attrs, Activity a) {
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index b715780..037cccf 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -55,6 +55,7 @@
void rebootSafeMode(boolean confirm, boolean wait);
void shutdown(boolean confirm, String reason, boolean wait);
void crash(String message);
+ int getLastShutdownReason();
void setStayOnSetting(int val);
void boostScreenBrightness(long time);
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index a713eef..7d1369f 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -16,10 +16,13 @@
package android.os;
+import android.annotation.IntDef;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.content.Context;
import android.util.Log;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
* This class gives you control of the power state of the device.
@@ -432,6 +435,49 @@
*/
public static final String SHUTDOWN_USER_REQUESTED = "userrequested";
+ /**
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({
+ SHUTDOWN_REASON_UNKNOWN,
+ SHUTDOWN_REASON_SHUTDOWN,
+ SHUTDOWN_REASON_REBOOT,
+ SHUTDOWN_REASON_USER_REQUESTED,
+ SHUTDOWN_REASON_THERMAL_SHUTDOWN
+ })
+ public @interface ShutdownReason {}
+
+ /**
+ * constant for shutdown reason being unknown.
+ * @hide
+ */
+ public static final int SHUTDOWN_REASON_UNKNOWN = 0;
+
+ /**
+ * constant for shutdown reason being normal shutdown.
+ * @hide
+ */
+ public static final int SHUTDOWN_REASON_SHUTDOWN = 1;
+
+ /**
+ * constant for shutdown reason being reboot.
+ * @hide
+ */
+ public static final int SHUTDOWN_REASON_REBOOT = 2;
+
+ /**
+ * constant for shutdown reason being user requested.
+ * @hide
+ */
+ public static final int SHUTDOWN_REASON_USER_REQUESTED = 3;
+
+ /**
+ * constant for shutdown reason being overheating.
+ * @hide
+ */
+ public static final int SHUTDOWN_REASON_THERMAL_SHUTDOWN = 4;
+
final Context mContext;
final IPowerManager mService;
final Handler mHandler;
@@ -1085,6 +1131,22 @@
}
/**
+ * Returns the reason the phone was last shutdown. Calling app must have the
+ * {@link android.Manifest.permission#DEVICE_POWER} permission to request this information.
+ * @return Reason for shutdown as an int, {@link #SHUTDOWN_REASON_UNKNOWN} if the file could
+ * not be accessed.
+ * @hide
+ */
+ @ShutdownReason
+ public int getLastShutdownReason() {
+ try {
+ return mService.getLastShutdownReason();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Intent that is broadcast when the state of {@link #isPowerSaveMode()} changes.
* This broadcast is only sent to registered receivers.
*/
diff --git a/core/java/android/os/TestLooperManager.java b/core/java/android/os/TestLooperManager.java
index 745642e..5e7549f 100644
--- a/core/java/android/os/TestLooperManager.java
+++ b/core/java/android/os/TestLooperManager.java
@@ -58,11 +58,17 @@
/**
* Returns the {@link MessageQueue} this object is wrapping.
*/
- public MessageQueue getQueue() {
+ public MessageQueue getMessageQueue() {
checkReleased();
return mQueue;
}
+ /** @removed */
+ @Deprecated
+ public MessageQueue getQueue() {
+ return getMessageQueue();
+ }
+
/**
* Returns the next message that should be executed by this queue, may block
* if no messages are ready.
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index 416455d..88d17ef 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -119,7 +119,7 @@
try {
onFillRequest(request, cancellation, fillCallback);
} catch (AbstractMethodError e) {
- final ArrayList<FillContext> contexts = request.getFillContexts();
+ final List<FillContext> contexts = request.getFillContexts();
onFillRequest(contexts.get(contexts.size() - 1).getStructure(),
request.getClientState(), request.getFlags(), cancellation,
fillCallback);
diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java
index 8ac399c..b1145ee 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -29,6 +29,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
+import java.util.List;
/**
* This class represents a request to an {@link AutofillService autofill provider}
@@ -96,7 +97,7 @@
/**
* @return The contexts associated with each previous fill request.
*/
- public @NonNull ArrayList<FillContext> getFillContexts() {
+ public @NonNull List<FillContext> getFillContexts() {
return mContexts;
}
diff --git a/core/java/android/speech/tts/UtteranceProgressListener.java b/core/java/android/speech/tts/UtteranceProgressListener.java
index ef81f12..7381a12 100644
--- a/core/java/android/speech/tts/UtteranceProgressListener.java
+++ b/core/java/android/speech/tts/UtteranceProgressListener.java
@@ -144,9 +144,8 @@
onUtteranceRangeStart(utteranceId, start, end);
}
- /**
- * @deprecated Due to internal API changes. Remove when apps catch up.
- */
+ /** @removed */
+ @Deprecated
public void onUtteranceRangeStart(String utteranceId, int start, int end) {
}
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 0a24bfb0..d0133ed 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -95,7 +95,7 @@
* Type: {@link android.os.Bundle}
*/
public static final String EXTRA_CLIENT_STATE =
- "android.view.autofill.extra.EXTRA_CLIENT_STATE";
+ "android.view.autofill.extra.CLIENT_STATE";
static final String SESSION_ID_TAG = "android:sessionId";
static final String LAST_AUTOFILLED_DATA_TAG = "android:lastAutoFilledData";
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 1c87726..5476ab2 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -7088,7 +7088,8 @@
final int size = scrapViews.size();
if (size > 0) {
// See if we still have a view for this position or ID.
- for (int i = 0; i < size; i++) {
+ // Traverse backwards to find the most recently used scrap view
+ for (int i = size - 1; i >= 0; i--) {
final View view = scrapViews.get(i);
final AbsListView.LayoutParams params =
(AbsListView.LayoutParams) view.getLayoutParams();
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 4b39646..ea9bd22 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -376,8 +376,6 @@
<protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_PROGRESS" />
<protected-broadcast android:name="android.nfc.handover.intent.action.TRANSFER_DONE" />
- <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED" />
- <protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE" />
@@ -445,6 +443,8 @@
<protected-broadcast android:name="android.telecom.action.PHONE_ACCOUNT_UNREGISTERED" />
<protected-broadcast android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION" />
<protected-broadcast android:name="android.telephony.action.CARRIER_CONFIG_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED" />
+ <protected-broadcast android:name="android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED" />
<protected-broadcast android:name="android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION" />
<protected-broadcast android:name="com.android.bluetooth.btservice.action.ALARM_WAKEUP" />
@@ -826,16 +826,6 @@
android:description="@string/permdesc_callPhone"
android:protectionLevel="dangerous" />
- <!-- Allows an application to manage its own calls, but rely on the system to route focus to the
- currently active call.
- <p>Protection level: dangerous
- -->
- <permission android:name="android.permission.MANAGE_OWN_CALLS"
- android:permissionGroup="android.permission-group.PHONE"
- android:label="@string/permlab_manageOwnCalls"
- android:description="@string/permdesc_manageOwnCalls"
- android:protectionLevel="dangerous" />
-
<!-- Allows an application to access the IMS call service: making and
modifying a call
<p>Protection level: signature|privileged
@@ -923,6 +913,16 @@
android:description="@string/permdesc_answerPhoneCalls"
android:protectionLevel="dangerous|runtime" />
+ <!-- Allows a calling application which manages it own calls through the self-managed
+ {@link android.telecom.ConnectionService} APIs. See
+ {@link android.telecom.PhoneAccount#CAPABILITY_SELF_MANAGED for more information on the
+ self-managed ConnectionService APIs.
+ <p>Protection level: normal
+ -->
+ <permission android:name="android.permission.MANAGE_OWN_CALLS"
+ android:label="@string/permlab_manageOwnCalls"
+ android:description="@string/permdesc_manageOwnCalls"
+ android:protectionLevel="normal" />
<!-- ====================================================================== -->
<!-- Permissions for accessing the device microphone -->
diff --git a/core/res/res/drawable/ic_picture_in_picture.xml b/core/res/res/drawable/ic_picture_in_picture.xml
deleted file mode 100644
index e2dda33..0000000
--- a/core/res/res/drawable/ic_picture_in_picture.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
-
- <path
- android:fillColor="#FFFFFF"
- android:pathData="M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1 .9
-2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z" />
- <path
- android:pathData="M0 0h24v24H0V0z" />
-</vector>
\ No newline at end of file
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index b7bc7b7..ced22cc 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -784,13 +784,13 @@
<enum name="locked" value="14" />
</attr>
- <!-- Specify the configuration changes that trigger the system to restart the
+ <!-- Specify the configuration changes that trigger the system to recreate the
current activity if any of these configuration changes happen in the system.
The valid configuration changes include mcc and mnc which are the same with
- those in configChanges. By default from Android O, we don't restart the activity
+ those in configChanges. By default from Android O, we don't recreate the activity
even the app doesn't specify mcc or mnc in configChanges. If the app wants to
- restart, specify them in restartOnConfigChanges. -->
- <attr name="restartOnConfigChanges">
+ be recreated, specify them in recreateOnConfigChanges. -->
+ <attr name="recreateOnConfigChanges">
<!-- The IMSI MCC has changed, that is a SIM has been detected and
updated the Mobile Country Code. -->
<flag name="mcc" value="0x0001" />
@@ -817,15 +817,15 @@
<attr name="configChanges">
<!-- The IMSI MCC has changed, that is a SIM has been detected and
updated the Mobile Country Code. By default from Android O, we
- don't restart the activity even the app doesn't specify mcc in
- configChanges. If the app wants to restart, specify mcc in
- restartOnConfigChanges. -->
+ don't recreate the activity even the app doesn't specify mcc in
+ configChanges. If the app wants to recreate the activity, specify
+ mcc in recreateOnConfigChanges. -->
<flag name="mcc" value="0x0001" />
<!-- The IMSI MNC has changed, that is a SIM has been detected and
updated the Mobile Network Code. By default from Android O, we
- don't restart the activity even the app doesn't specify mnc in
- configChanges. If the app wants to restart, specify mnc in
- restartOnConfigChanges. -->
+ don't recreate the activity even the app doesn't specify mnc in
+ configChanges. If the app wants to recreate the acvitity, specify
+ mnc in recreateOnConfigChanges. -->
<flag name="mnc" value="0x0002" />
<!-- The locale has changed, that is the user has selected a new
language that text should be displayed in. -->
@@ -2048,7 +2048,7 @@
<attr name="launchMode" />
<attr name="screenOrientation" />
<attr name="configChanges" />
- <attr name="restartOnConfigChanges" />
+ <attr name="recreateOnConfigChanges" />
<attr name="permission" />
<attr name="multiprocess" />
<attr name="process" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 17f4d39..42d3f27 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2786,7 +2786,7 @@
<public name="appCategory" />
<public name="autoSizeMaxTextSize" />
<public name="__removed2" />
- <public name="restartOnConfigChanges" />
+ <public name="recreateOnConfigChanges" />
<public name="certDigest" />
<public name="splitName" />
<public name="colorMode" />
@@ -2834,11 +2834,6 @@
<public name="autofill" />
</public-group>
- <public-group type="drawable" first-id="0x010800b5">
- <!-- 0x010800b4 was removed -->
- <public name="ic_picture_in_picture" />
- </public-group>
-
<public-group type="string" first-id="0x01040019">
<public name="paste_as_plain_text" />
</public-group>
diff --git a/core/tests/coretests/src/android/content/pm/PackageParserTest.java b/core/tests/coretests/src/android/content/pm/PackageParserTest.java
index ca4141a..b9bd193 100644
--- a/core/tests/coretests/src/android/content/pm/PackageParserTest.java
+++ b/core/tests/coretests/src/android/content/pm/PackageParserTest.java
@@ -220,41 +220,41 @@
* Unit test for PackageParser.getActivityConfigChanges().
* If the bit is 1 in the original configChanges, it is still 1 in the final configChanges.
* If the bit is 0 in the original configChanges and the bit is not set to 1 in
- * restartOnConfigChanges, the bit is changed to 1 in the final configChanges by default.
+ * recreateOnConfigChanges, the bit is changed to 1 in the final configChanges by default.
*/
@Test
public void testGetActivityConfigChanges() {
- // Not set in either configChanges or restartOnConfigChanges.
+ // Not set in either configChanges or recreateOnConfigChanges.
int configChanges = 0x0000; // 00000000.
- int restartOnConfigChanges = 0x0000; // 00000000.
+ int recreateOnConfigChanges = 0x0000; // 00000000.
int finalConfigChanges =
- PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges);
+ PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges);
assertEquals(0x0003, finalConfigChanges); // Should be 00000011.
- // Not set in configChanges, but set in restartOnConfigChanges.
+ // Not set in configChanges, but set in recreateOnConfigChanges.
configChanges = 0x0000; // 00000000.
- restartOnConfigChanges = 0x0003; // 00000011.
+ recreateOnConfigChanges = 0x0003; // 00000011.
finalConfigChanges =
- PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges);
+ PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges);
assertEquals(0x0000, finalConfigChanges); // Should be 00000000.
// Set in configChanges.
configChanges = 0x0003; // 00000011.
- restartOnConfigChanges = 0X0000; // 00000000.
+ recreateOnConfigChanges = 0X0000; // 00000000.
finalConfigChanges =
- PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges);
+ PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges);
assertEquals(0x0003, finalConfigChanges); // Should be 00000011.
- restartOnConfigChanges = 0x0003; // 00000011.
+ recreateOnConfigChanges = 0x0003; // 00000011.
finalConfigChanges =
- PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges);
+ PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges);
assertEquals(0x0003, finalConfigChanges); // Should still be 00000011.
// Other bit set in configChanges.
configChanges = 0x0080; // 10000000, orientation.
- restartOnConfigChanges = 0x0000; // 00000000.
+ recreateOnConfigChanges = 0x0000; // 00000000.
finalConfigChanges =
- PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges);
+ PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges);
assertEquals(0x0083, finalConfigChanges); // Should be 10000011.
}
}
diff --git a/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java b/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java
new file mode 100644
index 0000000..6e38fb6
--- /dev/null
+++ b/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.graphics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class ColorSpaceRendererTest {
+
+ @Test
+ public void testRendererSize() {
+ Bitmap b = ColorSpace.createRenderer()
+ .size(0)
+ .render();
+ assertEquals(128, b.getWidth());
+ assertEquals(128, b.getHeight());
+
+ b = ColorSpace.createRenderer()
+ .size(768)
+ .render();
+ assertEquals(768, b.getWidth());
+ assertEquals(768, b.getHeight());
+ }
+
+ @Test
+ public void testRenderer() {
+ Bitmap b = ColorSpace.createRenderer()
+ .size(1024)
+ .clip(true)
+ .showWhitePoint(false)
+ .add(ColorSpace.get(ColorSpace.Named.SRGB), 0xffffffff)
+ .add(ColorSpace.get(ColorSpace.Named.DCI_P3), 0xffffffff)
+ .add(ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB), 0.1f, 0.5f, 0.1f, 0xff000000)
+ .add(ColorSpace.get(ColorSpace.Named.ADOBE_RGB), 0.1f, 0.5f, 0.1f, 0xff000000)
+ .render();
+ assertNotNull(b);
+ }
+
+ @Test
+ public void testUcsRenderer() {
+ Bitmap b = ColorSpace.createRenderer()
+ .size(1024)
+ .clip(true)
+ .showWhitePoint(false)
+ .uniformChromaticityScale(true)
+ .add(ColorSpace.get(ColorSpace.Named.SRGB), 0xffffffff)
+ .add(ColorSpace.get(ColorSpace.Named.DCI_P3), 0xffffffff)
+ .add(ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB), 0.1f, 0.5f, 0.1f, 0xff000000)
+ .add(ColorSpace.get(ColorSpace.Named.ADOBE_RGB), 0.1f, 0.5f, 0.1f, 0xff000000)
+ .render();
+ assertNotNull(b);
+ }
+}
diff --git a/media/java/android/media/AudioFocusRequest.java b/media/java/android/media/AudioFocusRequest.java
index 29d1986..b1dc3ad 100644
--- a/media/java/android/media/AudioFocusRequest.java
+++ b/media/java/android/media/AudioFocusRequest.java
@@ -357,6 +357,20 @@
}
/**
+ * @hide
+ * Internal listener setter, no null checks on listener nor handler
+ * @param listener
+ * @param handler
+ * @return this {@code Builder} instance.
+ */
+ @NonNull Builder setOnAudioFocusChangeListenerInt(
+ OnAudioFocusChangeListener listener, Handler handler) {
+ mFocusListener = listener;
+ mListenerHandler = handler;
+ return this;
+ }
+
+ /**
* Sets the listener called when audio focus changes after being requested with
* {@link AudioManager#requestAudioFocus(AudioFocusRequest)}, and until being abandoned
* with {@link AudioManager#abandonAudioFocusRequest(AudioFocusRequest)}.
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index ce07c99..0b5dff2 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -2445,7 +2445,7 @@
}
final AudioFocusRequest afr = new AudioFocusRequest.Builder(durationHint)
- .setOnAudioFocusChangeListener(l, null /* no Handler for this legacy API */)
+ .setOnAudioFocusChangeListenerInt(l, null /* no Handler for this legacy API */)
.setAudioAttributes(requestAttributes)
.setAcceptsDelayedFocusGain((flags & AUDIOFOCUS_FLAG_DELAY_OK)
== AUDIOFOCUS_FLAG_DELAY_OK)
diff --git a/media/java/android/media/tv/TvContract.java b/media/java/android/media/tv/TvContract.java
index 6f4118e..4496a82 100644
--- a/media/java/android/media/tv/TvContract.java
+++ b/media/java/android/media/tv/TvContract.java
@@ -437,7 +437,7 @@
public static final String PARAM_BROWSABLE_ONLY = "browsable_only";
/**
- * A optional query, update or delete URI parameter that allows the caller to specify canonical
+ * An optional query, update or delete URI parameter that allows the caller to specify canonical
* genre to filter programs.
* @hide
*/
@@ -452,6 +452,13 @@
public static final String PARAM_PREVIEW = "preview";
/**
+ * An optional query, update or delete URI parameter that allows the caller to specify package
+ * name to filter channels.
+ * @hide
+ */
+ public static final String PARAM_PACKAGE = "package";
+
+ /**
* Builds an ID that uniquely identifies a TV input service.
*
* @param name The {@link ComponentName} of the TV input service to build ID for.
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java
index ccf7a0b..39dfe0e 100644
--- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java
+++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java
@@ -33,7 +33,7 @@
public final long freeBytes;
public final long totalBytes;
- private PrivateStorageInfo(long freeBytes, long totalBytes) {
+ public PrivateStorageInfo(long freeBytes, long totalBytes) {
this.freeBytes = freeBytes;
this.totalBytes = totalBytes;
}
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
index 28bd23c..df03fdc 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
@@ -103,6 +103,7 @@
// Re-enable touches after the animation completes
mTouchHandler.setTouchEnabled(true);
mTouchHandler.onPinnedStackAnimationEnded();
+ mMenuController.onPinnedStackAnimationEnded();
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
index 79ac816..65f24cf 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java
@@ -80,6 +80,7 @@
public static final int MESSAGE_HIDE_MENU = 3;
public static final int MESSAGE_UPDATE_ACTIONS = 4;
public static final int MESSAGE_UPDATE_DISMISS_FRACTION = 5;
+ public static final int MESSAGE_ANIMATION_ENDED = 6;
private static final long INITIAL_DISMISS_DELAY = 3500;
private static final long POST_INTERACTION_DISMISS_DELAY = 2000;
@@ -92,6 +93,7 @@
private int mMenuState;
private boolean mAllowMenuTimeout = true;
+ private boolean mAllowTouches = true;
private final List<RemoteAction> mActions = new ArrayList<>();
@@ -149,6 +151,10 @@
updateDismissFraction(data.getFloat(EXTRA_DISMISS_FRACTION));
break;
}
+ case MESSAGE_ANIMATION_ENDED: {
+ mAllowTouches = true;
+ break;
+ }
}
}
});
@@ -245,6 +251,10 @@
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
+ if (!mAllowTouches) {
+ return super.dispatchTouchEvent(ev);
+ }
+
// On the first action outside the window, hide the menu
switch (ev.getAction()) {
case MotionEvent.ACTION_OUTSIDE:
@@ -284,6 +294,9 @@
boolean allowMenuTimeout) {
mAllowMenuTimeout = allowMenuTimeout;
if (mMenuState != menuState) {
+ boolean deferTouchesUntilAnimationEnds = (mMenuState == MENU_STATE_FULL) ||
+ (menuState == MENU_STATE_FULL);
+ mAllowTouches = !deferTouchesUntilAnimationEnds;
cancelDelayedFinish();
updateActionViews(stackBounds);
if (mMenuContainerAnimator != null) {
@@ -447,8 +460,8 @@
});
} else {
actionView.setAlpha(DISABLED_ACTION_ALPHA);
- actionView.setEnabled(false);
}
+ actionView.setEnabled(action.isEnabled());
// Update the margin between actions
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java
index c41f898..d5cf1dd 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java
@@ -197,6 +197,19 @@
}
}
+ public void onPinnedStackAnimationEnded() {
+ // Note: Only active menu activities care about this event
+ if (mToActivityMessenger != null) {
+ Message m = Message.obtain();
+ m.what = PipMenuActivity.MESSAGE_ANIMATION_ENDED;
+ try {
+ mToActivityMessenger.send(m);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Could not notify menu pinned animation ended", e);
+ }
+ }
+ }
+
/**
* Adds a new menu activity listener.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index daf0622..6b3daa3 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -36,6 +36,7 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
+import android.support.annotation.VisibleForTesting;
import android.util.Slog;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
@@ -71,6 +72,10 @@
private static final String ACTION_DISMISSED_WARNING = "PNW.dismissedWarning";
private static final String ACTION_CLICKED_TEMP_WARNING = "PNW.clickedTempWarning";
private static final String ACTION_DISMISSED_TEMP_WARNING = "PNW.dismissedTempWarning";
+ private static final String ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING =
+ "PNW.clickedThermalShutdownWarning";
+ private static final String ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING =
+ "PNW.dismissedThermalShutdownWarning";
private static final AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -95,8 +100,9 @@
private boolean mPlaySound;
private boolean mInvalidCharger;
private SystemUIDialog mSaverConfirmation;
- private boolean mTempWarning;
+ private boolean mHighTempWarning;
private SystemUIDialog mHighTempDialog;
+ private SystemUIDialog mThermalShutdownDialog;
public PowerNotificationWarnings(Context context, NotificationManager notificationManager,
StatusBar statusBar) {
@@ -113,8 +119,10 @@
pw.print("mInvalidCharger="); pw.println(mInvalidCharger);
pw.print("mShowing="); pw.println(SHOWING_STRINGS[mShowing]);
pw.print("mSaverConfirmation="); pw.println(mSaverConfirmation != null ? "not null" : null);
- pw.print("mTempWarning="); pw.println(mTempWarning);
+ pw.print("mHighTempWarning="); pw.println(mHighTempWarning);
pw.print("mHighTempDialog="); pw.println(mHighTempDialog != null ? "not null" : null);
+ pw.print("mThermalShutdownDialog=");
+ pw.println(mThermalShutdownDialog != null ? "not null" : null);
}
@Override
@@ -212,29 +220,29 @@
}
@Override
- public void dismissTemperatureWarning() {
- if (!mTempWarning) {
+ public void dismissHighTemperatureWarning() {
+ if (!mHighTempWarning) {
return;
}
- mTempWarning = false;
- dismissTemperatureWarningInternal();
+ mHighTempWarning = false;
+ dismissHighTemperatureWarningInternal();
}
/**
- * Internal only version of {@link #dismissTemperatureWarning()} that simply dismisses
+ * Internal only version of {@link #dismissHighTemperatureWarning()} that simply dismisses
* the notification. As such, the notification will not show again until
- * {@link #dismissTemperatureWarning()} is called.
+ * {@link #dismissHighTemperatureWarning()} is called.
*/
- private void dismissTemperatureWarningInternal() {
+ private void dismissHighTemperatureWarningInternal() {
mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, UserHandle.ALL);
}
@Override
- public void showTemperatureWarning() {
- if (mTempWarning) {
+ public void showHighTemperatureWarning() {
+ if (mHighTempWarning) {
return;
}
- mTempWarning = true;
+ mHighTempWarning = true;
final Notification.Builder nb =
new Notification.Builder(mContext, NotificationChannels.ALERTS)
.setSmallIcon(R.drawable.ic_device_thermostat_24)
@@ -249,10 +257,9 @@
SystemUI.overrideNotificationAppName(mContext, nb);
final Notification n = nb.build();
mNoMan.notifyAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, n, UserHandle.ALL);
-
}
- private void showTemperatureDialog() {
+ private void showHighTemperatureDialog() {
if (mHighTempDialog != null) return;
final SystemUIDialog d = new SystemUIDialog(mContext);
d.setIconAttribute(android.R.attr.alertDialogIcon);
@@ -265,6 +272,44 @@
mHighTempDialog = d;
}
+ @VisibleForTesting
+ void dismissThermalShutdownWarning() {
+ mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_THERMAL_SHUTDOWN, UserHandle.ALL);
+ }
+
+ private void showThermalShutdownDialog() {
+ if (mThermalShutdownDialog != null) return;
+ final SystemUIDialog d = new SystemUIDialog(mContext);
+ d.setIconAttribute(android.R.attr.alertDialogIcon);
+ d.setTitle(R.string.thermal_shutdown_title);
+ d.setMessage(R.string.thermal_shutdown_dialog_message);
+ d.setPositiveButton(com.android.internal.R.string.ok, null);
+ d.setShowForAllUsers(true);
+ d.setOnDismissListener(dialog -> mThermalShutdownDialog = null);
+ d.show();
+ mThermalShutdownDialog = d;
+ }
+
+ @Override
+ public void showThermalShutdownWarning() {
+ final Notification.Builder nb =
+ new Notification.Builder(mContext, NotificationChannels.ALERTS)
+ .setSmallIcon(R.drawable.ic_device_thermostat_24)
+ .setWhen(0)
+ .setShowWhen(false)
+ .setContentTitle(mContext.getString(R.string.thermal_shutdown_title))
+ .setContentText(mContext.getString(R.string.thermal_shutdown_message))
+ .setVisibility(Notification.VISIBILITY_PUBLIC)
+ .setContentIntent(pendingBroadcast(ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING))
+ .setDeleteIntent(
+ pendingBroadcast(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING))
+ .setColor(Utils.getColorAttr(mContext, android.R.attr.colorError));
+ SystemUI.overrideNotificationAppName(mContext, nb);
+ final Notification n = nb.build();
+ mNoMan.notifyAsUser(
+ TAG_TEMPERATURE, SystemMessage.NOTE_THERMAL_SHUTDOWN, n, UserHandle.ALL);
+ }
+
@Override
public void updateLowBatteryWarning() {
updateNotification();
@@ -380,6 +425,8 @@
filter.addAction(ACTION_DISMISSED_WARNING);
filter.addAction(ACTION_CLICKED_TEMP_WARNING);
filter.addAction(ACTION_DISMISSED_TEMP_WARNING);
+ filter.addAction(ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING);
+ filter.addAction(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING);
mContext.registerReceiverAsUser(this, UserHandle.ALL, filter,
android.Manifest.permission.STATUS_BAR_SERVICE, mHandler);
}
@@ -397,10 +444,15 @@
} else if (action.equals(ACTION_DISMISSED_WARNING)) {
dismissLowBatteryWarning();
} else if (ACTION_CLICKED_TEMP_WARNING.equals(action)) {
- dismissTemperatureWarningInternal();
- showTemperatureDialog();
+ dismissHighTemperatureWarningInternal();
+ showHighTemperatureDialog();
} else if (ACTION_DISMISSED_TEMP_WARNING.equals(action)) {
- dismissTemperatureWarningInternal();
+ dismissHighTemperatureWarningInternal();
+ } else if (ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING.equals(action)) {
+ dismissThermalShutdownWarning();
+ showThermalShutdownDialog();
+ } else if (ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING.equals(action)) {
+ dismissThermalShutdownWarning();
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index 471c3ae..a642077 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -31,6 +31,7 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
+import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
import android.util.Slog;
@@ -93,6 +94,10 @@
updateBatteryWarningLevels();
mReceiver.init();
+ // Check to see if we need to let the user know that the phone previously shut down due
+ // to the temperature being too high.
+ showThermalShutdownDialog();
+
initTemperatureWarning();
}
@@ -256,6 +261,13 @@
updateTemperatureWarning();
}
+ private void showThermalShutdownDialog() {
+ if (mPowerManager.getLastShutdownReason()
+ == PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN) {
+ mWarnings.showThermalShutdownWarning();
+ }
+ }
+
private void updateTemperatureWarning() {
float[] temps = mHardwarePropertiesManager.getDeviceTemperatures(
HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
@@ -268,9 +280,9 @@
if (statusBar != null && !statusBar.isDeviceInVrMode()
&& temp >= mThresholdTemp) {
logAtTemperatureThreshold(temp);
- mWarnings.showTemperatureWarning();
+ mWarnings.showHighTemperatureWarning();
} else {
- mWarnings.dismissTemperatureWarning();
+ mWarnings.dismissHighTemperatureWarning();
}
}
@@ -369,8 +381,9 @@
void showInvalidChargerWarning();
void updateLowBatteryWarning();
boolean isInvalidChargerWarningShowing();
- void dismissTemperatureWarning();
- void showTemperatureWarning();
+ void dismissHighTemperatureWarning();
+ void showHighTemperatureWarning();
+ void showThermalShutdownWarning();
void dump(PrintWriter pw);
void userSwitched();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index 53a9eae..2b812a5 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -331,8 +331,7 @@
RecentsActivityLaunchState launchState = config.getLaunchState();
if (!launchState.launchedWithAltTab) {
// Has the user tapped quickly?
- boolean isQuickTap = ViewConfiguration.getDoubleTapMinTime() < elapsedTime &&
- elapsedTime < ViewConfiguration.getDoubleTapTimeout();
+ boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout();
if (Recents.getConfiguration().isGridEnabled) {
if (isQuickTap) {
EventBus.getDefault().post(new LaunchNextTaskRequestEvent());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
index ccc99c5..8b3d6d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java
@@ -145,13 +145,15 @@
}
private void showSnoozeOptions(boolean show) {
- mExpanded = show;
- animateSnoozeOptions(show);
int drawableId = show ? com.android.internal.R.drawable.ic_collapse_notification
: com.android.internal.R.drawable.ic_expand_notification;
mExpandButton.setImageResource(drawableId);
- if (mGutsContainer != null) {
- mGutsContainer.onHeightChanged();
+ if (mExpanded != show) {
+ mExpanded = show;
+ animateSnoozeOptions(show);
+ if (mGutsContainer != null) {
+ mGutsContainer.onHeightChanged();
+ }
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
index 34cfa7b..eb59a34 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java
@@ -24,7 +24,6 @@
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -129,17 +128,32 @@
}
@Test
- public void testShowTemperatureWarning_NotifyAsUser() {
- mPowerNotificationWarnings.showTemperatureWarning();
+ public void testShowHighTemperatureWarning_NotifyAsUser() {
+ mPowerNotificationWarnings.showHighTemperatureWarning();
verify(mMockNotificationManager, times(1))
.notifyAsUser(anyString(), eq(SystemMessage.NOTE_HIGH_TEMP), any(), any());
}
@Test
- public void testDismissTemperatureWarning_CancelAsUser() {
- mPowerNotificationWarnings.showTemperatureWarning();
- mPowerNotificationWarnings.dismissTemperatureWarning();
+ public void testDismissHighTemperatureWarning_CancelAsUser() {
+ mPowerNotificationWarnings.showHighTemperatureWarning();
+ mPowerNotificationWarnings.dismissHighTemperatureWarning();
verify(mMockNotificationManager, times(1)).cancelAsUser(anyString(),
eq(SystemMessage.NOTE_HIGH_TEMP), any());
}
+
+ @Test
+ public void testShowThermalShutdownWarning_NotifyAsUser() {
+ mPowerNotificationWarnings.showThermalShutdownWarning();
+ verify(mMockNotificationManager, times(1))
+ .notifyAsUser(anyString(), eq(SystemMessage.NOTE_THERMAL_SHUTDOWN), any(), any());
+ }
+
+ @Test
+ public void testDismissThermalShutdownWarning_CancelAsUser() {
+ mPowerNotificationWarnings.showThermalShutdownWarning();
+ mPowerNotificationWarnings.dismissThermalShutdownWarning();
+ verify(mMockNotificationManager, times(1)).cancelAsUser(anyString(),
+ eq(SystemMessage.NOTE_THERMAL_SHUTDOWN), any());
+ }
}
diff --git a/services/core/java/com/android/server/SystemService.java b/services/core/java/com/android/server/SystemService.java
index c105b12..94397d0 100644
--- a/services/core/java/com/android/server/SystemService.java
+++ b/services/core/java/com/android/server/SystemService.java
@@ -173,6 +173,9 @@
* state they maintain for running users. This is called prior to sending the SHUTDOWN
* broadcast to the user; it is a good place to stop making use of any resources of that
* user (such as binding to a service running in the user).
+ *
+ * <p>NOTE: This is the last callback where the callee may access the target user's CE storage.
+ *
* @param userHandle The identifier of the user.
*/
public void onStopUser(int userHandle) {}
@@ -181,6 +184,10 @@
* Called when an existing user is stopping, for system services to finalize any per-user
* state they maintain for running users. This is called after all application process
* teardown of the user is complete.
+ *
+ * <p>NOTE: When this callback is called, the CE storage for the target user may not be
+ * accessible already. Use {@link #onStopUser} instead if you need to access the CE storage.
+ *
* @param userHandle The identifier of the user.
*/
public void onCleanupUser(int userHandle) {}
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 5edf19a..e0fc531 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2808,7 +2808,7 @@
void removeUninstalledPackageLocked(String packageName, int userId) {
ServiceMap smap = mServiceMap.get(userId);
if (smap != null && smap.mActiveForegroundApps.size() > 0) {
- for (int i = smap.mActiveForegroundApps.size(); i >= 0; i--) {
+ for (int i = smap.mActiveForegroundApps.size()-1; i >= 0; i--) {
ActiveForegroundApp aa = smap.mActiveForegroundApps.valueAt(i);
if (aa.mPackageName.equals(packageName)) {
smap.mActiveForegroundApps.removeAt(i);
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index 7c89e1c..bed8f1a 100644
--- a/services/core/java/com/android/server/pm/ShortcutService.java
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
@@ -555,8 +555,8 @@
}
@Override
- public void onCleanupUser(int userHandle) {
- mService.handleCleanupUser(userHandle);
+ public void onStopUser(int userHandle) {
+ mService.handleStopUser(userHandle);
}
@Override
@@ -606,9 +606,9 @@
}
/** lifecycle event */
- void handleCleanupUser(int userId) {
+ void handleStopUser(int userId) {
if (DEBUG) {
- Slog.d(TAG, "handleCleanupUser: user=" + userId);
+ Slog.d(TAG, "handleStopUser: user=" + userId);
}
synchronized (mLock) {
unloadUserLocked(userId);
@@ -3777,7 +3777,7 @@
Slog.i(TAG, "cmd: handleUnloadUser: user=" + mUserId);
- ShortcutService.this.handleCleanupUser(mUserId);
+ ShortcutService.this.handleStopUser(mUserId);
}
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 61ed72d..8c3d80f 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -65,6 +65,7 @@
import android.service.vr.IVrStateCallbacks;
import android.util.EventLog;
import android.util.KeyValueListParser;
+import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Slog;
import android.util.SparseArray;
@@ -91,6 +92,10 @@
import com.android.server.lights.Light;
import com.android.server.lights.LightsManager;
import com.android.server.power.BatterySaverPolicy.ServiceType;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
import libcore.util.Objects;
import java.io.FileDescriptor;
@@ -191,6 +196,12 @@
// System property indicating that the screen should remain off until an explicit user action
private static final String SYSTEM_PROPERTY_QUIESCENT = "ro.boot.quiescent";
+ // Possible reasons for shutting down for use in data/misc/reboot/last_shutdown_reason
+ private static final String REASON_SHUTDOWN = "shutdown";
+ private static final String REASON_REBOOT = "reboot";
+ private static final String REASON_USERREQUESTED = "userrequested";
+ private static final String REASON_THERMAL_SHUTDOWN = "thermal-shutdown";
+
private static final String TRACE_SCREEN_ON = "Screen turning on";
/** If turning screen on takes more than this long, we show a warning on logcat. */
@@ -204,6 +215,9 @@
private static final int HALT_MODE_REBOOT = 1;
private static final int HALT_MODE_REBOOT_SAFE_MODE = 2;
+ // File location for last reboot reason
+ private static final String LAST_REBOOT_LOCATION = "/data/misc/reboot/last_reboot_reason";
+
private final Context mContext;
private final ServiceThread mHandlerThread;
private final PowerManagerHandler mHandler;
@@ -4340,6 +4354,25 @@
}
/**
+ * Gets the reason for the last time the phone had to reboot.
+ *
+ * @return The reason the phone last shut down as an int or
+ * {@link PowerManager.SHUTDOWN_REASON_UNKNOWN} if the file could not be opened.
+ */
+ @Override // Binder call
+ public int getLastShutdownReason() {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.DEVICE_POWER, null);
+
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ return getLastShutdownReasonInternal(new File(LAST_REBOOT_LOCATION));
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ }
+
+ /**
* Reboots the device.
*
* @param confirm If true, shows a reboot confirmation dialog.
@@ -4566,6 +4599,28 @@
}
}
+ @VisibleForTesting
+ int getLastShutdownReasonInternal(File lastRebootReason) {
+ String line = "";
+ try (BufferedReader bufferedReader = new BufferedReader(new FileReader(lastRebootReason))){
+ line = bufferedReader.readLine();
+ } catch (IOException e) {
+ Slog.e(TAG, "Failed to read last_reboot_reason file", e);
+ }
+ switch (line) {
+ case REASON_SHUTDOWN:
+ return PowerManager.SHUTDOWN_REASON_SHUTDOWN;
+ case REASON_REBOOT:
+ return PowerManager.SHUTDOWN_REASON_REBOOT;
+ case REASON_USERREQUESTED:
+ return PowerManager.SHUTDOWN_REASON_USER_REQUESTED;
+ case REASON_THERMAL_SHUTDOWN:
+ return PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN;
+ default:
+ return PowerManager.SHUTDOWN_REASON_UNKNOWN;
+ }
+ }
+
private final class LocalService extends PowerManagerInternal {
@Override
public void setScreenBrightnessOverrideFromWindowManager(int screenBrightness) {
diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp
index 4a08ce4..96c2d7e 100644
--- a/services/core/jni/com_android_server_SystemServer.cpp
+++ b/services/core/jni/com_android_server_SystemServer.cpp
@@ -48,7 +48,7 @@
status_t err;
- configureRpcThreadpool(1, false /* callerWillJoin */);
+ configureRpcThreadpool(5, false /* callerWillJoin */);
sp<ISensorManager> sensorService = new SensorManager();
err = sensorService->registerAsService();
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
index cd39d88..4c7bf4d 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
@@ -3241,7 +3241,7 @@
assertNull(mService.getShortcutsForTest().get(USER_10).getLastKnownLauncher());
// Try stopping the user
- mService.handleCleanupUser(USER_10);
+ mService.handleStopUser(USER_10);
// Now it's unloaded.
assertEquals(1, mService.getShortcutsForTest().size());
@@ -6106,7 +6106,7 @@
assertEmpty(mManager.getPinnedShortcuts());
});
// Send add broadcast, but the user is not running, so should be ignored.
- mService.handleCleanupUser(USER_10);
+ mService.handleStopUser(USER_10);
mRunningUsers.put(USER_10, false);
mUnlockedUsers.put(USER_10, false);
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
index 9880caa..2b40c51 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
@@ -2091,7 +2091,7 @@
assertFalse(mService.isUserUnlockedL(USER_10));
// Directly call the stop lifecycle event. Goes back to the initial state.
- mService.handleCleanupUser(USER_0);
+ mService.handleStopUser(USER_0);
assertFalse(mService.isUserUnlockedL(USER_0));
assertFalse(mService.isUserUnlockedL(USER_10));
}
diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
index 967b0a4..d12c07a 100644
--- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
@@ -16,10 +16,19 @@
package com.android.server.power;
+import android.content.Context;
import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
+import android.os.PowerManager;
import android.os.PowerSaveState;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import android.text.TextUtils;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -35,11 +44,16 @@
private static final float PRECISION = 0.001f;
private static final float BRIGHTNESS_FACTOR = 0.7f;
private static final boolean BATTERY_SAVER_ENABLED = true;
+ private static final String LAST_REBOOT_REASON = "last_reboot_reason";
private @Mock BatterySaverPolicy mBatterySaverPolicy;
private PowerManagerService mService;
private PowerSaveState mPowerSaveState;
private DisplayPowerRequest mDisplayPowerRequest;
+ private File mTempReason;
+
+ @Rule
+ public TemporaryFolder temporaryFolder = new TemporaryFolder();
public void setUp() throws Exception {
super.setUp();
@@ -54,6 +68,8 @@
.thenReturn(mPowerSaveState);
mDisplayPowerRequest = new DisplayPowerRequest();
mService = new PowerManagerService(getContext(), mBatterySaverPolicy);
+ temporaryFolder.create();
+ mTempReason = temporaryFolder.newFile(LAST_REBOOT_REASON);
}
@SmallTest
@@ -63,4 +79,17 @@
assertThat(mDisplayPowerRequest.screenLowPowerBrightnessFactor)
.isWithin(PRECISION).of(BRIGHTNESS_FACTOR);
}
+
+ @SmallTest
+ public void testGetLastShutdownReasonInternal() {
+ try {
+ FileWriter writer = new FileWriter(mTempReason);
+ writer.append("thermal-shutdown\n");
+ writer.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ int reason = mService.getLastShutdownReasonInternal(mTempReason);
+ assertThat(reason).isEqualTo(PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN);
+ }
}
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 81f6600..7f616ad 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -342,6 +342,32 @@
public static final String SUB_DEFAULT_CHANGED_ACTION =
"android.intent.action.SUB_DEFAULT_CHANGED";
+ /**
+ * Broadcast Action: The default subscription has changed. This has the following
+ * extra values:</p>
+ * The {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default subscription index
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
+ = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED";
+
+ /**
+ * Broadcast Action: The default sms subscription has changed. This has the following
+ * extra values:</p>
+ * {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default sms
+ * subscription index
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
+ = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED";
+
+ /**
+ * Integer extra used with {@link #ACTION_DEFAULT_SUBSCRIPTION_CHANGED} and
+ * {@link #ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} to indicate the subscription
+ * which has changed.
+ */
+ public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
+
private final Context mContext;
/**
@@ -1178,7 +1204,7 @@
public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, int subId) {
if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId);
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
- intent.putExtra(Intent.EXTRA_SUBSCRIPTION_INDEX, subId);
+ intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId);
//FIXME this is using phoneId and slotIndex interchangeably
//Eventually, this should be removed as it is not the slot id
diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
index ec9ca1d..1f32766 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -17,6 +17,7 @@
package com.android.internal.telephony;
import android.content.Intent;
+import android.telephony.SubscriptionManager;
/**
* The intents that the telephony services broadcast.
@@ -335,11 +336,11 @@
* <ul>
* <li><em>subscription</em> - A int, the current default subscription.</li>
* </ul>
- * @deprecated Use {@link Intent#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
+ * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
*/
@Deprecated
public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
- = Intent.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
+ = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
/**
* Broadcast Action: The default data subscription has changed. This has the following
@@ -367,11 +368,11 @@
* <ul>
* <li><em>subscription</em> - A int, the current sms default subscription.</li>
* </ul>
- * @deprecated Use {@link Intent#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
+ * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
*/
@Deprecated
public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
- = Intent.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
+ = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
/*
* Broadcast Action: An attempt to set phone radio type and access technology has changed.
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
index 339019d..ed428ec9 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
@@ -18,6 +18,7 @@
import android.os.IBinder;
import android.os.IPowerManager;
+import android.os.PowerManager;
import android.os.PowerSaveState;
import android.os.RemoteException;
import android.os.WorkSource;
@@ -170,4 +171,9 @@
public boolean isScreenBrightnessBoosted() throws RemoteException {
return false;
}
+
+ @Override
+ public int getLastShutdownReason() {
+ return PowerManager.SHUTDOWN_REASON_UNKNOWN;
+ }
}