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

Commit 76c8e68e authored by Varun Shah's avatar Varun Shah
Browse files

Exposes certain Settings fields as SystemApi for SUW.

User Setup related fields in Settings indicating the setup
personalization state are now exposed.

Global Settings fields indicating whether the device is in demo mode,
a password is required to decrypt the device, and if mobile data is
enabled for provisioning are now exposed.

Various Secure Settings fields are also now exposed. They indicate
information about  doze, user setup information, lock screen
notification settings, assist gesture setup, and whether a suggested
action was completed.

All of the exposed fields require the WRITE_SECURE_SETTINGS permission.

Bug: 116689780
Test: manual (run setup wizard)
Change-Id: If8a96cca216b1d3e3b9329a3f4695caf9f3f248a
parent 3875001f
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -4461,6 +4461,10 @@ package android.provider {
  public final class Settings {
  public final class Settings {
    field public static final java.lang.String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final java.lang.String ACTION_SHOW_ADMIN_SUPPORT_DETAILS = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
    field public static final java.lang.String ACTION_SHOW_ADMIN_SUPPORT_DETAILS = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
    field public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; // 0xa
    field public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; // 0x0
    field public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; // 0x2
    field public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; // 0x1
  }
  }


  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
@@ -4471,10 +4475,13 @@ package android.provider {
    field public static final java.lang.String CARRIER_APP_NAMES = "carrier_app_names";
    field public static final java.lang.String CARRIER_APP_NAMES = "carrier_app_names";
    field public static final java.lang.String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
    field public static final java.lang.String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
    field public static final java.lang.String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
    field public static final java.lang.String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
    field public static final java.lang.String DEVICE_DEMO_MODE = "device_demo_mode";
    field public static final java.lang.String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = "device_provisioning_mobile_data";
    field public static final java.lang.String EUICC_PROVISIONED = "euicc_provisioned";
    field public static final java.lang.String EUICC_PROVISIONED = "euicc_provisioned";
    field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = "install_carrier_app_notification_persistent";
    field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = "install_carrier_app_notification_persistent";
    field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = "install_carrier_app_notification_sleep_millis";
    field public static final java.lang.String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = "install_carrier_app_notification_sleep_millis";
    field public static final java.lang.String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
    field public static final java.lang.String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
    field public static final java.lang.String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
    field public static final java.lang.String SMS_ACCESS_RESTRICTION_ENABLED = "sms_access_restriction_enabled";
    field public static final java.lang.String SMS_ACCESS_RESTRICTION_ENABLED = "sms_access_restriction_enabled";
    field public static final java.lang.String THEATER_MODE_ON = "theater_mode_on";
    field public static final java.lang.String THEATER_MODE_ON = "theater_mode_on";
    field public static final java.lang.String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
    field public static final java.lang.String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
@@ -4485,16 +4492,23 @@ package android.provider {
  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String, boolean);
    method public static boolean putString(android.content.ContentResolver, java.lang.String, java.lang.String, java.lang.String, boolean);
    method public static void resetToDefaults(android.content.ContentResolver, java.lang.String);
    method public static void resetToDefaults(android.content.ContentResolver, java.lang.String);
    field public static final java.lang.String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
    field public static final java.lang.String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = "autofill_field_classification";
    field public static final java.lang.String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = "autofill_field_classification";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = "autofill_user_data_max_category_count";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = "autofill_user_data_max_category_count";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = "autofill_user_data_max_field_classification_size";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = "autofill_user_data_max_field_classification_size";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = "autofill_user_data_max_user_data_size";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = "autofill_user_data_max_user_data_size";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = "autofill_user_data_max_value_length";
    field public static final java.lang.String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = "autofill_user_data_max_value_length";
    field public static final java.lang.String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = "autofill_user_data_min_value_length";
    field public static final java.lang.String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = "autofill_user_data_min_value_length";
    field public static final java.lang.String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
    field public static final java.lang.String DOZE_ALWAYS_ON = "doze_always_on";
    field public static final java.lang.String HUSH_GESTURE_USED = "hush_gesture_used";
    field public static final java.lang.String HUSH_GESTURE_USED = "hush_gesture_used";
    field public static final java.lang.String INSTANT_APPS_ENABLED = "instant_apps_enabled";
    field public static final java.lang.String INSTANT_APPS_ENABLED = "instant_apps_enabled";
    field public static final java.lang.String LAST_SETUP_SHOWN = "last_setup_shown";
    field public static final java.lang.String LAST_SETUP_SHOWN = "last_setup_shown";
    field public static final java.lang.String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications";
    field public static final java.lang.String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications";
    field public static final java.lang.String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
    field public static final java.lang.String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
    field public static final java.lang.String USER_SETUP_COMPLETE = "user_setup_complete";
    field public static final java.lang.String USER_SETUP_PERSONALIZATION_STATE = "user_setup_personalization_state";
    field public static final java.lang.String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
    field public static final java.lang.String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
  }
  }


