diff options
| author | 2020-01-23 18:59:25 +0000 | |
|---|---|---|
| committer | 2020-01-23 18:59:25 +0000 | |
| commit | 55593ee94010ffb3e8e973dfc514500e7737ce2b (patch) | |
| tree | 18815e674a14ec09889c4113e111ced8060765ed | |
| parent | 38812f345c6067300cd878ae67b970de997b5cee (diff) | |
| parent | 67ffabede856ede0b3857c5287bf67eb318a4d45 (diff) | |
Merge "UserController: add UserHandle extra to user switched broadcast"
| -rw-r--r-- | services/core/java/com/android/server/am/UserController.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index b311233694ce..1452e25e70f9 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -1538,6 +1538,9 @@ class UserController implements Handler.Callback { intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, profileUserId); + // Also, add the UserHandle for mainline modules which can't use the @hide + // EXTRA_USER_HANDLE. + intent.putExtra(Intent.EXTRA_USER, UserHandle.of(profileUserId)); mInjector.broadcastIntent(intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, null, false, false, MY_PID, SYSTEM_UID, callingUid, callingPid, @@ -1554,6 +1557,9 @@ class UserController implements Handler.Callback { intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, profileUserId); + // Also, add the UserHandle for mainline modules which can't use the @hide + // EXTRA_USER_HANDLE. + intent.putExtra(Intent.EXTRA_USER, UserHandle.of(profileUserId)); mInjector.broadcastIntent(intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, null, false, false, MY_PID, SYSTEM_UID, callingUid, callingPid, @@ -1563,6 +1569,9 @@ class UserController implements Handler.Callback { intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, newUserId); + // Also, add the UserHandle for mainline modules which can't use the @hide + // EXTRA_USER_HANDLE. + intent.putExtra(Intent.EXTRA_USER, UserHandle.of(newUserId)); mInjector.broadcastIntent(intent, null, null, 0, null, null, new String[] {android.Manifest.permission.MANAGE_USERS}, |