Loading core/java/android/hardware/input/InputSettings.java +15 −4 Original line number Diff line number Diff line Loading @@ -76,6 +76,12 @@ public class InputSettings { */ public static final int MAX_ACCESSIBILITY_SLOW_KEYS_THRESHOLD_MILLIS = 5000; /** * Default value for {@link Settings.Secure#STYLUS_POINTER_ICON_ENABLED}. * @hide */ public static final int DEFAULT_STYLUS_POINTER_ICON_ENABLED = 1; private InputSettings() { } Loading Loading @@ -383,14 +389,19 @@ public class InputSettings { } /** * Whether a pointer icon will be shown over the location of a * stylus pointer. * Whether a pointer icon will be shown over the location of a stylus pointer. * * @hide */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { if (InputProperties.force_enable_stylus_pointer_icon().orElse(false)) { return true; } return context.getResources() .getBoolean(com.android.internal.R.bool.config_enableStylusPointerIcon) || InputProperties.force_enable_stylus_pointer_icon().orElse(false); && Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED, UserHandle.USER_CURRENT_OR_SELF) != 0; } /** Loading core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -12311,6 +12311,16 @@ public final class Settings { */ public static final String PRIVATE_SPACE_AUTO_LOCK = "private_space_auto_lock"; /** * Toggle for enabling stylus pointer icon. Pointer icons for styluses will only be be shown * when this is enabled. Enabling this alone won't enable the stylus pointer; * config_enableStylusPointerIcon needs to be true as well. * * @hide */ @Readable public static final String STYLUS_POINTER_ICON_ENABLED = "stylus_pointer_icon_enabled"; /** * These entries are considered common between the personal and the managed profile, * since the managed profile doesn't get to change them. Loading core/proto/android/providers/settings/secure.proto +2 −1 Original line number Diff line number Diff line Loading @@ -612,6 +612,7 @@ message SecureSettingsProto { } optional Sounds sounds = 72; optional SettingProto stylus_pointer_icon_enabled = 99 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto swipe_bottom_to_notification_enabled = 82 [ (android.privacy).dest = DEST_AUTOMATIC ]; // Defines whether managed profile ringtones should be synced from its // parent profile. Loading Loading @@ -720,5 +721,5 @@ message SecureSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). // Next tag = 99; // Next tag = 100; } packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +2 −1 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ public class SecureSettings { Settings.Secure.CREDENTIAL_SERVICE, Settings.Secure.CREDENTIAL_SERVICE_PRIMARY, Settings.Secure.EVEN_DIMMER_ACTIVATED, Settings.Secure.EVEN_DIMMER_MIN_NITS Settings.Secure.EVEN_DIMMER_MIN_NITS, Settings.Secure.STYLUS_POINTER_ICON_ENABLED, }; } packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -416,5 +416,6 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.CREDENTIAL_SERVICE, CREDENTIAL_SERVICE_VALIDATOR); VALIDATORS.put(Secure.CREDENTIAL_SERVICE_PRIMARY, NULLABLE_COMPONENT_NAME_VALIDATOR); VALIDATORS.put(Secure.AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); VALIDATORS.put(Secure.STYLUS_POINTER_ICON_ENABLED, BOOLEAN_VALIDATOR); } } Loading
core/java/android/hardware/input/InputSettings.java +15 −4 Original line number Diff line number Diff line Loading @@ -76,6 +76,12 @@ public class InputSettings { */ public static final int MAX_ACCESSIBILITY_SLOW_KEYS_THRESHOLD_MILLIS = 5000; /** * Default value for {@link Settings.Secure#STYLUS_POINTER_ICON_ENABLED}. * @hide */ public static final int DEFAULT_STYLUS_POINTER_ICON_ENABLED = 1; private InputSettings() { } Loading Loading @@ -383,14 +389,19 @@ public class InputSettings { } /** * Whether a pointer icon will be shown over the location of a * stylus pointer. * Whether a pointer icon will be shown over the location of a stylus pointer. * * @hide */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { if (InputProperties.force_enable_stylus_pointer_icon().orElse(false)) { return true; } return context.getResources() .getBoolean(com.android.internal.R.bool.config_enableStylusPointerIcon) || InputProperties.force_enable_stylus_pointer_icon().orElse(false); && Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED, UserHandle.USER_CURRENT_OR_SELF) != 0; } /** Loading
core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -12311,6 +12311,16 @@ public final class Settings { */ public static final String PRIVATE_SPACE_AUTO_LOCK = "private_space_auto_lock"; /** * Toggle for enabling stylus pointer icon. Pointer icons for styluses will only be be shown * when this is enabled. Enabling this alone won't enable the stylus pointer; * config_enableStylusPointerIcon needs to be true as well. * * @hide */ @Readable public static final String STYLUS_POINTER_ICON_ENABLED = "stylus_pointer_icon_enabled"; /** * These entries are considered common between the personal and the managed profile, * since the managed profile doesn't get to change them. Loading
core/proto/android/providers/settings/secure.proto +2 −1 Original line number Diff line number Diff line Loading @@ -612,6 +612,7 @@ message SecureSettingsProto { } optional Sounds sounds = 72; optional SettingProto stylus_pointer_icon_enabled = 99 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto swipe_bottom_to_notification_enabled = 82 [ (android.privacy).dest = DEST_AUTOMATIC ]; // Defines whether managed profile ringtones should be synced from its // parent profile. Loading Loading @@ -720,5 +721,5 @@ message SecureSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). // Next tag = 99; // Next tag = 100; }
packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +2 −1 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ public class SecureSettings { Settings.Secure.CREDENTIAL_SERVICE, Settings.Secure.CREDENTIAL_SERVICE_PRIMARY, Settings.Secure.EVEN_DIMMER_ACTIVATED, Settings.Secure.EVEN_DIMMER_MIN_NITS Settings.Secure.EVEN_DIMMER_MIN_NITS, Settings.Secure.STYLUS_POINTER_ICON_ENABLED, }; }
packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -416,5 +416,6 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.CREDENTIAL_SERVICE, CREDENTIAL_SERVICE_VALIDATOR); VALIDATORS.put(Secure.CREDENTIAL_SERVICE_PRIMARY, NULLABLE_COMPONENT_NAME_VALIDATOR); VALIDATORS.put(Secure.AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); VALIDATORS.put(Secure.STYLUS_POINTER_ICON_ENABLED, BOOLEAN_VALIDATOR); } }