Merge "Allow user add/remove broadcasts to manifest receivers"

This commit is contained in:
Chris Tate
2021-01-08 22:23:46 +00:00
committed by Android (Google) Code Review

View File

@@ -3646,6 +3646,7 @@ public class UserManagerService extends IUserManager.Stub {
//...then external ones
Intent addedIntent = new Intent(Intent.ACTION_USER_ADDED);
addedIntent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
addedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userInfo.id);
// Also, add the UserHandle for mainline modules which can't use the @hide
// EXTRA_USER_HANDLE.
@@ -4048,6 +4049,7 @@ public class UserManagerService extends IUserManager.Stub {
final long ident = Binder.clearCallingIdentity();
try {
Intent removedIntent = new Intent(Intent.ACTION_USER_REMOVED);
removedIntent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
removedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
// Also, add the UserHandle for mainline modules which can't use the @hide
// EXTRA_USER_HANDLE.