summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2023-09-13 17:58:03 +0000
committer Caitlin Shkuratov <caitlinshk@google.com> 2023-09-13 18:04:10 +0000
commit6e1fa788ebc88eed5e85cd25a2fc5b5a9e60182c (patch)
tree723ef290fac04db0cfa7de7bf917409ac224ce18
parentdfd500cad25f0a08882b077883216c9245a42a6b (diff)
Update NavBarController's CommandQueue callbacks to be separate.
Moves the CommandQueue.Callback methods to be in a separate object to make it clear what interface the methods are overriding. Child CL will add additional override methods. Bug: 277764509 Test: smoke test of gesture nav & 3 button nav working Test: atest NavigationBarControllerTest Change-Id: I7fb46a09be9c5a719679887948aa6c60aeddfe31
-rw-r--r--packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java39
1 files changed, 19 insertions, 20 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
index 580facdda7d7..1960620ab5a9 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
@@ -19,7 +19,6 @@ package com.android.systemui.navigationbar;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR;
-
import static com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler.DEBUG_MISSING_GESTURE_TAG;
import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen;
@@ -58,7 +57,6 @@ import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.statusbar.CommandQueue;
-import com.android.systemui.statusbar.CommandQueue.Callbacks;
import com.android.systemui.statusbar.phone.AutoHideController;
import com.android.systemui.statusbar.phone.BarTransitions.TransitionMode;
import com.android.systemui.statusbar.phone.LightBarController;
@@ -75,7 +73,6 @@ import javax.inject.Inject;
/** A controller to handle navigation bars. */
@SysUISingleton
public class NavigationBarController implements
- Callbacks,
ConfigurationController.ConfigurationListener,
NavigationModeController.ModeChangedListener,
Dumpable {
@@ -130,7 +127,7 @@ public class NavigationBarController implements
mSecureSettings = secureSettings;
mDisplayTracker = displayTracker;
mDisplayManager = mContext.getSystemService(DisplayManager.class);
- commandQueue.addCallback(this);
+ commandQueue.addCallback(mCommandQueueCallbacks);
configurationController.addCallback(this);
mConfigChanges.applyNewConfig(mContext.getResources());
mNavMode = navigationModeController.addListener(this);
@@ -270,25 +267,27 @@ public class NavigationBarController implements
return taskbarEnabled;
}
- @Override
- public void onDisplayRemoved(int displayId) {
- removeNavigationBar(displayId);
- }
+ private final CommandQueue.Callbacks mCommandQueueCallbacks = new CommandQueue.Callbacks() {
+ @Override
+ public void onDisplayRemoved(int displayId) {
+ removeNavigationBar(displayId);
+ }
- @Override
- public void onDisplayReady(int displayId) {
- Display display = mDisplayManager.getDisplay(displayId);
- mIsLargeScreen = isLargeScreen(mContext);
- createNavigationBar(display, null /* savedState */, null /* result */);
- }
+ @Override
+ public void onDisplayReady(int displayId) {
+ Display display = mDisplayManager.getDisplay(displayId);
+ mIsLargeScreen = isLargeScreen(mContext);
+ createNavigationBar(display, null /* savedState */, null /* result */);
+ }
- @Override
- public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
- final NavigationBar navigationBar = getNavigationBar(displayId);
- if (navigationBar != null) {
- navigationBar.setNavigationBarLumaSamplingEnabled(enable);
+ @Override
+ public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
+ final NavigationBar navigationBar = getNavigationBar(displayId);
+ if (navigationBar != null) {
+ navigationBar.setNavigationBarLumaSamplingEnabled(enable);
+ }
}
- }
+ };
/**
* Recreates the navigation bar for the given display.