diff options
author | Kevin F. Haggerty <haggertk@lineageos.org> | 2020-06-06 10:12:07 -0600 |
---|---|---|
committer | Kevin F. Haggerty <haggertk@lineageos.org> | 2020-06-06 10:12:07 -0600 |
commit | f67897bc05520f743974fc397aa96e4049a057b3 (patch) | |
tree | 1f6e15e69b9c76b427f2c92555f0047cd527445f /core/java/android | |
parent | 63fc6d8c0acb37835336862674206cf001753667 (diff) | |
parent | 81ee10241fc143ed576734268708c9943217ff8b (diff) | |
download | frameworks_base-f67897bc05520f743974fc397aa96e4049a057b3.tar.gz frameworks_base-f67897bc05520f743974fc397aa96e4049a057b3.tar.bz2 frameworks_base-f67897bc05520f743974fc397aa96e4049a057b3.zip |
Merge tag 'android-10.0.0_r37' into staging/lineage-17.1_merge-android-10.0.0_r37
Android 10.0.0 Release 37 (QQ3A.200605.001)
* tag 'android-10.0.0_r37':
DO NOT MERGE Fix ImageWallpaper memory regression
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Don't crash if NSSL gets incomplete gesture
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Fix order of uid/pid in LocationAccessPolicy
RESTRICT AUTOMERGE
RESTRICT AUTOMERGE
Verify all possible hosts that match web nav
Verify all possible hosts that match web nav
Verify all possible hosts that match web nav
Verify all possible hosts that match web nav
Verify all possible hosts that match web nav
RESTRICT AUTOMERGE
RESTRICT AUTOMERGE
Revert "Revoke 'always' web handler status when not autoverifying"
Revert "Revoke 'always' web handler status when not autoverifying"
Revert "Revoke 'always' web handler status when not autoverifying"
Fix Battery optimization takes long time
Import translations. DO NOT MERGE
Check DUMP permission before dumping in RollbackManagerService.
Check permissions in INetworkManagementService#setIPv6AddrGenMode
Require a more specific intent
Fix command injection on screencap
Failed UiModeManagerServiceTest
Revert "Revoke 'always' web handler status when not autoverifying"
Import translations. DO NOT MERGE
Force update uid state when pending uid state is applied
Notify all packages is uid-mode is changed
Import translations. DO NOT MERGE
Disable deep press when long press is long
Import translations. DO NOT MERGE
Revert "Revoke 'always' web handler status when not autoverifying"
DO NOT MERGE Institute limit on PhoneStateListener
Fix broken link
DO NOT MERGE use left/right insets instead of cutout
DO NOT MERGE: Add blacklist for camera protection
5G Q backport
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Create different KeyId for saved and suggestion network
String change for ConnectionFailureNotifier
Do not allow division by 0
Move filterMobileSubscriptionInSameGroup into KeyguardUpdateMonitor.
DO NOT MERGE: Use status_bar_padding_top
RESTRICT AUTOMERGE Prevent accessing companion records from arbitrary uids
RESTRICT AUTOMERGE Prevent accessing companion records from arbitrary uids
Import translations. DO NOT MERGE
RESTRICT AUTOMERGE Prevent accessing companion records from arbitrary uids
Camera: Clarify CAMERA_OPEN_CLOSE_LISTENER description
Import translations. DO NOT MERGE
DO NOT MERGE Optimizing ScreenDecorations performance
[RESTRICT AUTOMERGE] Allow bar to be transparent during animating.
Fix race condition while WallpaperMS rebinding service.
Either reuse sensor values or don't dim down at all
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
DO NOT MERGE: Allow corner UI to decouple from rounded_corner_radius
DO NOT MERGE - Kill apps outright for API contract violations
Properly rotate cutout protection rect
[DO NOT MERGE] Allows the Assistant to request suppression of fling
Camera: Add new hidden API for camera open/close callback
Allow two finger swipes down.
RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities
DO NOT MERGE Add null check for status bar transitions
DO NOT MERGE Ignore insets on status_bar_container
RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display
RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display
Fix bluetooth can't turn off during network reset (2/3)
DO NOT MERGE: Resolve mBehindAlpha with mCurrentBehindAlpha
Do not accept NaN as scrim values
Reset protection path on rotation
Revert "[automerger skipped] Merge "DO NOT MERGE - Kill apps out..."
Animate cuttout protection
DO NOT MERGE Set the sensor threshold only if sensor exists
RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display
RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Frameworks/base: Support dex2oat cpu-set system property
Create different KeyId for saved and suggestion network
Add EAP methods in wifi.proto
Remove Dependency.staticOnConfigurationChanged
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Set/get allowed capture policy via AudioService.
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
DO NOT MERGE: Revert Move startInput for WINDOW_FOCUS_GAIN to background thread
DO NOT MERGE: Revert: Freeup lock when IME is set inactive and unbound
Updated wakeLock permission descriptions.
CP ag/9571636 from master to qt-qpr1-dev Bug: 143299398
Fix carrier config string typo.
DO NOT MERGE Add toast message when bluetooth connects to voice recognition.
AudioService - remove sendBroadcastToAll() from setMasterMuteInternalNoCallerCheck()
Allow settingIgnored for DBH request if inEmergency
Use status_bar_padding_top in QS system icons
Resolve trust agents on USER_STARTED in addition to USER_ADDED.
DO NOT MERGE: Add SystemUI support for front-facing camera protection
RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities
RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities
DO NOT MERGE Fix Autohide functionality
DO NOT MERGE Respect rounded.xml size in ScreenDecorations
DO NOT MERGE Set background drawable on status_bar_container
Add DEBUG flag for rounded corner and display cutout path
RESTRICT AUTOMERGE Use Alternative Prox Sensor for Falsing
DO NOT MERGE Have volume UI dismiss on home button press.
RESTRICT AUTOMERGE Update keyguard locked state from TrustManagerService
Back porting Dark theme bug fixes from R
DO NOT MERGE Hold onto NotificationListener when reconnecting notifications UI.
Add carrier config to skip validation if recently validate.
DO NOT MERGE Dismiss system dialog
DO NOT MERGE Reflect the selection state that reflects the current task stack upon restarting the Navigation Bar.
Add cutout support in QSDetail
Add vertical type check to prevent non-Automotive Androids from force displaying system bars.
Fix potential NPE while releasing worker thread of ImageWallpaper
DO NOT MERGE Adjust NotificationView bottom margin based on whether Keyboard is shown.
Add null check for voiceInteractorComponentName.
CountryDetector: Enable detector class override for automotive
DO NOT MERGE - Added system user packages blacklist / whitelist to dump()
DO NOT MERGE - Add flag to turn on/off the headless user specific blacklist/whitelist
DO NOT MERGE - Enable blacklist for headless system user
Fix flaky sysui crash in devicehealthchecks test.
Disabled some DEBUG constants.
Fix security issue in DynamicRefTable::load.
Use the main thread to update alignment indication
DO NOT MERGE - Kill apps outright for API contract violations
Remove hidden shared account methods from AccountManager.java
Add null check for handler on Clock view
Make switching dialog full screen and change "Loading" text color.
DO NOT MERGE - Kill apps outright for API contract violations
Parcel only the canonical Uri.Part representation, not both.
DO NOT MERGE - Use TimingsTraceLog on SystemServiceManager and VoiceInteractionManagerService.
Call getPackageInfo() with cleared calling identity in ensureSystemPackageName().
Add SafetyNet logging for package names read from config.
DO NOT MERGE - Kill apps outright for API contract violations
Force update uid state when pending uid state is applied
Notify all packages is uid-mode is changed
DO NOT MERGE Ensure package names read from config are system packages.
DO NOT MERGE Ensure package names read from config are system packages.
Call getPackageInfo() with cleared calling identity in ensureSystemPackageName().
Re-activate backup service after cleaning a profile owner
[DO NOT MERGE] Fix AoD front scrim being opaque at DOZE_PULSING
resolve merge conflicts of 01f94b7cc053049a472481f457593d895ad9eca0 to qt-qpr1-dev
Set a shorter timeout for logging a warn on slow IUserSwitchObservers.
Added log statements to some user-switching tasks.
Change coverage dump to specify the output file instead of directory.
Add JVMTI agent to dump/reset JaCoCo coverage information
Don't crash system process on empty onTuneFailed
Update redaction upon profile changes
Fixed NPE in package installer session.
[framework] Remove boot complete marker
DO NOT MERGE Unregister notification listener before creating a new one to avoid duplicate Heads Up notifications.
Separate icon sizes for sharesheet and resolver list.
DO NOT MERGE Ensure package names read from config are system packages.
RESTRICT AUTOMERGE Update keyguard locked state from TrustManagerService
Fix serialization issue of ExternalVibration
GraphicsEnv: refactor to unify the debuggable logic
DO NOT MERGE Only set the LAYOUT flags if the window is fullscreen
Only suspend package from system or shell
Adding option in global setting to control the display message during user switch
Update mOnDissmissRunnable when Notification gets updated.
Ensure adb key store is instantiated before revoking grants
Do not destroy CustomTile when in QSCustomizer
Handle ParcelableException instead of crashing system server
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Fix potential double destroy of AssetManager
Change permissionLevel of ACCESS_SHORTCUTS and UNLIMITED_SHORTCUTS_API_CALLS
Fix potential double destroy of AssetManager
DO NOT MERGE Fix AppOpsServiceTest
DO NOT MERGE: Use a copy of bt device profile list when updating
Fix IsolatedUidAllocator for non-primary users.
DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
DO NOT MERGE Remove unnecessary internal APIs.
Prevent sending early termination of appop use
DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Import translations. DO NOT MERGE
Fix ModuleInfoProviderTest by passing correct flag
Refactor CountryDetectorService
Revoke 'always' web handler status when not autoverifying
Revoke 'always' web handler status when not autoverifying
Supplementary Services(SS) gray out when airplane mode on in Call Settings menu.
Revoke 'always' web handler status when not autoverifying
Revoke 'always' web handler status when not autoverifying
Revoke 'always' web handler status when not autoverifying
[DO NOT MERGE] Add a configuration to allow disabling auto-suspend
DO NOT MERGE: Adds artificial package handler latency
Concurrent collections for Bluetooth callbacks.
FocusRequester: fix NPE
Conflicts:
core/res/res/values/config.xml
core/res/res/values/symbols.xml
packages/SystemUI/res/layout/system_icons.xml
packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
services/core/java/com/android/server/BluetoothManagerService.java
services/core/java/com/android/server/NetworkManagementService.java
services/core/java/com/android/server/input/InputManagerService.java
services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java
Change-Id: I9bcfb8567a49063d8427986f7fc2fba8e19b241e
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/accounts/AccountManager.java | 29 | ||||
-rw-r--r-- | core/java/android/accounts/IAccountManager.aidl | 3 | ||||
-rw-r--r-- | core/java/android/app/ActivityManagerInternal.java | 4 | ||||
-rw-r--r-- | core/java/android/app/AppOpsManagerInternal.java | 29 | ||||
-rw-r--r-- | core/java/android/app/DisabledWallpaperManager.java | 7 | ||||
-rw-r--r-- | core/java/android/bluetooth/BluetoothAdapter.java | 6 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManagerInternal.java | 12 | ||||
-rw-r--r-- | core/java/android/hardware/camera2/CameraManager.java | 85 | ||||
-rw-r--r-- | core/java/android/net/INetworkPolicyListener.aidl | 2 | ||||
-rw-r--r-- | core/java/android/net/NetworkPolicyManager.java | 2 | ||||
-rw-r--r-- | core/java/android/net/Uri.java | 61 | ||||
-rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 25 | ||||
-rw-r--r-- | core/java/android/os/IUserManager.aidl | 1 | ||||
-rw-r--r-- | core/java/android/os/UserManager.java | 10 | ||||
-rw-r--r-- | core/java/android/view/ViewConfiguration.java | 3 |
15 files changed, 162 insertions, 117 deletions
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index f4e465ab3ad..0f10c398002 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -1943,35 +1943,6 @@ public class AccountManager { } /** - * @hide - * Removes the shared account. - * @param account the account to remove - * @param user the user to remove the account from - * @return - */ - public boolean removeSharedAccount(final Account account, UserHandle user) { - try { - boolean val = mService.removeSharedAccountAsUser(account, user.getIdentifier()); - return val; - } catch (RemoteException re) { - throw re.rethrowFromSystemServer(); - } - } - - /** - * @hide - * @param user - * @return - */ - public Account[] getSharedAccounts(UserHandle user) { - try { - return mService.getSharedAccountsAsUser(user.getIdentifier()); - } catch (RemoteException re) { - throw re.rethrowFromSystemServer(); - } - } - - /** * Confirms that the user knows the password for an account to make extra * sure they are the owner of the account. The user-entered password can * be supplied directly, otherwise the authenticator for this account type diff --git a/core/java/android/accounts/IAccountManager.aidl b/core/java/android/accounts/IAccountManager.aidl index 4cf0a2089fe..012713891d1 100644 --- a/core/java/android/accounts/IAccountManager.aidl +++ b/core/java/android/accounts/IAccountManager.aidl @@ -80,14 +80,11 @@ interface IAccountManager { String authTokenType); /* Shared accounts */ - Account[] getSharedAccountsAsUser(int userId); - boolean removeSharedAccountAsUser(in Account account, int userId); void addSharedAccountsFromParentUser(int parentUserId, int userId, String opPackageName); /* Account renaming. */ void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName); String getPreviousName(in Account account); - boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId); /* Add account in two steps. */ void startAddAccountSession(in IAccountManagerResponse response, String accountType, diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java index 1725db046a9..a30238ac9e3 100644 --- a/core/java/android/app/ActivityManagerInternal.java +++ b/core/java/android/app/ActivityManagerInternal.java @@ -29,7 +29,6 @@ import android.content.pm.UserInfo; import android.os.Bundle; import android.os.IBinder; import android.os.TransactionTooLargeException; -import android.view.RemoteAnimationAdapter; import java.util.ArrayList; import java.util.List; @@ -345,4 +344,7 @@ public abstract class ActivityManagerInternal { * Unregisters the specified {@code processObserver}. */ public abstract void unregisterProcessObserver(IProcessObserver processObserver); + + /** Returns true if the given UID is registered as an active instrumentation. */ + public abstract boolean isActiveInstrumentation(int uid); } diff --git a/core/java/android/app/AppOpsManagerInternal.java b/core/java/android/app/AppOpsManagerInternal.java index 08cad04401e..996939eb9ee 100644 --- a/core/java/android/app/AppOpsManagerInternal.java +++ b/core/java/android/app/AppOpsManagerInternal.java @@ -16,7 +16,6 @@ package android.app; -import android.annotation.NonNull; import android.util.SparseIntArray; import com.android.internal.util.function.QuadFunction; @@ -77,38 +76,10 @@ public abstract class AppOpsManagerInternal { public abstract void setDeviceAndProfileOwners(SparseIntArray owners); /** - * Sets the app-ops mode for a certain app-op and uid. - * - * <p>Similar as {@link AppOpsManager#setUidMode} but does not require the package manager to be - * working. Hence this can be used very early during boot. - * - * <p>Only for internal callers. Does <u>not</u> verify that package name belongs to uid. - * - * @param code The op code to set. - * @param uid The UID for which to set. - * @param mode The new mode to set. - */ - public abstract void setUidMode(int code, int uid, int mode); - - /** * Set all {@link #setMode (package) modes} for this uid to the default value. * * @param code The app-op * @param uid The uid */ public abstract void setAllPkgModesToDefault(int code, int uid); - - /** - * Get the (raw) mode of an app-op. - * - * <p>Does <u>not</u> verify that package belongs to uid. The caller needs to do that. - * - * @param code The code of the op - * @param uid The uid of the package the op belongs to - * @param packageName The package the op belongs to - * - * @return The mode of the op - */ - public abstract @AppOpsManager.Mode int checkOperationUnchecked(int code, int uid, - @NonNull String packageName); } diff --git a/core/java/android/app/DisabledWallpaperManager.java b/core/java/android/app/DisabledWallpaperManager.java index 518594191e6..7151f900c5a 100644 --- a/core/java/android/app/DisabledWallpaperManager.java +++ b/core/java/android/app/DisabledWallpaperManager.java @@ -41,8 +41,7 @@ final class DisabledWallpaperManager extends WallpaperManager { // Don't need to worry about synchronization private static DisabledWallpaperManager sInstance; - // TODO(b/138939803): STOPSHIP changed to false and/or remove it - private static final boolean DEBUG = true; + private static final boolean DEBUG = false; @NonNull static DisabledWallpaperManager getInstance() { @@ -66,10 +65,6 @@ final class DisabledWallpaperManager extends WallpaperManager { return false; } - // TODO(b/138939803): STOPSHIP methods below should not be necessary, - // callers should check if isWallpaperSupported(), consider removing them to keep this class - // simpler - private static <T> T unsupported() { if (DEBUG) Log.w(TAG, "unsupported method called; returning null", new Exception()); return null; diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 31bbd16497c..3b620b388ef 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1195,9 +1195,11 @@ public final class BluetoothAdapter { public boolean factoryReset() { try { mServiceLock.readLock().lock(); - if (mService != null) { - return mService.factoryReset(); + if (mService != null && mService.factoryReset() + && mManagerService != null && mManagerService.onFactoryReset()) { + return true; } + Log.e(TAG, "factoryReset(): Setting persist.bluetooth.factoryreset to retry later"); SystemProperties.set("persist.bluetooth.factoryreset", "true"); } catch (RemoteException e) { Log.e(TAG, "", e); diff --git a/core/java/android/content/pm/PackageManagerInternal.java b/core/java/android/content/pm/PackageManagerInternal.java index 672994e7913..3e880f03b22 100644 --- a/core/java/android/content/pm/PackageManagerInternal.java +++ b/core/java/android/content/pm/PackageManagerInternal.java @@ -999,4 +999,16 @@ public abstract class PackageManagerInternal { * Migrates legacy obb data to its new location. */ public abstract void migrateLegacyObbData(); + + /** + * Ensures that we block deletion of unused packages on user removal. This is purely for the + * purpose of ensuring that b/141413692 is not reproducible on Q. + */ + public abstract void notifyingOnNextUserRemovalForTest(); + + /** + * Notifies PackageManager of the removal of a user. This is purely for the purpose of ensuring + * that b/141413692 is not reproducible on Q. + */ + public abstract void userRemovedForTest(); } diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java index f1645c6afd8..7e89b1f01a5 100644 --- a/core/java/android/hardware/camera2/CameraManager.java +++ b/core/java/android/hardware/camera2/CameraManager.java @@ -702,6 +702,33 @@ public final class CameraManager { public void onCameraAccessPrioritiesChanged() { // default empty implementation } + + /** + * A camera device has been opened by an application. + * + * <p>The default implementation of this method does nothing.</p> + * + * @param cameraId The unique identifier of the new camera. + * @param packageId The package Id of the application opening the camera. + * + * @see #onCameraClosed + */ + /** @hide */ + public void onCameraOpened(@NonNull String cameraId, @NonNull String packageId) { + // default empty implementation + } + + /** + * A previously-opened camera has been closed. + * + * <p>The default implementation of this method does nothing.</p> + * + * @param cameraId The unique identifier of the closed camera. + */ + /** @hide */ + public void onCameraClosed(@NonNull String cameraId) { + // default empty implementation + } } /** @@ -1143,6 +1170,38 @@ public final class CameraManager { } } + private void postSingleCameraOpenedUpdate(final AvailabilityCallback callback, + final Executor executor, final String id, final String packageId) { + final long ident = Binder.clearCallingIdentity(); + try { + executor.execute( + new Runnable() { + @Override + public void run() { + callback.onCameraOpened(id, packageId); + } + }); + } finally { + Binder.restoreCallingIdentity(ident); + } + } + + private void postSingleCameraClosedUpdate(final AvailabilityCallback callback, + final Executor executor, final String id) { + final long ident = Binder.clearCallingIdentity(); + try { + executor.execute( + new Runnable() { + @Override + public void run() { + callback.onCameraClosed(id); + } + }); + } finally { + Binder.restoreCallingIdentity(ident); + } + } + private void postSingleUpdate(final AvailabilityCallback callback, final Executor executor, final String id, final int status) { if (isAvailable(status)) { @@ -1410,6 +1469,32 @@ public final class CameraManager { } } + @Override + public void onCameraOpened(String cameraId, String clientPackageId) { + synchronized (mLock) { + final int callbackCount = mCallbackMap.size(); + for (int i = 0; i < callbackCount; i++) { + Executor executor = mCallbackMap.valueAt(i); + final AvailabilityCallback callback = mCallbackMap.keyAt(i); + + postSingleCameraOpenedUpdate(callback, executor, cameraId, clientPackageId); + } + } + } + + @Override + public void onCameraClosed(String cameraId) { + synchronized (mLock) { + final int callbackCount = mCallbackMap.size(); + for (int i = 0; i < callbackCount; i++) { + Executor executor = mCallbackMap.valueAt(i); + final AvailabilityCallback callback = mCallbackMap.keyAt(i); + + postSingleCameraClosedUpdate(callback, executor, cameraId); + } + } + } + /** * Try to connect to camera service after some delay if any client registered camera * availability callback or torch status callback. diff --git a/core/java/android/net/INetworkPolicyListener.aidl b/core/java/android/net/INetworkPolicyListener.aidl index 10667aecd12..fe9141cb6a2 100644 --- a/core/java/android/net/INetworkPolicyListener.aidl +++ b/core/java/android/net/INetworkPolicyListener.aidl @@ -15,6 +15,7 @@ */ package android.net; +import android.telephony.SubscriptionPlan; /** {@hide} */ oneway interface INetworkPolicyListener { @@ -23,4 +24,5 @@ oneway interface INetworkPolicyListener { void onRestrictBackgroundChanged(boolean restrictBackground); void onUidPoliciesChanged(int uid, int uidPolicies); void onSubscriptionOverride(int subId, int overrideMask, int overrideValue); + void onSubscriptionPlansChanged(int subId, in SubscriptionPlan[] plans); } diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java index dbe1e094ce1..11029c2fb82 100644 --- a/core/java/android/net/NetworkPolicyManager.java +++ b/core/java/android/net/NetworkPolicyManager.java @@ -31,6 +31,7 @@ import android.net.wifi.WifiInfo; import android.os.Build; import android.os.RemoteException; import android.os.UserHandle; +import android.telephony.SubscriptionPlan; import android.util.DebugUtils; import android.util.Pair; import android.util.Range; @@ -387,5 +388,6 @@ public class NetworkPolicyManager { @Override public void onRestrictBackgroundChanged(boolean restrictBackground) { } @Override public void onUidPoliciesChanged(int uid, int uidPolicies) { } @Override public void onSubscriptionOverride(int subId, int overrideMask, int overrideValue) { } + @Override public void onSubscriptionPlansChanged(int subId, SubscriptionPlan[] plans) { } } } diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java index c3166e91fac..8cf182b4156 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java @@ -1987,17 +1987,26 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { * Enum which indicates which representation of a given part we have. */ static class Representation { - static final int BOTH = 0; static final int ENCODED = 1; static final int DECODED = 2; } volatile String encoded; volatile String decoded; + private final int mCanonicalRepresentation; AbstractPart(String encoded, String decoded) { - this.encoded = encoded; - this.decoded = decoded; + if (encoded != NOT_CACHED) { + this.mCanonicalRepresentation = Representation.ENCODED; + this.encoded = encoded; + this.decoded = NOT_CACHED; + } else if (decoded != NOT_CACHED) { + this.mCanonicalRepresentation = Representation.DECODED; + this.encoded = NOT_CACHED; + this.decoded = decoded; + } else { + throw new IllegalArgumentException("Neither encoded nor decoded"); + } } abstract String getEncoded(); @@ -2009,25 +2018,21 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { } final void writeTo(Parcel parcel) { - @SuppressWarnings("StringEquality") - boolean hasEncoded = encoded != NOT_CACHED; - - @SuppressWarnings("StringEquality") - boolean hasDecoded = decoded != NOT_CACHED; - - if (hasEncoded && hasDecoded) { - parcel.writeInt(Representation.BOTH); - parcel.writeString(encoded); - parcel.writeString(decoded); - } else if (hasEncoded) { - parcel.writeInt(Representation.ENCODED); - parcel.writeString(encoded); - } else if (hasDecoded) { - parcel.writeInt(Representation.DECODED); - parcel.writeString(decoded); + final String canonicalValue; + if (mCanonicalRepresentation == Representation.ENCODED) { + canonicalValue = encoded; + } else if (mCanonicalRepresentation == Representation.DECODED) { + canonicalValue = decoded; } else { - throw new IllegalArgumentException("Neither encoded nor decoded"); + throw new IllegalArgumentException("Unknown representation: " + + mCanonicalRepresentation); + } + if (canonicalValue == NOT_CACHED) { + throw new AssertionError("Canonical value not cached (" + + mCanonicalRepresentation + ")"); } + parcel.writeInt(mCanonicalRepresentation); + parcel.writeString(canonicalValue); } } @@ -2059,13 +2064,12 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { static Part readFrom(Parcel parcel) { int representation = parcel.readInt(); + String value = parcel.readString(); switch (representation) { - case Representation.BOTH: - return from(parcel.readString(), parcel.readString()); case Representation.ENCODED: - return fromEncoded(parcel.readString()); + return fromEncoded(value); case Representation.DECODED: - return fromDecoded(parcel.readString()); + return fromDecoded(value); default: throw new IllegalArgumentException("Unknown representation: " + representation); @@ -2127,6 +2131,11 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { private static class EmptyPart extends Part { public EmptyPart(String value) { super(value, value); + if (value != null && !value.isEmpty()) { + throw new IllegalArgumentException("Expected empty value, got: " + value); + } + // Avoid having to re-calculate the non-canonical value. + encoded = decoded = value; } @Override @@ -2245,14 +2254,12 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { static PathPart readFrom(Parcel parcel) { int representation = parcel.readInt(); switch (representation) { - case Representation.BOTH: - return from(parcel.readString(), parcel.readString()); case Representation.ENCODED: return fromEncoded(parcel.readString()); case Representation.DECODED: return fromDecoded(parcel.readString()); default: - throw new IllegalArgumentException("Bad representation: " + representation); + throw new IllegalArgumentException("Unknown representation: " + representation); } } diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index 7a70e93b69d..31cdf42e3a0 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -173,13 +173,6 @@ public class GraphicsEnvironment { } /** - * Check whether application is debuggable - */ - private static boolean isDebuggable(Context context) { - return (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) > 0; - } - - /** * Store the layer paths available to the loader. */ public void setLayerPaths(ClassLoader classLoader, @@ -233,7 +226,7 @@ public class GraphicsEnvironment { // 2. ENABLE_GPU_DEBUG_LAYERS is true // 3. Package name is equal to GPU_DEBUG_APP - if (isDebuggable(context) || (getCanLoadSystemLibraries() == 1)) { + if (isDebuggable()) { final int enable = coreSettings.getInt(Settings.Global.ENABLE_GPU_DEBUG_LAYERS, 0); @@ -414,9 +407,7 @@ public class GraphicsEnvironment { * Check for ANGLE debug package, but only for apps that can load them (dumpable) */ private String getAngleDebugPackage(Context context, Bundle coreSettings) { - final boolean appIsDebuggable = isDebuggable(context); - final boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; - if (appIsDebuggable || deviceIsDebuggable) { + if (isDebuggable()) { String debugPackage; if (coreSettings != null) { @@ -451,12 +442,8 @@ public class GraphicsEnvironment { * - devices that are running a userdebug build (ro.debuggable) or can inject libraries for * debugging (PR_SET_DUMPABLE). */ - final boolean appIsDebuggable = isDebuggable(context); - final boolean deviceIsDebuggable = getCanLoadSystemLibraries() == 1; - if (!(appIsDebuggable || deviceIsDebuggable)) { - Log.v(TAG, "Skipping loading temporary rules file: " - + "appIsDebuggable = " + appIsDebuggable + ", " - + "adbRootEnabled = " + deviceIsDebuggable); + if (!isDebuggable()) { + Log.v(TAG, "Skipping loading temporary rules file"); return false; } @@ -725,7 +712,7 @@ public class GraphicsEnvironment { final boolean enablePrereleaseDriver = (ai.metaData != null && ai.metaData.getBoolean(METADATA_DEVELOPER_DRIVER_ENABLE)) - || getCanLoadSystemLibraries() == 1; + || isDebuggable(); // Priority for Game Driver settings global on confliction (Higher priority comes first): // 1. GAME_DRIVER_ALL_APPS @@ -901,7 +888,7 @@ public class GraphicsEnvironment { return ""; } - private static native int getCanLoadSystemLibraries(); + private static native boolean isDebuggable(); private static native void setLayerPaths(ClassLoader classLoader, String layerPaths); private static native void setDebugLayers(String layers); private static native void setDebugLayersGLES(String layers); diff --git a/core/java/android/os/IUserManager.aidl b/core/java/android/os/IUserManager.aidl index c30491a3965..7721116d586 100644 --- a/core/java/android/os/IUserManager.aidl +++ b/core/java/android/os/IUserManager.aidl @@ -106,4 +106,5 @@ interface IUserManager { String getUserName(); long getUserStartRealtime(); long getUserUnlockRealtime(); + void notifyOnNextUserRemoveForTest(); } diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 45842926ff1..da41478e91a 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -1275,6 +1275,16 @@ public class UserManager { } /** + * @hide + * @return Whether the device is running in a headless system user mode. It means the headless + * user (system user) runs system services and system UI, but is not associated with any real + * person. Secondary users can be created to be associated with real person. + */ + public static boolean isHeadlessSystemUserMode() { + return RoSystemProperties.MULTIUSER_HEADLESS_SYSTEM_USER; + } + + /** * @return Whether guest user is always ephemeral * @hide */ diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 9e914d4e7d4..d83bbf6d6ab 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -64,8 +64,9 @@ public class ViewConfiguration { /** * Defines the default duration in milliseconds before a press turns into * a long press + * @hide */ - private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500; + public static final int DEFAULT_LONG_PRESS_TIMEOUT = 400; /** * Defines the default duration in milliseconds between the first tap's up event and the second |