Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGAT import static com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler.DEBUG_MISSING_GESTURE_TAG; import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; import static com.android.wm.shell.Flags.enableTaskbarOnPhones; import android.content.Context; import android.content.pm.ActivityInfo; Loading Loading @@ -285,8 +286,10 @@ public class NavigationBarControllerImpl implements @VisibleForTesting boolean supportsTaskbar() { // Enable for tablets, unfolded state on a foldable device or (non handheld AND flag is set) return mIsLargeScreen || (!mIsPhone && enableTaskbarNavbarUnification()); // Enable for tablets, unfolded state on a foldable device, (non handheld AND flag is set), // or handheld when enableTaskbarOnPhones() returns true. boolean foldedOrPhone = !mIsPhone || enableTaskbarOnPhones(); return mIsLargeScreen || (foldedOrPhone && enableTaskbarNavbarUnification()); } private final CommandQueue.Callbacks mCommandQueueCallbacks = new CommandQueue.Callbacks() { Loading packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java +14 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.Display.INVALID_DISPLAY; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession; import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; import static com.android.wm.shell.Flags.enableTaskbarOnPhones; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading Loading @@ -142,10 +143,11 @@ public class NavigationBarControllerImplTest extends SysuiTestCase { @Test public void testCreateNavigationBarsIncludeDefaultTrue() { assumeFalse(enableTaskbarNavbarUnification()); assumeFalse(enableTaskbarNavbarUnification() && enableTaskbarOnPhones()); // Large screens may be using taskbar and the logic is different mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; doNothing().when(mNavigationBarController).createNavigationBar(any(), any(), any()); mNavigationBarController.createNavigationBars(true, null); Loading Loading @@ -291,6 +293,17 @@ public class NavigationBarControllerImplTest extends SysuiTestCase { @Test public void testShouldRenderTaskbar_taskbarNotRenderedOnPhone() { assumeFalse(enableTaskbarOnPhones()); mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; assertFalse(mNavigationBarController.supportsTaskbar()); } @Test public void testShouldRenderTaskbar_taskbarRenderedOnPhone() { assumeTrue(enableTaskbarNavbarUnification() && enableTaskbarOnPhones()); mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; assertFalse(mNavigationBarController.supportsTaskbar()); Loading Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGAT import static com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler.DEBUG_MISSING_GESTURE_TAG; import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; import static com.android.wm.shell.Flags.enableTaskbarOnPhones; import android.content.Context; import android.content.pm.ActivityInfo; Loading Loading @@ -285,8 +286,10 @@ public class NavigationBarControllerImpl implements @VisibleForTesting boolean supportsTaskbar() { // Enable for tablets, unfolded state on a foldable device or (non handheld AND flag is set) return mIsLargeScreen || (!mIsPhone && enableTaskbarNavbarUnification()); // Enable for tablets, unfolded state on a foldable device, (non handheld AND flag is set), // or handheld when enableTaskbarOnPhones() returns true. boolean foldedOrPhone = !mIsPhone || enableTaskbarOnPhones(); return mIsLargeScreen || (foldedOrPhone && enableTaskbarNavbarUnification()); } private final CommandQueue.Callbacks mCommandQueueCallbacks = new CommandQueue.Callbacks() { Loading
packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java +14 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.Display.INVALID_DISPLAY; import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession; import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification; import static com.android.wm.shell.Flags.enableTaskbarOnPhones; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading Loading @@ -142,10 +143,11 @@ public class NavigationBarControllerImplTest extends SysuiTestCase { @Test public void testCreateNavigationBarsIncludeDefaultTrue() { assumeFalse(enableTaskbarNavbarUnification()); assumeFalse(enableTaskbarNavbarUnification() && enableTaskbarOnPhones()); // Large screens may be using taskbar and the logic is different mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; doNothing().when(mNavigationBarController).createNavigationBar(any(), any(), any()); mNavigationBarController.createNavigationBars(true, null); Loading Loading @@ -291,6 +293,17 @@ public class NavigationBarControllerImplTest extends SysuiTestCase { @Test public void testShouldRenderTaskbar_taskbarNotRenderedOnPhone() { assumeFalse(enableTaskbarOnPhones()); mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; assertFalse(mNavigationBarController.supportsTaskbar()); } @Test public void testShouldRenderTaskbar_taskbarRenderedOnPhone() { assumeTrue(enableTaskbarNavbarUnification() && enableTaskbarOnPhones()); mNavigationBarController.mIsLargeScreen = false; mNavigationBarController.mIsPhone = true; assertFalse(mNavigationBarController.supportsTaskbar()); Loading