Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b71f15b1 authored by Pat Manning's avatar Pat Manning Committed by Automerger Merge Worker
Browse files

Merge "Refactor force visible nav bar into new secure setting." into tm-dev am: 60b397e8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17002888

Change-Id: I36e8a2b87c990c23b0d743677c0963768b564941
parents 3d66524e 60b397e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ public class StatusBarManager {
     * Constant for {@link #setNavBarMode(int)} indicating kids navbar mode.
     *
     * <p>When used, back and home icons will change drawables and layout, recents will be hidden,
     * and the navbar will remain visible when apps are in immersive mode.
     * and enables the setting to force navbar visible, even when apps are in immersive mode.
     *
     * @hide
     */
+8 −0
Original line number Diff line number Diff line
@@ -10287,6 +10287,14 @@ public final class Settings {
        public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES =
                "theme_customization_overlay_packages";
        /**
         * Indicates whether the nav bar is forced to always be visible, even in immersive mode.
         * <p>Type: int (0 for false, 1 for true)
         *
         * @hide
         */
        public static final String NAV_BAR_FORCE_VISIBLE = "nav_bar_force_visible";
        /**
         * Indicates whether the device is in kids nav mode.
         * <p>Type: int (0 for false, 1 for true)
+3 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import android.provider.Settings;
/**
 * A ContentObserver for listening force show navigation bar relative setting keys:
 *  - {@link Settings.Secure#NAVIGATION_MODE}
 *  - {@link Settings.Secure#NAV_BAR_KIDS_MODE}
 *  - {@link Settings.Secure#NAV_BAR_FORCE_VISIBLE}
 *
 * @hide
 */
@@ -52,7 +52,7 @@ public class ForceShowNavigationBarSettingsObserver extends ContentObserver {
                Settings.Secure.getUriFor(Settings.Secure.NAVIGATION_MODE),
                false, this, UserHandle.USER_ALL);
        r.registerContentObserver(
                Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE),
                Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_FORCE_VISIBLE),
                false, this, UserHandle.USER_ALL);
    }

@@ -78,6 +78,6 @@ public class ForceShowNavigationBarSettingsObserver extends ContentObserver {
        return Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.NAVIGATION_MODE, 0, UserHandle.USER_CURRENT) == 0
                && Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.NAV_BAR_KIDS_MODE, 0, UserHandle.USER_CURRENT) == 1;
                Settings.Secure.NAV_BAR_FORCE_VISIBLE, 0, UserHandle.USER_CURRENT) == 1;
    }
}
+13 −2
Original line number Diff line number Diff line
@@ -385,7 +385,18 @@ message SecureSettingsProto {

    optional SettingProto multi_press_timeout = 38 [ (android.privacy).dest = DEST_AUTOMATIC ];

    optional SettingProto nav_bar_kids_mode = 91 [ (android.privacy).dest = DEST_AUTOMATIC ];
    message NavBar {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        // Nav bar is forced to always be visible, even in immersive mode.
        optional SettingProto nav_bar_force_visible = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        // Indicates whether the device is in kids nav mode.
        optional SettingProto nav_bar_kids_mode = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional NavBar nav_bar = 92;
    reserved 91; // Formerly nav_bar_kids_mode
    reserved "nav_bar_kids_mode"; // Moved to message NavBar

    optional SettingProto navigation_mode = 76 [ (android.privacy).dest = DEST_AUTOMATIC ];

    message NfcPayment {
@@ -668,5 +679,5 @@ message SecureSettingsProto {

    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // Next tag = 92;
    // Next tag = 93;
}
+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.SKIP_DIRECTION, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SILENCE_GESTURE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES, JSON_OBJECT_VALIDATOR);
        VALIDATORS.put(Secure.NAV_BAR_FORCE_VISIBLE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NAV_BAR_KIDS_MODE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
                Secure.NAVIGATION_MODE, new DiscreteValueValidator(new String[] {"0", "1", "2"}));
Loading