From 0c2b77e5acc31fb90bafc82d0f5c71824a4ce76c Mon Sep 17 00:00:00 2001 From: Caitlin Cassidy Date: Mon, 2 Aug 2021 14:37:45 +0000 Subject: [PATCH] [Misc] Only create KeyguardStatusBarViewController once inside NotificationPanelViewController. The KeyguardStatusBarView never changes, so we don't need to re-create its controller in NPVController#updateViewControllers. Fixes: 194181195 Test: atest and manual Change-Id: If955a8d6167a08bec6e7a7e9e66a2c6a55f68966 --- .../battery/BatteryMeterViewController.java | 6 ------ .../KeyguardStatusBarViewController.java | 11 ----------- .../NotificationPanelViewController.java | 19 ++++++------------- .../android/systemui/util/ViewController.java | 10 ---------- 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java b/packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java index 198aa4ab82777..6dfbd0cc22552 100644 --- a/packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java +++ b/packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java @@ -47,12 +47,6 @@ public class BatteryMeterViewController extends ViewController @Override protected void onViewDetached() { - destroy(); - } - - @Override - public void destroy() { - super.destroy(); mConfigurationController.removeCallback(mConfigurationListener); } } \ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java index 8770e86df7351..796df5507f4c7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java @@ -159,17 +159,6 @@ public class KeyguardStatusBarViewController extends ViewController { } } - /** - * Destroys this controller so that it never receives view attach and detach events again. - * Does nothing if the view is null. - */ - public void destroy() { - if (mView != null) { - mView.removeOnAttachStateChangeListener(mOnAttachStateListener); - } - } - /** * Called when the view is attached and a call to {@link #init()} has been made in either order. */