Merge "Waiting for reinflating the notifications until the user switched"

This commit is contained in:
TreeHugger Robot
2017-03-07 05:24:06 +00:00
committed by Android (Google) Code Review

View File

@@ -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);
}