Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,9 @@ interface ISystemUiProxy { /** Sets home rotation enabled. */ oneway void setHomeRotationEnabled(boolean enabled) = 45; /** Notifies when taskbar is enabled or disabled */ oneway void setTaskbarEnabled(boolean enabled) = 500; /** Notifies when taskbar status updated */ oneway void notifyTaskbarStatus(boolean visible, boolean stashed) = 47; Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +21 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ 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; import android.content.Context; import android.content.pm.ActivityInfo; Loading Loading @@ -78,6 +77,7 @@ public class NavigationBarController implements Callbacks, ConfigurationController.ConfigurationListener, NavigationModeController.ModeChangedListener, OverviewProxyService.OverviewProxyListener, Dumpable { private static final String TAG = NavigationBarController.class.getSimpleName(); Loading @@ -92,7 +92,7 @@ public class NavigationBarController implements private final TaskbarDelegate mTaskbarDelegate; private final NavBarHelper mNavBarHelper; private int mNavMode; @VisibleForTesting boolean mIsLargeScreen; @VisibleForTesting boolean mTaskbarShowing; /** A displayId - nav bar maps. */ @VisibleForTesting Loading Loading @@ -140,16 +140,15 @@ public class NavigationBarController implements navBarHelper, navigationModeController, sysUiFlagsContainer, dumpManager, autoHideController, lightBarController, pipOptional, backAnimation.orElse(null), taskStackChangeListeners); mIsLargeScreen = isLargeScreen(mContext); overviewProxyService.addCallback(this); dumpManager.registerDumpable(this); } @Override public void onConfigChanged(Configuration newConfig) { boolean isOldConfigLargeScreen = mIsLargeScreen; mIsLargeScreen = isLargeScreen(mContext); boolean oldShouldShowTaskbar = shouldShowTaskbar(); boolean willApplyConfig = mConfigChanges.applyNewConfig(mContext.getResources()); boolean largeScreenChanged = mIsLargeScreen != isOldConfigLargeScreen; boolean largeScreenChanged = shouldShowTaskbar() != oldShouldShowTaskbar; // TODO(b/243765256): Disable this logging once b/243765256 is fixed. Log.i(DEBUG_MISSING_GESTURE_TAG, "NavbarController: newConfig=" + newConfig + " mTaskbarDelegate initialized=" + mTaskbarDelegate.isInitialized() Loading Loading @@ -198,6 +197,16 @@ public class NavigationBarController implements }); } @Override public void onTaskbarEnabled(boolean enabled) { boolean oldShouldShowTaskbar = shouldShowTaskbar(); mTaskbarShowing = enabled; boolean largeScreenChanged = shouldShowTaskbar() != oldShouldShowTaskbar; if (largeScreenChanged) { updateNavbarForTaskbar(); } } private void updateAccessibilityButtonModeIfNeeded() { final int mode = mSecureSettings.getIntForUser( Settings.Secure.ACCESSIBILITY_BUTTON_MODE, Loading Loading @@ -250,7 +259,7 @@ public class NavigationBarController implements /** @return {@code true} if taskbar is enabled, false otherwise */ private boolean initializeTaskbarIfNecessary() { // Enable for large screens or (phone AND flag is set); assuming phone = !mIsLargeScreen boolean taskbarEnabled = (mIsLargeScreen || mFeatureFlags.isEnabled( boolean taskbarEnabled = (shouldShowTaskbar() || mFeatureFlags.isEnabled( Flags.HIDE_NAVBAR_WINDOW)) && shouldCreateNavBarAndTaskBar(mContext.getDisplayId()); if (taskbarEnabled) { Loading Loading @@ -278,7 +287,6 @@ public class NavigationBarController implements @Override public void onDisplayReady(int displayId) { Display display = mDisplayManager.getDisplay(displayId); mIsLargeScreen = isLargeScreen(mContext); createNavigationBar(display, null /* savedState */, null /* result */); } Loading Loading @@ -475,6 +483,10 @@ public class NavigationBarController implements } } private boolean shouldShowTaskbar() { return mTaskbarShowing; } /** @return {@link NavigationBar} on the default display. */ @Nullable public NavigationBar getDefaultNavigationBar() { Loading @@ -483,7 +495,7 @@ public class NavigationBarController implements @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("mIsLargeScreen=" + mIsLargeScreen); pw.println("mTaskbarShowing=" + mTaskbarShowing); pw.println("mNavMode=" + mNavMode); for (int i = 0; i < mNavigationBars.size(); i++) { if (i > 0) { Loading packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +13 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mHandler.post(() -> notifyHomeRotationEnabled(enabled))); } @Override public void setTaskbarEnabled(boolean enabled) { verifyCallerAndClearCallingIdentityPostMain("setTaskbarEnabled", () -> onTaskbarEnabled(enabled)); } @Override public void notifyTaskbarStatus(boolean visible, boolean stashed) { verifyCallerAndClearCallingIdentityPostMain("notifyTaskbarStatus", () -> Loading Loading @@ -872,6 +878,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } private void onTaskbarEnabled(boolean enabled) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onTaskbarEnabled(enabled); } } private void onTaskbarStatusUpdated(boolean visible, boolean stashed) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onTaskbarStatusUpdated(visible, stashed); Loading Loading @@ -1058,6 +1070,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis /** Notify the recents app (overview) is started by 3-button navigation. */ default void onToggleRecentApps() {} default void onHomeRotationEnabled(boolean enabled) {} default void onTaskbarEnabled(boolean enabled) {} default void onTaskbarStatusUpdated(boolean visible, boolean stashed) {} default void onTaskbarAutohideSuspend(boolean suspend) {} default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {} Loading packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class NavigationBarControllerTest extends SysuiTestCase { @Test public void testCreateNavigationBarsIncludeDefaultTrue() { // Large screens may be using taskbar and the logic is different mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mTaskbarShowing = false; doNothing().when(mNavigationBarController).createNavigationBar(any(), any(), any()); mNavigationBarController.createNavigationBars(true, null); Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,9 @@ interface ISystemUiProxy { /** Sets home rotation enabled. */ oneway void setHomeRotationEnabled(boolean enabled) = 45; /** Notifies when taskbar is enabled or disabled */ oneway void setTaskbarEnabled(boolean enabled) = 500; /** Notifies when taskbar status updated */ oneway void notifyTaskbarStatus(boolean visible, boolean stashed) = 47; Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +21 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ 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; import android.content.Context; import android.content.pm.ActivityInfo; Loading Loading @@ -78,6 +77,7 @@ public class NavigationBarController implements Callbacks, ConfigurationController.ConfigurationListener, NavigationModeController.ModeChangedListener, OverviewProxyService.OverviewProxyListener, Dumpable { private static final String TAG = NavigationBarController.class.getSimpleName(); Loading @@ -92,7 +92,7 @@ public class NavigationBarController implements private final TaskbarDelegate mTaskbarDelegate; private final NavBarHelper mNavBarHelper; private int mNavMode; @VisibleForTesting boolean mIsLargeScreen; @VisibleForTesting boolean mTaskbarShowing; /** A displayId - nav bar maps. */ @VisibleForTesting Loading Loading @@ -140,16 +140,15 @@ public class NavigationBarController implements navBarHelper, navigationModeController, sysUiFlagsContainer, dumpManager, autoHideController, lightBarController, pipOptional, backAnimation.orElse(null), taskStackChangeListeners); mIsLargeScreen = isLargeScreen(mContext); overviewProxyService.addCallback(this); dumpManager.registerDumpable(this); } @Override public void onConfigChanged(Configuration newConfig) { boolean isOldConfigLargeScreen = mIsLargeScreen; mIsLargeScreen = isLargeScreen(mContext); boolean oldShouldShowTaskbar = shouldShowTaskbar(); boolean willApplyConfig = mConfigChanges.applyNewConfig(mContext.getResources()); boolean largeScreenChanged = mIsLargeScreen != isOldConfigLargeScreen; boolean largeScreenChanged = shouldShowTaskbar() != oldShouldShowTaskbar; // TODO(b/243765256): Disable this logging once b/243765256 is fixed. Log.i(DEBUG_MISSING_GESTURE_TAG, "NavbarController: newConfig=" + newConfig + " mTaskbarDelegate initialized=" + mTaskbarDelegate.isInitialized() Loading Loading @@ -198,6 +197,16 @@ public class NavigationBarController implements }); } @Override public void onTaskbarEnabled(boolean enabled) { boolean oldShouldShowTaskbar = shouldShowTaskbar(); mTaskbarShowing = enabled; boolean largeScreenChanged = shouldShowTaskbar() != oldShouldShowTaskbar; if (largeScreenChanged) { updateNavbarForTaskbar(); } } private void updateAccessibilityButtonModeIfNeeded() { final int mode = mSecureSettings.getIntForUser( Settings.Secure.ACCESSIBILITY_BUTTON_MODE, Loading Loading @@ -250,7 +259,7 @@ public class NavigationBarController implements /** @return {@code true} if taskbar is enabled, false otherwise */ private boolean initializeTaskbarIfNecessary() { // Enable for large screens or (phone AND flag is set); assuming phone = !mIsLargeScreen boolean taskbarEnabled = (mIsLargeScreen || mFeatureFlags.isEnabled( boolean taskbarEnabled = (shouldShowTaskbar() || mFeatureFlags.isEnabled( Flags.HIDE_NAVBAR_WINDOW)) && shouldCreateNavBarAndTaskBar(mContext.getDisplayId()); if (taskbarEnabled) { Loading Loading @@ -278,7 +287,6 @@ public class NavigationBarController implements @Override public void onDisplayReady(int displayId) { Display display = mDisplayManager.getDisplay(displayId); mIsLargeScreen = isLargeScreen(mContext); createNavigationBar(display, null /* savedState */, null /* result */); } Loading Loading @@ -475,6 +483,10 @@ public class NavigationBarController implements } } private boolean shouldShowTaskbar() { return mTaskbarShowing; } /** @return {@link NavigationBar} on the default display. */ @Nullable public NavigationBar getDefaultNavigationBar() { Loading @@ -483,7 +495,7 @@ public class NavigationBarController implements @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("mIsLargeScreen=" + mIsLargeScreen); pw.println("mTaskbarShowing=" + mTaskbarShowing); pw.println("mNavMode=" + mNavMode); for (int i = 0; i < mNavigationBars.size(); i++) { if (i > 0) { Loading
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +13 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mHandler.post(() -> notifyHomeRotationEnabled(enabled))); } @Override public void setTaskbarEnabled(boolean enabled) { verifyCallerAndClearCallingIdentityPostMain("setTaskbarEnabled", () -> onTaskbarEnabled(enabled)); } @Override public void notifyTaskbarStatus(boolean visible, boolean stashed) { verifyCallerAndClearCallingIdentityPostMain("notifyTaskbarStatus", () -> Loading Loading @@ -872,6 +878,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } private void onTaskbarEnabled(boolean enabled) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onTaskbarEnabled(enabled); } } private void onTaskbarStatusUpdated(boolean visible, boolean stashed) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onTaskbarStatusUpdated(visible, stashed); Loading Loading @@ -1058,6 +1070,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis /** Notify the recents app (overview) is started by 3-button navigation. */ default void onToggleRecentApps() {} default void onHomeRotationEnabled(boolean enabled) {} default void onTaskbarEnabled(boolean enabled) {} default void onTaskbarStatusUpdated(boolean visible, boolean stashed) {} default void onTaskbarAutohideSuspend(boolean suspend) {} default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {} Loading
packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class NavigationBarControllerTest extends SysuiTestCase { @Test public void testCreateNavigationBarsIncludeDefaultTrue() { // Large screens may be using taskbar and the logic is different mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mTaskbarShowing = false; doNothing().when(mNavigationBarController).createNavigationBar(any(), any(), any()); mNavigationBarController.createNavigationBars(true, null); Loading