Loading core/java/android/util/FeatureFlagUtils.java +4 −4 Original line number Diff line number Diff line Loading @@ -71,8 +71,8 @@ public class FeatureFlagUtils { * Hide back key in the Settings two pane design. * @hide */ public static final String SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE = "settings_hide_secondary_page_back_button_in_two_pane"; public static final String SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE = "settings_hide_second_layer_page_navigate_up_button_in_two_pane"; private static final Map<String, String> DEFAULT_FLAGS; Loading @@ -99,7 +99,7 @@ public class FeatureFlagUtils { DEFAULT_FLAGS.put(SETTINGS_APP_LANGUAGE_SELECTION, "true"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS, "true"); DEFAULT_FLAGS.put(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME, "false"); DEFAULT_FLAGS.put(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE, "true"); DEFAULT_FLAGS.put(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE, "true"); } private static final Set<String> PERSISTENT_FLAGS; Loading @@ -109,7 +109,7 @@ public class FeatureFlagUtils { PERSISTENT_FLAGS.add(SETTINGS_SUPPORT_LARGE_SCREEN); PERSISTENT_FLAGS.add(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS); PERSISTENT_FLAGS.add(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME); PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE); PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE); } /** Loading packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java +15 −8 Original line number Diff line number Diff line Loading @@ -51,27 +51,34 @@ public class ActivityEmbeddingUtils { } /** * Whether current activity is embedded in the Settings app or not. * Whether the current activity is embedded in the Settings app or not. * * @param activity Activity that needs the check */ public static boolean isActivityEmbedded(Activity activity) { return SplitController.getInstance().isActivityEmbedded(activity); } /** * Whether current activity is suggested to show back button or not. * Whether the current activity should hide the navigate up button. * * @param activity Activity that needs the check * @param isSecondLayerPage indicates if the activity(page) is shown in the 2nd layer of * Settings app */ public static boolean shouldHideBackButton(Activity activity, boolean isSecondaryLayerPage) { public static boolean shouldHideNavigateUpButton(Activity activity, boolean isSecondLayerPage) { if (!BuildCompat.isAtLeastT()) { return false; } if (!isSecondaryLayerPage) { if (!isSecondLayerPage) { return false; } final String shouldHideBackButton = Settings.Global.getString(activity.getContentResolver(), "settings_hide_secondary_page_back_button_in_two_pane"); final String shouldHideNavigateUpButton = Settings.Global.getString(activity.getContentResolver(), "settings_hide_second_layer_page_navigate_up_button_in_two_pane"); if (TextUtils.isEmpty(shouldHideBackButton) || TextUtils.equals("true", shouldHideBackButton)) { if (TextUtils.isEmpty(shouldHideNavigateUpButton) || Boolean.parseBoolean(shouldHideNavigateUpButton)) { return isActivityEmbedded(activity); } return false; Loading Loading
core/java/android/util/FeatureFlagUtils.java +4 −4 Original line number Diff line number Diff line Loading @@ -71,8 +71,8 @@ public class FeatureFlagUtils { * Hide back key in the Settings two pane design. * @hide */ public static final String SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE = "settings_hide_secondary_page_back_button_in_two_pane"; public static final String SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE = "settings_hide_second_layer_page_navigate_up_button_in_two_pane"; private static final Map<String, String> DEFAULT_FLAGS; Loading @@ -99,7 +99,7 @@ public class FeatureFlagUtils { DEFAULT_FLAGS.put(SETTINGS_APP_LANGUAGE_SELECTION, "true"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS, "true"); DEFAULT_FLAGS.put(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME, "false"); DEFAULT_FLAGS.put(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE, "true"); DEFAULT_FLAGS.put(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE, "true"); } private static final Set<String> PERSISTENT_FLAGS; Loading @@ -109,7 +109,7 @@ public class FeatureFlagUtils { PERSISTENT_FLAGS.add(SETTINGS_SUPPORT_LARGE_SCREEN); PERSISTENT_FLAGS.add(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS); PERSISTENT_FLAGS.add(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME); PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECONDARY_PAGE_BACK_BUTTON_IN_TWO_PANE); PERSISTENT_FLAGS.add(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE); } /** Loading
packages/SettingsLib/ActivityEmbedding/src/com/android/settingslib/activityembedding/ActivityEmbeddingUtils.java +15 −8 Original line number Diff line number Diff line Loading @@ -51,27 +51,34 @@ public class ActivityEmbeddingUtils { } /** * Whether current activity is embedded in the Settings app or not. * Whether the current activity is embedded in the Settings app or not. * * @param activity Activity that needs the check */ public static boolean isActivityEmbedded(Activity activity) { return SplitController.getInstance().isActivityEmbedded(activity); } /** * Whether current activity is suggested to show back button or not. * Whether the current activity should hide the navigate up button. * * @param activity Activity that needs the check * @param isSecondLayerPage indicates if the activity(page) is shown in the 2nd layer of * Settings app */ public static boolean shouldHideBackButton(Activity activity, boolean isSecondaryLayerPage) { public static boolean shouldHideNavigateUpButton(Activity activity, boolean isSecondLayerPage) { if (!BuildCompat.isAtLeastT()) { return false; } if (!isSecondaryLayerPage) { if (!isSecondLayerPage) { return false; } final String shouldHideBackButton = Settings.Global.getString(activity.getContentResolver(), "settings_hide_secondary_page_back_button_in_two_pane"); final String shouldHideNavigateUpButton = Settings.Global.getString(activity.getContentResolver(), "settings_hide_second_layer_page_navigate_up_button_in_two_pane"); if (TextUtils.isEmpty(shouldHideBackButton) || TextUtils.equals("true", shouldHideBackButton)) { if (TextUtils.isEmpty(shouldHideNavigateUpButton) || Boolean.parseBoolean(shouldHideNavigateUpButton)) { return isActivityEmbedded(activity); } return false; Loading