1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 import android.content.ContentResolver; 18 import android.provider.Settings; 19 20 public class SettingsCompat { 21 public static String ACTION_SYSTEM_UPDATE_SETTINGS = Settings.ACTION_SYSTEM_UPDATE_SETTINGS; 22 23 public static String ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT = 24 Settings.Secure.ENABLED_ACCESSIBILITY_AUDIO_DESCRIPTION_BY_DEFAULT; 25 26 public static String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 27 Settings.Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED; 28 getStringForUser(ContentResolver resolver, String name, int userHandle)29 public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { 30 return Settings.Secure.getStringForUser(resolver, name, userHandle); 31 } 32 putStringForUser( ContentResolver resolver, String name, String value, int userHandle)33 public static boolean putStringForUser( 34 ContentResolver resolver, String name, String value, int userHandle) { 35 return Settings.Secure.putStringForUser(resolver, name, value, userHandle); 36 } 37 38 public static String ATTENTIVE_TIMEOUT = Settings.Secure.ATTENTIVE_TIMEOUT; 39 public static String SLEEP_TIMEOUT = Settings.Secure.SLEEP_TIMEOUT; 40 public static String SCREENSAVER_ACTIVATE_ON_DOCK = 41 Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK; 42 public static String SCREENSAVER_ACTIVATE_ON_SLEEP = 43 Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP; 44 public static String SCREENSAVER_ENABLED = Settings.Secure.SCREENSAVER_ENABLED; 45 public static String WIFI_SCAN_ALWAYS_AVAILABLE = Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE; 46 public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 47 Settings.Secure.MATCH_CONTENT_FRAMERATE_ALWAYS; 48 public static String MATCH_CONTENT_FRAME_RATE = Settings.Secure.MATCH_CONTENT_FRAME_RATE; 49 public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 50 Settings.Secure.MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY; 51 public static final int MATCH_CONTENT_FRAMERATE_NEVER = 52 Settings.Secure.MATCH_CONTENT_FRAMERATE_NEVER; 53 public static String MINIMAL_POST_PROCESSING_ALLOWED = 54 Settings.Secure.MINIMAL_POST_PROCESSING_ALLOWED; 55 public static final String ENCODED_SURROUND_OUTPUT = Settings.Global.ENCODED_SURROUND_OUTPUT; 56 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 57 Settings.Global.ENCODED_SURROUND_OUTPUT_AUTO; 58 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 59 Settings.Global.ENCODED_SURROUND_OUTPUT_MANUAL; 60 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 61 Settings.Global.ENCODED_SURROUND_OUTPUT_NEVER; 62 public static String DISABLED_SYSTEM_INPUT_METHODS = 63 Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS; 64 public static int LOCATION_MODE_ON = Settings.Secure.LOCATION_MODE_ON; 65 public static int LOCATION_MODE_OFF = Settings.Secure.LOCATION_MODE_OFF; 66 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 67 "accessibility_captioning_typeface"; 68 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 69 "accessibility_display_daltonizer_enabled"; 70 public static String ACTION_ENTERPRISE_PRIVACY_SETTINGS = 71 Settings.ACTION_ENTERPRISE_PRIVACY_SETTINGS; 72 public static String ENABLED_NOTIFICATION_LISTENERS = 73 Settings.Secure.ENABLED_NOTIFICATION_LISTENERS; 74 75 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 76 "accessibility_captioning_font_scale"; 77 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = "accessibility_captioning_locale"; 78 public static final String ACCESSIBILITY_CAPTIONING_PRESET = "accessibility_captioning_preset"; 79 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 80 "accessibility_captioning_enabled"; 81 public static String KEEP_PROFILE_IN_BACKGROUND = Settings.Global.KEEP_PROFILE_IN_BACKGROUND; 82 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS = 83 Settings.Global.ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS; 84 public static String AUTOFILL_SERVICE = Settings.Secure.AUTOFILL_SERVICE; 85 86 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 87 "accessibility_shortcut_target_service"; 88 89 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 90 91 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 92 "accessibility_captioning_foreground_color"; 93 94 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 95 "accessibility_captioning_edge_type"; 96 getIntForUser(ContentResolver cr, String name, int def, int userHandle)97 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 98 return Settings.System.getIntForUser(cr, name, def, userHandle); 99 } 100 101 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 102 "accessibility_captioning_edge_color"; 103 104 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 105 "accessibility_captioning_background_color"; 106 107 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 108 "accessibility_captioning_window_color"; 109 110 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 111 112 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 113 114 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 115 116 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 117 118 public static final String WIFI_DISPLAY_CERTIFICATION_ON = "wifi_display_certification_on"; 119 120 public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs"; 121 122 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 123 124 public static final String POINTER_LOCATION = "pointer_location"; 125 126 public static final String SHOW_TOUCHES = "show_touches"; 127 128 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 129 130 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 131 "accessibility_display_daltonizer"; 132 133 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 134 "usb_audio_automatic_routing_disabled"; 135 136 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES = 137 "force_resizable_activities"; 138 139 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 140 141 public static final String ACTION_DATA_SAVER_SETTINGS = "android.settings.DATA_SAVER_SETTINGS"; 142 } 143