Loading src/com/android/settings/gestures/SystemNavigationGestureSettings.java +2 −2 Original line number Diff line number Diff line Loading @@ -258,9 +258,9 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i @VisibleForTesting static String getCurrentSystemNavigationMode(Context context) { if (SystemNavigationPreferenceController.isEdgeToEdgeEnabled(context)) { if (SystemNavigationPreferenceController.isGestureNavigationEnabled(context)) { return KEY_SYSTEM_NAV_GESTURAL; } else if (SystemNavigationPreferenceController.isSwipeUpEnabled(context)) { } else if (SystemNavigationPreferenceController.is2ButtonNavigationEnabled(context)) { return KEY_SYSTEM_NAV_2BUTTONS; } else { return KEY_SYSTEM_NAV_3BUTTONS; Loading src/com/android/settings/gestures/SystemNavigationPreferenceController.java +4 −7 Original line number Diff line number Diff line Loading @@ -43,9 +43,9 @@ public class SystemNavigationPreferenceController extends BasePreferenceControll @Override public CharSequence getSummary() { if (isEdgeToEdgeEnabled(mContext)) { if (isGestureNavigationEnabled(mContext)) { return mContext.getText(R.string.edge_to_edge_navigation_title); } else if (isSwipeUpEnabled(mContext)) { } else if (is2ButtonNavigationEnabled(mContext)) { return mContext.getText(R.string.swipe_up_to_switch_apps_title); } else { return mContext.getText(R.string.legacy_navigation_title); Loading Loading @@ -86,15 +86,12 @@ public class SystemNavigationPreferenceController extends BasePreferenceControll } } static boolean isSwipeUpEnabled(Context context) { if (isEdgeToEdgeEnabled(context)) { return false; } static boolean is2ButtonNavigationEnabled(Context context) { return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } static boolean isEdgeToEdgeEnabled(Context context) { static boolean isGestureNavigationEnabled(Context context) { return NAV_BAR_MODE_GESTURAL == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } Loading tests/robotests/src/com/android/settings/gestures/SystemNavigationPreferenceControllerTest.java +12 −6 Original line number Diff line number Diff line Loading @@ -137,30 +137,36 @@ public class SystemNavigationPreferenceControllerTest { public void testIsSwipeUpEnabled() { SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_2BUTTON); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isTrue(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isTrue(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isFalse(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isFalse(); } @Test public void testIsEdgeToEdgeEnabled() { SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isTrue(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isTrue(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isFalse(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_2BUTTON); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isFalse(); } @Test Loading Loading
src/com/android/settings/gestures/SystemNavigationGestureSettings.java +2 −2 Original line number Diff line number Diff line Loading @@ -258,9 +258,9 @@ public class SystemNavigationGestureSettings extends RadioButtonPickerFragment i @VisibleForTesting static String getCurrentSystemNavigationMode(Context context) { if (SystemNavigationPreferenceController.isEdgeToEdgeEnabled(context)) { if (SystemNavigationPreferenceController.isGestureNavigationEnabled(context)) { return KEY_SYSTEM_NAV_GESTURAL; } else if (SystemNavigationPreferenceController.isSwipeUpEnabled(context)) { } else if (SystemNavigationPreferenceController.is2ButtonNavigationEnabled(context)) { return KEY_SYSTEM_NAV_2BUTTONS; } else { return KEY_SYSTEM_NAV_3BUTTONS; Loading
src/com/android/settings/gestures/SystemNavigationPreferenceController.java +4 −7 Original line number Diff line number Diff line Loading @@ -43,9 +43,9 @@ public class SystemNavigationPreferenceController extends BasePreferenceControll @Override public CharSequence getSummary() { if (isEdgeToEdgeEnabled(mContext)) { if (isGestureNavigationEnabled(mContext)) { return mContext.getText(R.string.edge_to_edge_navigation_title); } else if (isSwipeUpEnabled(mContext)) { } else if (is2ButtonNavigationEnabled(mContext)) { return mContext.getText(R.string.swipe_up_to_switch_apps_title); } else { return mContext.getText(R.string.legacy_navigation_title); Loading Loading @@ -86,15 +86,12 @@ public class SystemNavigationPreferenceController extends BasePreferenceControll } } static boolean isSwipeUpEnabled(Context context) { if (isEdgeToEdgeEnabled(context)) { return false; } static boolean is2ButtonNavigationEnabled(Context context) { return NAV_BAR_MODE_2BUTTON == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } static boolean isEdgeToEdgeEnabled(Context context) { static boolean isGestureNavigationEnabled(Context context) { return NAV_BAR_MODE_GESTURAL == context.getResources().getInteger( com.android.internal.R.integer.config_navBarInteractionMode); } Loading
tests/robotests/src/com/android/settings/gestures/SystemNavigationPreferenceControllerTest.java +12 −6 Original line number Diff line number Diff line Loading @@ -137,30 +137,36 @@ public class SystemNavigationPreferenceControllerTest { public void testIsSwipeUpEnabled() { SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_2BUTTON); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isTrue(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isTrue(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isFalse(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL); assertThat(SystemNavigationPreferenceController.isSwipeUpEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.is2ButtonNavigationEnabled( mContext)).isFalse(); } @Test public void testIsEdgeToEdgeEnabled() { SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isTrue(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isTrue(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isFalse(); SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode, NAV_BAR_MODE_2BUTTON); assertThat(SystemNavigationPreferenceController.isEdgeToEdgeEnabled(mContext)).isFalse(); assertThat(SystemNavigationPreferenceController.isGestureNavigationEnabled( mContext)).isFalse(); } @Test Loading