diff options
2 files changed, 19 insertions, 22 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java index a4e3f339b58f..038efdd0d1db 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java @@ -39,7 +39,6 @@ import com.android.systemui.statusbar.NotificationUpdateHandler; import com.android.systemui.statusbar.notification.collection.NotificationData; import com.android.systemui.statusbar.notification.collection.NotificationData.KeyguardEnvironment; import com.android.systemui.statusbar.notification.collection.NotificationEntry; -import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.row.NotificationInflater; import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; @@ -72,8 +71,6 @@ public class NotificationEntryManager implements protected final Context mContext; protected final HashMap<String, NotificationEntry> mPendingNotifications = new HashMap<>(); - private final NotificationGutsManager mGutsManager = - Dependency.get(NotificationGutsManager.class); private final DeviceProvisionedController mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class); private final ForegroundServiceController mForegroundServiceController = @@ -370,19 +367,6 @@ public class NotificationEntryManager implements } } - public void updateNotificationsOnDensityOrFontScaleChanged() { - ArrayList<NotificationEntry> userNotifications = - mNotificationData.getNotificationsForCurrentUser(); - for (int i = 0; i < userNotifications.size(); i++) { - NotificationEntry entry = userNotifications.get(i); - entry.onDensityOrFontScaleChanged(); - boolean exposedGuts = entry.areGutsExposed(); - if (exposedGuts) { - mGutsManager.onDensityOrFontScaleChanged(entry); - } - } - } - private void addNotificationInternal(StatusBarNotification notification, NotificationListenerService.RankingMap rankingMap) throws InflationException { String key = notification.getKey(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java index 16c8e6232b00..2c9def24a1a3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java @@ -104,6 +104,8 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, Dependency.get(NotificationMediaManager.class); private final VisualStabilityManager mVisualStabilityManager = Dependency.get(VisualStabilityManager.class); + private final NotificationGutsManager mGutsManager = + Dependency.get(NotificationGutsManager.class); protected AmbientPulseManager mAmbientPulseManager = Dependency.get(AmbientPulseManager.class); private final NotificationPanelView mNotificationPanel; @@ -206,14 +208,12 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, } }; - NotificationGutsManager gutsManager = Dependency.get(NotificationGutsManager.class); - mViewHierarchyManager.setUpWithPresenter(this, notifListContainer); mEntryManager.setUpWithPresenter(this, notifListContainer, mHeadsUpManager); mEntryManager.addNotificationEntryListener(notificationEntryListener); mEntryManager.addNotificationLifetimeExtender(mHeadsUpManager); mEntryManager.addNotificationLifetimeExtender(mAmbientPulseManager); - mEntryManager.addNotificationLifetimeExtender(gutsManager); + mEntryManager.addNotificationLifetimeExtender(mGutsManager); mEntryManager.addNotificationLifetimeExtenders( remoteInputManager.getLifetimeExtenders()); mNotificationRowBinder.setUpWithPresenter(this, notifListContainer, mHeadsUpManager, @@ -223,7 +223,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mLockscreenUserManager.setUpWithPresenter(this); mMediaManager.setUpWithPresenter(this); mVisualStabilityManager.setUpWithPresenter(this); - gutsManager.setUpWithPresenter(this, + mGutsManager.setUpWithPresenter(this, notifListContainer, mCheckSaveListener, mOnSettingsClickListener); // ForegroundServiceControllerListener adds its listener in its constructor // but we need to request it here in order for it to be instantiated. @@ -242,7 +242,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, MessagingMessage.dropCache(); MessagingGroup.dropCache(); if (!KeyguardUpdateMonitor.getInstance(mContext).isSwitchingUser()) { - mEntryManager.updateNotificationsOnDensityOrFontScaleChanged(); + updateNotificationsOnDensityOrFontScaleChanged(); } else { mReinflateNotificationsOnUserSwitched = true; } @@ -269,6 +269,19 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, } } + private void updateNotificationsOnDensityOrFontScaleChanged() { + ArrayList<NotificationEntry> userNotifications = + mEntryManager.getNotificationData().getNotificationsForCurrentUser(); + for (int i = 0; i < userNotifications.size(); i++) { + NotificationEntry entry = userNotifications.get(i); + entry.onDensityOrFontScaleChanged(); + boolean exposedGuts = entry.areGutsExposed(); + if (exposedGuts) { + mGutsManager.onDensityOrFontScaleChanged(entry); + } + } + } + @Override public boolean isCollapsing() { return mNotificationPanel.isCollapsing() @@ -367,7 +380,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, if (MULTIUSER_DEBUG) mNotificationPanelDebugText.setText("USER " + newUserId); mCommandQueue.animateCollapsePanels(); if (mReinflateNotificationsOnUserSwitched) { - mEntryManager.updateNotificationsOnDensityOrFontScaleChanged(); + updateNotificationsOnDensityOrFontScaleChanged(); mReinflateNotificationsOnUserSwitched = false; } if (mDispatchUiModeChangeOnUserSwitched) { |