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

Commit 04c48a4e authored by BK Choi's avatar BK Choi Committed by Android (Google) Code Review
Browse files

Merge "Prevent visible background users from updating the data managed by...

Merge "Prevent visible background users from updating the data managed by NotificationListers object in MUMD" into main
parents 0bb07990 acc748ab
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -6597,6 +6597,14 @@ public class NotificationManagerService extends SystemService {
                        android.Manifest.permission.INTERACT_ACROSS_USERS,
                        "setNotificationListenerAccessGrantedForUser for user " + userId);
            }
            if (mUmInternal.isVisibleBackgroundFullUser(userId)) {
                // The main use case for visible background users is the Automotive multi-display
                // configuration where a passenger can use a secondary display while the driver is
                // using the main display. NotificationListeners is designed only for the current
                // user and work profile. We added a condition to prevent visible background users
                // from updating the data managed within the NotificationListeners object.
                return;
            }
            checkNotificationListenerAccess();
            if (granted && listener.flattenToString().length()
                    > NotificationManager.MAX_SERVICE_COMPONENT_NAME_LENGTH) {
@@ -12745,6 +12753,20 @@ public class NotificationManagerService extends SystemService {
            }
        }
        @Override
        public void onUserUnlocked(int user) {
            if (mUmInternal.isVisibleBackgroundFullUser(user)) {
                // The main use case for visible background users is the Automotive
                // multi-display configuration where a passenger can use a secondary
                // display while the driver is using the main display.
                // NotificationListeners is designed only for the current user and work
                // profile. We added a condition to prevent visible background users from
                // updating the data managed within the NotificationListeners object.
                return;
            }
            super.onUserUnlocked(user);
        }
        @Override
        protected boolean allowRebindForParentUser() {
            return true;