diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 19be586710ce..005b701c0d52 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -715,6 +715,7 @@ public class StatusBar extends SystemUI implements DemoMode, private NotificationIconAreaController mNotificationIconAreaController; private ConfigurationListener mConfigurationListener; private InflationExceptionHandler mInflationExceptionHandler = this::handleInflationException; + private boolean mReinflateNotificationsOnUserSwitched; private void recycleAllVisibilityObjects(ArraySet<NotificationVisibility> array) { final int N = array.size(); @@ -1274,16 +1275,10 @@ public class StatusBar extends SystemUI implements DemoMode, protected void onDensityOrFontScaleChanged() { // start old BaseStatusBar.onDensityOrFontScaleChanged(). - ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications(); - for (int i = 0; i < activeNotifications.size(); i++) { - Entry entry = activeNotifications.get(i); - boolean exposedGuts = mNotificationGutsExposed != null - && entry.row.getGuts() == mNotificationGutsExposed; - entry.row.onDensityOrFontScaleChanged(); - if (exposedGuts) { - mNotificationGutsExposed = entry.row.getGuts(); - bindGuts(entry.row, mGutsMenuItem); - } + if (!KeyguardUpdateMonitor.getInstance(mContext).isSwitchingUser()) { + updateNotificationsOnDensityOrFontScaleChanged(); + } else { + mReinflateNotificationsOnUserSwitched = true; } // end old BaseStatusBar.onDensityOrFontScaleChanged(). mScrimController.onDensityOrFontScaleChanged(); @@ -1308,6 +1303,20 @@ public class StatusBar extends SystemUI implements DemoMode, } } + private void updateNotificationsOnDensityOrFontScaleChanged() { + ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications(); + for (int i = 0; i < activeNotifications.size(); i++) { + Entry entry = activeNotifications.get(i); + boolean exposedGuts = mNotificationGutsExposed != null + && entry.row.getGuts() == mNotificationGutsExposed; + entry.row.onDensityOrFontScaleChanged(); + if (exposedGuts) { + mNotificationGutsExposed = entry.row.getGuts(); + bindGuts(entry.row, mGutsMenuItem); + } + } + } + private void inflateSignalClusters() { reinflateSignalCluster(mKeyguardStatusBar); } @@ -3598,7 +3607,12 @@ public class StatusBar extends SystemUI implements DemoMode, if (MULTIUSER_DEBUG) mNotificationPanelDebugText.setText("USER " + newUserId); animateCollapsePanels(); updatePublicMode(); - updateNotifications(); + mNotificationData.filterAndSort(); + if (mReinflateNotificationsOnUserSwitched) { + updateNotificationsOnDensityOrFontScaleChanged(); + mReinflateNotificationsOnUserSwitched = false; + } + updateNotificationShade(); clearCurrentMediaNotification(); setLockscreenUser(newUserId); } |