summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk1
-rw-r--r--api/current.txt84
-rw-r--r--api/removed.txt117
-rw-r--r--api/system-current.txt145
-rw-r--r--api/system-removed.txt117
-rw-r--r--api/test-current.txt85
-rw-r--r--api/test-removed.txt117
-rw-r--r--core/java/android/accessibilityservice/AccessibilityButtonController.java3
-rw-r--r--core/java/android/accessibilityservice/AccessibilityServiceInfo.java5
-rw-r--r--core/java/android/app/Activity.java21
-rw-r--r--core/java/android/app/ActivityManager.java8
-rw-r--r--core/java/android/app/ApplicationPackageManager.java78
-rw-r--r--core/java/android/app/FragmentContainer.java2
-rw-r--r--core/java/android/app/KeyguardManager.java23
-rw-r--r--core/java/android/app/Notification.java27
-rw-r--r--core/java/android/app/PictureInPictureArgs.java333
-rw-r--r--core/java/android/app/PictureInPictureParams.java32
-rw-r--r--core/java/android/content/Intent.java39
-rw-r--r--core/java/android/content/pm/ActivityInfo.java5
-rw-r--r--core/java/android/content/pm/IDexModuleRegisterCallback.aidl28
-rw-r--r--core/java/android/content/pm/IPackageManager.aidl33
-rw-r--r--core/java/android/content/pm/PackageManager.java44
-rw-r--r--core/java/android/content/pm/PackageParser.java14
-rw-r--r--core/java/android/content/pm/ResolveInfo.java11
-rw-r--r--core/java/android/content/pm/SharedLibraryInfo.java2
-rw-r--r--core/java/android/net/NetworkBadging.java5
-rw-r--r--core/java/android/net/NetworkRecommendationProvider.java5
-rw-r--r--core/java/android/net/RecommendationRequest.java5
-rw-r--r--core/java/android/net/RecommendationResult.java4
-rw-r--r--core/java/android/os/IPowerManager.aidl1
-rw-r--r--core/java/android/os/PowerManager.java62
-rw-r--r--core/java/android/os/TestLooperManager.java8
-rw-r--r--core/java/android/service/autofill/AutofillService.java2
-rw-r--r--core/java/android/service/autofill/FillRequest.java3
-rw-r--r--core/java/android/service/autofill/FillResponse.java38
-rw-r--r--core/java/android/speech/tts/UtteranceProgressListener.java5
-rw-r--r--core/java/android/view/autofill/AutofillManager.java2
-rw-r--r--core/java/android/widget/AbsListView.java3
-rw-r--r--core/jni/com_google_android_gles_jni_EGLImpl.cpp10
-rw-r--r--core/res/AndroidManifest.xml34
-rw-r--r--core/res/res/drawable/ic_picture_in_picture.xml28
-rw-r--r--core/res/res/values/attrs_manifest.xml22
-rw-r--r--core/res/res/values/config.xml9
-rw-r--r--core/res/res/values/public.xml7
-rw-r--r--core/res/res/values/strings.xml5
-rw-r--r--core/res/res/values/symbols.xml6
-rw-r--r--core/tests/coretests/src/android/content/pm/PackageManagerTests.java121
-rw-r--r--core/tests/coretests/src/android/content/pm/PackageParserTest.java26
-rw-r--r--core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java75
-rw-r--r--graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java2
-rw-r--r--libs/hwui/JankTracker.cpp1
-rw-r--r--media/java/android/media/AudioFocusRequest.java14
-rw-r--r--media/java/android/media/AudioManager.java2
-rw-r--r--media/java/android/media/tv/TvContract.java9
-rw-r--r--opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java3
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java2
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java57
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java75
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java86
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerUI.java21
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java32
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java26
-rw-r--r--proto/src/system_messages.proto3
-rw-r--r--rs/jni/Android.mk3
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp1
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillManagerService.java6
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java51
-rw-r--r--services/autofill/java/com/android/server/autofill/ViewState.java16
-rw-r--r--services/core/java/com/android/server/SystemService.java7
-rw-r--r--services/core/java/com/android/server/am/ActiveServices.java2
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java2
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java60
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java14
-rw-r--r--services/core/java/com/android/server/notification/SnoozeHelper.java52
-rw-r--r--services/core/java/com/android/server/pm/InstructionSets.java2
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java36
-rw-r--r--services/core/java/com/android/server/pm/ShortcutService.java10
-rw-r--r--services/core/java/com/android/server/pm/dex/DexManager.java64
-rw-r--r--services/core/java/com/android/server/power/PowerManagerService.java55
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java5
-rw-r--r--services/core/jni/com_android_server_SystemServer.cpp2
-rw-r--r--services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java50
-rw-r--r--services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java4
-rw-r--r--services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java2
-rw-r--r--services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java29
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java96
-rw-r--r--telephony/java/android/telephony/SubscriptionManager.java28
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyIntents.java9
-rw-r--r--test-runner/src/android/test/mock/MockPackageManager.java10
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java17
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java6
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java6
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl2
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java29
-rw-r--r--wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java72
-rw-r--r--wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java10
-rw-r--r--wifi/java/android/net/wifi/hotspot2/pps/Credential.java46
-rw-r--r--wifi/tests/src/android/net/wifi/WifiManagerTest.java33
-rw-r--r--wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java6
-rw-r--r--wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java10
-rw-r--r--wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java6
107 files changed, 2268 insertions, 829 deletions
diff --git a/Android.mk b/Android.mk
index 6e75bea0520d..8bb366ae2fed 100644
--- a/Android.mk
+++ b/Android.mk
@@ -157,6 +157,7 @@ LOCAL_SRC_FILES += \
core/java/android/content/ISyncServiceAdapter.aidl \
core/java/android/content/ISyncStatusObserver.aidl \
core/java/android/content/om/IOverlayManager.aidl \
+ core/java/android/content/pm/IDexModuleRegisterCallback.aidl \
core/java/android/content/pm/ILauncherApps.aidl \
core/java/android/content/pm/IOnAppsChangedListener.aidl \
core/java/android/content/pm/IOnPermissionsChangeListener.aidl \
diff --git a/api/current.txt b/api/current.txt
index 90da660cbdd2..ce7f7f0b32ec 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -121,7 +121,6 @@ package android {
field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
- field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
@@ -1062,6 +1061,7 @@ package android {
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
@@ -1086,7 +1086,6 @@ package android {
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
@@ -1709,7 +1708,6 @@ package android {
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
@@ -2830,7 +2828,7 @@ package android.accessibilityservice {
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
@@ -3581,7 +3579,6 @@ package android.app {
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();
@@ -3756,7 +3753,6 @@ package android.app {
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);
@@ -3836,7 +3832,6 @@ package android.app {
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);
@@ -4700,7 +4695,6 @@ package android.app {
public abstract class FragmentContainer {
ctor public FragmentContainer();
- method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle);
method public abstract <T extends android.view.View> T onFindViewById(int);
method public abstract boolean onHasView();
}
@@ -4973,7 +4967,6 @@ package android.app {
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();
@@ -5122,7 +5115,6 @@ package android.app {
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();
@@ -5131,7 +5123,6 @@ package android.app {
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;
@@ -5334,7 +5325,6 @@ package android.app {
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);
@@ -5379,7 +5369,6 @@ package android.app {
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[]);
@@ -5698,21 +5687,10 @@ package android.app {
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 {
@@ -9349,15 +9327,12 @@ package android.content {
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";
@@ -9561,7 +9536,6 @@ package android.content {
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";
@@ -10934,8 +10908,8 @@ package android.content.pm {
field public android.content.pm.ActivityInfo activityInfo;
field public android.content.IntentFilter filter;
field public int icon;
- field public boolean instantAppAvailable;
field public boolean isDefault;
+ field public boolean isInstantAppAvailable;
field public int labelRes;
field public int match;
field public java.lang.CharSequence nonLocalizedLabel;
@@ -10972,7 +10946,7 @@ package android.content.pm {
method public java.util.List<android.content.pm.VersionedPackage> getDependentPackages();
method public java.lang.String getName();
method public int getType();
- method public long getVersion();
+ method public int getVersion();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.content.pm.SharedLibraryInfo> CREATOR;
field public static final int TYPE_BUILTIN = 0; // 0x0
@@ -13859,6 +13833,7 @@ package android.graphics {
package android.graphics.drawable {
public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+ ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
method public void draw(android.graphics.Canvas);
method public android.graphics.drawable.Drawable getBackground();
method public static float getExtraInsetFraction();
@@ -26570,6 +26545,7 @@ package android.net.wifi {
method public void setTdlsEnabled(java.net.InetAddress, boolean);
method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean);
method public boolean setWifiEnabled(boolean);
+ method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
method public boolean startScan();
method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
method public int updateNetwork(android.net.wifi.WifiConfiguration);
@@ -26620,6 +26596,22 @@ package android.net.wifi {
field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
}
+ public static class WifiManager.LocalOnlyHotspotCallback {
+ ctor public WifiManager.LocalOnlyHotspotCallback();
+ method public void onFailed(int);
+ method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
+ method public void onStopped();
+ field public static final int ERROR_GENERIC = 2; // 0x2
+ field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
+ field public static final int ERROR_NO_CHANNEL = 1; // 0x1
+ field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
+ }
+
+ public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
+ method public void close();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ }
+
public class WifiManager.MulticastLock {
method public void acquire();
method public boolean isHeld();
@@ -26785,28 +26777,28 @@ package android.net.wifi.hotspot2 {
method public int getCredentialPriority();
method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp();
method public android.net.wifi.hotspot2.pps.Policy getPolicy();
- method public long getSubscriptionCreationTimeInMs();
- method public long getSubscriptionExpirationTimeInMs();
+ method public long getSubscriptionCreationTimeInMillis();
+ method public long getSubscriptionExpirationTimeInMillis();
method public java.lang.String getSubscriptionType();
method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate();
method public java.util.Map<java.lang.String, byte[]> getTrustRootCertList();
method public int getUpdateIdentifier();
method public long getUsageLimitDataLimit();
- method public long getUsageLimitStartTimeInMs();
+ method public long getUsageLimitStartTimeInMillis();
method public long getUsageLimitTimeLimitInMinutes();
method public long getUsageLimitUsageTimePeriodInMinutes();
method public void setCredential(android.net.wifi.hotspot2.pps.Credential);
method public void setCredentialPriority(int);
method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
method public void setPolicy(android.net.wifi.hotspot2.pps.Policy);
- method public void setSubscriptionCreationTimeInMs(long);
- method public void setSubscriptionExpirationTimeInMs(long);
+ method public void setSubscriptionCreationTimeInMillis(long);
+ method public void setSubscriptionExpirationTimeInMillis(long);
method public void setSubscriptionType(java.lang.String);
method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter);
method public void setTrustRootCertList(java.util.Map<java.lang.String, byte[]>);
method public void setUpdateIdentifier(int);
method public void setUsageLimitDataLimit(long);
- method public void setUsageLimitStartTimeInMs(long);
+ method public void setUsageLimitStartTimeInMillis(long);
method public void setUsageLimitTimeLimitInMinutes(long);
method public void setUsageLimitUsageTimePeriodInMinutes(long);
method public void writeToParcel(android.os.Parcel, int);
@@ -26834,8 +26826,8 @@ package android.net.wifi.hotspot2.pps {
method public boolean getCheckAaaServerCertStatus();
method public java.security.cert.X509Certificate[] getClientCertificateChain();
method public java.security.PrivateKey getClientPrivateKey();
- method public long getCreationTimeInMs();
- method public long getExpirationTimeInMs();
+ method public long getCreationTimeInMillis();
+ method public long getExpirationTimeInMillis();
method public java.lang.String getRealm();
method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential();
method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential();
@@ -26844,8 +26836,8 @@ package android.net.wifi.hotspot2.pps {
method public void setCheckAaaServerCertStatus(boolean);
method public void setClientCertificateChain(java.security.cert.X509Certificate[]);
method public void setClientPrivateKey(java.security.PrivateKey);
- method public void setCreationTimeInMs(long);
- method public void setExpirationTimeInMs(long);
+ method public void setCreationTimeInMillis(long);
+ method public void setExpirationTimeInMillis(long);
method public void setRealm(java.lang.String);
method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
@@ -31622,7 +31614,7 @@ package android.os {
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();
@@ -37032,7 +37024,7 @@ package android.service.autofill {
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);
@@ -38016,7 +38008,6 @@ package android.speech.tts {
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 {
@@ -40098,8 +40089,11 @@ package android.telephony {
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
}
@@ -47800,7 +47794,7 @@ package android.view.autofill {
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 779ff7cce923..187349916286 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);
}
@@ -76,6 +126,10 @@ package android.content.pm {
method public abstract boolean setInstantAppCookie(byte[]);
}
+ public class ResolveInfo implements android.os.Parcelable {
+ field public deprecated boolean instantAppAvailable;
+ }
+
public final class SharedLibraryInfo implements android.os.Parcelable {
method public boolean isBuiltin();
method public boolean isDynamic();
@@ -188,6 +242,26 @@ package android.net {
method public deprecated int stopUsingNetworkFeature(int, java.lang.String);
}
+ public deprecated class NetworkBadging {
+ method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme);
+ field public static final int BADGING_4K = 30; // 0x1e
+ field public static final int BADGING_HD = 20; // 0x14
+ field public static final int BADGING_NONE = 0; // 0x0
+ field public static final int BADGING_SD = 10; // 0xa
+ }
+
+ public abstract class NetworkRecommendationProvider {
+ ctor public deprecated NetworkRecommendationProvider(android.os.Handler);
+ method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback);
+ field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT";
+ field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE";
+ }
+
+ public static deprecated class NetworkRecommendationProvider.ResultCallback {
+ ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int);
+ method public void onResult(android.net.RecommendationResult);
+ }
+
public abstract class PskKeyManager {
ctor public PskKeyManager();
field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80
@@ -195,6 +269,37 @@ package android.net {
field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100
}
+ public final deprecated class RecommendationRequest implements android.os.Parcelable {
+ ctor protected RecommendationRequest(android.os.Parcel);
+ method public android.net.wifi.WifiConfiguration[] getConnectableConfigs();
+ method public android.net.wifi.WifiConfiguration getConnectedConfig();
+ method public android.net.wifi.WifiConfiguration getDefaultWifiConfig();
+ method public int getLastSelectedNetworkId();
+ method public long getLastSelectedNetworkTimestamp();
+ method public android.net.wifi.ScanResult[] getScanResults();
+ method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public void setConnectedConfig(android.net.wifi.WifiConfiguration);
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationRequest> CREATOR;
+ }
+
+ public static final deprecated class RecommendationRequest.Builder {
+ ctor public RecommendationRequest.Builder();
+ method public android.net.RecommendationRequest build();
+ method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long);
+ method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]);
+ }
+
+ public final deprecated class RecommendationResult implements android.os.Parcelable {
+ method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration);
+ method public static android.net.RecommendationResult createDoNotConnectRecommendation();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ method public boolean hasRecommendation();
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationResult> CREATOR;
+ }
+
public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
}
@@ -221,6 +326,10 @@ package android.os {
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 +491,14 @@ package android.provider {
}
+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 9f696d2cb140..b7afcf096630 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1182,6 +1182,7 @@ package android {
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 @@ package android {
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 @@ package android {
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 @@ package android.accessibilityservice {
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 @@ package android.app {
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 @@ package android.app {
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 @@ package android.app {
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);
@@ -4869,7 +4865,6 @@ package android.app {
public abstract class FragmentContainer {
ctor public FragmentContainer();
- method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle);
method public abstract <T extends android.view.View> T onFindViewById(int);
method public abstract boolean onHasView();
}
@@ -5154,7 +5149,6 @@ package android.app {
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 +5297,6 @@ package android.app {
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 +5306,6 @@ package android.app {
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 +5511,6 @@ package android.app {
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 +5555,6 @@ package android.app {
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 +5659,6 @@ package android.app {
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 +5893,10 @@ package android.app {
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 {
@@ -9875,15 +9853,12 @@ package android.content {
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";
@@ -10136,7 +10111,6 @@ package android.content {
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";
@@ -11365,6 +11339,7 @@ package android.content.pm {
method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.Intent, int);
method public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentServices(android.content.Intent, int);
method public abstract java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
+ method public abstract void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback);
method public abstract void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener);
method public abstract deprecated void removePackageFromPreferred(java.lang.String);
method public abstract void removePermission(java.lang.String);
@@ -11585,6 +11560,11 @@ package android.content.pm {
field public static final int VERSION_CODE_HIGHEST = -1; // 0xffffffff
}
+ public static abstract class PackageManager.DexModuleRegisterCallback {
+ ctor public PackageManager.DexModuleRegisterCallback();
+ method public abstract void onDexModuleRegistered(java.lang.String, boolean, java.lang.String);
+ }
+
public static class PackageManager.NameNotFoundException extends android.util.AndroidException {
ctor public PackageManager.NameNotFoundException();
ctor public PackageManager.NameNotFoundException(java.lang.String);
@@ -11701,8 +11681,8 @@ package android.content.pm {
field public android.content.pm.ActivityInfo activityInfo;
field public android.content.IntentFilter filter;
field public int icon;
- field public boolean instantAppAvailable;
field public boolean isDefault;
+ field public boolean isInstantAppAvailable;
field public int labelRes;
field public int match;
field public java.lang.CharSequence nonLocalizedLabel;
@@ -11739,7 +11719,7 @@ package android.content.pm {
method public java.util.List<android.content.pm.VersionedPackage> getDependentPackages();
method public java.lang.String getName();
method public int getType();
- method public long getVersion();
+ method public int getVersion();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.content.pm.SharedLibraryInfo> CREATOR;
field public static final int TYPE_BUILTIN = 0; // 0x0
@@ -14640,6 +14620,7 @@ package android.graphics {
package android.graphics.drawable {
public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+ ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
method public void draw(android.graphics.Canvas);
method public android.graphics.drawable.Drawable getBackground();
method public static float getExtraInsetFraction();
@@ -27802,17 +27783,6 @@ package android.net {
field public static final android.os.Parcelable.Creator<android.net.Network> CREATOR;
}
- public class NetworkBadging {
- method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme);
- field public static final int BADGING_4K = 30; // 0x1e
- field public static final int BADGING_HD = 20; // 0x14
- field public static final int BADGING_NONE = 0; // 0x0
- field public static final int BADGING_SD = 10; // 0xa
- }
-
- public static abstract class NetworkBadging.Badging implements java.lang.annotation.Annotation {
- }
-
public final class NetworkCapabilities implements android.os.Parcelable {
ctor public NetworkCapabilities(android.net.NetworkCapabilities);
method public int describeContents();
@@ -27907,17 +27877,9 @@ package android.net {
}
public abstract class NetworkRecommendationProvider {
- ctor public deprecated NetworkRecommendationProvider(android.os.Handler);
ctor public NetworkRecommendationProvider(android.content.Context, java.util.concurrent.Executor);
method public final android.os.IBinder getBinder();
- method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback);
method public abstract void onRequestScores(android.net.NetworkKey[]);
- field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT";
- field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE";
- }
-
- public static deprecated class NetworkRecommendationProvider.ResultCallback {
- method public void onResult(android.net.RecommendationResult);
}
public class NetworkRequest implements android.os.Parcelable {
@@ -27983,41 +27945,6 @@ package android.net {
field public static final android.os.Parcelable.Creator<android.net.ProxyInfo> CREATOR;
}
- public final deprecated class RecommendationRequest implements android.os.Parcelable {
- ctor protected RecommendationRequest(android.os.Parcel);
- method public int describeContents();
- method public android.net.wifi.WifiConfiguration[] getConnectableConfigs();
- method public android.net.wifi.WifiConfiguration getConnectedConfig();
- method public android.net.wifi.WifiConfiguration getDefaultWifiConfig();
- method public int getLastSelectedNetworkId();
- method public long getLastSelectedNetworkTimestamp();
- method public android.net.wifi.ScanResult[] getScanResults();
- method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
- method public void setConnectedConfig(android.net.wifi.WifiConfiguration);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.net.RecommendationRequest> CREATOR;
- }
-
- public static final deprecated class RecommendationRequest.Builder {
- ctor public RecommendationRequest.Builder();
- method public android.net.RecommendationRequest build();
- method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
- method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration);
- method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration);
- method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long);
- method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]);
- }
-
- public final deprecated class RecommendationResult implements android.os.Parcelable {
- method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration);
- method public static android.net.RecommendationResult createDoNotConnectRecommendation();
- method public int describeContents();
- method public android.net.wifi.WifiConfiguration getWifiConfiguration();
- method public boolean hasRecommendation();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.net.RecommendationResult> CREATOR;
- }
-
public final class RouteInfo implements android.os.Parcelable {
method public int describeContents();
method public android.net.IpPrefix getDestination();
@@ -29152,6 +29079,7 @@ package android.net.wifi {
method public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
method public boolean setWifiApEnabled(android.net.wifi.WifiConfiguration, boolean);
method public boolean setWifiEnabled(boolean);
+ method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
method public deprecated boolean startLocationRestrictedScan(android.os.WorkSource);
method public boolean startScan();
method public boolean startScan(android.os.WorkSource);
@@ -29229,6 +29157,22 @@ package android.net.wifi {
method public abstract void onSuccess();
}
+ public static class WifiManager.LocalOnlyHotspotCallback {
+ ctor public WifiManager.LocalOnlyHotspotCallback();
+ method public void onFailed(int);
+ method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
+ method public void onStopped();
+ field public static final int ERROR_GENERIC = 2; // 0x2
+ field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
+ field public static final int ERROR_NO_CHANNEL = 1; // 0x1
+ field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
+ }
+
+ public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
+ method public void close();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ }
+
public class WifiManager.MulticastLock {
method public void acquire();
method public boolean isHeld();
@@ -29536,28 +29480,28 @@ package android.net.wifi.hotspot2 {
method public int getCredentialPriority();
method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp();
method public android.net.wifi.hotspot2.pps.Policy getPolicy();
- method public long getSubscriptionCreationTimeInMs();
- method public long getSubscriptionExpirationTimeInMs();
+ method public long getSubscriptionCreationTimeInMillis();
+ method public long getSubscriptionExpirationTimeInMillis();
method public java.lang.String getSubscriptionType();
method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate();
method public java.util.Map<java.lang.String, byte[]> getTrustRootCertList();
method public int getUpdateIdentifier();
method public long getUsageLimitDataLimit();
- method public long getUsageLimitStartTimeInMs();
+ method public long getUsageLimitStartTimeInMillis();
method public long getUsageLimitTimeLimitInMinutes();
method public long getUsageLimitUsageTimePeriodInMinutes();
method public void setCredential(android.net.wifi.hotspot2.pps.Credential);
method public void setCredentialPriority(int);
method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
method public void setPolicy(android.net.wifi.hotspot2.pps.Policy);
- method public void setSubscriptionCreationTimeInMs(long);
- method public void setSubscriptionExpirationTimeInMs(long);
+ method public void setSubscriptionCreationTimeInMillis(long);
+ method public void setSubscriptionExpirationTimeInMillis(long);
method public void setSubscriptionType(java.lang.String);
method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter);
method public void setTrustRootCertList(java.util.Map<java.lang.String, byte[]>);
method public void setUpdateIdentifier(int);
method public void setUsageLimitDataLimit(long);
- method public void setUsageLimitStartTimeInMs(long);
+ method public void setUsageLimitStartTimeInMillis(long);
method public void setUsageLimitTimeLimitInMinutes(long);
method public void setUsageLimitUsageTimePeriodInMinutes(long);
method public void writeToParcel(android.os.Parcel, int);
@@ -29585,8 +29529,8 @@ package android.net.wifi.hotspot2.pps {
method public boolean getCheckAaaServerCertStatus();
method public java.security.cert.X509Certificate[] getClientCertificateChain();
method public java.security.PrivateKey getClientPrivateKey();
- method public long getCreationTimeInMs();
- method public long getExpirationTimeInMs();
+ method public long getCreationTimeInMillis();
+ method public long getExpirationTimeInMillis();
method public java.lang.String getRealm();
method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential();
method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential();
@@ -29595,8 +29539,8 @@ package android.net.wifi.hotspot2.pps {
method public void setCheckAaaServerCertStatus(boolean);
method public void setClientCertificateChain(java.security.cert.X509Certificate[]);
method public void setClientPrivateKey(java.security.PrivateKey);
- method public void setCreationTimeInMs(long);
- method public void setExpirationTimeInMs(long);
+ method public void setCreationTimeInMillis(long);
+ method public void setExpirationTimeInMillis(long);
method public void setRealm(java.lang.String);
method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
@@ -34448,7 +34392,7 @@ package android.os {
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();
@@ -40156,7 +40100,7 @@ package android.service.autofill {
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);
@@ -41283,7 +41227,6 @@ package android.speech.tts {
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 {
@@ -43585,8 +43528,11 @@ package android.telephony {
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
}
@@ -44576,6 +44522,7 @@ package android.test.mock {
method public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.Intent, int);
method public java.util.List<android.content.pm.ResolveInfo> queryIntentServices(android.content.Intent, int);
method public java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException;
+ method public void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback);
method public void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener);
method public void removePackageFromPreferred(java.lang.String);
method public void removePermission(java.lang.String);
@@ -51397,7 +51344,7 @@ package android.view.autofill {
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 fe512481b1ad..60865a3892da 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);
}
@@ -74,6 +124,10 @@ package android.content.pm {
method public abstract boolean setInstantAppCookie(byte[]);
}
+ public class ResolveInfo implements android.os.Parcelable {
+ field public deprecated boolean instantAppAvailable;
+ }
+
public final class SharedLibraryInfo implements android.os.Parcelable {
method public boolean isBuiltin();
method public boolean isDynamic();
@@ -186,6 +240,26 @@ package android.net {
method public deprecated int stopUsingNetworkFeature(int, java.lang.String);
}
+ public deprecated class NetworkBadging {
+ method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme);
+ field public static final int BADGING_4K = 30; // 0x1e
+ field public static final int BADGING_HD = 20; // 0x14
+ field public static final int BADGING_NONE = 0; // 0x0
+ field public static final int BADGING_SD = 10; // 0xa
+ }
+
+ public abstract class NetworkRecommendationProvider {
+ ctor public deprecated NetworkRecommendationProvider(android.os.Handler);
+ method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback);
+ field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT";
+ field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE";
+ }
+
+ public static deprecated class NetworkRecommendationProvider.ResultCallback {
+ ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int);
+ method public void onResult(android.net.RecommendationResult);
+ }
+
public abstract class PskKeyManager {
ctor public PskKeyManager();
field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80
@@ -193,6 +267,37 @@ package android.net {
field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100
}
+ public final deprecated class RecommendationRequest implements android.os.Parcelable {
+ ctor protected RecommendationRequest(android.os.Parcel);
+ method public android.net.wifi.WifiConfiguration[] getConnectableConfigs();
+ method public android.net.wifi.WifiConfiguration getConnectedConfig();
+ method public android.net.wifi.WifiConfiguration getDefaultWifiConfig();
+ method public int getLastSelectedNetworkId();
+ method public long getLastSelectedNetworkTimestamp();
+ method public android.net.wifi.ScanResult[] getScanResults();
+ method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public void setConnectedConfig(android.net.wifi.WifiConfiguration);
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationRequest> CREATOR;
+ }
+
+ public static final deprecated class RecommendationRequest.Builder {
+ ctor public RecommendationRequest.Builder();
+ method public android.net.RecommendationRequest build();
+ method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long);
+ method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]);
+ }
+
+ public final deprecated class RecommendationResult implements android.os.Parcelable {
+ method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration);
+ method public static android.net.RecommendationResult createDoNotConnectRecommendation();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ method public boolean hasRecommendation();
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationResult> CREATOR;
+ }
+
public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
}
@@ -215,6 +320,10 @@ package android.os {
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 +485,14 @@ package android.provider {
}
+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 2ac284efbbd7..ea0864be0ce4 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -121,7 +121,6 @@ package android {
field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
- field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS";
field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM";
@@ -1062,6 +1061,7 @@ package android {
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
@@ -1086,7 +1086,6 @@ package android {
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
@@ -1709,7 +1708,6 @@ package android {
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
@@ -2830,7 +2828,7 @@ package android.accessibilityservice {
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
@@ -3583,7 +3581,6 @@ package android.app {
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();
@@ -3758,7 +3755,6 @@ package android.app {
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);
@@ -3839,7 +3835,6 @@ package android.app {
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);
@@ -4713,7 +4708,6 @@ package android.app {
public abstract class FragmentContainer {
ctor public FragmentContainer();
- method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle);
method public abstract <T extends android.view.View> T onFindViewById(int);
method public abstract boolean onHasView();
}
@@ -4986,7 +4980,6 @@ package android.app {
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();
@@ -5135,7 +5128,6 @@ package android.app {
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();
@@ -5144,7 +5136,6 @@ package android.app {
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;
@@ -5347,7 +5338,6 @@ package android.app {
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);
@@ -5392,7 +5382,6 @@ package android.app {
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[]);
@@ -5712,21 +5701,10 @@ package android.app {
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 {
@@ -9383,15 +9361,12 @@ package android.content {
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";
@@ -9595,7 +9570,6 @@ package android.content {
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";
@@ -10975,8 +10949,8 @@ package android.content.pm {
field public android.content.pm.ActivityInfo activityInfo;
field public android.content.IntentFilter filter;
field public int icon;
- field public boolean instantAppAvailable;
field public boolean isDefault;
+ field public boolean isInstantAppAvailable;
field public int labelRes;
field public int match;
field public java.lang.CharSequence nonLocalizedLabel;
@@ -11013,7 +10987,7 @@ package android.content.pm {
method public java.util.List<android.content.pm.VersionedPackage> getDependentPackages();
method public java.lang.String getName();
method public int getType();
- method public long getVersion();
+ method public int getVersion();
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.content.pm.SharedLibraryInfo> CREATOR;
field public static final int TYPE_BUILTIN = 0; // 0x0
@@ -13901,6 +13875,7 @@ package android.graphics {
package android.graphics.drawable {
public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+ ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable);
method public void draw(android.graphics.Canvas);
method public android.graphics.drawable.Drawable getBackground();
method public static float getExtraInsetFraction();
@@ -13914,6 +13889,7 @@ package android.graphics.drawable {
method public void setColorFilter(android.graphics.ColorFilter);
method public void setOpacity(int);
method public void unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable);
+ field public static final float MASK_SIZE = 100.0f;
}
public abstract interface Animatable {
@@ -26678,6 +26654,7 @@ package android.net.wifi {
method public void setTdlsEnabled(java.net.InetAddress, boolean);
method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean);
method public boolean setWifiEnabled(boolean);
+ method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler);
method public boolean startScan();
method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback);
method public int updateNetwork(android.net.wifi.WifiConfiguration);
@@ -26728,6 +26705,22 @@ package android.net.wifi {
field public static final int WPS_WEP_PROHIBITED = 4; // 0x4
}
+ public static class WifiManager.LocalOnlyHotspotCallback {
+ ctor public WifiManager.LocalOnlyHotspotCallback();
+ method public void onFailed(int);
+ method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation);
+ method public void onStopped();
+ field public static final int ERROR_GENERIC = 2; // 0x2
+ field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3
+ field public static final int ERROR_NO_CHANNEL = 1; // 0x1
+ field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4
+ }
+
+ public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable {
+ method public void close();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ }
+
public class WifiManager.MulticastLock {
method public void acquire();
method public boolean isHeld();
@@ -26893,28 +26886,28 @@ package android.net.wifi.hotspot2 {
method public int getCredentialPriority();
method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp();
method public android.net.wifi.hotspot2.pps.Policy getPolicy();
- method public long getSubscriptionCreationTimeInMs();
- method public long getSubscriptionExpirationTimeInMs();
+ method public long getSubscriptionCreationTimeInMillis();
+ method public long getSubscriptionExpirationTimeInMillis();
method public java.lang.String getSubscriptionType();
method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate();
method public java.util.Map<java.lang.String, byte[]> getTrustRootCertList();
method public int getUpdateIdentifier();
method public long getUsageLimitDataLimit();
- method public long getUsageLimitStartTimeInMs();
+ method public long getUsageLimitStartTimeInMillis();
method public long getUsageLimitTimeLimitInMinutes();
method public long getUsageLimitUsageTimePeriodInMinutes();
method public void setCredential(android.net.wifi.hotspot2.pps.Credential);
method public void setCredentialPriority(int);
method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
method public void setPolicy(android.net.wifi.hotspot2.pps.Policy);
- method public void setSubscriptionCreationTimeInMs(long);
- method public void setSubscriptionExpirationTimeInMs(long);
+ method public void setSubscriptionCreationTimeInMillis(long);
+ method public void setSubscriptionExpirationTimeInMillis(long);
method public void setSubscriptionType(java.lang.String);
method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter);
method public void setTrustRootCertList(java.util.Map<java.lang.String, byte[]>);
method public void setUpdateIdentifier(int);
method public void setUsageLimitDataLimit(long);
- method public void setUsageLimitStartTimeInMs(long);
+ method public void setUsageLimitStartTimeInMillis(long);
method public void setUsageLimitTimeLimitInMinutes(long);
method public void setUsageLimitUsageTimePeriodInMinutes(long);
method public void writeToParcel(android.os.Parcel, int);
@@ -26942,8 +26935,8 @@ package android.net.wifi.hotspot2.pps {
method public boolean getCheckAaaServerCertStatus();
method public java.security.cert.X509Certificate[] getClientCertificateChain();
method public java.security.PrivateKey getClientPrivateKey();
- method public long getCreationTimeInMs();
- method public long getExpirationTimeInMs();
+ method public long getCreationTimeInMillis();
+ method public long getExpirationTimeInMillis();
method public java.lang.String getRealm();
method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential();
method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential();
@@ -26952,8 +26945,8 @@ package android.net.wifi.hotspot2.pps {
method public void setCheckAaaServerCertStatus(boolean);
method public void setClientCertificateChain(java.security.cert.X509Certificate[]);
method public void setClientPrivateKey(java.security.PrivateKey);
- method public void setCreationTimeInMs(long);
- method public void setExpirationTimeInMs(long);
+ method public void setCreationTimeInMillis(long);
+ method public void setExpirationTimeInMillis(long);
method public void setRealm(java.lang.String);
method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential);
method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential);
@@ -31752,7 +31745,7 @@ package android.os {
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();
@@ -37186,7 +37179,7 @@ package android.service.autofill {
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);
@@ -38211,7 +38204,6 @@ package android.speech.tts {
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 {
@@ -40309,8 +40301,11 @@ package android.telephony {
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
}
@@ -48195,7 +48190,7 @@ package android.view.autofill {
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 779ff7cce923..187349916286 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);
}
@@ -76,6 +126,10 @@ package android.content.pm {
method public abstract boolean setInstantAppCookie(byte[]);
}
+ public class ResolveInfo implements android.os.Parcelable {
+ field public deprecated boolean instantAppAvailable;
+ }
+
public final class SharedLibraryInfo implements android.os.Parcelable {
method public boolean isBuiltin();
method public boolean isDynamic();
@@ -188,6 +242,26 @@ package android.net {
method public deprecated int stopUsingNetworkFeature(int, java.lang.String);
}
+ public deprecated class NetworkBadging {
+ method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme);
+ field public static final int BADGING_4K = 30; // 0x1e
+ field public static final int BADGING_HD = 20; // 0x14
+ field public static final int BADGING_NONE = 0; // 0x0
+ field public static final int BADGING_SD = 10; // 0xa
+ }
+
+ public abstract class NetworkRecommendationProvider {
+ ctor public deprecated NetworkRecommendationProvider(android.os.Handler);
+ method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback);
+ field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT";
+ field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE";
+ }
+
+ public static deprecated class NetworkRecommendationProvider.ResultCallback {
+ ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int);
+ method public void onResult(android.net.RecommendationResult);
+ }
+
public abstract class PskKeyManager {
ctor public PskKeyManager();
field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80
@@ -195,6 +269,37 @@ package android.net {
field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100
}
+ public final deprecated class RecommendationRequest implements android.os.Parcelable {
+ ctor protected RecommendationRequest(android.os.Parcel);
+ method public android.net.wifi.WifiConfiguration[] getConnectableConfigs();
+ method public android.net.wifi.WifiConfiguration getConnectedConfig();
+ method public android.net.wifi.WifiConfiguration getDefaultWifiConfig();
+ method public int getLastSelectedNetworkId();
+ method public long getLastSelectedNetworkTimestamp();
+ method public android.net.wifi.ScanResult[] getScanResults();
+ method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public void setConnectedConfig(android.net.wifi.WifiConfiguration);
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationRequest> CREATOR;
+ }
+
+ public static final deprecated class RecommendationRequest.Builder {
+ ctor public RecommendationRequest.Builder();
+ method public android.net.RecommendationRequest build();
+ method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]);
+ method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration);
+ method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long);
+ method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]);
+ }
+
+ public final deprecated class RecommendationResult implements android.os.Parcelable {
+ method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration);
+ method public static android.net.RecommendationResult createDoNotConnectRecommendation();
+ method public android.net.wifi.WifiConfiguration getWifiConfiguration();
+ method public boolean hasRecommendation();
+ field public static final android.os.Parcelable.Creator<android.net.RecommendationResult> CREATOR;
+ }
+
public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
}
@@ -221,6 +326,10 @@ package android.os {
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 +491,14 @@ package android.provider {
}
+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 ee1976889299..a70085cbde4f 100644
--- a/core/java/android/accessibilityservice/AccessibilityButtonController.java
+++ b/core/java/android/accessibilityservice/AccessibilityButtonController.java
@@ -19,6 +19,7 @@ package android.accessibilityservice;
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 @@ public final class AccessibilityButtonController {
* @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 70a6ce615731..06a9b0676d08 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -670,9 +670,10 @@ public class AccessibilityServiceInfo implements Parcelable {
* <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 ab4f33d6b6e6..4f6c0c9d8f91 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2050,20 +2050,10 @@ public class Activity extends ContextThemeWrapper
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 @@ public class Activity extends ContextThemeWrapper
}
}
- /**
- * 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 66d221aefc14..4c3e1b077091 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1143,13 +1143,7 @@ public class ActivityManager {
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/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index e50c307df854..f6aea96bf7e2 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -78,6 +78,10 @@ import android.os.UserManager;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.provider.Settings;
+import android.system.ErrnoException;
+import android.system.Os;
+import android.system.OsConstants;
+import android.system.StructStat;
import android.util.ArrayMap;
import android.util.IconDrawableFactory;
import android.util.LauncherIcons;
@@ -2662,4 +2666,78 @@ public class ApplicationPackageManager extends PackageManager {
throw e.rethrowAsRuntimeException();
}
}
+
+ private static class DexModuleRegisterResult {
+ final String dexModulePath;
+ final boolean success;
+ final String message;
+
+ private DexModuleRegisterResult(String dexModulePath, boolean success, String message) {
+ this.dexModulePath = dexModulePath;
+ this.success = success;
+ this.message = message;
+ }
+ }
+
+ private static class DexModuleRegisterCallbackDelegate
+ extends android.content.pm.IDexModuleRegisterCallback.Stub
+ implements Handler.Callback {
+ private static final int MSG_DEX_MODULE_REGISTERED = 1;
+ private final DexModuleRegisterCallback callback;
+ private final Handler mHandler;
+
+ DexModuleRegisterCallbackDelegate(@NonNull DexModuleRegisterCallback callback) {
+ this.callback = callback;
+ mHandler = new Handler(Looper.getMainLooper(), this);
+ }
+
+ @Override
+ public void onDexModuleRegistered(@NonNull String dexModulePath, boolean success,
+ @Nullable String message)throws RemoteException {
+ mHandler.obtainMessage(MSG_DEX_MODULE_REGISTERED,
+ new DexModuleRegisterResult(dexModulePath, success, message)).sendToTarget();
+ }
+
+ @Override
+ public boolean handleMessage(Message msg) {
+ if (msg.what != MSG_DEX_MODULE_REGISTERED) {
+ return false;
+ }
+ DexModuleRegisterResult result = (DexModuleRegisterResult)msg.obj;
+ callback.onDexModuleRegistered(result.dexModulePath, result.success, result.message);
+ return true;
+ }
+ }
+
+ @Override
+ public void registerDexModule(@NonNull String dexModule,
+ @Nullable DexModuleRegisterCallback callback) {
+ // Check if this is a shared module by looking if the others can read it.
+ boolean isSharedModule = false;
+ try {
+ StructStat stat = Os.stat(dexModule);
+ if ((OsConstants.S_IROTH & stat.st_mode) != 0) {
+ isSharedModule = true;
+ }
+ } catch (ErrnoException e) {
+ callback.onDexModuleRegistered(dexModule, false,
+ "Could not get stat the module file: " + e.getMessage());
+ return;
+ }
+
+ // Module path is ok.
+ // Create the callback delegate to be passed to package manager service.
+ DexModuleRegisterCallbackDelegate callbackDelegate = null;
+ if (callback != null) {
+ callbackDelegate = new DexModuleRegisterCallbackDelegate(callback);
+ }
+
+ // Invoke the package manager service.
+ try {
+ mPM.registerDexModule(mContext.getPackageName(), dexModule,
+ isSharedModule, callbackDelegate);
+ } catch (RemoteException e) {
+ throw e.rethrowAsRuntimeException();
+ }
+ }
}
diff --git a/core/java/android/app/FragmentContainer.java b/core/java/android/app/FragmentContainer.java
index 77c9c312ce24..f8836bc829a0 100644
--- a/core/java/android/app/FragmentContainer.java
+++ b/core/java/android/app/FragmentContainer.java
@@ -42,6 +42,8 @@ public abstract class FragmentContainer {
* Creates an instance of the specified fragment, can be overridden to construct fragments
* with dependencies, or change the fragment being constructed. By default just calls
* {@link Fragment#instantiate(Context, String, Bundle)}.
+ *
+ * @hide
*/
public Fragment instantiate(Context context, String className, Bundle arguments) {
return Fragment.instantiate(context, className, arguments);
diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java
index 4de6e44b0400..fcf0aab0c821 100644
--- a/core/java/android/app/KeyguardManager.java
+++ b/core/java/android/app/KeyguardManager.java
@@ -362,28 +362,7 @@ public class KeyguardManager {
}
}
- /**
- * 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 28fe3195839d..c8b8c6c1b262 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -2494,9 +2494,8 @@ public class Notification implements Parcelable
}
}
- /**
- * Returns the id of the channel this notification posts to.
- */
+ /** @removed */
+ @Deprecated
public String getChannel() {
return mChannelId;
}
@@ -2508,10 +2507,8 @@ public class Notification implements Parcelable
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 @@ public class Notification implements Parcelable
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 @@ public class Notification implements Parcelable
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 @@ public class Notification implements Parcelable
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 63db86aac9a8..88e6b9981486 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 {
+
+ @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;
+ }
}
/**
- * Creates a new set of picture-in-picture arguments from the given {@param aspectRatio} and
- * {@param actions}.
- *
- * TODO: Remove once we remove PictureInPictureArgs.
+ * The expected aspect ratio of the picture-in-picture.
*/
- @Deprecated
- public PictureInPictureArgs(float aspectRatio, List<RemoteAction> actions) {
- setAspectRatio(aspectRatio);
- if (actions != null) {
- setActions(actions);
+ @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 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.
+ * Copies the set parameters from the other picture-in-picture args.
+ * @hide
*/
- @Deprecated
- public void setAspectRatio(float aspectRatio) {
- // Temporary workaround
- mAspectRatio = new Rational((int) (aspectRatio * 1000000000), 1000000000);
+ public void copyOnlySet(PictureInPictureArgs otherArgs) {
+ if (otherArgs.hasSetAspectRatio()) {
+ mAspectRatio = otherArgs.mAspectRatio;
+ }
+ if (otherArgs.hasSetActions()) {
+ mUserActions = otherArgs.mUserActions;
+ }
+ if (otherArgs.hasSourceBoundsHint()) {
+ mSourceRectHint = new Rect(otherArgs.getSourceRectHint());
+ }
+ if (otherArgs.hasSourceBoundsHintInsets()) {
+ mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets());
+ }
}
/**
- * 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.
+ * @return the aspect ratio. If none is set, return 0.
+ * @hide
*/
- @Deprecated
- public void setActions(List<RemoteAction> actions) {
- if (mUserActions != null) {
- mUserActions = null;
+ public float getAspectRatio() {
+ if (mAspectRatio != null) {
+ return mAspectRatio.floatValue();
}
- if (actions != null) {
- mUserActions = new ArrayList<>(actions);
+ 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 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.
+ * 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 e1df33b55281..323a0fbaa5b1 100644
--- a/core/java/android/app/PictureInPictureParams.java
+++ b/core/java/android/app/PictureInPictureParams.java
@@ -28,10 +28,8 @@ import java.util.List;
/**
* 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 @@ public class PictureInPictureParams implements Parcelable {
/**
* 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 @@ public class PictureInPictureParams implements Parcelable {
/**
* 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 @@ public class PictureInPictureParams implements Parcelable {
@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 @@ public class PictureInPictureParams implements Parcelable {
}
}
- private PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions,
+ /** {@hide} */
+ PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions,
Rect sourceRectHint) {
mAspectRatio = aspectRatio;
mUserActions = actions;
@@ -208,6 +201,11 @@ public class PictureInPictureParams implements Parcelable {
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 5f93313acab4..852e5f708ec3 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1710,19 +1710,6 @@ public class Intent implements Parcelable, Cloneable {
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 @@ public class Intent implements Parcelable, Cloneable {
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/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index 0be0885c5bdc..cf7f017daf60 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -883,9 +883,12 @@ public class ActivityInfo extends ComponentInfo
/**
* Screen rotation animation desired by the activity, with values as defined
* for {@link android.view.WindowManager.LayoutParams#rotationAnimation}.
+ *
+ * -1 means to use the system default.
+ *
* @hide
*/
- public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
+ public int rotationAnimation = -1;
/** @hide */
public static final int LOCK_TASK_LAUNCH_MODE_DEFAULT = 0;
diff --git a/core/java/android/content/pm/IDexModuleRegisterCallback.aidl b/core/java/android/content/pm/IDexModuleRegisterCallback.aidl
new file mode 100644
index 000000000000..4af6999c09ba
--- /dev/null
+++ b/core/java/android/content/pm/IDexModuleRegisterCallback.aidl
@@ -0,0 +1,28 @@
+/*
+** Copyright 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.content.pm;
+
+import android.os.Bundle;
+
+/**
+ * Callback for registering a dex module with the Package Manager.
+ *
+ * @hide
+ */
+oneway interface IDexModuleRegisterCallback {
+ void onDexModuleRegistered(in String dexModulePath, in boolean success, in String message);
+}
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index c7dd1fad4edc..77891fa84f78 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -25,6 +25,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.ChangedPackages;
import android.content.pm.InstantAppInfo;
import android.content.pm.FeatureInfo;
+import android.content.pm.IDexModuleRegisterCallback;
import android.content.pm.IPackageInstallObserver2;
import android.content.pm.IPackageInstaller;
import android.content.pm.IPackageDeleteObserver;
@@ -474,6 +475,38 @@ interface IPackageManager {
void notifyDexLoad(String loadingPackageName, in List<String> dexPaths, String loaderIsa);
/**
+ * Register an application dex module with the package manager.
+ * The package manager will keep track of the given module for future optimizations.
+ *
+ * Dex module optimizations will disable the classpath checking at runtime. The client bares
+ * the responsibility to ensure that the static assumptions on classes in the optimized code
+ * hold at runtime (e.g. there's no duplicate classes in the classpath).
+ *
+ * Note that the package manager already keeps track of dex modules loaded with
+ * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}.
+ * This can be called for an eager registration.
+ *
+ * The call might take a while and the results will be posted on the main thread, using
+ * the given callback.
+ *
+ * If the module is intended to be shared with other apps, make sure that the file
+ * permissions allow for it.
+ * If at registration time the permissions allow for others to read it, the module would
+ * be marked as a shared module which might undergo a different optimization strategy.
+ * (usually shared modules will generated larger optimizations artifacts,
+ * taking more disk space).
+ *
+ * @param packageName the package name to which the dex module belongs
+ * @param dexModulePath the absolute path of the dex module.
+ * @param isSharedModule whether or not the module is intended to be used by other apps.
+ * @param callback if not null,
+ * {@link android.content.pm.IDexModuleRegisterCallback.IDexModuleRegisterCallback#onDexModuleRegistered}
+ * will be called once the registration finishes.
+ */
+ void registerDexModule(in String packageName, in String dexModulePath,
+ in boolean isSharedModule, IDexModuleRegisterCallback callback);
+
+ /**
* Ask the package manager to perform a dex-opt for the given reason. The package
* manager will map the reason to a compiler filter according to the current system
* configuration.
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 10b7965c58ea..07125e035edc 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -5725,4 +5725,48 @@ public abstract class PackageManager {
* @hide
*/
public abstract String getInstantAppAndroidId(String packageName, @NonNull UserHandle user);
+
+ /**
+ * Callback use to notify the callers of module registration that the operation
+ * has finished.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static abstract class DexModuleRegisterCallback {
+ public abstract void onDexModuleRegistered(String dexModulePath, boolean success,
+ String message);
+ }
+
+ /**
+ * Register an application dex module with the package manager.
+ * The package manager will keep track of the given module for future optimizations.
+ *
+ * Dex module optimizations will disable the classpath checking at runtime. The client bares
+ * the responsibility to ensure that the static assumptions on classes in the optimized code
+ * hold at runtime (e.g. there's no duplicate classes in the classpath).
+ *
+ * Note that the package manager already keeps track of dex modules loaded with
+ * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}.
+ * This can be called for an eager registration.
+ *
+ * The call might take a while and the results will be posted on the main thread, using
+ * the given callback.
+ *
+ * If the module is intended to be shared with other apps, make sure that the file
+ * permissions allow for it.
+ * If at registration time the permissions allow for others to read it, the module would
+ * be marked as a shared module which might undergo a different optimization strategy.
+ * (usually shared modules will generated larger optimizations artifacts,
+ * taking more disk space).
+ *
+ * @param dexModulePath the absolute path of the dex module.
+ * @param callback if not null, {@link DexModuleRegisterCallback#onDexModuleRegistered} will
+ * be called once the registration finishes.
+ *
+ * @hide
+ */
+ @SystemApi
+ public abstract void registerDexModule(String dexModulePath,
+ @Nullable DexModuleRegisterCallback callback);
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 101317784c17..9b0bab427478 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -201,10 +201,10 @@ public class PackageParser {
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 @@ public class PackageParser {
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 @@ public class PackageParser {
/**
* @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/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java
index 650b4c008dcc..f312204e9467 100644
--- a/core/java/android/content/pm/ResolveInfo.java
+++ b/core/java/android/content/pm/ResolveInfo.java
@@ -71,6 +71,10 @@ public class ResolveInfo implements Parcelable {
/**
* Whether or not an instant app is available for the resolved intent.
*/
+ public boolean isInstantAppAvailable;
+
+ /** @removed */
+ @Deprecated
public boolean instantAppAvailable;
/**
@@ -330,7 +334,8 @@ public class ResolveInfo implements Parcelable {
system = orig.system;
targetUserId = orig.targetUserId;
handleAllWebDataURI = orig.handleAllWebDataURI;
- instantAppAvailable = orig.instantAppAvailable;
+ isInstantAppAvailable = orig.isInstantAppAvailable;
+ instantAppAvailable = isInstantAppAvailable;
}
public String toString() {
@@ -394,7 +399,7 @@ public class ResolveInfo implements Parcelable {
dest.writeInt(noResourceId ? 1 : 0);
dest.writeInt(iconResourceId);
dest.writeInt(handleAllWebDataURI ? 1 : 0);
- dest.writeInt(instantAppAvailable ? 1 : 0);
+ dest.writeInt(isInstantAppAvailable ? 1 : 0);
}
public static final Creator<ResolveInfo> CREATOR
@@ -442,7 +447,7 @@ public class ResolveInfo implements Parcelable {
noResourceId = source.readInt() != 0;
iconResourceId = source.readInt();
handleAllWebDataURI = source.readInt() != 0;
- instantAppAvailable = source.readInt() != 0;
+ instantAppAvailable = isInstantAppAvailable = source.readInt() != 0;
}
public static class DisplayNameComparator
diff --git a/core/java/android/content/pm/SharedLibraryInfo.java b/core/java/android/content/pm/SharedLibraryInfo.java
index 0ad4874d41fe..5032e6a59a8b 100644
--- a/core/java/android/content/pm/SharedLibraryInfo.java
+++ b/core/java/android/content/pm/SharedLibraryInfo.java
@@ -131,7 +131,7 @@ public final class SharedLibraryInfo implements Parcelable {
*
* @return The version.
*/
- public @IntRange(from = -1) long getVersion() {
+ public @IntRange(from = -1) int getVersion() {
return mVersion;
}
diff --git a/core/java/android/net/NetworkBadging.java b/core/java/android/net/NetworkBadging.java
index b4ef69542bd1..6de28b7146e8 100644
--- a/core/java/android/net/NetworkBadging.java
+++ b/core/java/android/net/NetworkBadging.java
@@ -35,9 +35,10 @@ import java.lang.annotation.RetentionPolicy;
/**
* Utility methods for working with network badging.
*
- * @hide
+ * @removed
+ *
*/
-@SystemApi
+@Deprecated
public class NetworkBadging {
@IntDef({BADGING_NONE, BADGING_SD, BADGING_HD, BADGING_4K})
diff --git a/core/java/android/net/NetworkRecommendationProvider.java b/core/java/android/net/NetworkRecommendationProvider.java
index 1eaa1f90d64c..a6d132e5f28d 100644
--- a/core/java/android/net/NetworkRecommendationProvider.java
+++ b/core/java/android/net/NetworkRecommendationProvider.java
@@ -41,11 +41,13 @@ public abstract class NetworkRecommendationProvider {
private static final boolean VERBOSE = Build.IS_DEBUGGABLE && Log.isLoggable(TAG, Log.VERBOSE);
/** The key into the callback Bundle where the RecommendationResult will be found.
* @deprecated to be removed.
+ * @removed
*/
public static final String EXTRA_RECOMMENDATION_RESULT =
"android.net.extra.RECOMMENDATION_RESULT";
/** The key into the callback Bundle where the sequence will be found.
* @deprecated to be removed.
+ * @removed
*/
public static final String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE";
private final IBinder mService;
@@ -54,6 +56,7 @@ public abstract class NetworkRecommendationProvider {
* Constructs a new instance.
* @param handler indicates which thread to use when handling requests. Cannot be {@code null}.
* @deprecated use {@link #NetworkRecommendationProvider(Context, Executor)}
+ * @removed
*/
public NetworkRecommendationProvider(Handler handler) {
if (handler == null) {
@@ -82,6 +85,7 @@ public abstract class NetworkRecommendationProvider {
* available it must be passed into
* {@link ResultCallback#onResult(RecommendationResult)}.
* @deprecated to be removed.
+ * @removed
*/
public void onRequestRecommendation(RecommendationRequest request, ResultCallback callback) {}
@@ -107,6 +111,7 @@ public abstract class NetworkRecommendationProvider {
* is available.
*
* @deprecated to be removed.
+ * @removed
*/
public static class ResultCallback {
private final IRemoteCallback mCallback;
diff --git a/core/java/android/net/RecommendationRequest.java b/core/java/android/net/RecommendationRequest.java
index 45ee3a5283dd..21641d9e7fe3 100644
--- a/core/java/android/net/RecommendationRequest.java
+++ b/core/java/android/net/RecommendationRequest.java
@@ -17,7 +17,6 @@
package android.net;
-import android.annotation.SystemApi;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.os.Parcel;
@@ -31,8 +30,8 @@ import com.android.internal.annotations.VisibleForTesting;
* @see {@link NetworkScoreManager#requestRecommendation(RecommendationRequest)}.
* @hide
* @deprecated to be removed.
+ * @removed
*/
-@SystemApi
public final class RecommendationRequest implements Parcelable {
private final ScanResult[] mScanResults;
private final WifiConfiguration mDefaultConfig;
@@ -45,8 +44,8 @@ public final class RecommendationRequest implements Parcelable {
* Builder class for constructing {@link RecommendationRequest} instances.
* @hide
* @deprecated to be removed.
+ * @removed
*/
- @SystemApi
public static final class Builder {
private ScanResult[] mScanResults;
private WifiConfiguration mDefaultConfig;
diff --git a/core/java/android/net/RecommendationResult.java b/core/java/android/net/RecommendationResult.java
index ce4d83af3f01..d66dd22de40a 100644
--- a/core/java/android/net/RecommendationResult.java
+++ b/core/java/android/net/RecommendationResult.java
@@ -18,12 +18,10 @@ package android.net;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.annotation.SystemApi;
import android.net.wifi.WifiConfiguration;
import android.os.Parcel;
import android.os.Parcelable;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Preconditions;
/**
@@ -32,8 +30,8 @@ import com.android.internal.util.Preconditions;
* @see {@link NetworkScoreManager#requestRecommendation(RecommendationRequest)}.
* @hide
* @deprecated to be removed.
+ * @removed
*/
-@SystemApi
public final class RecommendationResult implements Parcelable {
private final WifiConfiguration mWifiConfiguration;
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index b71578060fdc..037cccf14615 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -55,6 +55,7 @@ interface IPowerManager
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 a713eef72c45..7d1369fe1b69 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 final class PowerManager {
*/
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 @@ public final class PowerManager {
}
/**
+ * 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 745642efc423..5e7549fa67d8 100644
--- a/core/java/android/os/TestLooperManager.java
+++ b/core/java/android/os/TestLooperManager.java
@@ -58,11 +58,17 @@ public class TestLooperManager {
/**
* 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 416455d596be..88d17ef32c13 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -119,7 +119,7 @@ public abstract class AutofillService extends Service {
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 8ac399c776ec..b1145ee38929 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -29,6 +29,7 @@ import com.android.internal.util.Preconditions;
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 @@ public final class FillRequest implements Parcelable {
/**
* @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/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 42c0151298b0..1914db9eb438 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -30,6 +30,7 @@ import android.view.autofill.AutofillManager;
import android.widget.RemoteViews;
import java.util.ArrayList;
+import java.util.Arrays;
/**
* Response for a {@link
@@ -258,12 +259,17 @@ public final class FillResponse implements Parcelable {
* @param ids id of Views that when focused will display the authentication UI affordance.
*
* @return This builder.
+ * @throw {@link IllegalArgumentException} if {@code ids} is {@code null} or empty, or if
+ * neither {@code authentication} nor {@code presentation} is non-{@code null}.
+ *
* @see android.app.PendingIntent#getIntentSender()
*/
public @NonNull Builder setAuthentication(@NonNull AutofillId[] ids,
@Nullable IntentSender authentication, @Nullable RemoteViews presentation) {
throwIfDestroyed();
- // TODO(b/37424539): assert ids is not null nor empty once old version is removed
+ if (ids == null || ids.length == 0) {
+ throw new IllegalArgumentException("ids cannot be null or empry");
+ }
if (authentication == null ^ presentation == null) {
throw new IllegalArgumentException("authentication and presentation"
+ " must be both non-null or null");
@@ -275,17 +281,6 @@ public final class FillResponse implements Parcelable {
}
/**
- * TODO(b/37424539): will be removed once clients use the version that takes ids
- * @hide
- * @deprecated
- */
- @Deprecated
- public @NonNull Builder setAuthentication(@Nullable IntentSender authentication,
- @Nullable RemoteViews presentation) {
- return setAuthentication(null, authentication, presentation);
- }
-
- /**
* Specifies views that should not trigger new
* {@link AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal,
* FillCallback)} requests.
@@ -396,6 +391,7 @@ public final class FillResponse implements Parcelable {
public String toString() {
if (!sDebug) return super.toString();
+ // TODO: create a dump() method instead
return new StringBuilder(
"FillResponse : [mRequestId=" + mRequestId)
.append(", datasets=").append(mDatasets)
@@ -403,10 +399,8 @@ public final class FillResponse implements Parcelable {
.append(", clientState=").append(mClientState != null)
.append(", hasPresentation=").append(mPresentation != null)
.append(", hasAuthentication=").append(mAuthentication != null)
- .append(", authenticationSize=").append(mAuthenticationIds != null
- ? mAuthenticationIds.length : "N/A")
- .append(", ignoredIdsSize=").append(mIgnoredIds != null
- ? mIgnoredIds.length : "N/A")
+ .append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds))
+ .append(", ignoredIds=").append(Arrays.toString(mIgnoredIds))
.append("]")
.toString();
}
@@ -447,8 +441,16 @@ public final class FillResponse implements Parcelable {
}
builder.setSaveInfo(parcel.readParcelable(null));
builder.setClientState(parcel.readParcelable(null));
- builder.setAuthentication(parcel.readParcelableArray(null, AutofillId.class),
- parcel.readParcelable(null), parcel.readParcelable(null));
+
+ // Sets authentication state.
+ final AutofillId[] authenticationIds = parcel.readParcelableArray(null,
+ AutofillId.class);
+ final IntentSender authentication = parcel.readParcelable(null);
+ final RemoteViews presentation = parcel.readParcelable(null);
+ if (authenticationIds != null) {
+ builder.setAuthentication(authenticationIds, authentication, presentation);
+ }
+
builder.setIgnoredIds(parcel.readParcelableArray(null, AutofillId.class));
final FillResponse response = builder.build();
diff --git a/core/java/android/speech/tts/UtteranceProgressListener.java b/core/java/android/speech/tts/UtteranceProgressListener.java
index ef81f1211364..7381a12af083 100644
--- a/core/java/android/speech/tts/UtteranceProgressListener.java
+++ b/core/java/android/speech/tts/UtteranceProgressListener.java
@@ -144,9 +144,8 @@ public abstract class UtteranceProgressListener {
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 0a24bfb019ca..d0133ed66535 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -95,7 +95,7 @@ public final class AutofillManager {
* 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 1c87726b3ca9..5476ab216f2f 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -7088,7 +7088,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
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/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index d0ce1927b108..c00d698770b3 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -45,7 +45,6 @@ static jmethodID gConfig_ctorID;
static jfieldID gDisplay_EGLDisplayFieldID;
static jfieldID gContext_EGLContextFieldID;
static jfieldID gSurface_EGLSurfaceFieldID;
-static jfieldID gSurface_NativePixelRefFieldID;
static jfieldID gConfig_EGLConfigFieldID;
static inline EGLDisplay getDisplay(JNIEnv* env, jobject o) {
@@ -84,7 +83,6 @@ static void nativeClassInit(JNIEnv *_env, jclass eglImplClass)
jclass surface_class = _env->FindClass("com/google/android/gles_jni/EGLSurfaceImpl");
gSurface_EGLSurfaceFieldID = _env->GetFieldID(surface_class, "mEGLSurface", "J");
- gSurface_NativePixelRefFieldID = _env->GetFieldID(surface_class, "mNativePixelRef", "J");
}
static const jint gNull_attrib_base[] = {EGL_NONE};
@@ -398,14 +396,6 @@ static jboolean jni_eglDestroySurface(JNIEnv *_env, jobject _this, jobject displ
}
EGLDisplay dpy = getDisplay(_env, display);
EGLSurface sur = getSurface(_env, surface);
-
- if (sur) {
- SkPixelRef* ref = (SkPixelRef*)(_env->GetLongField(surface,
- gSurface_NativePixelRefFieldID));
- if (ref) {
- SkSafeUnref(ref);
- }
- }
return EglBoolToJBool(eglDestroySurface(dpy, sur));
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 6fe356777a79..5e34e0559f79 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -377,8 +377,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" />
@@ -446,6 +444,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" />
@@ -827,16 +827,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
@@ -924,6 +914,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 -->
@@ -1900,20 +1900,20 @@
android:protectionLevel="signature|privileged" />
<!-- Allows a companion app to run in the background.
- <p>Protection level: signature
+ <p>Protection level: normal
-->
<permission android:name="android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND"
android:label="@string/permlab_runInBackground"
android:description="@string/permdesc_runInBackground"
- android:protectionLevel="signature" />
+ android:protectionLevel="normal" />
<!-- Allows a companion app to use data in the background.
- <p>Protection level: signature
+ <p>Protection level: normal
-->
<permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND"
android:label="@string/permlab_useDataInBackground"
android:description="@string/permdesc_useDataInBackground"
- android:protectionLevel="signature" />
+ android:protectionLevel="normal" />
<!-- ================================== -->
@@ -3374,6 +3374,8 @@
android:protectionLevel="signature" />
<!-- Must be required by system apps when accessing restricted VR APIs.
+ @hide
+ @SystemApi
<p>Protection level: signature -->
<permission android:name="android.permission.RESTRICTED_VR_ACCESS"
android:protectionLevel="signature|preinstalled" />
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 e2dda336f8f7..000000000000
--- 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 b7bc7b7a5fe3..ced22cc37f5a 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/config.xml b/core/res/res/values/config.xml
index eb25ab37b4b5..f3c54ba63aa2 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2877,4 +2877,13 @@
<!-- The apps that need to be hidden when they are disabled -->
<string-array name="config_hideWhenDisabled_packageNames"></string-array>
+
+ <!-- Additional non-platform defined global settings exposed to Instant Apps -->
+ <string-array name="config_allowedGlobalInstantAppSettings"></string-array>
+
+ <!-- Additional non-platform defined system settings exposed to Instant Apps -->
+ <string-array name="config_allowedSystemInstantAppSettings"></string-array>
+
+ <!-- Additional non-platform defined secure settings exposed to Instant Apps -->
+ <string-array name="config_allowedSecureInstantAppSettings"></string-array>
</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 17f4d39a3251..42d3f27eccfb 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/res/res/values/strings.xml b/core/res/res/values/strings.xml
index e633d66514cc..9848485d15c2 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3155,6 +3155,11 @@
<string name="usb_accessory_notification_title">Connected to a USB accessory</string>
<!-- See USB_PREFERENCES. This is the message. -->
<string name="usb_notification_message">Tap for more options.</string>
+ <!-- USB_PREFERENCES: Notification for when a type-c USB audio accessory is attached but not supported. This is the title -->
+ <string name="usb_unsupported_audio_accessory_title">Audio accessory not supported</string>
+ <!-- Message of notification shown when a type-c USB audio accessory is attached but not supported. -->
+ <string name="usb_unsupported_audio_accessory_message">Tap for more info</string>
+
<!-- Title of notification shown when ADB is actively connected to the phone. -->
<string name="adb_active_notification_title">USB debugging connected</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index bd70ca8c2191..e6af1d9a933b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1958,6 +1958,8 @@
<java-symbol type="string" name="usb_ptp_notification_title" />
<java-symbol type="string" name="usb_midi_notification_title" />
<java-symbol type="string" name="usb_supplying_notification_title" />
+ <java-symbol type="string" name="usb_unsupported_audio_accessory_title" />
+ <java-symbol type="string" name="usb_unsupported_audio_accessory_message" />
<java-symbol type="string" name="config_UsbDeviceConnectionHandling_component" />
<java-symbol type="string" name="vpn_text" />
<java-symbol type="string" name="vpn_text_long" />
@@ -3013,4 +3015,8 @@
<java-symbol type="string" name="config_feedbackIntentNameKey" />
<java-symbol type="array" name="config_hideWhenDisabled_packageNames" />
+
+ <java-symbol type="array" name="config_allowedGlobalInstantAppSettings" />
+ <java-symbol type="array" name="config_allowedSystemInstantAppSettings" />
+ <java-symbol type="array" name="config_allowedSecureInstantAppSettings" />
</resources>
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 33a04939387a..698f2ec1c2f3 100644
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -36,6 +36,7 @@ import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.net.Uri;
import android.os.Binder;
+import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.FileUtils;
@@ -64,9 +65,14 @@ import android.util.Log;
import com.android.frameworks.coretests.R;
import com.android.internal.content.PackageHelper;
+import dalvik.system.VMRuntime;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -78,9 +84,9 @@ public class PackageManagerTests extends AndroidTestCase {
public static final String TAG = "PackageManagerTests";
- public final long MAX_WAIT_TIME = 25 * 1000;
+ public static final long MAX_WAIT_TIME = 25 * 1000;
- public final long WAIT_TIME_INCR = 5 * 1000;
+ public static final long WAIT_TIME_INCR = 5 * 1000;
private static final String SECURE_CONTAINERS_PREFIX = "/mnt/asec";
@@ -3861,6 +3867,117 @@ public class PackageManagerTests extends AndroidTestCase {
PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
+ private static class TestDexModuleRegisterCallback
+ extends PackageManager.DexModuleRegisterCallback {
+ private String mDexModulePath = null;
+ private boolean mSuccess = false;
+ private String mMessage = null;
+ CountDownLatch doneSignal = new CountDownLatch(1);
+
+ @Override
+ public void onDexModuleRegistered(String dexModulePath, boolean success, String message) {
+ mDexModulePath = dexModulePath;
+ mSuccess = success;
+ mMessage = message;
+ doneSignal.countDown();
+ }
+
+ boolean waitTillDone() {
+ long startTime = System.currentTimeMillis();
+ while (System.currentTimeMillis() - startTime < MAX_WAIT_TIME) {
+ try {
+ return doneSignal.await(MAX_WAIT_TIME, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ Log.i(TAG, "Interrupted during sleep", e);
+ }
+ }
+ return false;
+ }
+
+ }
+
+ // Verify that the base code path cannot be registered.
+ public void testRegisterDexModuleBaseCode() throws Exception {
+ PackageManager pm = getPm();
+ ApplicationInfo info = getContext().getApplicationInfo();
+ TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback();
+ pm.registerDexModule(info.getBaseCodePath(), callback);
+ assertTrue(callback.waitTillDone());
+ assertEquals(info.getBaseCodePath(), callback.mDexModulePath);
+ assertFalse("BaseCodePath should not be registered", callback.mSuccess);
+ }
+
+ // Verify thatmodules which are not own by the calling package are not registered.
+ public void testRegisterDexModuleNotOwningModule() throws Exception {
+ TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback();
+ String moduleBelongingToOtherPackage = "/data/user/0/com.google.android.gms/module.apk";
+ getPm().registerDexModule(moduleBelongingToOtherPackage, callback);
+ assertTrue(callback.waitTillDone());
+ assertEquals(moduleBelongingToOtherPackage, callback.mDexModulePath);
+ assertTrue(callback.waitTillDone());
+ assertFalse("Only modules belonging to the calling package can be registered",
+ callback.mSuccess);
+ }
+
+ // Verify that modules owned by the package are successfully registered.
+ public void testRegisterDexModuleSuccessfully() throws Exception {
+ ApplicationInfo info = getContext().getApplicationInfo();
+ // Copy the main apk into the data folder and use it as a "module".
+ File dexModuleDir = new File(info.dataDir, "module-dir");
+ File dexModule = new File(dexModuleDir, "module.apk");
+ try {
+ assertNotNull(FileUtils.createDir(
+ dexModuleDir.getParentFile(), dexModuleDir.getName()));
+ Files.copy(Paths.get(info.getBaseCodePath()), dexModule.toPath(),
+ StandardCopyOption.REPLACE_EXISTING);
+ TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback();
+ getPm().registerDexModule(dexModule.toString(), callback);
+ assertTrue(callback.waitTillDone());
+ assertEquals(dexModule.toString(), callback.mDexModulePath);
+ assertTrue(callback.waitTillDone());
+ assertTrue(callback.mMessage, callback.mSuccess);
+
+ // NOTE:
+ // This actually verifies internal behaviour which might change. It's not
+ // ideal but it's the best we can do since there's no other place we can currently
+ // write a better test.
+ for(String isa : getAppDexInstructionSets(info)) {
+ Files.exists(Paths.get(dexModuleDir.toString(), "oat", isa, "module.odex"));
+ Files.exists(Paths.get(dexModuleDir.toString(), "oat", isa, "module.vdex"));
+ }
+ } finally {
+ FileUtils.deleteContentsAndDir(dexModuleDir);
+ }
+ }
+
+ // If the module does not exist on disk we should get a failure.
+ public void testRegisterDexModuleNotExists() throws Exception {
+ ApplicationInfo info = getContext().getApplicationInfo();
+ String nonExistentApk = Paths.get(info.dataDir, "non-existent.apk").toString();
+ TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback();
+ getPm().registerDexModule(nonExistentApk, callback);
+ assertTrue(callback.waitTillDone());
+ assertEquals(nonExistentApk, callback.mDexModulePath);
+ assertTrue(callback.waitTillDone());
+ assertFalse("DexModule registration should fail", callback.mSuccess);
+ }
+
+ // Copied from com.android.server.pm.InstructionSets because we don't have access to it here.
+ private static String[] getAppDexInstructionSets(ApplicationInfo info) {
+ if (info.primaryCpuAbi != null) {
+ if (info.secondaryCpuAbi != null) {
+ return new String[] {
+ VMRuntime.getInstructionSet(info.primaryCpuAbi),
+ VMRuntime.getInstructionSet(info.secondaryCpuAbi) };
+ } else {
+ return new String[] {
+ VMRuntime.getInstructionSet(info.primaryCpuAbi) };
+ }
+ }
+
+ return new String[] { VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]) };
+ }
+
/*---------- Recommended install location tests ----*/
/*
* TODO's
diff --git a/core/tests/coretests/src/android/content/pm/PackageParserTest.java b/core/tests/coretests/src/android/content/pm/PackageParserTest.java
index ca4141afae2d..b9bd193ad48c 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 @@ public class PackageParserTest {
* 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 000000000000..6e38fb685887
--- /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/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
index ffadad9d68c5..ab10e978b0f7 100644
--- a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
+++ b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java
@@ -78,6 +78,7 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
* Mask path is defined inside device configuration in following dimension: [100 x 100]
* @hide
*/
+ @TestApi
public static final float MASK_SIZE = 100f;
/**
@@ -179,7 +180,6 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
*
* @param backgroundDrawable drawable that should be rendered in the background
* @param foregroundDrawable drawable that should be rendered in the foreground
- * @hide
*/
public AdaptiveIconDrawable(Drawable backgroundDrawable,
Drawable foregroundDrawable) {
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 8126d57a3a79..028d9f756fb7 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -291,7 +291,6 @@ void JankTracker::addFrame(const FrameInfo& frame) {
/ kSlowFrameBucketIntervalMs;
framebucket = std::min(framebucket,
static_cast<uint32_t>(mData->slowFrameCounts.size() - 1));
- framebucket = std::max(framebucket, 0u);
mData->slowFrameCounts[framebucket]++;
}
diff --git a/media/java/android/media/AudioFocusRequest.java b/media/java/android/media/AudioFocusRequest.java
index 29d19860eba3..b1dc3ad13f12 100644
--- a/media/java/android/media/AudioFocusRequest.java
+++ b/media/java/android/media/AudioFocusRequest.java
@@ -357,6 +357,20 @@ public final class AudioFocusRequest {
}
/**
+ * @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 ce07c9982623..0b5dff227d23 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -2445,7 +2445,7 @@ public class AudioManager {
}
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 6f4118ecebbb..4496a82e55d5 100644
--- a/media/java/android/media/tv/TvContract.java
+++ b/media/java/android/media/tv/TvContract.java
@@ -437,7 +437,7 @@ public final class TvContract {
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 final class TvContract {
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/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java b/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java
index 7a3ed24f8811..21c350be7c39 100644
--- a/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java
+++ b/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java
@@ -20,14 +20,11 @@ import javax.microedition.khronos.egl.*;
public class EGLSurfaceImpl extends EGLSurface {
long mEGLSurface;
- private long mNativePixelRef;
public EGLSurfaceImpl() {
mEGLSurface = 0;
- mNativePixelRef = 0;
}
public EGLSurfaceImpl(long surface) {
mEGLSurface = surface;
- mNativePixelRef = 0;
}
@Override
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java
index ccf7a0bfdfc6..39dfe0ef6620 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 class PrivateStorageInfo {
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/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java b/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java
index e5cdc85a48d9..988060eac64d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java
+++ b/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java
@@ -16,6 +16,7 @@
package com.android.settingslib.dream;
+import android.annotation.IntDef;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -35,6 +36,8 @@ import android.util.AttributeSet;
import android.util.Log;
import android.util.Xml;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -68,6 +71,15 @@ public class DreamBackend {
}
}
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({WHILE_CHARGING, WHILE_DOCKED, EITHER, NEVER})
+ public @interface WhenToDream{}
+
+ public static final int WHILE_CHARGING = 0;
+ public static final int WHILE_DOCKED = 1;
+ public static final int EITHER = 2;
+ public static final int NEVER = 3;
+
private final Context mContext;
private final IDreamManager mDreamManager;
private final DreamInfoComparator mComparator;
@@ -75,6 +87,15 @@ public class DreamBackend {
private final boolean mDreamsActivatedOnSleepByDefault;
private final boolean mDreamsActivatedOnDockByDefault;
+ private static DreamBackend sInstance;
+
+ public static DreamBackend getInstance(Context context) {
+ if (sInstance == null) {
+ sInstance = new DreamBackend(context);
+ }
+ return sInstance;
+ }
+
public DreamBackend(Context context) {
mContext = context;
mDreamManager = IDreamManager.Stub.asInterface(
@@ -138,6 +159,42 @@ public class DreamBackend {
return null;
}
+ public @WhenToDream int getWhenToDreamSetting() {
+ if (!isEnabled()) {
+ return NEVER;
+ }
+ return isActivatedOnDock() && isActivatedOnSleep() ? EITHER
+ : isActivatedOnDock() ? WHILE_DOCKED
+ : isActivatedOnSleep() ? WHILE_CHARGING
+ : NEVER;
+ }
+
+ public void setWhenToDream(@WhenToDream int whenToDream) {
+ setEnabled(whenToDream != NEVER);
+
+ switch (whenToDream) {
+ case WHILE_CHARGING:
+ setActivatedOnDock(false);
+ setActivatedOnSleep(true);
+ break;
+
+ case WHILE_DOCKED:
+ setActivatedOnDock(true);
+ setActivatedOnSleep(false);
+ break;
+
+ case EITHER:
+ setActivatedOnDock(true);
+ setActivatedOnSleep(true);
+ break;
+
+ case NEVER:
+ default:
+ break;
+ }
+
+ }
+
public boolean isEnabled() {
return getBoolean(Settings.Secure.SCREENSAVER_ENABLED, mDreamsEnabledByDefault);
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index a6347c67efd8..4b304b2353b3 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -35,6 +35,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.UserInfo;
+import android.content.res.Resources;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.database.sqlite.SQLiteDatabase;
@@ -185,6 +186,26 @@ public class SettingsProvider extends ContentProvider {
private static final Bundle NULL_SETTING_BUNDLE = Bundle.forPair(
Settings.NameValueTable.VALUE, null);
+ // Overlay specified settings whitelisted for Instant Apps
+ private static final Set<String> OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS = new ArraySet<>();
+ private static final Set<String> OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS = new ArraySet<>();
+ private static final Set<String> OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS = new ArraySet<>();
+
+ static {
+ for (String name : Resources.getSystem().getStringArray(
+ com.android.internal.R.array.config_allowedGlobalInstantAppSettings)) {
+ OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS.add(name);
+ }
+ for (String name : Resources.getSystem().getStringArray(
+ com.android.internal.R.array.config_allowedSystemInstantAppSettings)) {
+ OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS.add(name);
+ }
+ for (String name : Resources.getSystem().getStringArray(
+ com.android.internal.R.array.config_allowedSecureInstantAppSettings)) {
+ OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS.add(name);
+ }
+ }
+
// Changes to these global settings are synchronously persisted
private static final Set<String> CRITICAL_GLOBAL_SETTINGS = new ArraySet<>();
static {
@@ -898,14 +919,13 @@ public class SettingsProvider extends ContentProvider {
Slog.v(LOG_TAG, "getGlobalSetting(" + name + ")");
}
+ // Ensure the caller can access the setting.
+ enforceSettingReadable(name, SETTINGS_TYPE_GLOBAL, UserHandle.getCallingUserId());
+
// Get the value.
synchronized (mLock) {
- Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL,
+ return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL,
UserHandle.USER_SYSTEM, name);
- // Ensure the caller can access the setting before we return it.
- enforceSettingReadable(setting, name, SETTINGS_TYPE_GLOBAL,
- UserHandle.getCallingUserId());
- return setting;
}
}
@@ -1063,6 +1083,9 @@ public class SettingsProvider extends ContentProvider {
// Resolve the userId on whose behalf the call is made.
final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
+ // Ensure the caller can access the setting.
+ enforceSettingReadable(name, SETTINGS_TYPE_SECURE, UserHandle.getCallingUserId());
+
// Determine the owning user as some profile settings are cloned from the parent.
final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name);
@@ -1076,7 +1099,6 @@ public class SettingsProvider extends ContentProvider {
// As of Android O, the SSAID is read from an app-specific entry in table
// SETTINGS_FILE_SSAID, unless accessed by a system process.
- // All apps are allowed to access their SSAID, so we skip the permission check.
if (isNewSsaidSetting(name)) {
PackageInfo callingPkg = getCallingPackageInfo(owningUserId);
synchronized (mLock) {
@@ -1086,12 +1108,8 @@ public class SettingsProvider extends ContentProvider {
// Not the SSAID; do a straight lookup
synchronized (mLock) {
- Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE,
+ return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name);
- // Ensure the caller can access the setting before we return it.
- enforceSettingReadable(setting, name, SETTINGS_TYPE_SECURE,
- UserHandle.getCallingUserId());
- return setting;
}
}
@@ -1292,18 +1310,15 @@ public class SettingsProvider extends ContentProvider {
// Resolve the userId on whose behalf the call is made.
final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
+ // Ensure the caller can access the setting.
+ enforceSettingReadable(name, SETTINGS_TYPE_SYSTEM, UserHandle.getCallingUserId());
// Determine the owning user as some profile settings are cloned from the parent.
final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name);
// Get the value.
synchronized (mLock) {
- Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM,
- owningUserId, name);
- // Ensure the caller can access the setting before we return it.
- enforceSettingReadable(setting, name, SETTINGS_TYPE_SYSTEM,
- UserHandle.getCallingUserId());
- return setting;
+ return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name);
}
}
@@ -1635,6 +1650,19 @@ public class SettingsProvider extends ContentProvider {
}
}
+ private Set<String> getOverlayInstantAppAccessibleSettings(int settingsType) {
+ switch (settingsType) {
+ case SETTINGS_TYPE_GLOBAL:
+ return OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS;
+ case SETTINGS_TYPE_SYSTEM:
+ return OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS;
+ case SETTINGS_TYPE_SECURE:
+ return OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS;
+ default:
+ throw new IllegalArgumentException("Invalid settings type: " + settingsType);
+ }
+ }
+
private List<String> getSettingsNamesLocked(int settingsType, int userId) {
boolean instantApp;
if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
@@ -1650,23 +1678,16 @@ public class SettingsProvider extends ContentProvider {
}
}
- private void enforceSettingReadable(Setting setting, String settingName, int settingsType,
- int userId) {
+ private void enforceSettingReadable(String settingName, int settingsType, int userId) {
if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
return;
}
ApplicationInfo ai = getCallingApplicationInfoOrThrow();
- // Installed apps are allowed to read all settings.
if (!ai.isInstantApp()) {
return;
}
- // Instant Apps are allowed to read settings defined by applications.
- // TODO: Replace this with an API that allows the setting application to say if a setting
- // shoud/shouldn't be accessible.
- if (!setting.isDefaultFromSystem()) {
- return;
- }
- if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)) {
+ if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)
+ && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) {
throw new SecurityException("Setting " + settingName + " is not accessible from"
+ " ephemeral package " + getCallingPackage());
}
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index a98afa9e6830..9273f01ce53e 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -130,6 +130,9 @@
<!-- size at which Notification icons will be drawn in the status bar -->
<dimen name="status_bar_icon_drawing_size">17dp</dimen>
+ <!-- size at which Notification icons will be drawn on Ambient Display -->
+ <dimen name="status_bar_icon_drawing_size_dark">@*android:dimen/notification_header_icon_size_ambient</dimen>
+
<!-- opacity at which Notification icons will be drawn in the status bar -->
<item type="dimen" name="status_bar_icon_drawing_alpha">90%</item>
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 28bd23ce9825..df03fdc46d06 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 @@ public class PipManager implements BasePipManager {
// 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 79ac8160c095..65f24cf5ba98 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 class PipMenuActivity extends Activity {
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 @@ public class PipMenuActivity extends Activity {
private int mMenuState;
private boolean mAllowMenuTimeout = true;
+ private boolean mAllowTouches = true;
private final List<RemoteAction> mActions = new ArrayList<>();
@@ -149,6 +151,10 @@ public class PipMenuActivity extends Activity {
updateDismissFraction(data.getFloat(EXTRA_DISMISS_FRACTION));
break;
}
+ case MESSAGE_ANIMATION_ENDED: {
+ mAllowTouches = true;
+ break;
+ }
}
}
});
@@ -245,6 +251,10 @@ public class PipMenuActivity extends Activity {
@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 @@ public class PipMenuActivity extends Activity {
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 @@ public class PipMenuActivity extends Activity {
});
} 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 c41f898ef4fe..d5cf1dd0387d 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 class PipMenuActivityController {
}
}
+ 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 daf0622fa7a6..6b3daa306103 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.PowerManager;
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
}
@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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
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 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
} 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 471c3aeb9eb5..a64207714093 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.PowerManager;
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 @@ public class PowerUI extends SystemUI {
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 @@ public class PowerUI extends SystemUI {
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 @@ public class PowerUI extends SystemUI {
if (statusBar != null && !statusBar.isDeviceInVrMode()
&& temp >= mThresholdTemp) {
logAtTemperatureThreshold(temp);
- mWarnings.showTemperatureWarning();
+ mWarnings.showHighTemperatureWarning();
} else {
- mWarnings.dismissTemperatureWarning();
+ mWarnings.dismissHighTemperatureWarning();
}
}
@@ -369,8 +381,9 @@ public class PowerUI extends SystemUI {
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 53a9eae17f41..2b812a5f7ac3 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 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
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 ccc99c59e510..8b3d6d9b7021 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 @@ public class NotificationSnooze extends LinearLayout
}
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/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 263df79318ea..c7fbbf956c68 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -89,6 +89,9 @@ public class StatusBarIconView extends AnimatedImageView {
};
private boolean mAlwaysScaleIcon;
+ private int mStatusBarIconDrawingSizeDark = 1;
+ private int mStatusBarIconDrawingSize = 1;
+ private int mStatusBarIconSize = 1;
private StatusBarIcon mIcon;
@ViewDebug.ExportedProperty private String mSlot;
private Drawable mNumberBackground;
@@ -139,7 +142,7 @@ public class StatusBarIconView extends AnimatedImageView {
mNumberPain.setColor(context.getColor(R.drawable.notification_number_text_color));
mNumberPain.setAntiAlias(true);
setNotification(notification);
- maybeUpdateIconScale();
+ maybeUpdateIconScaleDimens();
setScaleType(ScaleType.CENTER);
mDensity = context.getResources().getDisplayMetrics().densityDpi;
if (mNotification != null) {
@@ -149,18 +152,30 @@ public class StatusBarIconView extends AnimatedImageView {
reloadDimens();
}
- private void maybeUpdateIconScale() {
+ private void maybeUpdateIconScaleDimens() {
// We do not resize and scale system icons (on the right), only notification icons (on the
// left).
if (mNotification != null || mAlwaysScaleIcon) {
- updateIconScale();
+ updateIconScaleDimens();
}
}
- private void updateIconScale() {
+ private void updateIconScaleDimens() {
Resources res = mContext.getResources();
- final int outerBounds = res.getDimensionPixelSize(R.dimen.status_bar_icon_size);
- final int imageBounds = res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size);
+ mStatusBarIconSize = res.getDimensionPixelSize(R.dimen.status_bar_icon_size);
+ mStatusBarIconDrawingSizeDark =
+ res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size_dark);
+ mStatusBarIconDrawingSize =
+ res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size);
+ updateIconScale();
+ }
+
+ private void updateIconScale() {
+ final float imageBounds = NotificationUtils.interpolate(
+ mStatusBarIconDrawingSize,
+ mStatusBarIconDrawingSizeDark,
+ mDarkAmount);
+ final int outerBounds = mStatusBarIconSize;
mIconScale = (float)imageBounds / (float)outerBounds;
}
@@ -174,7 +189,7 @@ public class StatusBarIconView extends AnimatedImageView {
int density = newConfig.densityDpi;
if (density != mDensity) {
mDensity = density;
- maybeUpdateIconScale();
+ maybeUpdateIconScaleDimens();
updateDrawable();
reloadDimens();
}
@@ -198,7 +213,7 @@ public class StatusBarIconView extends AnimatedImageView {
mDozer = new NotificationIconDozeHelper(context);
mBlocked = false;
mAlwaysScaleIcon = true;
- updateIconScale();
+ updateIconScaleDimens();
mDensity = context.getResources().getDisplayMetrics().densityDpi;
}
@@ -681,6 +696,7 @@ public class StatusBarIconView extends AnimatedImageView {
public void setDark(boolean dark, boolean fade, long delay) {
mDozer.setIntensityDark(f -> {
mDarkAmount = f;
+ updateIconScale();
updateDecorColor();
updateIconColor();
}, dark, fade, delay);
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 34cfa7be5b53..eb59a341ef0f 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 junit.framework.Assert.assertTrue;
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 @@ public class PowerNotificationWarningsTest extends SysuiTestCase {
}
@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/proto/src/system_messages.proto b/proto/src/system_messages.proto
index 53b3fe9c1a0d..ac544e8abd74 100644
--- a/proto/src/system_messages.proto
+++ b/proto/src/system_messages.proto
@@ -180,6 +180,9 @@ message SystemMessage {
// Package: android
NOTE_FOREGROUND_SERVICES = 40;
+ // Inform the user that the connected audio accessory is not supported
+ NOTE_USB_AUDIO_ACCESSORY_NOT_SUPPORTED = 41;
+
// ADD_NEW_IDS_ABOVE_THIS_LINE
// Legacy IDs with arbitrary values appear below
// Legacy IDs existed as stable non-conflicting constants prior to the O release
diff --git a/rs/jni/Android.mk b/rs/jni/Android.mk
index 4040db36c4fb..21438e04f38c 100644
--- a/rs/jni/Android.mk
+++ b/rs/jni/Android.mk
@@ -18,7 +18,8 @@ LOCAL_SHARED_LIBRARIES := \
libgui \
libjnigraphics
-LOCAL_STATIC_LIBRARIES :=
+LOCAL_HEADER_LIBRARIES := \
+ libbase_headers
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE) \
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index f6d3f4835381..ee48289731a8 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -27,6 +27,7 @@
#include <androidfw/Asset.h>
#include <androidfw/AssetManager.h>
#include <androidfw/ResourceTypes.h>
+#include <android-base/macros.h>
#include "jni.h"
#include "JNIHelp.h"
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
index 2358ec55f686..b536ad969c95 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
@@ -603,15 +603,12 @@ public final class AutofillManagerService extends SystemService {
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
boolean oldDebug = sDebug;
- boolean oldVerbose = sVerbose;
try {
synchronized (mLock) {
oldDebug = sDebug;
- oldVerbose = sVerbose;
setDebugLocked(true);
- setVerboseLocked(true);
pw.print("Debug mode: "); pw.println(oldDebug);
- pw.print("Verbose mode: "); pw.println(oldVerbose);
+ pw.print("Verbose mode: "); pw.println(sVerbose);
pw.print("Disabled users: "); pw.println(mDisabledUsers);
final int size = mServicesCache.size();
pw.print("Cached services: ");
@@ -631,7 +628,6 @@ public final class AutofillManagerService extends SystemService {
mRequestsHistory.reverseDump(fd, pw, args);
} finally {
setDebugLocked(oldDebug);
- setVerboseLocked(oldVerbose);
}
}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index c85ce436375e..018fb6886cd9 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -922,6 +922,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
}
}
}
+
+ if (ArrayUtils.contains(response.getAuthenticationIds(), id)) {
+ return false;
+ }
}
return true;
@@ -943,8 +947,14 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
Slog.v(TAG,
"Creating viewState for " + id + " on " + getActionAsString(action));
}
- viewState = new ViewState(this, id, value, this, ViewState.STATE_INITIAL);
+ boolean isIgnored = isIgnoredLocked(id);
+ viewState = new ViewState(this, id, value, this,
+ isIgnored ? ViewState.STATE_IGNORED : ViewState.STATE_INITIAL);
mViewStates.put(id, viewState);
+ if (isIgnored) {
+ if (sDebug) Slog.d(TAG, "updateLocked(): ignoring view " + id);
+ return;
+ }
} else {
if (sVerbose) Slog.v(TAG, "Ignored " + getActionAsString(action) + " for " + id);
return;
@@ -983,16 +993,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
break;
case ACTION_VIEW_ENTERED:
if (shouldStartNewPartitionLocked(id)) {
- // TODO(b/37424539): proper implementation
- if (mResponseWaitingAuth != null) {
- viewState.setState(ViewState.STATE_WAITING_RESPONSE_AUTH);
- } else {
- if (sDebug) {
- Slog.d(TAG, "Starting partition for view id " + viewState.id);
- }
- viewState.setState(ViewState.STATE_STARTED_PARTITION);
- requestNewFillResponseLocked(flags);
+ if (sDebug) {
+ Slog.d(TAG, "Starting partition for view id " + viewState.id);
}
+ viewState.setState(ViewState.STATE_STARTED_PARTITION);
+ requestNewFillResponseLocked(flags);
}
// Remove the UI if the ViewState has changed.
@@ -1015,6 +1020,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
}
}
+ /**
+ * Checks whether a view should be ignored.
+ */
+ private boolean isIgnoredLocked(AutofillId id) {
+ if (mResponses == null || mResponses.size() == 0) {
+ return false;
+ }
+ // Always check the latest response only
+ final FillResponse response = mResponses.valueAt(mResponses.size() - 1);
+ return ArrayUtils.contains(response.getIgnoredIds(), id);
+ }
+
@Override
public void onFillReady(FillResponse response, AutofillId filledId,
@Nullable AutofillValue value) {
@@ -1149,18 +1166,24 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
final SaveInfo saveInfo = response.getSaveInfo();
if (saveInfo != null) {
final AutofillId[] requiredIds = saveInfo.getRequiredIds();
- for (int i = 0; i < requiredIds.length; i++) {
- final AutofillId id = requiredIds[i];
+ for (AutofillId id : requiredIds) {
createOrUpdateViewStateLocked(id, state, null);
}
final AutofillId[] optionalIds = saveInfo.getOptionalIds();
if (optionalIds != null) {
- for (int i = 0; i < optionalIds.length; i++) {
- final AutofillId id = optionalIds[i];
+ for (AutofillId id : optionalIds) {
createOrUpdateViewStateLocked(id, state, null);
}
}
}
+
+ final AutofillId[] authIds = response.getAuthenticationIds();
+ if (authIds != null) {
+ for (AutofillId id : authIds) {
+ createOrUpdateViewStateLocked(id, state, null);
+ }
+ }
+
}
/**
diff --git a/services/autofill/java/com/android/server/autofill/ViewState.java b/services/autofill/java/com/android/server/autofill/ViewState.java
index 7ca943511dc0..d114e1452373 100644
--- a/services/autofill/java/com/android/server/autofill/ViewState.java
+++ b/services/autofill/java/com/android/server/autofill/ViewState.java
@@ -17,6 +17,7 @@
package com.android.server.autofill;
import static com.android.server.autofill.Helper.sDebug;
+import static com.android.server.autofill.Helper.sVerbose;
import android.annotation.Nullable;
import android.graphics.Rect;
@@ -61,8 +62,8 @@ final class ViewState {
public static final int STATE_STARTED_PARTITION = 0x20;
/** User select a dataset in this view, but service must authenticate first. */
public static final int STATE_WAITING_DATASET_AUTH = 0x40;
- // TODO(b/37424539): temporary workaround until partitioning supports auth
- public static final int STATE_WAITING_RESPONSE_AUTH = 0x80;
+ /** Service does not care about this view. */
+ public static final int STATE_IGNORED = 0x80;
public final AutofillId id;
@@ -199,7 +200,16 @@ final class ViewState {
void dump(String prefix, PrintWriter pw) {
pw.print(prefix); pw.print("id:" ); pw.println(this.id);
pw.print(prefix); pw.print("state:" ); pw.println(getStateAsString());
- pw.print(prefix); pw.print("has response:" ); pw.println(mResponse != null);
+ pw.print(prefix); pw.print("response:");
+ if (mResponse == null) {
+ pw.println("N/A");
+ } else {
+ if (sVerbose) {
+ pw.println(mResponse);
+ } else {
+ pw.println(mResponse.getRequestId());
+ }
+ }
pw.print(prefix); pw.print("initialValue:" ); pw.println(mInitialValue);
pw.print(prefix); pw.print("currentValue:" ); pw.println(mCurrentValue);
pw.print(prefix); pw.print("autofilledValue:" ); pw.println(mAutofilledValue);
diff --git a/services/core/java/com/android/server/SystemService.java b/services/core/java/com/android/server/SystemService.java
index c105b1244e74..94397d07e1a2 100644
--- a/services/core/java/com/android/server/SystemService.java
+++ b/services/core/java/com/android/server/SystemService.java
@@ -173,6 +173,9 @@ public abstract class SystemService {
* 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 @@ public abstract class SystemService {
* 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 5edf19a9d012..e0fc531eb326 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 @@ public final class ActiveServices {
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/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 01e86e271127..d84a1c03a453 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2503,7 +2503,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
tempRect /* outStackBounds */,
otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */);
- resizeStackLocked(i, tempRect,
+ resizeStackLocked(i, !tempRect.isEmpty() ? tempRect : null,
!otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds,
tempOtherTaskInsetBounds, preserveWindows,
true /* allowResizeInDockedMode */, deferResume);
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index e2b838f74699..e9555f7870d7 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -3251,9 +3251,10 @@ public class AudioService extends IAudioService.Stub
if (deviceList.size() > 0) {
btDevice = deviceList.get(0);
int state = mA2dp.getConnectionState(btDevice);
+ int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0;
int delay = checkSendBecomingNoisyIntent(
- AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
- (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0);
+ AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, intState,
+ AudioSystem.DEVICE_NONE);
queueMsgUnderWakeLock(mAudioHandler,
MSG_SET_A2DP_SINK_CONNECTION_STATE,
state,
@@ -3381,9 +3382,8 @@ public class AudioService extends IAudioService.Stub
}
}
if (toRemove != null) {
- int delay = checkSendBecomingNoisyIntent(
- AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
- 0);
+ int delay = checkSendBecomingNoisyIntent(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
+ 0, AudioSystem.DEVICE_NONE);
for (int i = 0; i < toRemove.size(); i++) {
makeA2dpDeviceUnavailableLater(toRemove.valueAt(i), delay);
}
@@ -3919,7 +3919,7 @@ public class AudioService extends IAudioService.Stub
Slog.i(TAG, "setWiredDeviceConnectionState(" + state + " nm: " + name + " addr:"
+ address + ")");
}
- int delay = checkSendBecomingNoisyIntent(type, state);
+ int delay = checkSendBecomingNoisyIntent(type, state, AudioSystem.DEVICE_NONE);
queueMsgUnderWakeLock(mAudioHandler,
MSG_SET_WIRED_DEVICE_CONNECTION_STATE,
0 /* arg1 unused */,
@@ -3931,14 +3931,25 @@ public class AudioService extends IAudioService.Stub
public int setBluetoothA2dpDeviceConnectionState(BluetoothDevice device, int state, int profile)
{
+ if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE)) {
+ return 0;
+ }
+ return setBluetoothA2dpDeviceConnectionStateInt(
+ device, state, profile, AudioSystem.DEVICE_NONE);
+ }
+
+ public int setBluetoothA2dpDeviceConnectionStateInt(
+ BluetoothDevice device, int state, int profile, int musicDevice)
+ {
int delay;
if (profile != BluetoothProfile.A2DP && profile != BluetoothProfile.A2DP_SINK) {
throw new IllegalArgumentException("invalid profile " + profile);
}
synchronized (mConnectedDevices) {
if (profile == BluetoothProfile.A2DP) {
+ int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0;
delay = checkSendBecomingNoisyIntent(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
- (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0);
+ intState, musicDevice);
} else {
delay = 0;
}
@@ -5162,16 +5173,21 @@ public class AudioService extends IAudioService.Stub
int device = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP;
synchronized (mConnectedDevices) {
+ if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE)) {
+ return;
+ }
final String key = makeDeviceListKey(device, address);
final DeviceListSpec deviceSpec = mConnectedDevices.get(key);
if (deviceSpec != null) {
// Device is connected
+ int musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC);
if (AudioSystem.handleDeviceConfigChange(device, address,
btDevice.getName()) != AudioSystem.AUDIO_STATUS_OK) {
// force A2DP device disconnection in case of error so that AudioService state is
// consistent with audio policy manager state
- setBluetoothA2dpDeviceConnectionState(
- btDevice, BluetoothA2dp.STATE_DISCONNECTED, BluetoothProfile.A2DP_SINK);
+ setBluetoothA2dpDeviceConnectionStateInt(
+ btDevice, BluetoothA2dp.STATE_DISCONNECTED, BluetoothProfile.A2DP,
+ musicDevice);
}
}
}
@@ -5242,7 +5258,9 @@ public class AudioService extends IAudioService.Stub
// must be called before removing the device from mConnectedDevices
// Called synchronized on mConnectedDevices
- private int checkSendBecomingNoisyIntent(int device, int state) {
+ // musicDevice argument is used when not AudioSystem.DEVICE_NONE instead of querying
+ // from AudioSystem
+ private int checkSendBecomingNoisyIntent(int device, int state, int musicDevice) {
int delay = 0;
if ((state == 0) && ((device & mBecomingNoisyIntentDevices) != 0)) {
int devices = 0;
@@ -5253,8 +5271,13 @@ public class AudioService extends IAudioService.Stub
devices |= dev;
}
}
- int musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC);
- if ((device == musicDevice) && (device == devices)) {
+ if (musicDevice == AudioSystem.DEVICE_NONE) {
+ musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC);
+ }
+ // ignore condition on device being actually used for music when in communication
+ // because music routing is altered in this case.
+ if (((device == musicDevice) || isInCommunication()) && (device == devices)) {
+ mAudioHandler.removeMessages(MSG_BROADCAST_AUDIO_BECOMING_NOISY);
sendMsg(mAudioHandler,
MSG_BROADCAST_AUDIO_BECOMING_NOISY,
SENDMSG_REPLACE,
@@ -5338,6 +5361,11 @@ public class AudioService extends IAudioService.Stub
}
}
+ private static final int DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG =
+ AudioSystem.DEVICE_OUT_WIRED_HEADSET | AudioSystem.DEVICE_OUT_WIRED_HEADPHONE |
+ AudioSystem.DEVICE_OUT_LINE |
+ AudioSystem.DEVICE_OUT_ALL_USB;
+
private void onSetWiredDeviceConnectionState(int device, int state, String address,
String deviceName, String caller) {
if (DEBUG_DEVICES) {
@@ -5349,9 +5377,7 @@ public class AudioService extends IAudioService.Stub
}
synchronized (mConnectedDevices) {
- if ((state == 0) && ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) ||
- (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE) ||
- (device == AudioSystem.DEVICE_OUT_LINE))) {
+ if ((state == 0) && ((device & DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG) != 0)) {
setBluetoothA2dpOnInt(true);
}
boolean isUsb = ((device & ~AudioSystem.DEVICE_OUT_ALL_USB) == 0) ||
@@ -5362,9 +5388,7 @@ public class AudioService extends IAudioService.Stub
return;
}
if (state != 0) {
- if ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) ||
- (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE) ||
- (device == AudioSystem.DEVICE_OUT_LINE)) {
+ if ((device & DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG) != 0) {
setBluetoothA2dpOnInt(false);
}
if ((device & mSafeMediaVolumeDevices) != 0) {
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 8b8420571db4..ed47c3e55b74 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -4217,7 +4217,9 @@ public class NotificationManagerService extends SystemService {
if (wasPosted) {
// status bar
if (r.getNotification().getSmallIcon() != null) {
- r.isCanceled = true;
+ if (reason != REASON_SNOOZED) {
+ r.isCanceled = true;
+ }
mListeners.notifyRemovedLocked(r.sbn, reason);
mHandler.post(new Runnable() {
@Override
@@ -4340,9 +4342,11 @@ public class NotificationManagerService extends SystemService {
updateLightsLocked();
} else {
// No notification was found, assume that it is snoozed and cancel it.
- final boolean wasSnoozed = mSnoozeHelper.cancel(userId, pkg, tag, id);
- if (wasSnoozed) {
- savePolicyFile();
+ if (reason != REASON_SNOOZED) {
+ final boolean wasSnoozed = mSnoozeHelper.cancel(userId, pkg, tag, id);
+ if (wasSnoozed) {
+ savePolicyFile();
+ }
}
}
}
@@ -4472,7 +4476,7 @@ public class NotificationManagerService extends SystemService {
void snoozeNotificationInt(String key, long duration, String snoozeCriterionId,
ManagedServiceInfo listener) {
String listenerName = listener == null ? null : listener.component.toShortString();
- if (duration <= 0 && snoozeCriterionId == null) {
+ if (duration <= 0 && snoozeCriterionId == null || key == null) {
return;
}
diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java
index 42b4f573dfcc..a178a525cede 100644
--- a/services/core/java/com/android/server/notification/SnoozeHelper.java
+++ b/services/core/java/com/android/server/notification/SnoozeHelper.java
@@ -167,16 +167,10 @@ public class SnoozeHelper {
for (Map.Entry<String, NotificationRecord> record : records) {
final StatusBarNotification sbn = record.getValue().sbn;
if (Objects.equals(sbn.getTag(), tag) && sbn.getId() == id) {
- key = record.getKey();
+ record.getValue().isCanceled = true;
+ return true;
}
}
- if (key != null) {
- recordsForPkg.remove(key);
- cancelAlarm(userId, pkg, key);
- mPackages.remove(key);
- mUsers.remove(key);
- return true;
- }
}
}
return false;
@@ -190,7 +184,7 @@ public class SnoozeHelper {
final int N = userIds.length;
for (int i = 0; i < N; i++) {
final ArrayMap<String, ArrayMap<String, NotificationRecord>> snoozedPkgs =
- mSnoozedNotifications.remove(userIds[i]);
+ mSnoozedNotifications.get(userIds[i]);
if (snoozedPkgs != null) {
final int M = snoozedPkgs.size();
for (int j = 0; j < M; j++) {
@@ -198,10 +192,7 @@ public class SnoozeHelper {
if (records != null) {
int P = records.size();
for (int k = 0; k < P; k++) {
- final String key = records.keyAt(k);
- cancelAlarm(userId, snoozedPkgs.keyAt(j), key);
- mPackages.remove(key);
- mUsers.remove(key);
+ records.valueAt(k).isCanceled = true;
}
}
}
@@ -215,13 +206,10 @@ public class SnoozeHelper {
if (mSnoozedNotifications.containsKey(userId)) {
if (mSnoozedNotifications.get(userId).containsKey(pkg)) {
ArrayMap<String, NotificationRecord> records =
- mSnoozedNotifications.get(userId).remove(pkg);
+ mSnoozedNotifications.get(userId).get(pkg);
int N = records.size();
for (int i = 0; i < N; i++) {
- final String key = records.keyAt(i);
- cancelAlarm(userId, pkg, key);
- mPackages.remove(key);
- mUsers.remove(key);
+ records.valueAt(i).isCanceled = true;
}
return true;
}
@@ -229,16 +217,6 @@ public class SnoozeHelper {
return false;
}
- private void cancelAlarm(int userId, String pkg, String key) {
- long identity = Binder.clearCallingIdentity();
- try {
- final PendingIntent pi = createPendingIntent(pkg, key, userId);
- mAm.cancel(pi);
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
- }
-
/**
* Updates the notification record so the most up to date information is shown on re-post.
*/
@@ -252,6 +230,10 @@ public class SnoozeHelper {
if (pkgRecords == null) {
return;
}
+ NotificationRecord existing = pkgRecords.get(record.getKey());
+ if (existing != null && existing.isCanceled) {
+ return;
+ }
pkgRecords.put(record.getKey(), record);
}
@@ -274,8 +256,10 @@ public class SnoozeHelper {
return;
}
final NotificationRecord record = pkgRecords.remove(key);
+ mPackages.remove(key);
+ mUsers.remove(key);
- if (record != null) {
+ if (record != null && !record.isCanceled) {
MetricsLogger.action(record.getLogMaker()
.setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED)
.setType(MetricsProto.MetricsEvent.TYPE_OPEN));
@@ -309,10 +293,12 @@ public class SnoozeHelper {
mPackages.remove(groupSummaryKey);
mUsers.remove(groupSummaryKey);
- MetricsLogger.action(record.getLogMaker()
- .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED)
- .setType(MetricsProto.MetricsEvent.TYPE_OPEN));
- mCallback.repost(userId, record);
+ if (record != null && !record.isCanceled) {
+ MetricsLogger.action(record.getLogMaker()
+ .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED)
+ .setType(MetricsProto.MetricsEvent.TYPE_OPEN));
+ mCallback.repost(userId, record);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/pm/InstructionSets.java b/services/core/java/com/android/server/pm/InstructionSets.java
index 5092ebf9d4b9..f326f1d20c46 100644
--- a/services/core/java/com/android/server/pm/InstructionSets.java
+++ b/services/core/java/com/android/server/pm/InstructionSets.java
@@ -34,7 +34,7 @@ import dalvik.system.VMRuntime;
*/
public class InstructionSets {
private static final String PREFERRED_INSTRUCTION_SET =
- VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]);;
+ VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]);
public static String[] getAppDexInstructionSets(ApplicationInfo info) {
if (info.primaryCpuAbi != null) {
if (info.secondaryCpuAbi != null) {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index e21a2b9aa412..03f6aaa21293 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -127,6 +127,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.AppsQueryHelper;
import android.content.pm.ChangedPackages;
import android.content.pm.ComponentInfo;
+import android.content.pm.IDexModuleRegisterCallback;
import android.content.pm.InstantAppRequest;
import android.content.pm.AuxiliaryResolveInfo;
import android.content.pm.FallbackCategoryProvider;
@@ -4360,8 +4361,7 @@ public class PackageManagerService extends IPackageManager.Stub
}
SharedLibraryInfo resLibInfo = new SharedLibraryInfo(libInfo.getName(),
- // TODO: Remove cast for lib version once internally we support longs.
- (int) libInfo.getVersion(), libInfo.getType(),
+ libInfo.getVersion(), libInfo.getType(),
libInfo.getDeclaringPackage(), getPackagesUsingSharedLibraryLPr(libInfo,
flags, userId));
@@ -6509,7 +6509,7 @@ public class PackageManagerService extends IPackageManager.Stub
ephemeralInstaller.filter = new IntentFilter(intent.getAction());
ephemeralInstaller.filter.addDataPath(
intent.getData().getPath(), PatternMatcher.PATTERN_LITERAL);
- ephemeralInstaller.instantAppAvailable = true;
+ ephemeralInstaller.isInstantAppAvailable = true;
result.add(ephemeralInstaller);
}
}
@@ -8729,6 +8729,31 @@ public class PackageManagerService extends IPackageManager.Stub
}
@Override
+ public void registerDexModule(String packageName, String dexModulePath, boolean isSharedModule,
+ IDexModuleRegisterCallback callback) {
+ int userId = UserHandle.getCallingUserId();
+ ApplicationInfo ai = getApplicationInfo(packageName, /*flags*/ 0, userId);
+ DexManager.RegisterDexModuleResult result;
+ if (ai == null) {
+ Slog.w(TAG, "Registering a dex module for a package that does not exist for the" +
+ " calling user. package=" + packageName + ", user=" + userId);
+ result = new DexManager.RegisterDexModuleResult(false, "Package not installed");
+ } else {
+ result = mDexManager.registerDexModule(ai, dexModulePath, isSharedModule, userId);
+ }
+
+ if (callback != null) {
+ mHandler.post(() -> {
+ try {
+ callback.onDexModuleRegistered(dexModulePath, result.success, result.message);
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Failed to callback after module registration " + dexModulePath, e);
+ }
+ });
+ }
+ }
+
+ @Override
public boolean performDexOpt(String packageName,
boolean checkProfiles, int compileReason, boolean force) {
int dexOptStatus = performDexOptTraced(packageName, checkProfiles,
@@ -12611,7 +12636,7 @@ public class PackageManagerService extends IPackageManager.Stub
}
res.iconResourceId = info.icon;
res.system = res.activityInfo.applicationInfo.isSystemApp();
- res.instantAppAvailable = userState.instantApp;
+ res.isInstantAppAvailable = userState.instantApp;
return res;
}
@@ -17750,8 +17775,7 @@ public class PackageManagerService extends IPackageManager.Stub
for (int i = 0; i < versionCount; i++) {
SharedLibraryEntry libEntry = versionedLib.valueAt(i);
if (versionsCallerCanSee != null && versionsCallerCanSee.indexOfKey(
- // TODO: Remove cast for lib version once internally we support longs.
- (int) libEntry.info.getVersion()) < 0) {
+ libEntry.info.getVersion()) < 0) {
continue;
}
// TODO: We will change version code to long, so in the new API it is long
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index 7c89e1ccb7c8..bed8f1a78649 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 @@ public class ShortcutService extends IShortcutService.Stub {
}
@Override
- public void onCleanupUser(int userHandle) {
- mService.handleCleanupUser(userHandle);
+ public void onStopUser(int userHandle) {
+ mService.handleStopUser(userHandle);
}
@Override
@@ -606,9 +606,9 @@ public class ShortcutService extends IShortcutService.Stub {
}
/** 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 @@ public class ShortcutService extends IShortcutService.Stub {
Slog.i(TAG, "cmd: handleUnloadUser: user=" + mUserId);
- ShortcutService.this.handleCleanupUser(mUserId);
+ ShortcutService.this.handleStopUser(mUserId);
}
}
diff --git a/services/core/java/com/android/server/pm/dex/DexManager.java b/services/core/java/com/android/server/pm/dex/DexManager.java
index 3d7cedce522a..4a8232da2b35 100644
--- a/services/core/java/com/android/server/pm/dex/DexManager.java
+++ b/services/core/java/com/android/server/pm/dex/DexManager.java
@@ -30,6 +30,7 @@ import com.android.internal.annotations.GuardedBy;
import com.android.server.pm.Installer;
import com.android.server.pm.Installer.InstallerException;
import com.android.server.pm.PackageDexOptimizer;
+import com.android.server.pm.PackageManagerService;
import com.android.server.pm.PackageManagerServiceUtils;
import com.android.server.pm.PackageManagerServiceCompilerMapping;
@@ -41,6 +42,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import static com.android.server.pm.InstructionSets.getAppDexInstructionSets;
import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo;
import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo;
@@ -431,6 +433,52 @@ public class DexManager {
}
}
+ public RegisterDexModuleResult registerDexModule(ApplicationInfo info, String dexPath,
+ boolean isUsedByOtherApps, int userId) {
+ // Find the owning package record.
+ DexSearchResult searchResult = getDexPackage(info, dexPath, userId);
+
+ if (searchResult.mOutcome == DEX_SEARCH_NOT_FOUND) {
+ return new RegisterDexModuleResult(false, "Package not found");
+ }
+ if (!info.packageName.equals(searchResult.mOwningPackageName)) {
+ return new RegisterDexModuleResult(false, "Dex path does not belong to package");
+ }
+ if (searchResult.mOutcome == DEX_SEARCH_FOUND_PRIMARY ||
+ searchResult.mOutcome == DEX_SEARCH_FOUND_SPLIT) {
+ return new RegisterDexModuleResult(false, "Main apks cannot be registered");
+ }
+
+ // We found the package. Now record the usage for all declared ISAs.
+ boolean update = false;
+ Set<String> isas = new HashSet<>();
+ for (String isa : getAppDexInstructionSets(info)) {
+ isas.add(isa);
+ boolean newUpdate = mPackageDexUsage.record(searchResult.mOwningPackageName,
+ dexPath, userId, isa, isUsedByOtherApps, /*primaryOrSplit*/ false);
+ update |= newUpdate;
+ }
+ if (update) {
+ mPackageDexUsage.maybeWriteAsync();
+ }
+
+ // Try to optimize the package according to the install reason.
+ String compilerFilter = PackageManagerServiceCompilerMapping.getCompilerFilterForReason(
+ PackageManagerService.REASON_INSTALL);
+ int result = mPackageDexOptimizer.dexOptSecondaryDexPath(info, dexPath, isas,
+ compilerFilter, isUsedByOtherApps);
+
+ // If we fail to optimize the package log an error but don't propagate the error
+ // back to the app. The app cannot do much about it and the background job
+ // will rety again when it executes.
+ // TODO(calin): there might be some value to return the error here but it may
+ // cause red herrings since that doesn't mean the app cannot use the module.
+ if (result != PackageDexOptimizer.DEX_OPT_FAILED) {
+ Slog.e(TAG, "Failed to optimize dex module " + dexPath);
+ }
+ return new RegisterDexModuleResult(true, "Dex module registered successfully");
+ }
+
/**
* Return all packages that contain records of secondary dex files.
*/
@@ -510,6 +558,20 @@ public class DexManager {
return existingValue == null ? newValue : existingValue;
}
+ public static class RegisterDexModuleResult {
+ public RegisterDexModuleResult() {
+ this(false, null);
+ }
+
+ public RegisterDexModuleResult(boolean success, String message) {
+ this.success = success;
+ this.message = message;
+ }
+
+ public final boolean success;
+ public final String message;
+ }
+
/**
* Convenience class to store the different locations where a package might
* own code.
@@ -589,6 +651,4 @@ public class DexManager {
return mOwningPackageName + "-" + mOutcome;
}
}
-
-
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 61ed72d990ca..8c3d80f18581 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.IVrManager;
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.am.BatteryStatsService;
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 @@ public final class PowerManagerService extends SystemService
// 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 @@ public final class PowerManagerService extends SystemService
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 @@ public final class PowerManagerService extends SystemService
}
/**
+ * 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 @@ public final class PowerManagerService extends SystemService
}
}
+ @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/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 2236b597ac5e..a6b95d635ba7 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1132,7 +1132,10 @@ class WindowStateAnimator {
// Task is non-null per shouldCropToStackBounds
final TaskStack stack = w.getTask().mStack;
stack.getDimBounds(finalClipRect);
- w.expandForSurfaceInsets(finalClipRect);
+
+ if (StackId.tasksAreFloating(stack.mStackId)) {
+ w.expandForSurfaceInsets(finalClipRect);
+ }
return true;
}
diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp
index 4a08ce4aebb7..96c2d7e38232 100644
--- a/services/core/jni/com_android_server_SystemServer.cpp
+++ b/services/core/jni/com_android_server_SystemServer.cpp
@@ -48,7 +48,7 @@ static void android_server_SystemServer_startHidlServices(JNIEnv* /* env */, job
status_t err;
- configureRpcThreadpool(1, false /* callerWillJoin */);
+ configureRpcThreadpool(5, false /* callerWillJoin */);
sp<ISensorManager> sensorService = new SensorManager();
err = sensorService->registerAsService();
diff --git a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
index 51ec05c51b07..bc25860e8e92 100644
--- a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
+++ b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java
@@ -107,9 +107,9 @@ public class SnoozeHelperTest {
UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey()));
mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1);
- // 3 = one for each snooze, above + one for cancel itself.
- verify(mAm, times(3)).cancel(any(PendingIntent.class));
- assertFalse(mSnoozeHelper.isSnoozed(
+ // 2 = one for each snooze, above, zero for the cancel.
+ verify(mAm, times(2)).cancel(any(PendingIntent.class));
+ assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey()));
@@ -131,11 +131,11 @@ public class SnoozeHelperTest {
UserHandle.USER_ALL, r3.sbn.getPackageName(), r3.getKey()));
mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, false);
- // 5 = once for each snooze above (3) + once for each notification canceled (2).
- verify(mAm, times(5)).cancel(any(PendingIntent.class));
- assertFalse(mSnoozeHelper.isSnoozed(
+ // 3 = once for each snooze above (3), only.
+ verify(mAm, times(3)).cancel(any(PendingIntent.class));
+ assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
- assertFalse(mSnoozeHelper.isSnoozed(
+ assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey()));
assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_ALL, r3.sbn.getPackageName(), r3.getKey()));
@@ -157,17 +157,47 @@ public class SnoozeHelperTest {
UserHandle.USER_SYSTEM, r3.sbn.getPackageName(), r3.getKey()));
mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, "pkg2");
- // 4 = once for each snooze above (3) + once for each notification canceled (1).
- verify(mAm, times(4)).cancel(any(PendingIntent.class));
+ // 3 = once for each snooze above (3), only.
+ verify(mAm, times(3)).cancel(any(PendingIntent.class));
assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey()));
- assertFalse(mSnoozeHelper.isSnoozed(
+ assertTrue(mSnoozeHelper.isSnoozed(
UserHandle.USER_SYSTEM, r3.sbn.getPackageName(), r3.getKey()));
}
@Test
+ public void testCancelDoesNotUnsnooze() throws Exception {
+ NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM);
+ mSnoozeHelper.snooze(r, 1000);
+ assertTrue(mSnoozeHelper.isSnoozed(
+ UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
+
+ mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1);
+
+ assertTrue(mSnoozeHelper.isSnoozed(
+ UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
+ }
+
+ @Test
+ public void testCancelDoesNotRepost() throws Exception {
+ NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM);
+ NotificationRecord r2 = getNotificationRecord("pkg", 2, "two", UserHandle.SYSTEM);
+ mSnoozeHelper.snooze(r, 1000);
+ mSnoozeHelper.snooze(r2 , 1000);
+ assertTrue(mSnoozeHelper.isSnoozed(
+ UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey()));
+ assertTrue(mSnoozeHelper.isSnoozed(
+ UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey()));
+
+ mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1);
+
+ mSnoozeHelper.repost(r.getKey(), UserHandle.USER_SYSTEM);
+ verify(mCallback, never()).repost(UserHandle.USER_SYSTEM, r);
+ }
+
+ @Test
public void testRepost() throws Exception {
NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM);
mSnoozeHelper.snooze(r, 1000);
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 cd39d8875692..4c7bf4df0143 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 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest {
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 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest {
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 9880caa11f85..2b40c511ef14 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 @@ public class ShortcutManagerTest2 extends BaseShortcutManagerTest {
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 967b0a44e086..d12c07a84004 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 @@ public class PowerManagerServiceTest extends AndroidTestCase {
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 @@ public class PowerManagerServiceTest extends AndroidTestCase {
.thenReturn(mPowerSaveState);
mDisplayPowerRequest = new DisplayPowerRequest();
mService = new PowerManagerService(getContext(), mBatterySaverPolicy);
+ temporaryFolder.create();
+ mTempReason = temporaryFolder.newFile(LAST_REBOOT_REASON);
}
@SmallTest
@@ -63,4 +79,17 @@ public class PowerManagerServiceTest extends AndroidTestCase {
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/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 3b4fd04f2442..84a2e8b5d266 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -424,6 +424,8 @@ public class UsbDeviceManager {
private boolean mSinkPower;
private boolean mConfigured;
private boolean mUsbDataUnlocked;
+ private boolean mAudioAccessoryConnected;
+ private boolean mAudioAccessorySupported;
private String mCurrentFunctions;
private boolean mCurrentFunctionsApplied;
private UsbAccessory mCurrentAccessory;
@@ -534,30 +536,13 @@ public class UsbDeviceManager {
}
public void updateHostState(UsbPort port, UsbPortStatus status) {
- boolean hostConnected = status.getCurrentDataRole() == UsbPort.DATA_ROLE_HOST;
- boolean sourcePower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE;
- boolean sinkPower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SINK;
- // Ideally we want to see if PR_SWAP and DR_SWAP is supported.
- // But, this should be suffice, since, all four combinations are only supported
- // when PR_SWAP and DR_SWAP are supported.
- boolean supportsAllCombinations = status.isRoleCombinationSupported(
- UsbPort.POWER_ROLE_SOURCE, UsbPort.DATA_ROLE_HOST)
- && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK,
- UsbPort.DATA_ROLE_HOST)
- && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SOURCE,
- UsbPort.DATA_ROLE_DEVICE)
- && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK,
- UsbPort.DATA_ROLE_HOST);
-
if (DEBUG) {
Slog.i(TAG, "updateHostState " + port + " status=" + status);
}
SomeArgs args = SomeArgs.obtain();
- args.argi1 = hostConnected ? 1 : 0;
- args.argi2 = sourcePower ? 1 : 0;
- args.argi3 = sinkPower ? 1 : 0;
- args.argi4 = supportsAllCombinations ? 1 : 0;
+ args.arg1 = port;
+ args.arg2 = status;
removeMessages(MSG_UPDATE_PORT_STATE);
Message msg = obtainMessage(MSG_UPDATE_PORT_STATE, args);
@@ -931,10 +916,26 @@ public class UsbDeviceManager {
case MSG_UPDATE_PORT_STATE:
SomeArgs args = (SomeArgs) msg.obj;
boolean prevHostConnected = mHostConnected;
- mHostConnected = (args.argi1 == 1);
- mSourcePower = (args.argi2 == 1);
- mSinkPower = (args.argi3 == 1);
- mSupportsAllCombinations = (args.argi4 == 1);
+ UsbPort port = (UsbPort) args.arg1;
+ UsbPortStatus status = (UsbPortStatus) args.arg2;
+ mHostConnected = status.getCurrentDataRole() == UsbPort.DATA_ROLE_HOST;
+ mSourcePower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE;
+ mSinkPower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SINK;
+ mAudioAccessoryConnected =
+ (status.getCurrentMode() == UsbPort.MODE_AUDIO_ACCESSORY);
+ mAudioAccessorySupported = port.isModeSupported(UsbPort.MODE_AUDIO_ACCESSORY);
+ // Ideally we want to see if PR_SWAP and DR_SWAP is supported.
+ // But, this should be suffice, since, all four combinations are only supported
+ // when PR_SWAP and DR_SWAP are supported.
+ mSupportsAllCombinations = status.isRoleCombinationSupported(
+ UsbPort.POWER_ROLE_SOURCE, UsbPort.DATA_ROLE_HOST)
+ && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK,
+ UsbPort.DATA_ROLE_HOST)
+ && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SOURCE,
+ UsbPort.DATA_ROLE_DEVICE)
+ && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK,
+ UsbPort.DATA_ROLE_HOST);
+
args.recycle();
updateUsbNotification(false);
if (mBootCompleted) {
@@ -1076,7 +1077,10 @@ public class UsbDeviceManager {
int id = 0;
int titleRes = 0;
Resources r = mContext.getResources();
- if (mConnected) {
+ if (mAudioAccessoryConnected && !mAudioAccessorySupported) {
+ titleRes = com.android.internal.R.string.usb_unsupported_audio_accessory_title;
+ id = SystemMessage.NOTE_USB_AUDIO_ACCESSORY_NOT_SUPPORTED;
+ } else if (mConnected) {
if (!mUsbDataUnlocked) {
if (mSourcePower) {
titleRes = com.android.internal.R.string.usb_supplying_notification_title;
@@ -1123,18 +1127,43 @@ public class UsbDeviceManager {
mUsbNotificationId = 0;
}
if (id != 0) {
- CharSequence message = r.getText(
- com.android.internal.R.string.usb_notification_message);
+ CharSequence message;
CharSequence title = r.getText(titleRes);
+ PendingIntent pi;
+ String channel;
+
+ if (titleRes
+ != com.android.internal.R.string
+ .usb_unsupported_audio_accessory_title) {
+ Intent intent = Intent.makeRestartActivityTask(
+ new ComponentName("com.android.settings",
+ "com.android.settings.deviceinfo.UsbModeChooserActivity"));
+ pi = PendingIntent.getActivityAsUser(mContext, 0,
+ intent, 0, null, UserHandle.CURRENT);
+ channel = SystemNotificationChannels.USB;
+ message = r.getText(
+ com.android.internal.R.string.usb_notification_message);
+ } else {
+ final Intent intent = new Intent();
+ intent.setClassName("com.android.settings",
+ "com.android.settings.HelpTrampoline");
+ intent.putExtra(Intent.EXTRA_TEXT,
+ "help_url_audio_accessory_not_supported");
+
+ if (mContext.getPackageManager().resolveActivity(intent, 0) != null) {
+ pi = PendingIntent.getActivity(mContext, 0, intent, 0);
+ } else {
+ pi = null;
+ }
- Intent intent = Intent.makeRestartActivityTask(
- new ComponentName("com.android.settings",
- "com.android.settings.deviceinfo.UsbModeChooserActivity"));
- PendingIntent pi = PendingIntent.getActivityAsUser(mContext, 0,
- intent, 0, null, UserHandle.CURRENT);
+ channel = SystemNotificationChannels.ALERTS;
+ message = r.getText(
+ com.android.internal.R.string
+ .usb_unsupported_audio_accessory_message);
+ }
Notification notification =
- new Notification.Builder(mContext, SystemNotificationChannels.USB)
+ new Notification.Builder(mContext, channel)
.setSmallIcon(com.android.internal.R.drawable.stat_sys_adb)
.setWhen(0)
.setOngoing(true)
@@ -1148,6 +1177,7 @@ public class UsbDeviceManager {
.setContentIntent(pi)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.build();
+
mNotificationManager.notifyAsUser(null, id, notification,
UserHandle.ALL);
mUsbNotificationId = id;
@@ -1230,6 +1260,8 @@ public class UsbDeviceManager {
pw.println(" mSinkPower: " + mSinkPower);
pw.println(" mUsbCharging: " + mUsbCharging);
pw.println(" mHideUsbNotification: " + mHideUsbNotification);
+ pw.println(" mAudioAccessoryConnected: " + mAudioAccessoryConnected);
+
try {
pw.println(" Kernel state: "
+ FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim());
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 81f660047c6b..7f616ad6fb08 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -342,6 +342,32 @@ public class SubscriptionManager {
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 class SubscriptionManager {
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 cf8d6903187b..32d3f2705d27 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -18,6 +18,7 @@ package com.android.internal.telephony;
import android.content.Intent;
import android.content.Intent;
+import android.telephony.SubscriptionManager;
/**
* The intents that the telephony services broadcast.
@@ -336,11 +337,11 @@ public class TelephonyIntents {
* <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
@@ -368,11 +369,11 @@ public class TelephonyIntents {
* <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/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 2d3d79a03446..9a03c53d95cc 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -17,6 +17,7 @@
package android.test.mock;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.PackageInstallObserver;
import android.content.ComponentName;
import android.content.Intent;
@@ -1159,4 +1160,13 @@ public class MockPackageManager extends PackageManager {
public String getInstantAppAndroidId(String packageName, UserHandle user) {
throw new UnsupportedOperationException();
}
+
+ /**
+ * @hide
+ */
+ @Override
+ public void registerDexModule(String dexModulePath,
+ @Nullable DexModuleRegisterCallback callback) {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
index 93677e35dc4f..5dd42dd21c90 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
@@ -385,6 +385,23 @@ public class NotificationTestList extends TestActivity
mNM.notify("timeout_min", 7013, n);
}
},
+ new Test("Too many cancels") {
+ public void run()
+ {
+ mNM.cancelAll();
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ Notification n = new Notification.Builder(NotificationTestList.this, "default")
+ .setSmallIcon(R.drawable.icon2)
+ .setContentTitle("Cancel then post")
+ .setContentText("instead of just updating the existing notification")
+ .build();
+ mNM.notify("cancel_madness", 7014, n);
+ }
+ },
new Test("Off") {
public void run() {
PowerManager pm = (PowerManager) NotificationTestList.this.getSystemService(
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java
index 764eeebaef6a..47dad3404beb 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java
@@ -949,4 +949,10 @@ public class BridgePackageManager extends PackageManager {
public String getInstantAppAndroidId(String packageName, UserHandle user) {
return null;
}
+
+ @Override
+ public void registerDexModule(String dexModulePath,
+ @Nullable DexModuleRegisterCallback callback) {
+ callback.onDexModuleRegistered(dexModulePath, false, null);
+ }
}
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 339019d2ab16..ed428ec9cfe8 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 @@ package com.android.layoutlib.bridge.android;
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 class BridgePowerManager implements IPowerManager {
public boolean isScreenBrightnessBoosted() throws RemoteException {
return false;
}
+
+ @Override
+ public int getLastShutdownReason() {
+ return PowerManager.SHUTDOWN_REASON_UNKNOWN;
+ }
}
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index faae90bec86f..d942d056a316 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -131,7 +131,7 @@ interface IWifiManager
boolean stopSoftAp();
- WifiConfiguration startLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
+ int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
void stopLocalOnlyHotspot();
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 8fbf4721a20e..e59b74f0bf60 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -478,7 +478,6 @@ public class WifiManager {
*/
public static final int IFACE_IP_MODE_LOCAL_ONLY = 2;
-
/**
* Broadcast intent action indicating that a connection to the supplicant has
* been established (and it is now possible
@@ -1850,8 +1849,9 @@ public class WifiManager {
* Tethering to provide an upstream to another device, LocalOnlyHotspot will not start due to
* an incompatible mode. The possible error codes include:
* {@link LocalOnlyHotspotCallback#ERROR_NO_CHANNEL},
- * {@link LocalOnlyHotspotCallback#ERROR_GENERIC} and
- * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE}.
+ * {@link LocalOnlyHotspotCallback#ERROR_GENERIC},
+ * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE} and
+ * {@link LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED}.
* <p>
* Internally, requests will be tracked to prevent the hotspot from being torn down while apps
* are still using it. The {@link LocalOnlyHotspotReservation} object passed in the {@link
@@ -1882,8 +1882,6 @@ public class WifiManager {
* operating status.
* @param handler Handler to be used for callbacks. If the caller passes a null Handler, the
* main thread will be used.
- *
- * @hide
*/
public void startLocalOnlyHotspot(LocalOnlyHotspotCallback callback,
@Nullable Handler handler) {
@@ -1892,12 +1890,10 @@ public class WifiManager {
LocalOnlyHotspotCallbackProxy proxy =
new LocalOnlyHotspotCallbackProxy(this, looper, callback);
try {
- WifiConfiguration config = mService.startLocalOnlyHotspot(
- proxy.getMessenger(), new Binder());
- if (config == null) {
+ int returnCode = mService.startLocalOnlyHotspot(proxy.getMessenger(), new Binder());
+ if (returnCode != LocalOnlyHotspotCallback.REQUEST_REGISTERED) {
// Send message to the proxy to make sure we call back on the correct thread
- proxy.notifyFailed(
- LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE);
+ proxy.notifyFailed(returnCode);
return;
}
mLOHSCallbackProxy = proxy;
@@ -2274,8 +2270,6 @@ public class WifiManager {
* any further callbacks. If the LocalOnlyHotspot is stopped due to a
* user triggered mode change, applications will be notified via the {@link
* LocalOnlyHotspotCallback#onStopped()} callback.
- *
- * @hide
*/
public class LocalOnlyHotspotReservation implements AutoCloseable {
@@ -2289,7 +2283,7 @@ public class WifiManager {
mCloseGuard.open("close");
}
- public WifiConfiguration getConfig() {
+ public WifiConfiguration getWifiConfiguration() {
return mConfig;
}
@@ -2318,13 +2312,15 @@ public class WifiManager {
/**
* Callback class for applications to receive updates about the LocalOnlyHotspot status.
- *
- * @hide
*/
public static class LocalOnlyHotspotCallback {
+ /** @hide */
+ public static final int REQUEST_REGISTERED = 0;
+
public static final int ERROR_NO_CHANNEL = 1;
public static final int ERROR_GENERIC = 2;
public static final int ERROR_INCOMPATIBLE_MODE = 3;
+ public static final int ERROR_TETHERING_DISALLOWED = 4;
/** LocalOnlyHotspot start succeeded. */
public void onStarted(LocalOnlyHotspotReservation reservation) {};
@@ -2345,7 +2341,8 @@ public class WifiManager {
* {@link WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)} again at
* a later time.
* <p>
- * @param reason The reason for failure could be one of: {@link #ERROR_INCOMPATIBLE_MODE},
+ * @param reason The reason for failure could be one of: {@link
+ * #ERROR_TETHERING_DISALLOWED}, {@link #ERROR_INCOMPATIBLE_MODE},
* {@link #ERROR_NO_CHANNEL}, or {@link #ERROR_GENERIC}.
*/
public void onFailed(int reason) { };
diff --git a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java
index 333a4f7dc3ce..1dbaa80ade72 100644
--- a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java
+++ b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java
@@ -144,12 +144,12 @@ public final class PasspointConfiguration implements Parcelable {
*
* Use Long.MIN_VALUE to indicate unset value.
*/
- private long mSubscriptionCreationTimeInMs = Long.MIN_VALUE;
- public void setSubscriptionCreationTimeInMs(long subscriptionCreationTimeInMs) {
- mSubscriptionCreationTimeInMs = subscriptionCreationTimeInMs;
+ private long mSubscriptionCreationTimeInMillis = Long.MIN_VALUE;
+ public void setSubscriptionCreationTimeInMillis(long subscriptionCreationTimeInMillis) {
+ mSubscriptionCreationTimeInMillis = subscriptionCreationTimeInMillis;
}
- public long getSubscriptionCreationTimeInMs() {
- return mSubscriptionCreationTimeInMs;
+ public long getSubscriptionCreationTimeInMillis() {
+ return mSubscriptionCreationTimeInMillis;
}
/**
@@ -158,12 +158,12 @@ public final class PasspointConfiguration implements Parcelable {
*
* Use Long.MIN_VALUE to indicate unset value.
*/
- private long mSubscriptionExpirationTimeInMs = Long.MIN_VALUE;
- public void setSubscriptionExpirationTimeInMs(long subscriptionExpirationTimeInMs) {
- mSubscriptionExpirationTimeInMs = subscriptionExpirationTimeInMs;
+ private long mSubscriptionExpirationTimeInMillis = Long.MIN_VALUE;
+ public void setSubscriptionExpirationTimeInMillis(long subscriptionExpirationTimeInMillis) {
+ mSubscriptionExpirationTimeInMillis = subscriptionExpirationTimeInMillis;
}
- public long getSubscriptionExpirationTimeInMs() {
- return mSubscriptionExpirationTimeInMs;
+ public long getSubscriptionExpirationTimeInMillis() {
+ return mSubscriptionExpirationTimeInMillis;
}
/**
@@ -197,12 +197,12 @@ public final class PasspointConfiguration implements Parcelable {
*
* Use Long.MIN_VALUE to indicate unset value.
*/
- private long mUsageLimitStartTimeInMs = Long.MIN_VALUE;
- public void setUsageLimitStartTimeInMs(long usageLimitStartTimeInMs) {
- mUsageLimitStartTimeInMs = usageLimitStartTimeInMs;
+ private long mUsageLimitStartTimeInMillis = Long.MIN_VALUE;
+ public void setUsageLimitStartTimeInMillis(long usageLimitStartTimeInMillis) {
+ mUsageLimitStartTimeInMillis = usageLimitStartTimeInMillis;
}
- public long getUsageLimitStartTimeInMs() {
- return mUsageLimitStartTimeInMs;
+ public long getUsageLimitStartTimeInMillis() {
+ return mUsageLimitStartTimeInMillis;
}
/**
@@ -263,11 +263,11 @@ public final class PasspointConfiguration implements Parcelable {
}
mUpdateIdentifier = source.mUpdateIdentifier;
mCredentialPriority = source.mCredentialPriority;
- mSubscriptionCreationTimeInMs = source.mSubscriptionCreationTimeInMs;
- mSubscriptionExpirationTimeInMs = source.mSubscriptionExpirationTimeInMs;
+ mSubscriptionCreationTimeInMillis = source.mSubscriptionCreationTimeInMillis;
+ mSubscriptionExpirationTimeInMillis = source.mSubscriptionExpirationTimeInMillis;
mSubscriptionType = source.mSubscriptionType;
mUsageLimitDataLimit = source.mUsageLimitDataLimit;
- mUsageLimitStartTimeInMs = source.mUsageLimitStartTimeInMs;
+ mUsageLimitStartTimeInMillis = source.mUsageLimitStartTimeInMillis;
mUsageLimitTimeLimitInMinutes = source.mUsageLimitTimeLimitInMinutes;
mUsageLimitUsageTimePeriodInMinutes = source.mUsageLimitUsageTimePeriodInMinutes;
}
@@ -286,11 +286,11 @@ public final class PasspointConfiguration implements Parcelable {
writeTrustRootCerts(dest, mTrustRootCertList);
dest.writeInt(mUpdateIdentifier);
dest.writeInt(mCredentialPriority);
- dest.writeLong(mSubscriptionCreationTimeInMs);
- dest.writeLong(mSubscriptionExpirationTimeInMs);
+ dest.writeLong(mSubscriptionCreationTimeInMillis);
+ dest.writeLong(mSubscriptionExpirationTimeInMillis);
dest.writeString(mSubscriptionType);
dest.writeLong(mUsageLimitUsageTimePeriodInMinutes);
- dest.writeLong(mUsageLimitStartTimeInMs);
+ dest.writeLong(mUsageLimitStartTimeInMillis);
dest.writeLong(mUsageLimitDataLimit);
dest.writeLong(mUsageLimitTimeLimitInMinutes);
}
@@ -313,11 +313,11 @@ public final class PasspointConfiguration implements Parcelable {
&& isTrustRootCertListEquals(mTrustRootCertList, that.mTrustRootCertList)
&& mUpdateIdentifier == that.mUpdateIdentifier
&& mCredentialPriority == that.mCredentialPriority
- && mSubscriptionCreationTimeInMs == that.mSubscriptionCreationTimeInMs
- && mSubscriptionExpirationTimeInMs == that.mSubscriptionExpirationTimeInMs
+ && mSubscriptionCreationTimeInMillis == that.mSubscriptionCreationTimeInMillis
+ && mSubscriptionExpirationTimeInMillis == that.mSubscriptionExpirationTimeInMillis
&& TextUtils.equals(mSubscriptionType, that.mSubscriptionType)
&& mUsageLimitUsageTimePeriodInMinutes == that.mUsageLimitUsageTimePeriodInMinutes
- && mUsageLimitStartTimeInMs == that.mUsageLimitStartTimeInMs
+ && mUsageLimitStartTimeInMillis == that.mUsageLimitStartTimeInMillis
&& mUsageLimitDataLimit == that.mUsageLimitDataLimit
&& mUsageLimitTimeLimitInMinutes == that.mUsageLimitTimeLimitInMinutes;
}
@@ -325,9 +325,9 @@ public final class PasspointConfiguration implements Parcelable {
@Override
public int hashCode() {
return Objects.hash(mHomeSp, mCredential, mPolicy, mSubscriptionUpdate, mTrustRootCertList,
- mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMs,
- mSubscriptionExpirationTimeInMs, mUsageLimitUsageTimePeriodInMinutes,
- mUsageLimitStartTimeInMs, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes);
+ mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMillis,
+ mSubscriptionExpirationTimeInMillis, mUsageLimitUsageTimePeriodInMinutes,
+ mUsageLimitStartTimeInMillis, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes);
}
@Override
@@ -336,13 +336,13 @@ public final class PasspointConfiguration implements Parcelable {
builder.append("UpdateIdentifier: ").append(mUpdateIdentifier).append("\n");
builder.append("CredentialPriority: ").append(mCredentialPriority).append("\n");
builder.append("SubscriptionCreationTime: ").append(
- mSubscriptionCreationTimeInMs != Long.MIN_VALUE
- ? new Date(mSubscriptionCreationTimeInMs) : "Not specified").append("\n");
+ mSubscriptionCreationTimeInMillis != Long.MIN_VALUE
+ ? new Date(mSubscriptionCreationTimeInMillis) : "Not specified").append("\n");
builder.append("SubscriptionExpirationTime: ").append(
- mSubscriptionExpirationTimeInMs != Long.MIN_VALUE
- ? new Date(mSubscriptionExpirationTimeInMs) : "Not specified").append("\n");
- builder.append("UsageLimitStartTime: ").append(mUsageLimitStartTimeInMs != Long.MIN_VALUE
- ? new Date(mUsageLimitStartTimeInMs) : "Not specified").append("\n");
+ mSubscriptionExpirationTimeInMillis != Long.MIN_VALUE
+ ? new Date(mSubscriptionExpirationTimeInMillis) : "Not specified").append("\n");
+ builder.append("UsageLimitStartTime: ").append(mUsageLimitStartTimeInMillis != Long.MIN_VALUE
+ ? new Date(mUsageLimitStartTimeInMillis) : "Not specified").append("\n");
builder.append("UsageTimePeriod: ").append(mUsageLimitUsageTimePeriodInMinutes)
.append("\n");
builder.append("UsageLimitDataLimit: ").append(mUsageLimitDataLimit).append("\n");
@@ -433,11 +433,11 @@ public final class PasspointConfiguration implements Parcelable {
config.setTrustRootCertList(readTrustRootCerts(in));
config.setUpdateIdentifier(in.readInt());
config.setCredentialPriority(in.readInt());
- config.setSubscriptionCreationTimeInMs(in.readLong());
- config.setSubscriptionExpirationTimeInMs(in.readLong());
+ config.setSubscriptionCreationTimeInMillis(in.readLong());
+ config.setSubscriptionExpirationTimeInMillis(in.readLong());
config.setSubscriptionType(in.readString());
config.setUsageLimitUsageTimePeriodInMinutes(in.readLong());
- config.setUsageLimitStartTimeInMs(in.readLong());
+ config.setUsageLimitStartTimeInMillis(in.readLong());
config.setUsageLimitDataLimit(in.readLong());
config.setUsageLimitTimeLimitInMinutes(in.readLong());
return config;
diff --git a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java b/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java
index 5dc5d13569c6..f6183fa219a1 100644
--- a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java
+++ b/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java
@@ -903,10 +903,10 @@ public final class PpsMoParser {
for (PPSNode child: node.getChildren()) {
switch (child.getName()) {
case NODE_CREATION_DATE:
- credential.setCreationTimeInMs(parseDate(getPpsNodeValue(child)));
+ credential.setCreationTimeInMillis(parseDate(getPpsNodeValue(child)));
break;
case NODE_EXPIRATION_DATE:
- credential.setExpirationTimeInMs(parseDate(getPpsNodeValue(child)));
+ credential.setExpirationTimeInMillis(parseDate(getPpsNodeValue(child)));
break;
case NODE_USERNAME_PASSWORD:
credential.setUserCredential(parseUserCredential(child));
@@ -1517,10 +1517,10 @@ public final class PpsMoParser {
for (PPSNode child : node.getChildren()) {
switch (child.getName()) {
case NODE_CREATION_DATE:
- config.setSubscriptionCreationTimeInMs(parseDate(getPpsNodeValue(child)));
+ config.setSubscriptionCreationTimeInMillis(parseDate(getPpsNodeValue(child)));
break;
case NODE_EXPIRATION_DATE:
- config.setSubscriptionExpirationTimeInMs(parseDate(getPpsNodeValue(child)));
+ config.setSubscriptionExpirationTimeInMillis(parseDate(getPpsNodeValue(child)));
break;
case NODE_TYPE_OF_SUBSCRIPTION:
config.setSubscriptionType(getPpsNodeValue(child));
@@ -1555,7 +1555,7 @@ public final class PpsMoParser {
config.setUsageLimitDataLimit(parseLong(getPpsNodeValue(child), 10));
break;
case NODE_START_DATE:
- config.setUsageLimitStartTimeInMs(parseDate(getPpsNodeValue(child)));
+ config.setUsageLimitStartTimeInMillis(parseDate(getPpsNodeValue(child)));
break;
case NODE_TIME_LIMIT:
config.setUsageLimitTimeLimitInMinutes(parseLong(getPpsNodeValue(child), 10));
diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
index 67fa1bbccd1e..f89efa6265a8 100644
--- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
+++ b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java
@@ -58,12 +58,12 @@ public final class Credential implements Parcelable {
* of milliseconds since January 1, 1970, 00:00:00 GMT.
* Using Long.MIN_VALUE to indicate unset value.
*/
- private long mCreationTimeInMs = Long.MIN_VALUE;
- public void setCreationTimeInMs(long creationTimeInMs) {
- mCreationTimeInMs = creationTimeInMs;
+ private long mCreationTimeInMillis = Long.MIN_VALUE;
+ public void setCreationTimeInMillis(long creationTimeInMillis) {
+ mCreationTimeInMillis = creationTimeInMillis;
}
- public long getCreationTimeInMs() {
- return mCreationTimeInMs;
+ public long getCreationTimeInMillis() {
+ return mCreationTimeInMillis;
}
/**
@@ -71,12 +71,12 @@ public final class Credential implements Parcelable {
* of milliseconds since January 1, 1970, 00:00:00 GMT.
* Using Long.MIN_VALUE to indicate unset value.
*/
- private long mExpirationTimeInMs = Long.MIN_VALUE;
- public void setExpirationTimeInMs(long expirationTimeInMs) {
- mExpirationTimeInMs = expirationTimeInMs;
+ private long mExpirationTimeInMillis = Long.MIN_VALUE;
+ public void setExpirationTimeInMillis(long expirationTimeInMillis) {
+ mExpirationTimeInMillis = expirationTimeInMillis;
}
- public long getExpirationTimeInMs() {
- return mExpirationTimeInMs;
+ public long getExpirationTimeInMillis() {
+ return mExpirationTimeInMillis;
}
/**
@@ -720,8 +720,8 @@ public final class Credential implements Parcelable {
*/
public Credential(Credential source) {
if (source != null) {
- mCreationTimeInMs = source.mCreationTimeInMs;
- mExpirationTimeInMs = source.mExpirationTimeInMs;
+ mCreationTimeInMillis = source.mCreationTimeInMillis;
+ mExpirationTimeInMillis = source.mExpirationTimeInMillis;
mRealm = source.mRealm;
mCheckAaaServerCertStatus = source.mCheckAaaServerCertStatus;
if (source.mUserCredential != null) {
@@ -749,8 +749,8 @@ public final class Credential implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
- dest.writeLong(mCreationTimeInMs);
- dest.writeLong(mExpirationTimeInMs);
+ dest.writeLong(mCreationTimeInMillis);
+ dest.writeLong(mExpirationTimeInMillis);
dest.writeString(mRealm);
dest.writeInt(mCheckAaaServerCertStatus ? 1 : 0);
dest.writeParcelable(mUserCredential, flags);
@@ -772,8 +772,8 @@ public final class Credential implements Parcelable {
Credential that = (Credential) thatObject;
return TextUtils.equals(mRealm, that.mRealm)
- && mCreationTimeInMs == that.mCreationTimeInMs
- && mExpirationTimeInMs == that.mExpirationTimeInMs
+ && mCreationTimeInMillis == that.mCreationTimeInMillis
+ && mExpirationTimeInMillis == that.mExpirationTimeInMillis
&& mCheckAaaServerCertStatus == that.mCheckAaaServerCertStatus
&& (mUserCredential == null ? that.mUserCredential == null
: mUserCredential.equals(that.mUserCredential))
@@ -788,7 +788,7 @@ public final class Credential implements Parcelable {
@Override
public int hashCode() {
- return Objects.hash(mRealm, mCreationTimeInMs, mExpirationTimeInMs,
+ return Objects.hash(mRealm, mCreationTimeInMillis, mExpirationTimeInMillis,
mCheckAaaServerCertStatus, mUserCredential, mCertCredential, mSimCredential,
mCaCertificate, mClientCertificateChain, mClientPrivateKey);
}
@@ -797,10 +797,10 @@ public final class Credential implements Parcelable {
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Realm: ").append(mRealm).append("\n");
- builder.append("CreationTime: ").append(mCreationTimeInMs != Long.MIN_VALUE
- ? new Date(mCreationTimeInMs) : "Not specified").append("\n");
- builder.append("ExpirationTime: ").append(mExpirationTimeInMs != Long.MIN_VALUE
- ? new Date(mExpirationTimeInMs) : "Not specified").append("\n");
+ builder.append("CreationTime: ").append(mCreationTimeInMillis != Long.MIN_VALUE
+ ? new Date(mCreationTimeInMillis) : "Not specified").append("\n");
+ builder.append("ExpirationTime: ").append(mExpirationTimeInMillis != Long.MIN_VALUE
+ ? new Date(mExpirationTimeInMillis) : "Not specified").append("\n");
builder.append("CheckAAAServerStatus: ").append(mCheckAaaServerCertStatus).append("\n");
if (mUserCredential != null) {
builder.append("UserCredential Begin ---\n");
@@ -863,8 +863,8 @@ public final class Credential implements Parcelable {
@Override
public Credential createFromParcel(Parcel in) {
Credential credential = new Credential();
- credential.setCreationTimeInMs(in.readLong());
- credential.setExpirationTimeInMs(in.readLong());
+ credential.setCreationTimeInMillis(in.readLong());
+ credential.setExpirationTimeInMillis(in.readLong());
credential.setRealm(in.readString());
credential.setCheckAaaServerCertStatus(in.readInt() != 0);
credential.setUserCredential(in.readParcelable(null));
diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
index 3c0fc6ef0aa8..03ef319fa1e0 100644
--- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
@@ -22,6 +22,7 @@ import static android.net.wifi.WifiManager.HOTSPOT_STOPPED;
import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_GENERIC;
import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE;
import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_NO_CHANNEL;
+import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.REQUEST_REGISTERED;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -125,12 +126,12 @@ public class WifiManagerTest {
public void testCreationAndCloseOfLocalOnlyHotspotReservation() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(mApConfig);
+ .thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(mApConfig));
- assertEquals(mApConfig, callback.mRes.getConfig());
+ assertEquals(mApConfig, callback.mRes.getWifiConfiguration());
callback.mRes.close();
verify(mWifiService).stopLocalOnlyHotspot();
}
@@ -143,13 +144,13 @@ public class WifiManagerTest {
throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(mApConfig);
+ .thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(mApConfig));
try (WifiManager.LocalOnlyHotspotReservation res = callback.mRes) {
- assertEquals(mApConfig, res.getConfig());
+ assertEquals(mApConfig, res.getWifiConfiguration());
}
verify(mWifiService).stopLocalOnlyHotspot();
@@ -337,7 +338,7 @@ public class WifiManagerTest {
// record thread from looper.getThread and check ids.
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(null);
+ .thenReturn(ERROR_INCOMPATIBLE_MODE);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mLooper.dispatchAll();
assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
@@ -355,7 +356,7 @@ public class WifiManagerTest {
when(mContext.getMainLooper()).thenReturn(altLooper.getLooper());
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(null);
+ .thenReturn(ERROR_INCOMPATIBLE_MODE);
mWifiManager.startLocalOnlyHotspot(callback, null);
altLooper.dispatchAll();
assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
@@ -372,7 +373,7 @@ public class WifiManagerTest {
TestLooper callbackLooper = new TestLooper();
Handler callbackHandler = new Handler(callbackLooper.getLooper());
when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(),
- any(IBinder.class))).thenReturn(mApConfig);
+ any(IBinder.class))).thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
callbackLooper.dispatchAll();
mLooper.dispatchAll();
@@ -386,7 +387,7 @@ public class WifiManagerTest {
mLooper.dispatchAll();
callbackLooper.dispatchAll();
assertTrue(callback.mOnStartedCalled);
- assertEquals(mApConfig, callback.mRes.getConfig());
+ assertEquals(mApConfig, callback.mRes.getWifiConfiguration());
}
/**
@@ -399,7 +400,7 @@ public class WifiManagerTest {
TestLooper callbackLooper = new TestLooper();
Handler callbackHandler = new Handler(callbackLooper.getLooper());
when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(),
- any(IBinder.class))).thenReturn(mApConfig);
+ any(IBinder.class))).thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
callbackLooper.dispatchAll();
mLooper.dispatchAll();
@@ -424,7 +425,7 @@ public class WifiManagerTest {
TestLooper callbackLooper = new TestLooper();
Handler callbackHandler = new Handler(callbackLooper.getLooper());
when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(),
- any(IBinder.class))).thenReturn(mApConfig);
+ any(IBinder.class))).thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
callbackLooper.dispatchAll();
mLooper.dispatchAll();
@@ -447,7 +448,7 @@ public class WifiManagerTest {
TestLooper callbackLooper = new TestLooper();
Handler callbackHandler = new Handler(callbackLooper.getLooper());
when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(),
- any(IBinder.class))).thenReturn(mApConfig);
+ any(IBinder.class))).thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, callbackHandler);
callbackLooper.dispatchAll();
mLooper.dispatchAll();
@@ -470,7 +471,7 @@ public class WifiManagerTest {
public void testLocalOnlyHotspotCallbackFullOnNullConfig() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(null);
+ .thenReturn(ERROR_INCOMPATIBLE_MODE);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mLooper.dispatchAll();
assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
@@ -508,7 +509,7 @@ public class WifiManagerTest {
public void testLocalOnlyHotspotCallbackFullOnNoChannelError() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(mApConfig);
+ .thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mLooper.dispatchAll();
//assertEquals(ERROR_NO_CHANNEL, callback.mFailureReason);
@@ -524,7 +525,7 @@ public class WifiManagerTest {
public void testCancelLocalOnlyHotspotRequestCallsStopOnWifiService() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(mApConfig);
+ .thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mWifiManager.cancelLocalOnlyHotspotRequest();
verify(mWifiService).stopLocalOnlyHotspot();
@@ -546,7 +547,7 @@ public class WifiManagerTest {
public void testCallbackAfterLocalOnlyHotspotWasCancelled() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(mApConfig);
+ .thenReturn(REQUEST_REGISTERED);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mWifiManager.cancelLocalOnlyHotspotRequest();
verify(mWifiService).stopLocalOnlyHotspot();
@@ -565,7 +566,7 @@ public class WifiManagerTest {
public void testCancelAfterLocalOnlyHotspotCallbackTriggered() throws Exception {
TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback();
when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class)))
- .thenReturn(null);
+ .thenReturn(ERROR_INCOMPATIBLE_MODE);
mWifiManager.startLocalOnlyHotspot(callback, mHandler);
mLooper.dispatchAll();
assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason);
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
index 7df4fcf56e8a..afcf3e344c27 100644
--- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
@@ -158,11 +158,11 @@ public class PasspointConfigurationTest {
config.setTrustRootCertList(trustRootCertList);
config.setUpdateIdentifier(1);
config.setCredentialPriority(120);
- config.setSubscriptionCreationTimeInMs(231200);
- config.setSubscriptionExpirationTimeInMs(2134232);
+ config.setSubscriptionCreationTimeInMillis(231200);
+ config.setSubscriptionExpirationTimeInMillis(2134232);
config.setSubscriptionType("Gold");
config.setUsageLimitUsageTimePeriodInMinutes(3600);
- config.setUsageLimitStartTimeInMs(124214213);
+ config.setUsageLimitStartTimeInMillis(124214213);
config.setUsageLimitDataLimit(14121);
config.setUsageLimitTimeLimitInMinutes(78912);
return config;
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java b/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java
index 7cd72f03dd1b..afa9fd6a9e8b 100644
--- a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java
+++ b/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java
@@ -113,11 +113,11 @@ public class PpsMoParserTest {
config.setSubscriptionUpdate(subscriptionUpdate);
// Subscription parameters.
- config.setSubscriptionCreationTimeInMs(format.parse("2016-02-01T10:00:00Z").getTime());
- config.setSubscriptionExpirationTimeInMs(format.parse("2016-03-01T10:00:00Z").getTime());
+ config.setSubscriptionCreationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime());
+ config.setSubscriptionExpirationTimeInMillis(format.parse("2016-03-01T10:00:00Z").getTime());
config.setSubscriptionType("Gold");
config.setUsageLimitDataLimit(921890);
- config.setUsageLimitStartTimeInMs(format.parse("2016-12-01T10:00:00Z").getTime());
+ config.setUsageLimitStartTimeInMillis(format.parse("2016-12-01T10:00:00Z").getTime());
config.setUsageLimitTimeLimitInMinutes(120);
config.setUsageLimitUsageTimePeriodInMinutes(99910);
@@ -138,8 +138,8 @@ public class PpsMoParserTest {
// Credential configuration.
Credential credential = new Credential();
- credential.setCreationTimeInMs(format.parse("2016-01-01T10:00:00Z").getTime());
- credential.setExpirationTimeInMs(format.parse("2016-02-01T10:00:00Z").getTime());
+ credential.setCreationTimeInMillis(format.parse("2016-01-01T10:00:00Z").getTime());
+ credential.setExpirationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime());
credential.setRealm("shaken.stirred.com");
credential.setCheckAaaServerCertStatus(true);
Credential.UserCredential userCredential = new Credential.UserCredential();
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java
index c7ade002c826..9bfc0105fcc9 100644
--- a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java
+++ b/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java
@@ -56,8 +56,8 @@ public class CredentialTest {
X509Certificate[] clientCertificateChain,
PrivateKey clientPrivateKey) {
Credential cred = new Credential();
- cred.setCreationTimeInMs(123455L);
- cred.setExpirationTimeInMs(2310093L);
+ cred.setCreationTimeInMillis(123455L);
+ cred.setExpirationTimeInMillis(2310093L);
cred.setRealm("realm");
cred.setCheckAaaServerCertStatus(true);
cred.setUserCredential(userCred);
@@ -440,4 +440,4 @@ public class CredentialTest {
Credential copyCred = new Credential(sourceCred);
assertTrue(copyCred.equals(sourceCred));
}
-} \ No newline at end of file
+}