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

Commit 66619a2e authored by Chris Wren's avatar Chris Wren
Browse files

Never fetch notification badges for USER_SYSTEM

This user never gets a badge, and secondary users will
see a security exception attempting to fetch it for
USER_ALL notifications, such as USB and battery state,
which are posted by USER_SYSTEM.

Bug: 28743335
Change-Id: I65aeb1cf2192811055f8cd94df0b7e292c5c1acf
parent 5a68af38
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3105,6 +3105,11 @@ public class Notification implements Parcelable
        }

        private Drawable getProfileBadgeDrawable() {
            if (mContext.getUserId() == UserHandle.USER_SYSTEM) {
                // This user can never be a badged profile,
                // and also includes USER_ALL system notifications.
                return null;
            }
            // Note: This assumes that the current user can read the profile badge of the
            // originating user.
            return mContext.getPackageManager().getUserBadgeForDensityNoBackground(