Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94679020 authored by Christopher Tate's avatar Christopher Tate
Browse files

Allow user add/remove broadcasts to manifest receivers

Bring the implemention into line with the documented (intended)
behavior.  Note that these broadcast already require that the recipient
hold a signature|privileged permission.

Bug: 177072348
Test: manual (bug test case validation)
Change-Id: Ic56892b934017f0d8f75c9c97932d4f6f2bc4166
parent 3c72f3de
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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.