+78 −32
Original line number Original line Diff line number Diff line
@@ -1815,27 +1815,39 @@ public final class Settings {
    /**
    /**
     * User has not started setup personalization.
     * Indicates that the user has not started setup personalization.
     * One of the possible states for {@link Secure#USER_SETUP_PERSONALIZATION_STATE}.
     *
     * @hide
     * @hide
     */
     */
    @SystemApi
    public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
    public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0;
    /**
    /**
     * User has not yet completed setup personalization.
     * Indicates that the user has not yet completed setup personalization.
     * One of the possible states for {@link Secure#USER_SETUP_PERSONALIZATION_STATE}.
     *
     * @hide
     * @hide
     */
     */
    @SystemApi
    public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
    public static final int USER_SETUP_PERSONALIZATION_STARTED = 1;
    /**
    /**
     * User has snoozed personalization and will complete it later.
     * Indicates that the user has snoozed personalization and will complete it later.
     * One of the possible states for {@link Secure#USER_SETUP_PERSONALIZATION_STATE}.
     *
     * @hide
     * @hide
     */
     */
    @SystemApi
    public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
    public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2;
    /**
    /**
     * User has completed setup personalization.
     * Indicates that the user has completed setup personalization.
     * One of the possible states for {@link Secure#USER_SETUP_PERSONALIZATION_STATE}.
     *
     * @hide
     * @hide
     */
     */
    @SystemApi
    public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
    public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10;
    /** @hide */
    /** @hide */
@@ -5614,18 +5626,23 @@ public final class Settings {
        public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
        public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
        /**
        /**
         * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
         * Indicates whether the current user has completed setup via the setup wizard.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        @TestApi
        @TestApi
        public static final String USER_SETUP_COMPLETE = "user_setup_complete";
        public static final String USER_SETUP_COMPLETE = "user_setup_complete";
        /**
        /**
         * The current state of device personalization.
         * Defines the user's current state of device personalization.
         * The possible states are defined in {@link UserSetupPersonalization}.
         *
         *
         * @hide
         * @hide
         * @see UserSetupPersonalization
         */
         */
        @SystemApi
        public static final String USER_SETUP_PERSONALIZATION_STATE =
        public static final String USER_SETUP_PERSONALIZATION_STATE =
                "user_setup_personalization_state";
                "user_setup_personalization_state";
@@ -5639,10 +5656,14 @@ public final class Settings {
        public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
        public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete";
        /**
        /**
         * Prefix for category name that marks whether a suggested action from that category was
         * The prefix for a category name that indicates whether a suggested action from that
         * completed.
         * category was marked as completed.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
        public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
        /**
        /**
@@ -5914,11 +5935,14 @@ public final class Settings {
            "lock_screen_owner_info_enabled";
            "lock_screen_owner_info_enabled";
        /**
        /**
         * When set by a user, allows notifications to be shown atop a securely locked screen
         * Indicates whether the user has allowed notifications to be shown atop a securely locked
         * in their full "private" form (same as when the device is unlocked).
         * screen in their full "private" form (same as when the device is unlocked).
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @UnsupportedAppUsage
        @SystemApi
        public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
        public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS =
                "lock_screen_allow_private_notifications";
                "lock_screen_allow_private_notifications";
@@ -6944,8 +6968,9 @@ public final class Settings {
        public static final String BACKUP_TRANSPORT = "backup_transport";
        public static final String BACKUP_TRANSPORT = "backup_transport";
        /**
        /**
         * Version for which the setup wizard was last shown.  Bumped for
         * Indicates the version for which the setup wizard was last shown. The version gets
         * each release when there is new setup information to show.
         * bumped for each release when there is new setup information to show.
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
@@ -7261,9 +7286,13 @@ public final class Settings {
        private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
        private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
        /**
        /**
         * Whether doze should be always on.
         * Indicates whether doze should be always on.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        public static final String DOZE_ALWAYS_ON = "doze_always_on";
        public static final String DOZE_ALWAYS_ON = "doze_always_on";
        private static final Validator DOZE_ALWAYS_ON_VALIDATOR = BOOLEAN_VALIDATOR;
        private static final Validator DOZE_ALWAYS_ON_VALIDATOR = BOOLEAN_VALIDATOR;
@@ -7581,10 +7610,13 @@ public final class Settings {
        public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
        public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms";
        /**
        /**
         * This preference enables notification display on the lockscreen.
         * Indicates whether notification display on the lock screen is enabled.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @UnsupportedAppUsage
        @SystemApi
        public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
        public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS =
                "lock_screen_show_notifications";
                "lock_screen_show_notifications";
@@ -7778,10 +7810,13 @@ public final class Settings {
                BOOLEAN_VALIDATOR;
                BOOLEAN_VALIDATOR;
        /**
        /**
         * Whether Assist Gesture Deferred Setup has been completed
         * Indicates whether the Assist Gesture Deferred Setup has been completed.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
        public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
        /**
        /**
@@ -8424,6 +8459,8 @@ public final class Settings {
            VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR);
            VALIDATORS.put(CHARGING_VIBRATION_ENABLED, BOOLEAN_VALIDATOR);
            VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_ENABLED, BOOLEAN_VALIDATOR);
            VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_ENABLED, BOOLEAN_VALIDATOR);
            VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR);
            VALIDATORS.put(ACCESSIBILITY_MINIMUM_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR);
            VALIDATORS.put(USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
            VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR);
        }
        }
        /**
        /**
@@ -9130,13 +9167,16 @@ public final class Settings {
       public static final String DEVICE_PROVISIONED = "device_provisioned";
       public static final String DEVICE_PROVISIONED = "device_provisioned";
        /**
        /**
        * Whether mobile data should be allowed while the device is being provisioned.
         * Indicates whether mobile data should be allowed while the device is being provisioned.
         * This allows the provisioning process to turn off mobile data before the user
         * This allows the provisioning process to turn off mobile data before the user
         * has an opportunity to set things up, preventing other processes from burning
         * has an opportunity to set things up, preventing other processes from burning
         * precious bytes before wifi is setup.
         * precious bytes before wifi is setup.
        * (0 = false, 1 = true)
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
        public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED =
                "device_provisioning_mobile_data";
                "device_provisioning_mobile_data";
@@ -12113,13 +12153,14 @@ public final class Settings {
        public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
        public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned";
        /**
        /**
         * Whether the user wants to be prompted for password to decrypt the device on boot.
         * Indicates whether the user wants to be prompted for password to decrypt the device on
         * This only matters if the storage is encrypted.
         * boot. This only matters if the storage is encrypted.
         * <p>
         * <p>
         * Type: int (0 for false, 1 for true)
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @UnsupportedAppUsage
        @SystemApi
        public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
        public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
        /**
        /**
@@ -12303,12 +12344,14 @@ public final class Settings {
        public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
        public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed";
        /**
        /**
         * Whether this device is currently in retail demo mode. If true, device
         * Indicates whether this device is currently in retail demo mode. If true, the device
         * usage is severely limited.
         * usage is severely limited.
         * <p>
         * <p>
         * Type: int (0 for false, 1 for true)
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         * @hide
         */
         */
        @SystemApi
        public static final String DEVICE_DEMO_MODE = "device_demo_mode";
        public static final String DEVICE_DEMO_MODE = "device_demo_mode";
        /**
        /**
@@ -12630,6 +12673,9 @@ public final class Settings {
            VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
            VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR);
            VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
            VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR);
            VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
            VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR);
            VALIDATORS.put(DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, BOOLEAN_VALIDATOR);
            VALIDATORS.put(REQUIRE_PASSWORD_TO_DECRYPT, BOOLEAN_VALIDATOR);
            VALIDATORS.put(DEVICE_DEMO_MODE, BOOLEAN_VALIDATOR);
        }
        }
        /**
        /**