The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 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 | package android.provider; |
| 18 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 19 | import static android.provider.SettingsValidators.ANY_INTEGER_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 20 | import static android.provider.SettingsValidators.ANY_STRING_VALIDATOR; |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 21 | import static android.provider.SettingsValidators.BOOLEAN_VALIDATOR; |
| 22 | import static android.provider.SettingsValidators.COMPONENT_NAME_VALIDATOR; |
| 23 | import static android.provider.SettingsValidators.LENIENT_IP_ADDRESS_VALIDATOR; |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 24 | import static android.provider.SettingsValidators.LOCALE_VALIDATOR; |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 25 | import static android.provider.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 26 | import static android.provider.SettingsValidators.PACKAGE_NAME_VALIDATOR; |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 27 | import static android.provider.SettingsValidators.URI_VALIDATOR; |
| 28 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 29 | import android.Manifest; |
| 30 | import android.annotation.IntDef; |
| 31 | import android.annotation.IntRange; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 32 | import android.annotation.NonNull; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 33 | import android.annotation.Nullable; |
| 34 | import android.annotation.RequiresPermission; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.annotation.SdkConstant; |
| 36 | import android.annotation.SdkConstant.SdkConstantType; |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 37 | import android.annotation.SystemApi; |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 38 | import android.annotation.TestApi; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 39 | import android.annotation.UserIdInt; |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 40 | import android.app.ActivityThread; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 41 | import android.app.AppOpsManager; |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 42 | import android.app.Application; |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 43 | import android.app.NotificationChannel; |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 44 | import android.app.NotificationManager; |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 45 | import android.app.SearchManager; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 46 | import android.app.WallpaperManager; |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 47 | import android.content.ComponentName; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.content.ContentResolver; |
| 49 | import android.content.ContentValues; |
| 50 | import android.content.Context; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 51 | import android.content.IContentProvider; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.content.Intent; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 53 | import android.content.pm.ActivityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | import android.content.pm.PackageManager; |
| 55 | import android.content.pm.ResolveInfo; |
| 56 | import android.content.res.Configuration; |
| 57 | import android.content.res.Resources; |
| 58 | import android.database.Cursor; |
| 59 | import android.database.SQLException; |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 60 | import android.location.LocationManager; |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 61 | import android.net.ConnectivityManager; |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 62 | import android.net.NetworkScoreManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 63 | import android.net.Uri; |
Irfan Sheriff | 36f7413 | 2010-11-04 16:57:37 -0700 | [diff] [blame] | 64 | import android.net.wifi.WifiManager; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 65 | import android.os.BatteryManager; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 66 | import android.os.Binder; |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 67 | import android.os.Build.VERSION_CODES; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 68 | import android.os.Bundle; |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 69 | import android.os.DropBoxManager; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 70 | import android.os.IBinder; |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 71 | import android.os.LocaleList; |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 72 | import android.os.Process; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 73 | import android.os.RemoteException; |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 74 | import android.os.ResultReceiver; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 75 | import android.os.ServiceManager; |
Dianne Hackborn | f02b60a | 2012-08-16 10:48:27 -0700 | [diff] [blame] | 76 | import android.os.UserHandle; |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 77 | import android.provider.SettingsValidators.Validator; |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 78 | import android.speech.tts.TextToSpeech; |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 79 | import android.telephony.SubscriptionManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | import android.text.TextUtils; |
| 81 | import android.util.AndroidException; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 82 | import android.util.ArrayMap; |
| 83 | import android.util.ArraySet; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 84 | import android.util.Log; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 85 | import android.util.MemoryIntArray; |
Yohei Yukawa | 3f8c568 | 2018-03-01 13:10:23 -0800 | [diff] [blame] | 86 | import android.view.textservice.TextServicesManager; |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 87 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 88 | import com.android.internal.annotations.GuardedBy; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 89 | import com.android.internal.widget.ILockSettings; |
| 90 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 91 | import java.io.IOException; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 92 | import java.lang.annotation.Retention; |
| 93 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 94 | import java.net.URISyntaxException; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 95 | import java.text.SimpleDateFormat; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | import java.util.HashMap; |
| 97 | import java.util.HashSet; |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 98 | import java.util.Locale; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 99 | import java.util.Map; |
| 100 | import java.util.Set; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 101 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | /** |
| 103 | * The Settings provider contains global system-level device preferences. |
| 104 | */ |
| 105 | public final class Settings { |
| 106 | |
| 107 | // Intent actions for Settings |
| 108 | |
| 109 | /** |
| 110 | * Activity Action: Show system settings. |
| 111 | * <p> |
| 112 | * Input: Nothing. |
| 113 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 114 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 115 | */ |
| 116 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 117 | public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; |
| 118 | |
| 119 | /** |
| 120 | * Activity Action: Show settings to allow configuration of APNs. |
| 121 | * <p> |
| 122 | * Input: Nothing. |
| 123 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 124 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 125 | */ |
| 126 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 127 | public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; |
| 128 | |
| 129 | /** |
| 130 | * Activity Action: Show settings to allow configuration of current location |
| 131 | * sources. |
| 132 | * <p> |
| 133 | * In some cases, a matching Activity may not exist, so ensure you |
| 134 | * safeguard against this. |
| 135 | * <p> |
| 136 | * Input: Nothing. |
| 137 | * <p> |
| 138 | * Output: Nothing. |
| 139 | */ |
| 140 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 141 | public static final String ACTION_LOCATION_SOURCE_SETTINGS = |
| 142 | "android.settings.LOCATION_SOURCE_SETTINGS"; |
| 143 | |
| 144 | /** |
Lifu Tang | 58aa11b | 2018-04-12 10:13:15 -0700 | [diff] [blame] | 145 | * Activity Action: Show scanning settings to allow configuration of Wi-Fi |
| 146 | * and Bluetooth scanning settings. |
| 147 | * <p> |
| 148 | * In some cases, a matching Activity may not exist, so ensure you |
| 149 | * safeguard against this. |
| 150 | * <p> |
| 151 | * Input: Nothing. |
| 152 | * <p> |
| 153 | * Output: Nothing. |
| 154 | * @hide |
| 155 | */ |
| 156 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 157 | public static final String ACTION_LOCATION_SCANNING_SETTINGS = |
| 158 | "android.settings.LOCATION_SCANNING_SETTINGS"; |
| 159 | |
| 160 | /** |
Jason Monk | 76c67aa | 2016-02-19 14:49:42 -0500 | [diff] [blame] | 161 | * Activity Action: Show settings to allow configuration of users. |
| 162 | * <p> |
| 163 | * In some cases, a matching Activity may not exist, so ensure you |
| 164 | * safeguard against this. |
| 165 | * <p> |
| 166 | * Input: Nothing. |
| 167 | * <p> |
| 168 | * Output: Nothing. |
| 169 | * @hide |
| 170 | */ |
| 171 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 172 | public static final String ACTION_USER_SETTINGS = |
| 173 | "android.settings.USER_SETTINGS"; |
| 174 | |
| 175 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 176 | * Activity Action: Show settings to allow configuration of wireless controls |
| 177 | * such as Wi-Fi, Bluetooth and Mobile networks. |
| 178 | * <p> |
| 179 | * In some cases, a matching Activity may not exist, so ensure you |
| 180 | * safeguard against this. |
| 181 | * <p> |
| 182 | * Input: Nothing. |
| 183 | * <p> |
| 184 | * Output: Nothing. |
| 185 | */ |
| 186 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 187 | public static final String ACTION_WIRELESS_SETTINGS = |
| 188 | "android.settings.WIRELESS_SETTINGS"; |
| 189 | |
| 190 | /** |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 191 | * Activity Action: Show tether provisioning activity. |
| 192 | * |
| 193 | * <p> |
| 194 | * In some cases, a matching Activity may not exist, so ensure you |
| 195 | * safeguard against this. |
| 196 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 197 | * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type |
| 198 | * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 199 | * contain a {@link ResultReceiver} which will be called back with a tether result code. |
| 200 | * <p> |
| 201 | * Output: The result of the provisioning check. |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 202 | * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, |
| 203 | * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 204 | * |
| 205 | * @hide |
| 206 | */ |
| 207 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 208 | public static final String ACTION_TETHER_PROVISIONING = |
| 209 | "android.settings.TETHER_PROVISIONING_UI"; |
| 210 | |
| 211 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 212 | * Activity Action: Show settings to allow entering/exiting airplane mode. |
| 213 | * <p> |
| 214 | * In some cases, a matching Activity may not exist, so ensure you |
| 215 | * safeguard against this. |
| 216 | * <p> |
| 217 | * Input: Nothing. |
| 218 | * <p> |
| 219 | * Output: Nothing. |
| 220 | */ |
| 221 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 222 | public static final String ACTION_AIRPLANE_MODE_SETTINGS = |
| 223 | "android.settings.AIRPLANE_MODE_SETTINGS"; |
| 224 | |
| 225 | /** |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 226 | * Activity Action: Show mobile data usage list. |
| 227 | * <p> |
| 228 | * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify |
| 229 | * how and what mobile data statistics should be collected. |
| 230 | * <p> |
| 231 | * Output: Nothing |
| 232 | * @hide |
| 233 | */ |
| 234 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 235 | public static final String ACTION_MOBILE_DATA_USAGE = |
| 236 | "android.settings.MOBILE_DATA_USAGE"; |
| 237 | |
| 238 | /** @hide */ |
| 239 | public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 240 | |
| 241 | /** |
| 242 | * An int extra specifying a subscription ID. |
| 243 | * |
| 244 | * @see android.telephony.SubscriptionInfo#getSubscriptionId |
| 245 | */ |
| 246 | public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 247 | |
| 248 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 249 | * Activity Action: Modify Airplane mode settings using a voice command. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 250 | * <p> |
| 251 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 252 | * <p> |
| 253 | * This intent MUST be started using |
| 254 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 255 | * startVoiceActivity}. |
| 256 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 257 | * Note: The activity implementing this intent MUST verify that |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 258 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 259 | * modifying the setting. |
| 260 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 261 | * Input: To tell which state airplane mode should be set to, add the |
| 262 | * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. |
| 263 | * If the extra is not included, no changes will be made. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 264 | * <p> |
| 265 | * Output: Nothing. |
| 266 | */ |
| 267 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 268 | public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = |
| 269 | "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; |
| 270 | |
| 271 | /** |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 272 | * Activity Action: Show settings for accessibility modules. |
| 273 | * <p> |
| 274 | * In some cases, a matching Activity may not exist, so ensure you |
| 275 | * safeguard against this. |
| 276 | * <p> |
| 277 | * Input: Nothing. |
| 278 | * <p> |
| 279 | * Output: Nothing. |
| 280 | */ |
| 281 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 282 | public static final String ACTION_ACCESSIBILITY_SETTINGS = |
| 283 | "android.settings.ACCESSIBILITY_SETTINGS"; |
| 284 | |
| 285 | /** |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 286 | * Activity Action: Show settings to control access to usage information. |
| 287 | * <p> |
| 288 | * In some cases, a matching Activity may not exist, so ensure you |
| 289 | * safeguard against this. |
| 290 | * <p> |
| 291 | * Input: Nothing. |
| 292 | * <p> |
| 293 | * Output: Nothing. |
| 294 | */ |
| 295 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 296 | public static final String ACTION_USAGE_ACCESS_SETTINGS = |
| 297 | "android.settings.USAGE_ACCESS_SETTINGS"; |
| 298 | |
| 299 | /** |
Jason Monk | 6f90978 | 2015-04-17 14:30:25 -0400 | [diff] [blame] | 300 | * Activity Category: Show application settings related to usage access. |
| 301 | * <p> |
| 302 | * An activity that provides a user interface for adjusting usage access related |
| 303 | * preferences for its containing application. Optional but recommended for apps that |
| 304 | * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. |
| 305 | * <p> |
| 306 | * The activity may define meta-data to describe what usage access is |
| 307 | * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which |
| 308 | * will be displayed in Settings. |
| 309 | * <p> |
| 310 | * Input: Nothing. |
| 311 | * <p> |
| 312 | * Output: Nothing. |
| 313 | */ |
| 314 | @SdkConstant(SdkConstantType.INTENT_CATEGORY) |
| 315 | public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = |
| 316 | "android.intent.category.USAGE_ACCESS_CONFIG"; |
| 317 | |
| 318 | /** |
| 319 | * Metadata key: Reason for needing usage access. |
| 320 | * <p> |
| 321 | * A key for metadata attached to an activity that receives action |
| 322 | * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the |
| 323 | * user as description of how the app uses usage access. |
| 324 | * <p> |
| 325 | */ |
| 326 | public static final String METADATA_USAGE_ACCESS_REASON = |
| 327 | "android.settings.metadata.USAGE_ACCESS_REASON"; |
| 328 | |
| 329 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 330 | * Activity Action: Show settings to allow configuration of security and |
| 331 | * location privacy. |
| 332 | * <p> |
| 333 | * In some cases, a matching Activity may not exist, so ensure you |
| 334 | * safeguard against this. |
| 335 | * <p> |
| 336 | * Input: Nothing. |
| 337 | * <p> |
| 338 | * Output: Nothing. |
| 339 | */ |
| 340 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 341 | public static final String ACTION_SECURITY_SETTINGS = |
| 342 | "android.settings.SECURITY_SETTINGS"; |
| 343 | |
| 344 | /** |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 345 | * Activity Action: Show settings to allow configuration of trusted external sources |
Suprabh Shukla | 905df00 | 2017-05-25 14:21:59 -0700 | [diff] [blame] | 346 | * |
Suprabh Shukla | 84d11b4 | 2017-03-07 23:40:25 -0800 | [diff] [blame] | 347 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 348 | * directly invoke the management GUI specific to the package name. For example |
| 349 | * "package:com.my.app". |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 350 | * <p> |
| 351 | * Output: Nothing. |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 352 | */ |
| 353 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Suprabh Shukla | a1300c8 | 2017-04-06 17:52:32 -0700 | [diff] [blame] | 354 | public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = |
Suprabh Shukla | 89aae44 | 2017-04-20 16:04:26 -0700 | [diff] [blame] | 355 | "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 356 | |
| 357 | /** |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 358 | * Activity Action: Show trusted credentials settings, opening to the user tab, |
| 359 | * to allow management of installed credentials. |
| 360 | * <p> |
| 361 | * In some cases, a matching Activity may not exist, so ensure you |
| 362 | * safeguard against this. |
| 363 | * <p> |
| 364 | * Input: Nothing. |
| 365 | * <p> |
| 366 | * Output: Nothing. |
| 367 | * @hide |
| 368 | */ |
| 369 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 370 | public static final String ACTION_TRUSTED_CREDENTIALS_USER = |
| 371 | "com.android.settings.TRUSTED_CREDENTIALS_USER"; |
| 372 | |
| 373 | /** |
| 374 | * Activity Action: Show dialog explaining that an installed CA cert may enable |
| 375 | * monitoring of encrypted network traffic. |
| 376 | * <p> |
| 377 | * In some cases, a matching Activity may not exist, so ensure you |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 378 | * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the |
| 379 | * number of certificates. |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 380 | * <p> |
| 381 | * Input: Nothing. |
| 382 | * <p> |
| 383 | * Output: Nothing. |
| 384 | * @hide |
| 385 | */ |
| 386 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 387 | public static final String ACTION_MONITORING_CERT_INFO = |
| 388 | "com.android.settings.MONITORING_CERT_INFO"; |
| 389 | |
| 390 | /** |
Amith Yamasani | c15255a | 2009-09-23 15:33:19 -0700 | [diff] [blame] | 391 | * Activity Action: Show settings to allow configuration of privacy options. |
| 392 | * <p> |
| 393 | * In some cases, a matching Activity may not exist, so ensure you |
| 394 | * safeguard against this. |
| 395 | * <p> |
| 396 | * Input: Nothing. |
| 397 | * <p> |
| 398 | * Output: Nothing. |
| 399 | */ |
| 400 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 401 | public static final String ACTION_PRIVACY_SETTINGS = |
| 402 | "android.settings.PRIVACY_SETTINGS"; |
| 403 | |
| 404 | /** |
Robin Lee | a249aee | 2016-02-03 13:42:56 +0000 | [diff] [blame] | 405 | * Activity Action: Show settings to allow configuration of VPN. |
| 406 | * <p> |
| 407 | * In some cases, a matching Activity may not exist, so ensure you |
| 408 | * safeguard against this. |
| 409 | * <p> |
| 410 | * Input: Nothing. |
| 411 | * <p> |
| 412 | * Output: Nothing. |
| 413 | */ |
| 414 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 415 | public static final String ACTION_VPN_SETTINGS = |
| 416 | "android.settings.VPN_SETTINGS"; |
| 417 | |
| 418 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 419 | * Activity Action: Show settings to allow configuration of Wi-Fi. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 420 | * <p> |
| 421 | * In some cases, a matching Activity may not exist, so ensure you |
| 422 | * safeguard against this. |
| 423 | * <p> |
| 424 | * Input: Nothing. |
| 425 | * <p> |
| 426 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 427 | */ |
| 428 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 429 | public static final String ACTION_WIFI_SETTINGS = |
| 430 | "android.settings.WIFI_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 431 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 432 | /** |
| 433 | * Activity Action: Show settings to allow configuration of a static IP |
| 434 | * address for Wi-Fi. |
| 435 | * <p> |
| 436 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 437 | * against this. |
| 438 | * <p> |
| 439 | * Input: Nothing. |
| 440 | * <p> |
| 441 | * Output: Nothing. |
| 442 | */ |
| 443 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 444 | public static final String ACTION_WIFI_IP_SETTINGS = |
| 445 | "android.settings.WIFI_IP_SETTINGS"; |
| 446 | |
| 447 | /** |
Rohan Shah | 53f3f15 | 2018-02-28 15:13:31 -0800 | [diff] [blame] | 448 | * Activity Action: Show settings to allow configuration of data and view data usage. |
| 449 | * <p> |
| 450 | * In some cases, a matching Activity may not exist, so ensure you |
| 451 | * safeguard against this. |
| 452 | * <p> |
| 453 | * Input: Nothing. |
| 454 | * <p> |
| 455 | * Output: Nothing. |
| 456 | */ |
| 457 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 458 | public static final String ACTION_DATA_USAGE_SETTINGS = |
| 459 | "android.settings.DATA_USAGE_SETTINGS"; |
| 460 | |
| 461 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 462 | * Activity Action: Show settings to allow configuration of Bluetooth. |
| 463 | * <p> |
| 464 | * In some cases, a matching Activity may not exist, so ensure you |
| 465 | * safeguard against this. |
| 466 | * <p> |
| 467 | * Input: Nothing. |
| 468 | * <p> |
| 469 | * Output: Nothing. |
| 470 | */ |
| 471 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 472 | public static final String ACTION_BLUETOOTH_SETTINGS = |
| 473 | "android.settings.BLUETOOTH_SETTINGS"; |
| 474 | |
| 475 | /** |
Kevin Chyn | 268a96c | 2017-06-17 17:32:49 -0700 | [diff] [blame] | 476 | * Activity Action: Show settings to allow configuration of Assist Gesture. |
| 477 | * <p> |
| 478 | * In some cases, a matching Activity may not exist, so ensure you |
| 479 | * safeguard against this. |
| 480 | * <p> |
| 481 | * Input: Nothing. |
| 482 | * <p> |
| 483 | * Output: Nothing. |
| 484 | * @hide |
| 485 | */ |
| 486 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 487 | public static final String ACTION_ASSIST_GESTURE_SETTINGS = |
| 488 | "android.settings.ASSIST_GESTURE_SETTINGS"; |
| 489 | |
| 490 | /** |
Kevin Chyn | 83ff28c | 2017-10-13 16:35:17 -0700 | [diff] [blame] | 491 | * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if |
| 492 | * necessary. |
| 493 | * <p> |
| 494 | * Input: Nothing. |
| 495 | * <p> |
| 496 | * Output: Nothing. |
| 497 | */ |
| 498 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 499 | public static final String ACTION_FINGERPRINT_ENROLL = |
| 500 | "android.settings.FINGERPRINT_ENROLL"; |
| 501 | |
| 502 | /** |
Jeff Brown | c05c1ae | 2015-05-05 13:46:30 -0700 | [diff] [blame] | 503 | * Activity Action: Show settings to allow configuration of cast endpoints. |
Jeff Brown | 1a937b0 | 2014-07-01 22:13:04 -0700 | [diff] [blame] | 504 | * <p> |
| 505 | * In some cases, a matching Activity may not exist, so ensure you |
| 506 | * safeguard against this. |
| 507 | * <p> |
| 508 | * Input: Nothing. |
| 509 | * <p> |
| 510 | * Output: Nothing. |
| 511 | */ |
| 512 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 513 | public static final String ACTION_CAST_SETTINGS = |
| 514 | "android.settings.CAST_SETTINGS"; |
| 515 | |
| 516 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 517 | * Activity Action: Show settings to allow configuration of date and time. |
| 518 | * <p> |
| 519 | * In some cases, a matching Activity may not exist, so ensure you |
| 520 | * safeguard against this. |
| 521 | * <p> |
| 522 | * Input: Nothing. |
| 523 | * <p> |
| 524 | * Output: Nothing. |
| 525 | */ |
| 526 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 527 | public static final String ACTION_DATE_SETTINGS = |
| 528 | "android.settings.DATE_SETTINGS"; |
| 529 | |
| 530 | /** |
| 531 | * Activity Action: Show settings to allow configuration of sound and volume. |
| 532 | * <p> |
| 533 | * In some cases, a matching Activity may not exist, so ensure you |
| 534 | * safeguard against this. |
| 535 | * <p> |
| 536 | * Input: Nothing. |
| 537 | * <p> |
| 538 | * Output: Nothing. |
| 539 | */ |
| 540 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 541 | public static final String ACTION_SOUND_SETTINGS = |
| 542 | "android.settings.SOUND_SETTINGS"; |
| 543 | |
| 544 | /** |
| 545 | * Activity Action: Show settings to allow configuration of display. |
| 546 | * <p> |
| 547 | * In some cases, a matching Activity may not exist, so ensure you |
| 548 | * safeguard against this. |
| 549 | * <p> |
| 550 | * Input: Nothing. |
| 551 | * <p> |
| 552 | * Output: Nothing. |
| 553 | */ |
| 554 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 555 | public static final String ACTION_DISPLAY_SETTINGS = |
| 556 | "android.settings.DISPLAY_SETTINGS"; |
| 557 | |
| 558 | /** |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 559 | * Activity Action: Show settings to allow configuration of Night display. |
| 560 | * <p> |
| 561 | * In some cases, a matching Activity may not exist, so ensure you |
| 562 | * safeguard against this. |
| 563 | * <p> |
| 564 | * Input: Nothing. |
| 565 | * <p> |
| 566 | * Output: Nothing. |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 567 | */ |
| 568 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 569 | public static final String ACTION_NIGHT_DISPLAY_SETTINGS = |
| 570 | "android.settings.NIGHT_DISPLAY_SETTINGS"; |
| 571 | |
| 572 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 573 | * Activity Action: Show settings to allow configuration of locale. |
| 574 | * <p> |
| 575 | * In some cases, a matching Activity may not exist, so ensure you |
| 576 | * safeguard against this. |
| 577 | * <p> |
| 578 | * Input: Nothing. |
| 579 | * <p> |
| 580 | * Output: Nothing. |
| 581 | */ |
| 582 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 583 | public static final String ACTION_LOCALE_SETTINGS = |
| 584 | "android.settings.LOCALE_SETTINGS"; |
| 585 | |
| 586 | /** |
| 587 | * Activity Action: Show settings to configure input methods, in particular |
| 588 | * allowing the user to enable input methods. |
| 589 | * <p> |
| 590 | * In some cases, a matching Activity may not exist, so ensure you |
| 591 | * safeguard against this. |
| 592 | * <p> |
| 593 | * Input: Nothing. |
| 594 | * <p> |
| 595 | * Output: Nothing. |
| 596 | */ |
| 597 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 598 | public static final String ACTION_VOICE_INPUT_SETTINGS = |
| 599 | "android.settings.VOICE_INPUT_SETTINGS"; |
| 600 | |
| 601 | /** |
| 602 | * Activity Action: Show settings to configure input methods, in particular |
| 603 | * allowing the user to enable input methods. |
| 604 | * <p> |
| 605 | * In some cases, a matching Activity may not exist, so ensure you |
| 606 | * safeguard against this. |
| 607 | * <p> |
| 608 | * Input: Nothing. |
| 609 | * <p> |
| 610 | * Output: Nothing. |
| 611 | */ |
| 612 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 613 | public static final String ACTION_INPUT_METHOD_SETTINGS = |
| 614 | "android.settings.INPUT_METHOD_SETTINGS"; |
| 615 | |
| 616 | /** |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 617 | * Activity Action: Show settings to enable/disable input method subtypes. |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 618 | * <p> |
| 619 | * In some cases, a matching Activity may not exist, so ensure you |
| 620 | * safeguard against this. |
| 621 | * <p> |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 622 | * To tell which input method's subtypes are displayed in the settings, add |
| 623 | * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. |
| 624 | * If there is no extra in this Intent, subtypes from all installed input methods |
| 625 | * will be displayed in the settings. |
| 626 | * |
| 627 | * @see android.view.inputmethod.InputMethodInfo#getId |
| 628 | * <p> |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 629 | * Input: Nothing. |
| 630 | * <p> |
| 631 | * Output: Nothing. |
| 632 | */ |
| 633 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 634 | public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = |
| 635 | "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 636 | |
| 637 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 638 | * Activity Action: Show settings to manage the user input dictionary. |
| 639 | * <p> |
Chet Haase | e8222dd | 2013-09-05 07:44:18 -0700 | [diff] [blame] | 640 | * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, |
Satoshi Kataoka | 2aa2bc5 | 2013-07-30 14:25:11 +0900 | [diff] [blame] | 641 | * it is guaranteed there will always be an appropriate implementation for this Intent action. |
| 642 | * In prior releases of the platform this was optional, so ensure you safeguard against it. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 643 | * <p> |
| 644 | * Input: Nothing. |
| 645 | * <p> |
| 646 | * Output: Nothing. |
| 647 | */ |
| 648 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 649 | public static final String ACTION_USER_DICTIONARY_SETTINGS = |
| 650 | "android.settings.USER_DICTIONARY_SETTINGS"; |
| 651 | |
| 652 | /** |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 653 | * Activity Action: Show settings to configure the hardware keyboard. |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 654 | * <p> |
| 655 | * In some cases, a matching Activity may not exist, so ensure you |
| 656 | * safeguard against this. |
| 657 | * <p> |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 658 | * Input: Nothing. |
| 659 | * <p> |
| 660 | * Output: Nothing. |
| 661 | */ |
| 662 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 663 | public static final String ACTION_HARD_KEYBOARD_SETTINGS = |
| 664 | "android.settings.HARD_KEYBOARD_SETTINGS"; |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 665 | |
| 666 | /** |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 667 | * Activity Action: Adds a word to the user dictionary. |
| 668 | * <p> |
| 669 | * In some cases, a matching Activity may not exist, so ensure you |
| 670 | * safeguard against this. |
| 671 | * <p> |
| 672 | * Input: An extra with key <code>word</code> that contains the word |
| 673 | * that should be added to the dictionary. |
| 674 | * <p> |
| 675 | * Output: Nothing. |
| 676 | * |
| 677 | * @hide |
| 678 | */ |
| 679 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 680 | public static final String ACTION_USER_DICTIONARY_INSERT = |
| 681 | "com.android.settings.USER_DICTIONARY_INSERT"; |
| 682 | |
| 683 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | * Activity Action: Show settings to allow configuration of application-related settings. |
| 685 | * <p> |
| 686 | * In some cases, a matching Activity may not exist, so ensure you |
| 687 | * safeguard against this. |
| 688 | * <p> |
| 689 | * Input: Nothing. |
| 690 | * <p> |
| 691 | * Output: Nothing. |
| 692 | */ |
| 693 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 694 | public static final String ACTION_APPLICATION_SETTINGS = |
| 695 | "android.settings.APPLICATION_SETTINGS"; |
| 696 | |
| 697 | /** |
| 698 | * Activity Action: Show settings to allow configuration of application |
Dianne Hackborn | 8d866e5 | 2012-10-10 18:39:45 -0700 | [diff] [blame] | 699 | * development-related settings. As of |
| 700 | * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is |
| 701 | * a required part of the platform. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | * <p> |
| 703 | * Input: Nothing. |
| 704 | * <p> |
| 705 | * Output: Nothing. |
| 706 | */ |
| 707 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 708 | public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = |
| 709 | "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; |
| 710 | |
| 711 | /** |
| 712 | * Activity Action: Show settings to allow configuration of quick launch shortcuts. |
| 713 | * <p> |
| 714 | * In some cases, a matching Activity may not exist, so ensure you |
| 715 | * safeguard against this. |
| 716 | * <p> |
| 717 | * Input: Nothing. |
| 718 | * <p> |
| 719 | * Output: Nothing. |
| 720 | */ |
| 721 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 722 | public static final String ACTION_QUICK_LAUNCH_SETTINGS = |
| 723 | "android.settings.QUICK_LAUNCH_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 724 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 725 | /** |
| 726 | * Activity Action: Show settings to manage installed applications. |
| 727 | * <p> |
| 728 | * In some cases, a matching Activity may not exist, so ensure you |
| 729 | * safeguard against this. |
| 730 | * <p> |
| 731 | * Input: Nothing. |
| 732 | * <p> |
| 733 | * Output: Nothing. |
| 734 | */ |
| 735 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 736 | public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = |
| 737 | "android.settings.MANAGE_APPLICATIONS_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 738 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 739 | /** |
Winson Chung | 44e8ff9 | 2010-09-27 14:36:52 -0700 | [diff] [blame] | 740 | * Activity Action: Show settings to manage all applications. |
| 741 | * <p> |
| 742 | * In some cases, a matching Activity may not exist, so ensure you |
| 743 | * safeguard against this. |
| 744 | * <p> |
| 745 | * Input: Nothing. |
| 746 | * <p> |
| 747 | * Output: Nothing. |
| 748 | */ |
| 749 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 750 | public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = |
| 751 | "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; |
| 752 | |
| 753 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 754 | * Activity Action: Show screen for controlling which apps can draw on top of other apps. |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 755 | * <p> |
| 756 | * In some cases, a matching Activity may not exist, so ensure you |
| 757 | * safeguard against this. |
| 758 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 759 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 760 | * directly invoke the management GUI specific to the package name. For example |
| 761 | * "package:com.my.app". |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 762 | * <p> |
| 763 | * Output: Nothing. |
| 764 | */ |
| 765 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 766 | public static final String ACTION_MANAGE_OVERLAY_PERMISSION = |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 767 | "android.settings.action.MANAGE_OVERLAY_PERMISSION"; |
| 768 | |
| 769 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 770 | * Activity Action: Show screen for controlling which apps are allowed to write/modify |
| 771 | * system settings. |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 772 | * <p> |
| 773 | * In some cases, a matching Activity may not exist, so ensure you |
| 774 | * safeguard against this. |
| 775 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 776 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 777 | * directly invoke the management GUI specific to the package name. For example |
| 778 | * "package:com.my.app". |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 779 | * <p> |
| 780 | * Output: Nothing. |
| 781 | */ |
| 782 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 783 | public static final String ACTION_MANAGE_WRITE_SETTINGS = |
| 784 | "android.settings.action.MANAGE_WRITE_SETTINGS"; |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 785 | |
| 786 | /** |
Dianne Hackborn | b7bb3b3 | 2010-06-06 22:47:50 -0700 | [diff] [blame] | 787 | * Activity Action: Show screen of details about a particular application. |
| 788 | * <p> |
| 789 | * In some cases, a matching Activity may not exist, so ensure you |
| 790 | * safeguard against this. |
| 791 | * <p> |
| 792 | * Input: The Intent's data URI specifies the application package name |
| 793 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 794 | * <p> |
| 795 | * Output: Nothing. |
| 796 | */ |
| 797 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 798 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS = |
| 799 | "android.settings.APPLICATION_DETAILS_SETTINGS"; |
| 800 | |
| 801 | /** |
Ben Lin | 296f80a | 2018-02-27 15:23:38 -0800 | [diff] [blame] | 802 | * Activity Action: Show the "Open by Default" page in a particular application's details page. |
| 803 | * <p> |
| 804 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 805 | * <p> |
| 806 | * Input: The Intent's data URI specifies the application package name |
| 807 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 808 | * <p> |
| 809 | * Output: Nothing. |
| 810 | * @hide |
| 811 | */ |
| 812 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 813 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE = |
| 814 | "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE"; |
| 815 | |
| 816 | /** |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 817 | * Activity Action: Show list of applications that have been running |
| 818 | * foreground services (to the user "running in the background"). |
| 819 | * <p> |
| 820 | * Input: Extras "packages" is a string array of package names. |
| 821 | * <p> |
| 822 | * Output: Nothing. |
| 823 | * @hide |
| 824 | */ |
| 825 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 826 | public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = |
| 827 | "android.settings.FOREGROUND_SERVICES_SETTINGS"; |
| 828 | |
| 829 | /** |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 830 | * Activity Action: Show screen for controlling which apps can ignore battery optimizations. |
| 831 | * <p> |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 832 | * Input: Nothing. |
| 833 | * <p> |
| 834 | * Output: Nothing. |
| 835 | * <p> |
| 836 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 837 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 838 | * already ignoring optimizations. You can use |
| 839 | * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you |
| 840 | * on this list. |
| 841 | */ |
| 842 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 843 | public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = |
| 844 | "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; |
| 845 | |
| 846 | /** |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 847 | * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 848 | * put them on the whitelist of apps shown by |
| 849 | * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also |
| 850 | * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} |
| 851 | * permission. |
| 852 | * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities |
| 853 | * provided by the platform for applications to operate correctly in the various power |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 854 | * saving modes. This is only for unusual applications that need to deeply control their own |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 855 | * execution, at the potential expense of the user's battery life. Note that these applications |
Kweku Adams | eb80f7c | 2016-01-12 11:46:52 -0800 | [diff] [blame] | 856 | * greatly run the risk of showing to the user as high power consumers on their device.</p> |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 857 | * <p> |
| 858 | * Input: The Intent's data URI must specify the application package name |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 859 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 860 | * <p> |
| 861 | * Output: Nothing. |
Dianne Hackborn | 1958e5e | 2015-06-12 18:11:41 -0700 | [diff] [blame] | 862 | * <p> |
| 863 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 864 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 865 | * already ignoring optimizations. |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 866 | */ |
| 867 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 868 | public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = |
| 869 | "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 870 | |
| 871 | /** |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 872 | * Activity Action: Show screen for controlling background data |
| 873 | * restrictions for a particular application. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 874 | * <p> |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 875 | * Input: Intent's data URI set with an application name, using the |
| 876 | * "package" schema (like "package:com.my.app"). |
| 877 | * |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 878 | * <p> |
| 879 | * Output: Nothing. |
| 880 | * <p> |
| 881 | * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 882 | * ConnectivityManager#getRestrictBackgroundStatus()} to determine the |
| 883 | * status of the background data restrictions for them. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 884 | */ |
| 885 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 886 | public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = |
| 887 | "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; |
| 888 | |
| 889 | /** |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 890 | * @hide |
| 891 | * Activity Action: Show the "app ops" settings screen. |
| 892 | * <p> |
| 893 | * Input: Nothing. |
| 894 | * <p> |
| 895 | * Output: Nothing. |
| 896 | */ |
| 897 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 898 | public static final String ACTION_APP_OPS_SETTINGS = |
| 899 | "android.settings.APP_OPS_SETTINGS"; |
| 900 | |
| 901 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 902 | * Activity Action: Show settings for system update functionality. |
| 903 | * <p> |
| 904 | * In some cases, a matching Activity may not exist, so ensure you |
| 905 | * safeguard against this. |
| 906 | * <p> |
| 907 | * Input: Nothing. |
| 908 | * <p> |
| 909 | * Output: Nothing. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 910 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 911 | * @hide |
| 912 | */ |
| 913 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 914 | public static final String ACTION_SYSTEM_UPDATE_SETTINGS = |
| 915 | "android.settings.SYSTEM_UPDATE_SETTINGS"; |
| 916 | |
| 917 | /** |
Ricky Wai | 38bb832 | 2017-02-01 15:23:50 +0000 | [diff] [blame] | 918 | * Activity Action: Show settings for managed profile settings. |
| 919 | * <p> |
| 920 | * In some cases, a matching Activity may not exist, so ensure you |
| 921 | * safeguard against this. |
| 922 | * <p> |
| 923 | * Input: Nothing. |
| 924 | * <p> |
| 925 | * Output: Nothing. |
| 926 | * |
| 927 | * @hide |
| 928 | */ |
| 929 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 930 | public static final String ACTION_MANAGED_PROFILE_SETTINGS = |
| 931 | "android.settings.MANAGED_PROFILE_SETTINGS"; |
| 932 | |
| 933 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 934 | * Activity Action: Show settings to allow configuration of sync settings. |
| 935 | * <p> |
| 936 | * In some cases, a matching Activity may not exist, so ensure you |
| 937 | * safeguard against this. |
| 938 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 939 | * The account types available to add via the add account button may be restricted by adding an |
| 940 | * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's |
| 941 | * authorities. Only account types which can sync with that content provider will be offered to |
| 942 | * the user. |
| 943 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 944 | * Input: Nothing. |
| 945 | * <p> |
| 946 | * Output: Nothing. |
| 947 | */ |
| 948 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 949 | public static final String ACTION_SYNC_SETTINGS = |
| 950 | "android.settings.SYNC_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 951 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 952 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 953 | * Activity Action: Show add account screen for creating a new account. |
| 954 | * <p> |
| 955 | * In some cases, a matching Activity may not exist, so ensure you |
| 956 | * safeguard against this. |
| 957 | * <p> |
| 958 | * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} |
| 959 | * extra to the Intent with one or more syncable content provider's authorities. Only account |
| 960 | * types which can sync with that content provider will be offered to the user. |
| 961 | * <p> |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 962 | * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the |
| 963 | * Intent with one or more account types. |
| 964 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 965 | * Input: Nothing. |
| 966 | * <p> |
| 967 | * Output: Nothing. |
| 968 | */ |
| 969 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 970 | public static final String ACTION_ADD_ACCOUNT = |
| 971 | "android.settings.ADD_ACCOUNT_SETTINGS"; |
| 972 | |
| 973 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 974 | * Activity Action: Show settings for selecting the network operator. |
| 975 | * <p> |
| 976 | * In some cases, a matching Activity may not exist, so ensure you |
| 977 | * safeguard against this. |
| 978 | * <p> |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 979 | * The subscription ID of the subscription for which available network operators should be |
| 980 | * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. |
| 981 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 982 | * Input: Nothing. |
| 983 | * <p> |
| 984 | * Output: Nothing. |
| 985 | */ |
| 986 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 987 | public static final String ACTION_NETWORK_OPERATOR_SETTINGS = |
| 988 | "android.settings.NETWORK_OPERATOR_SETTINGS"; |
| 989 | |
| 990 | /** |
| 991 | * Activity Action: Show settings for selection of 2G/3G. |
| 992 | * <p> |
| 993 | * In some cases, a matching Activity may not exist, so ensure you |
| 994 | * safeguard against this. |
| 995 | * <p> |
| 996 | * Input: Nothing. |
| 997 | * <p> |
| 998 | * Output: Nothing. |
| 999 | */ |
| 1000 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1001 | public static final String ACTION_DATA_ROAMING_SETTINGS = |
| 1002 | "android.settings.DATA_ROAMING_SETTINGS"; |
| 1003 | |
| 1004 | /** |
| 1005 | * Activity Action: Show settings for internal storage. |
| 1006 | * <p> |
| 1007 | * In some cases, a matching Activity may not exist, so ensure you |
| 1008 | * safeguard against this. |
| 1009 | * <p> |
| 1010 | * Input: Nothing. |
| 1011 | * <p> |
| 1012 | * Output: Nothing. |
| 1013 | */ |
| 1014 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1015 | public static final String ACTION_INTERNAL_STORAGE_SETTINGS = |
| 1016 | "android.settings.INTERNAL_STORAGE_SETTINGS"; |
| 1017 | /** |
| 1018 | * Activity Action: Show settings for memory card storage. |
| 1019 | * <p> |
| 1020 | * In some cases, a matching Activity may not exist, so ensure you |
| 1021 | * safeguard against this. |
| 1022 | * <p> |
| 1023 | * Input: Nothing. |
| 1024 | * <p> |
| 1025 | * Output: Nothing. |
| 1026 | */ |
| 1027 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1028 | public static final String ACTION_MEMORY_CARD_SETTINGS = |
| 1029 | "android.settings.MEMORY_CARD_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1030 | |
Justin Mattson | ef34035 | 2010-01-13 21:05:46 -0800 | [diff] [blame] | 1031 | /** |
| 1032 | * Activity Action: Show settings for global search. |
| 1033 | * <p> |
| 1034 | * In some cases, a matching Activity may not exist, so ensure you |
| 1035 | * safeguard against this. |
| 1036 | * <p> |
| 1037 | * Input: Nothing. |
| 1038 | * <p> |
| 1039 | * Output: Nothing |
| 1040 | */ |
| 1041 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1042 | public static final String ACTION_SEARCH_SETTINGS = |
| 1043 | "android.search.action.SEARCH_SETTINGS"; |
| 1044 | |
Daniel Sandler | 9d8b876 | 2010-01-22 20:50:15 -0500 | [diff] [blame] | 1045 | /** |
| 1046 | * Activity Action: Show general device information settings (serial |
| 1047 | * number, software version, phone number, etc.). |
| 1048 | * <p> |
| 1049 | * In some cases, a matching Activity may not exist, so ensure you |
| 1050 | * safeguard against this. |
| 1051 | * <p> |
| 1052 | * Input: Nothing. |
| 1053 | * <p> |
| 1054 | * Output: Nothing |
| 1055 | */ |
| 1056 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1057 | public static final String ACTION_DEVICE_INFO_SETTINGS = |
| 1058 | "android.settings.DEVICE_INFO_SETTINGS"; |
| 1059 | |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1060 | /** |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1061 | * Activity Action: Show NFC settings. |
| 1062 | * <p> |
| 1063 | * This shows UI that allows NFC to be turned on or off. |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1064 | * <p> |
| 1065 | * In some cases, a matching Activity may not exist, so ensure you |
| 1066 | * safeguard against this. |
| 1067 | * <p> |
| 1068 | * Input: Nothing. |
| 1069 | * <p> |
| 1070 | * Output: Nothing |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1071 | * @see android.nfc.NfcAdapter#isEnabled() |
| 1072 | */ |
| 1073 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1074 | public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; |
| 1075 | |
| 1076 | /** |
| 1077 | * Activity Action: Show NFC Sharing settings. |
| 1078 | * <p> |
| 1079 | * This shows UI that allows NDEF Push (Android Beam) to be turned on or |
| 1080 | * off. |
| 1081 | * <p> |
| 1082 | * In some cases, a matching Activity may not exist, so ensure you |
| 1083 | * safeguard against this. |
| 1084 | * <p> |
| 1085 | * Input: Nothing. |
| 1086 | * <p> |
| 1087 | * Output: Nothing |
| 1088 | * @see android.nfc.NfcAdapter#isNdefPushEnabled() |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1089 | */ |
| 1090 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1091 | public static final String ACTION_NFCSHARING_SETTINGS = |
| 1092 | "android.settings.NFCSHARING_SETTINGS"; |
| 1093 | |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1094 | /** |
Martijn Coenen | 62c196a | 2013-08-09 13:43:34 -0700 | [diff] [blame] | 1095 | * Activity Action: Show NFC Tap & Pay settings |
| 1096 | * <p> |
| 1097 | * This shows UI that allows the user to configure Tap&Pay |
| 1098 | * settings. |
| 1099 | * <p> |
| 1100 | * In some cases, a matching Activity may not exist, so ensure you |
| 1101 | * safeguard against this. |
| 1102 | * <p> |
| 1103 | * Input: Nothing. |
| 1104 | * <p> |
| 1105 | * Output: Nothing |
| 1106 | */ |
| 1107 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1108 | public static final String ACTION_NFC_PAYMENT_SETTINGS = |
| 1109 | "android.settings.NFC_PAYMENT_SETTINGS"; |
| 1110 | |
| 1111 | /** |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1112 | * Activity Action: Show Daydream settings. |
| 1113 | * <p> |
| 1114 | * In some cases, a matching Activity may not exist, so ensure you |
| 1115 | * safeguard against this. |
| 1116 | * <p> |
| 1117 | * Input: Nothing. |
| 1118 | * <p> |
| 1119 | * Output: Nothing. |
| 1120 | * @see android.service.dreams.DreamService |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1121 | */ |
| 1122 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1123 | public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; |
| 1124 | |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1125 | /** |
| 1126 | * Activity Action: Show Notification listener settings. |
| 1127 | * <p> |
| 1128 | * In some cases, a matching Activity may not exist, so ensure you |
| 1129 | * safeguard against this. |
| 1130 | * <p> |
| 1131 | * Input: Nothing. |
| 1132 | * <p> |
| 1133 | * Output: Nothing. |
| 1134 | * @see android.service.notification.NotificationListenerService |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1135 | */ |
| 1136 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1137 | public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS |
Chris Wren | 8326a8a | 2014-10-22 14:13:32 -0400 | [diff] [blame] | 1138 | = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1139 | |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1140 | /** |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1141 | * Activity Action: Show Do Not Disturb access settings. |
| 1142 | * <p> |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1143 | * Users can grant and deny access to Do Not Disturb configuration from here. |
| 1144 | * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more |
| 1145 | * details. |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1146 | * <p> |
| 1147 | * Input: Nothing. |
| 1148 | * <p> |
| 1149 | * Output: Nothing. |
| 1150 | */ |
| 1151 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1152 | public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS |
| 1153 | = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1154 | |
| 1155 | /** |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 1156 | * @hide |
| 1157 | */ |
| 1158 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1159 | public static final String ACTION_CONDITION_PROVIDER_SETTINGS |
| 1160 | = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; |
| 1161 | |
| 1162 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1163 | * Activity Action: Show settings for video captioning. |
| 1164 | * <p> |
| 1165 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1166 | * against this. |
| 1167 | * <p> |
| 1168 | * Input: Nothing. |
| 1169 | * <p> |
| 1170 | * Output: Nothing. |
| 1171 | */ |
| 1172 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1173 | public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; |
| 1174 | |
Svetoslav | 773f54d | 2013-09-03 14:01:43 -0700 | [diff] [blame] | 1175 | /** |
| 1176 | * Activity Action: Show the top level print settings. |
| 1177 | * <p> |
| 1178 | * In some cases, a matching Activity may not exist, so ensure you |
| 1179 | * safeguard against this. |
| 1180 | * <p> |
| 1181 | * Input: Nothing. |
| 1182 | * <p> |
| 1183 | * Output: Nothing. |
| 1184 | */ |
| 1185 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1186 | public static final String ACTION_PRINT_SETTINGS = |
| 1187 | "android.settings.ACTION_PRINT_SETTINGS"; |
| 1188 | |
John Spurlock | de54700 | 2014-02-28 17:50:39 -0500 | [diff] [blame] | 1189 | /** |
| 1190 | * Activity Action: Show Zen Mode configuration settings. |
| 1191 | * |
| 1192 | * @hide |
| 1193 | */ |
| 1194 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1195 | public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; |
| 1196 | |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1197 | /** |
Julia Reynolds | 9aa1c9e | 2018-04-09 11:31:15 -0400 | [diff] [blame] | 1198 | * Activity Action: Show Zen Mode visual effects configuration settings. |
| 1199 | * |
| 1200 | * @hide |
| 1201 | */ |
| 1202 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1203 | public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS = |
| 1204 | "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS"; |
| 1205 | |
| 1206 | /** |
| 1207 | * Activity Action: Show Zen Mode onboarding activity. |
| 1208 | * |
| 1209 | * @hide |
| 1210 | */ |
| 1211 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1212 | public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING"; |
| 1213 | |
| 1214 | /** |
Julia Reynolds | a11d0b1 | 2017-02-16 15:01:36 -0500 | [diff] [blame] | 1215 | * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. |
John Spurlock | fc746f8 | 2015-04-03 13:47:14 -0400 | [diff] [blame] | 1216 | */ |
| 1217 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1218 | public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS |
| 1219 | = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; |
| 1220 | |
| 1221 | /** |
John Spurlock | 7af1018 | 2015-04-03 15:10:31 -0400 | [diff] [blame] | 1222 | * Activity Action: Show Zen Mode automation configuration settings. |
| 1223 | * |
| 1224 | * @hide |
| 1225 | */ |
| 1226 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1227 | public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS |
| 1228 | = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; |
| 1229 | |
| 1230 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1231 | * Activity Action: Modify do not disturb mode settings. |
| 1232 | * <p> |
| 1233 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1234 | * <p> |
| 1235 | * This intent MUST be started using |
| 1236 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1237 | * startVoiceActivity}. |
| 1238 | * <p> |
| 1239 | * Note: The Activity implementing this intent MUST verify that |
| 1240 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. |
| 1241 | * returns true before modifying the setting. |
| 1242 | * <p> |
| 1243 | * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate |
| 1244 | * how long the user wishes to avoid interruptions for. The optional |
| 1245 | * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is |
| 1246 | * enabling or disabling do not disturb mode. If either extra is not included, the |
| 1247 | * user maybe asked to provide the value. |
| 1248 | * <p> |
| 1249 | * Output: Nothing. |
| 1250 | */ |
| 1251 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1252 | public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = |
| 1253 | "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; |
| 1254 | |
| 1255 | /** |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 1256 | * Activity Action: Show Zen Mode schedule rule configuration settings. |
| 1257 | * |
| 1258 | * @hide |
| 1259 | */ |
| 1260 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1261 | public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS |
| 1262 | = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; |
| 1263 | |
| 1264 | /** |
John Spurlock | d60258f | 2015-04-30 09:30:52 -0400 | [diff] [blame] | 1265 | * Activity Action: Show Zen Mode event rule configuration settings. |
| 1266 | * |
| 1267 | * @hide |
| 1268 | */ |
| 1269 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1270 | public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS |
| 1271 | = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; |
| 1272 | |
| 1273 | /** |
John Spurlock | 39581cc | 2015-04-10 11:59:01 -0400 | [diff] [blame] | 1274 | * Activity Action: Show Zen Mode external rule configuration settings. |
| 1275 | * |
| 1276 | * @hide |
| 1277 | */ |
| 1278 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1279 | public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS |
| 1280 | = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; |
| 1281 | |
| 1282 | /** |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1283 | * Activity Action: Show the regulatory information screen for the device. |
| 1284 | * <p> |
| 1285 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1286 | * against this. |
| 1287 | * <p> |
| 1288 | * Input: Nothing. |
| 1289 | * <p> |
| 1290 | * Output: Nothing. |
| 1291 | */ |
Jeff Sharkey | dd77fda | 2014-04-16 17:23:08 -0700 | [diff] [blame] | 1292 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1293 | public static final String |
| 1294 | ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; |
| 1295 | |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1296 | /** |
| 1297 | * Activity Action: Show Device Name Settings. |
| 1298 | * <p> |
| 1299 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
Tim Kilbourn | 87cd0dc | 2014-04-14 15:37:51 -0700 | [diff] [blame] | 1300 | * against this. |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1301 | * |
| 1302 | * @hide |
| 1303 | */ |
| 1304 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1305 | public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; |
| 1306 | |
Tim Kilbourn | 87cd0dc | 2014-04-14 15:37:51 -0700 | [diff] [blame] | 1307 | /** |
| 1308 | * Activity Action: Show pairing settings. |
| 1309 | * <p> |
| 1310 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1311 | * against this. |
| 1312 | * |
| 1313 | * @hide |
| 1314 | */ |
| 1315 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1316 | public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; |
| 1317 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1318 | /** |
| 1319 | * Activity Action: Show battery saver settings. |
John Spurlock | 7346666 | 2014-10-30 13:42:05 -0400 | [diff] [blame] | 1320 | * <p> |
| 1321 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1322 | * against this. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1323 | */ |
| 1324 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1325 | public static final String ACTION_BATTERY_SAVER_SETTINGS |
| 1326 | = "android.settings.BATTERY_SAVER_SETTINGS"; |
| 1327 | |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1328 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1329 | * Activity Action: Modify Battery Saver mode setting using a voice command. |
| 1330 | * <p> |
| 1331 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1332 | * <p> |
| 1333 | * This intent MUST be started using |
| 1334 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1335 | * startVoiceActivity}. |
| 1336 | * <p> |
| 1337 | * Note: The activity implementing this intent MUST verify that |
| 1338 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 1339 | * modifying the setting. |
| 1340 | * <p> |
| 1341 | * Input: To tell which state batter saver mode should be set to, add the |
| 1342 | * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. |
| 1343 | * If the extra is not included, no changes will be made. |
| 1344 | * <p> |
| 1345 | * Output: Nothing. |
| 1346 | */ |
| 1347 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1348 | public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = |
| 1349 | "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; |
| 1350 | |
| 1351 | /** |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1352 | * Activity Action: Show Home selection settings. If there are multiple activities |
| 1353 | * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you |
| 1354 | * to pick your preferred activity. |
| 1355 | */ |
| 1356 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1357 | public static final String ACTION_HOME_SETTINGS |
| 1358 | = "android.settings.HOME_SETTINGS"; |
| 1359 | |
Julia Reynolds | 7eba593 | 2015-12-11 16:40:39 -0500 | [diff] [blame] | 1360 | /** |
| 1361 | * Activity Action: Show Default apps settings. |
| 1362 | * <p> |
| 1363 | * In some cases, a matching Activity may not exist, so ensure you |
| 1364 | * safeguard against this. |
| 1365 | * <p> |
| 1366 | * Input: Nothing. |
| 1367 | * <p> |
| 1368 | * Output: Nothing. |
| 1369 | */ |
| 1370 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1371 | public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS |
| 1372 | = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; |
| 1373 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1374 | /** |
| 1375 | * Activity Action: Show notification settings. |
| 1376 | * |
| 1377 | * @hide |
| 1378 | */ |
| 1379 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1380 | public static final String ACTION_NOTIFICATION_SETTINGS |
| 1381 | = "android.settings.NOTIFICATION_SETTINGS"; |
| 1382 | |
| 1383 | /** |
Julia Reynolds | ed1c9af | 2018-03-21 15:21:09 -0400 | [diff] [blame] | 1384 | * Activity Action: Show app listing settings, filtered by those that send notifications. |
| 1385 | * |
| 1386 | * @hide |
| 1387 | */ |
| 1388 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1389 | public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = |
| 1390 | "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; |
| 1391 | |
| 1392 | /** |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1393 | * Activity Action: Show notification settings for a single app. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1394 | * <p> |
Julia Reynolds | ed1c9af | 2018-03-21 15:21:09 -0400 | [diff] [blame] | 1395 | * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1396 | * <p> |
| 1397 | * Output: Nothing. |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1398 | */ |
| 1399 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1400 | public static final String ACTION_APP_NOTIFICATION_SETTINGS |
| 1401 | = "android.settings.APP_NOTIFICATION_SETTINGS"; |
| 1402 | |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1403 | /** |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1404 | * Activity Action: Show notification settings for a single {@link NotificationChannel}. |
| 1405 | * <p> |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1406 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1407 | * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. |
| 1408 | * <p> |
| 1409 | * Output: Nothing. |
| 1410 | */ |
| 1411 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1412 | public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS |
| 1413 | = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; |
| 1414 | |
| 1415 | /** |
| 1416 | * Activity Extra: The package owner of the notification channel settings to display. |
| 1417 | * <p> |
| 1418 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1419 | */ |
| 1420 | public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; |
| 1421 | |
| 1422 | /** |
| 1423 | * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings |
| 1424 | * to display. |
| 1425 | * <p> |
| 1426 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1427 | */ |
| 1428 | public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; |
| 1429 | |
| 1430 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1431 | * Activity Action: Show notification redaction settings. |
| 1432 | * |
| 1433 | * @hide |
| 1434 | */ |
| 1435 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1436 | public static final String ACTION_APP_NOTIFICATION_REDACTION |
| 1437 | = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; |
| 1438 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1439 | /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1440 | |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1441 | /** |
| 1442 | * Activity Action: Show a dialog with disabled by policy message. |
| 1443 | * <p> If an user action is disabled by policy, this dialog can be triggered to let |
| 1444 | * the user know about this. |
| 1445 | * <p> |
| 1446 | * Input: Nothing. |
| 1447 | * <p> |
| 1448 | * Output: Nothing. |
Sudheer Shanka | aebd5dd | 2016-02-18 12:37:14 +0000 | [diff] [blame] | 1449 | * |
| 1450 | * @hide |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1451 | */ |
| 1452 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1453 | public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS |
| 1454 | = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; |
| 1455 | |
Michal Karpinski | ba24409 | 2016-02-25 17:28:24 +0000 | [diff] [blame] | 1456 | /** |
| 1457 | * Activity Action: Show a dialog for remote bugreport flow. |
| 1458 | * <p> |
| 1459 | * Input: Nothing. |
| 1460 | * <p> |
| 1461 | * Output: Nothing. |
| 1462 | * |
| 1463 | * @hide |
| 1464 | */ |
| 1465 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1466 | public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG |
| 1467 | = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; |
| 1468 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 1469 | /** |
| 1470 | * Activity Action: Show VR listener settings. |
| 1471 | * <p> |
| 1472 | * Input: Nothing. |
| 1473 | * <p> |
| 1474 | * Output: Nothing. |
| 1475 | * |
| 1476 | * @see android.service.vr.VrListenerService |
| 1477 | */ |
| 1478 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1479 | public static final String ACTION_VR_LISTENER_SETTINGS |
| 1480 | = "android.settings.VR_LISTENER_SETTINGS"; |
| 1481 | |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1482 | /** |
Winson Chung | 59fda9e | 2017-01-20 16:14:51 -0800 | [diff] [blame] | 1483 | * Activity Action: Show Picture-in-picture settings. |
| 1484 | * <p> |
| 1485 | * Input: Nothing. |
| 1486 | * <p> |
| 1487 | * Output: Nothing. |
| 1488 | * |
| 1489 | * @hide |
| 1490 | */ |
| 1491 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1492 | public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS |
| 1493 | = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; |
| 1494 | |
| 1495 | /** |
Daniel Nishi | e58d2a7 | 2016-09-20 16:42:19 -0700 | [diff] [blame] | 1496 | * Activity Action: Show Storage Manager settings. |
| 1497 | * <p> |
| 1498 | * Input: Nothing. |
| 1499 | * <p> |
| 1500 | * Output: Nothing. |
| 1501 | * |
| 1502 | * @hide |
| 1503 | */ |
| 1504 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1505 | public static final String ACTION_STORAGE_MANAGER_SETTINGS |
| 1506 | = "android.settings.STORAGE_MANAGER_SETTINGS"; |
| 1507 | |
| 1508 | /** |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1509 | * Activity Action: Allows user to select current webview implementation. |
| 1510 | * <p> |
| 1511 | * Input: Nothing. |
| 1512 | * <p> |
| 1513 | * Output: Nothing. |
| 1514 | */ |
| 1515 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1516 | public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; |
| 1517 | |
Bartosz Fabianowski | 46bea2e | 2016-12-06 01:20:29 +0100 | [diff] [blame] | 1518 | /** |
| 1519 | * Activity Action: Show enterprise privacy section. |
| 1520 | * <p> |
| 1521 | * Input: Nothing. |
| 1522 | * <p> |
| 1523 | * Output: Nothing. |
| 1524 | * @hide |
| 1525 | */ |
| 1526 | @SystemApi |
| 1527 | @TestApi |
| 1528 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1529 | public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS |
| 1530 | = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; |
| 1531 | |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1532 | /** |
| 1533 | * Activity Action: Show screen that let user select its Autofill Service. |
| 1534 | * <p> |
| 1535 | * Input: Intent's data URI set with an application name, using the |
| 1536 | * "package" schema (like "package:com.my.app"). |
| 1537 | * |
| 1538 | * <p> |
| 1539 | * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging |
| 1540 | * to the caller package. |
| 1541 | * |
| 1542 | * <p> |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1543 | * <b>NOTE: </b> Applications should call |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1544 | * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1545 | * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action |
| 1546 | * to start an activity if they return {@code false} and {@code true} respectively. |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1547 | */ |
| 1548 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1549 | public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = |
| 1550 | "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; |
| 1551 | |
Felipe Leme | d82096e | 2018-01-22 13:44:01 -0800 | [diff] [blame] | 1552 | /** |
| 1553 | * Activity Action: Show screen for controlling which apps have access on volume directories. |
| 1554 | * <p> |
| 1555 | * Input: Nothing. |
| 1556 | * <p> |
| 1557 | * Output: Nothing. |
| 1558 | * <p> |
| 1559 | * Applications typically use this action to ask the user to revert the "Do not ask again" |
| 1560 | * status of directory access requests made by |
| 1561 | * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. |
| 1562 | */ |
| 1563 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1564 | public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = |
| 1565 | "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; |
| 1566 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1567 | // End of Intent actions for Settings |
| 1568 | |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1569 | /** |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1570 | * @hide - Private call() method on SettingsProvider to read from 'system' table. |
| 1571 | */ |
| 1572 | public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; |
| 1573 | |
| 1574 | /** |
| 1575 | * @hide - Private call() method on SettingsProvider to read from 'secure' table. |
| 1576 | */ |
| 1577 | public static final String CALL_METHOD_GET_SECURE = "GET_secure"; |
| 1578 | |
| 1579 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1580 | * @hide - Private call() method on SettingsProvider to read from 'global' table. |
| 1581 | */ |
| 1582 | public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; |
| 1583 | |
| 1584 | /** |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1585 | * @hide - Specifies that the caller of the fast-path call()-based flow tracks |
| 1586 | * the settings generation in order to cache values locally. If this key is |
| 1587 | * mapped to a <code>null</code> string extra in the request bundle, the response |
| 1588 | * bundle will contain the same key mapped to a parcelable extra which would be |
| 1589 | * an {@link android.util.MemoryIntArray}. The response will also contain an |
| 1590 | * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the |
| 1591 | * index in the array clients should use to lookup the generation. For efficiency |
| 1592 | * the caller should request the generation tracking memory array only if it |
| 1593 | * doesn't already have it. |
| 1594 | * |
| 1595 | * @see #CALL_METHOD_GENERATION_INDEX_KEY |
| 1596 | */ |
| 1597 | public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; |
| 1598 | |
| 1599 | /** |
| 1600 | * @hide Key with the location in the {@link android.util.MemoryIntArray} where |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1601 | * to look up the generation id of the backing table. The value is an integer. |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1602 | * |
| 1603 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1604 | */ |
| 1605 | public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; |
| 1606 | |
| 1607 | /** |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1608 | * @hide Key with the settings table generation. The value is an integer. |
| 1609 | * |
| 1610 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1611 | */ |
| 1612 | public static final String CALL_METHOD_GENERATION_KEY = "_generation"; |
| 1613 | |
| 1614 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1615 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1616 | */ |
| 1617 | public static final String CALL_METHOD_USER_KEY = "_user"; |
| 1618 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1619 | /** |
| 1620 | * @hide - Boolean argument extra to the fast-path call()-based requests |
| 1621 | */ |
| 1622 | public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; |
| 1623 | |
| 1624 | /** |
| 1625 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1626 | */ |
| 1627 | public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; |
| 1628 | |
| 1629 | /** |
| 1630 | * @hide - String argument extra to the fast-path call()-based requests |
| 1631 | */ |
| 1632 | public static final String CALL_METHOD_TAG_KEY = "_tag"; |
| 1633 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1634 | /** @hide - Private call() method to write to 'system' table */ |
| 1635 | public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; |
| 1636 | |
| 1637 | /** @hide - Private call() method to write to 'secure' table */ |
| 1638 | public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; |
| 1639 | |
| 1640 | /** @hide - Private call() method to write to 'global' table */ |
| 1641 | public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; |
| 1642 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1643 | /** @hide - Private call() method to reset to defaults the 'global' table */ |
| 1644 | public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; |
| 1645 | |
| 1646 | /** @hide - Private call() method to reset to defaults the 'secure' table */ |
| 1647 | public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; |
| 1648 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1649 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1650 | * Activity Extra: Limit available options in launched activity based on the given authority. |
| 1651 | * <p> |
| 1652 | * This can be passed as an extra field in an Activity Intent with one or more syncable content |
| 1653 | * provider's authorities as a String[]. This field is used by some intents to alter the |
| 1654 | * behavior of the called activity. |
| 1655 | * <p> |
| 1656 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based |
| 1657 | * on the authority given. |
| 1658 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1659 | public static final String EXTRA_AUTHORITIES = "authorities"; |
| 1660 | |
Alon Albert | d35bf1f | 2013-04-18 14:26:51 -0700 | [diff] [blame] | 1661 | /** |
| 1662 | * Activity Extra: Limit available options in launched activity based on the given account |
| 1663 | * types. |
| 1664 | * <p> |
| 1665 | * This can be passed as an extra field in an Activity Intent with one or more account types |
| 1666 | * as a String[]. This field is used by some intents to alter the behavior of the called |
| 1667 | * activity. |
| 1668 | * <p> |
| 1669 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified |
| 1670 | * list. |
| 1671 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1672 | public static final String EXTRA_ACCOUNT_TYPES = "account_types"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1673 | |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 1674 | public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; |
| 1675 | |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1676 | /** |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1677 | * Activity Extra: The device identifier to act upon. |
| 1678 | * <p> |
| 1679 | * This can be passed as an extra field in an Activity Intent with a single |
| 1680 | * InputDeviceIdentifier. This field is used by some activities to jump straight into the |
| 1681 | * settings for the given device. |
| 1682 | * <p> |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 1683 | * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout |
| 1684 | * dialog for the given device. |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1685 | * @hide |
| 1686 | */ |
| 1687 | public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; |
| 1688 | |
| 1689 | /** |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1690 | * Activity Extra: Enable or disable Airplane Mode. |
| 1691 | * <p> |
| 1692 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1693 | * intent as a boolean to indicate if it should be enabled. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1694 | */ |
| 1695 | public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; |
| 1696 | |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1697 | /** |
| 1698 | * Activity Extra: Enable or disable Battery saver mode. |
| 1699 | * <p> |
| 1700 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} |
| 1701 | * intent as a boolean to indicate if it should be enabled. |
| 1702 | */ |
| 1703 | public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = |
| 1704 | "android.settings.extra.battery_saver_mode_enabled"; |
| 1705 | |
| 1706 | /** |
| 1707 | * Activity Extra: Enable or disable Do Not Disturb mode. |
| 1708 | * <p> |
| 1709 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1710 | * intent as a boolean to indicate if it should be enabled. |
| 1711 | */ |
| 1712 | public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = |
| 1713 | "android.settings.extra.do_not_disturb_mode_enabled"; |
| 1714 | |
| 1715 | /** |
| 1716 | * Activity Extra: How many minutes to enable do not disturb mode for. |
| 1717 | * <p> |
| 1718 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1719 | * intent to indicate how long do not disturb mode should be enabled for. |
| 1720 | */ |
| 1721 | public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = |
| 1722 | "android.settings.extra.do_not_disturb_mode_minutes"; |
| 1723 | |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1724 | /** |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1725 | * Reset mode: reset to defaults only settings changed by the |
| 1726 | * calling package. If there is a default set the setting |
| 1727 | * will be set to it, otherwise the setting will be deleted. |
| 1728 | * This is the only type of reset available to non-system clients. |
| 1729 | * @hide |
| 1730 | */ |
| 1731 | public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; |
| 1732 | |
| 1733 | /** |
| 1734 | * Reset mode: reset all settings set by untrusted packages, which is |
| 1735 | * packages that aren't a part of the system, to the current defaults. |
| 1736 | * If there is a default set the setting will be set to it, otherwise |
| 1737 | * the setting will be deleted. This mode is only available to the system. |
| 1738 | * @hide |
| 1739 | */ |
| 1740 | public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; |
| 1741 | |
| 1742 | /** |
| 1743 | * Reset mode: delete all settings set by untrusted packages, which is |
| 1744 | * packages that aren't a part of the system. If a setting is set by an |
| 1745 | * untrusted package it will be deleted if its default is not provided |
| 1746 | * by the system, otherwise the setting will be set to its default. |
| 1747 | * This mode is only available to the system. |
| 1748 | * @hide |
| 1749 | */ |
| 1750 | public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; |
| 1751 | |
| 1752 | /** |
| 1753 | * Reset mode: reset all settings to defaults specified by trusted |
| 1754 | * packages, which is packages that are a part of the system, and |
| 1755 | * delete all settings set by untrusted packages. If a setting has |
| 1756 | * a default set by a system package it will be set to the default, |
| 1757 | * otherwise the setting will be deleted. This mode is only available |
| 1758 | * to the system. |
| 1759 | * @hide |
| 1760 | */ |
| 1761 | public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; |
| 1762 | |
| 1763 | /** @hide */ |
| 1764 | @Retention(RetentionPolicy.SOURCE) |
Jeff Sharkey | ce8db99 | 2017-12-13 20:05:05 -0700 | [diff] [blame] | 1765 | @IntDef(prefix = { "RESET_MODE_" }, value = { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1766 | RESET_MODE_PACKAGE_DEFAULTS, |
| 1767 | RESET_MODE_UNTRUSTED_DEFAULTS, |
| 1768 | RESET_MODE_UNTRUSTED_CHANGES, |
| 1769 | RESET_MODE_TRUSTED_DEFAULTS |
| 1770 | }) |
| 1771 | public @interface ResetMode{} |
| 1772 | |
Ajay Nadathur | 702fc64 | 2018-03-09 11:56:01 -0800 | [diff] [blame] | 1773 | |
| 1774 | /** |
| 1775 | * User has not started setup personalization. |
| 1776 | * @hide |
| 1777 | */ |
| 1778 | public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; |
| 1779 | |
| 1780 | /** |
| 1781 | * User has not yet completed setup personalization. |
| 1782 | * @hide |
| 1783 | */ |
| 1784 | public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; |
| 1785 | |
| 1786 | /** |
| 1787 | * User has completed setup personalization. |
| 1788 | * @hide |
| 1789 | */ |
| 1790 | public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; |
| 1791 | |
| 1792 | /** @hide */ |
| 1793 | @Retention(RetentionPolicy.SOURCE) |
| 1794 | @IntDef({ |
| 1795 | USER_SETUP_PERSONALIZATION_NOT_STARTED, |
| 1796 | USER_SETUP_PERSONALIZATION_STARTED, |
| 1797 | USER_SETUP_PERSONALIZATION_COMPLETE |
| 1798 | }) |
| 1799 | public @interface UserSetupPersonalization {} |
| 1800 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1801 | /** |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1802 | * Activity Extra: Number of certificates |
| 1803 | * <p> |
| 1804 | * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} |
| 1805 | * intent to indicate the number of certificates |
| 1806 | * @hide |
| 1807 | */ |
| 1808 | public static final String EXTRA_NUMBER_OF_CERTIFICATES = |
| 1809 | "android.settings.extra.number_of_certificates"; |
| 1810 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1811 | private static final String JID_RESOURCE_PREFIX = "android"; |
| 1812 | |
| 1813 | public static final String AUTHORITY = "settings"; |
| 1814 | |
| 1815 | private static final String TAG = "Settings"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1816 | private static final boolean LOCAL_LOGV = false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1817 | |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 1818 | // Lock ensures that when enabling/disabling the master location switch, we don't end up |
| 1819 | // with a partial enable/disable state in multi-threaded situations. |
| 1820 | private static final Object mLocationSettingsLock = new Object(); |
| 1821 | |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1822 | // Used in system server calling uid workaround in call() |
| 1823 | private static boolean sInSystemServer = false; |
| 1824 | private static final Object sInSystemServerLock = new Object(); |
| 1825 | |
| 1826 | /** @hide */ |
| 1827 | public static void setInSystemServer() { |
| 1828 | synchronized (sInSystemServerLock) { |
| 1829 | sInSystemServer = true; |
| 1830 | } |
| 1831 | } |
| 1832 | |
| 1833 | /** @hide */ |
| 1834 | public static boolean isInSystemServer() { |
| 1835 | synchronized (sInSystemServerLock) { |
| 1836 | return sInSystemServer; |
| 1837 | } |
| 1838 | } |
| 1839 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1840 | public static class SettingNotFoundException extends AndroidException { |
| 1841 | public SettingNotFoundException(String msg) { |
| 1842 | super(msg); |
| 1843 | } |
| 1844 | } |
| 1845 | |
| 1846 | /** |
| 1847 | * Common base for tables of name/value settings. |
| 1848 | */ |
| 1849 | public static class NameValueTable implements BaseColumns { |
| 1850 | public static final String NAME = "name"; |
| 1851 | public static final String VALUE = "value"; |
| 1852 | |
| 1853 | protected static boolean putString(ContentResolver resolver, Uri uri, |
| 1854 | String name, String value) { |
| 1855 | // The database will take care of replacing duplicates. |
| 1856 | try { |
| 1857 | ContentValues values = new ContentValues(); |
| 1858 | values.put(NAME, name); |
| 1859 | values.put(VALUE, value); |
| 1860 | resolver.insert(uri, values); |
| 1861 | return true; |
| 1862 | } catch (SQLException e) { |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 1863 | Log.w(TAG, "Can't set key " + name + " in " + uri, e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1864 | return false; |
| 1865 | } |
| 1866 | } |
| 1867 | |
| 1868 | public static Uri getUriFor(Uri uri, String name) { |
| 1869 | return Uri.withAppendedPath(uri, name); |
| 1870 | } |
| 1871 | } |
| 1872 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1873 | private static final class GenerationTracker { |
| 1874 | private final MemoryIntArray mArray; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1875 | private final Runnable mErrorHandler; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1876 | private final int mIndex; |
| 1877 | private int mCurrentGeneration; |
| 1878 | |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1879 | public GenerationTracker(@NonNull MemoryIntArray array, int index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1880 | int generation, Runnable errorHandler) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1881 | mArray = array; |
| 1882 | mIndex = index; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1883 | mErrorHandler = errorHandler; |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1884 | mCurrentGeneration = generation; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1885 | } |
| 1886 | |
| 1887 | public boolean isGenerationChanged() { |
| 1888 | final int currentGeneration = readCurrentGeneration(); |
| 1889 | if (currentGeneration >= 0) { |
| 1890 | if (currentGeneration == mCurrentGeneration) { |
| 1891 | return false; |
| 1892 | } |
| 1893 | mCurrentGeneration = currentGeneration; |
| 1894 | } |
| 1895 | return true; |
| 1896 | } |
| 1897 | |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1898 | public int getCurrentGeneration() { |
| 1899 | return mCurrentGeneration; |
| 1900 | } |
| 1901 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1902 | private int readCurrentGeneration() { |
| 1903 | try { |
| 1904 | return mArray.get(mIndex); |
| 1905 | } catch (IOException e) { |
| 1906 | Log.e(TAG, "Error getting current generation", e); |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1907 | if (mErrorHandler != null) { |
| 1908 | mErrorHandler.run(); |
| 1909 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1910 | } |
| 1911 | return -1; |
| 1912 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1913 | |
| 1914 | public void destroy() { |
| 1915 | try { |
| 1916 | mArray.close(); |
| 1917 | } catch (IOException e) { |
| 1918 | Log.e(TAG, "Error closing backing array", e); |
| 1919 | if (mErrorHandler != null) { |
| 1920 | mErrorHandler.run(); |
| 1921 | } |
| 1922 | } |
| 1923 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1924 | } |
| 1925 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1926 | private static final class ContentProviderHolder { |
| 1927 | private final Object mLock = new Object(); |
| 1928 | |
| 1929 | @GuardedBy("mLock") |
| 1930 | private final Uri mUri; |
| 1931 | @GuardedBy("mLock") |
| 1932 | private IContentProvider mContentProvider; |
| 1933 | |
| 1934 | public ContentProviderHolder(Uri uri) { |
| 1935 | mUri = uri; |
| 1936 | } |
| 1937 | |
| 1938 | public IContentProvider getProvider(ContentResolver contentResolver) { |
| 1939 | synchronized (mLock) { |
| 1940 | if (mContentProvider == null) { |
| 1941 | mContentProvider = contentResolver |
| 1942 | .acquireProvider(mUri.getAuthority()); |
| 1943 | } |
| 1944 | return mContentProvider; |
| 1945 | } |
| 1946 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 1947 | |
| 1948 | public void clearProviderForTest() { |
| 1949 | synchronized (mLock) { |
| 1950 | mContentProvider = null; |
| 1951 | } |
| 1952 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1953 | } |
| 1954 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1955 | // Thread-safe. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1956 | private static class NameValueCache { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1957 | private static final boolean DEBUG = false; |
| 1958 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1959 | private static final String[] SELECT_VALUE_PROJECTION = new String[] { |
| 1960 | Settings.NameValueTable.VALUE |
| 1961 | }; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1962 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1963 | private static final String NAME_EQ_PLACEHOLDER = "name=?"; |
| 1964 | |
| 1965 | // Must synchronize on 'this' to access mValues and mValuesVersion. |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1966 | private final HashMap<String, String> mValues = new HashMap<>(); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1967 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1968 | private final Uri mUri; |
| 1969 | private final ContentProviderHolder mProviderHolder; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1970 | |
| 1971 | // The method we'll call (or null, to not use) on the provider |
| 1972 | // for the fast path of retrieving settings. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1973 | private final String mCallGetCommand; |
| 1974 | private final String mCallSetCommand; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1975 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1976 | @GuardedBy("this") |
| 1977 | private GenerationTracker mGenerationTracker; |
| 1978 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1979 | public NameValueCache(Uri uri, String getCommand, String setCommand, |
| 1980 | ContentProviderHolder providerHolder) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1981 | mUri = uri; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1982 | mCallGetCommand = getCommand; |
| 1983 | mCallSetCommand = setCommand; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1984 | mProviderHolder = providerHolder; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1985 | } |
| 1986 | |
| 1987 | public boolean putStringForUser(ContentResolver cr, String name, String value, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1988 | String tag, boolean makeDefault, final int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1989 | try { |
| 1990 | Bundle arg = new Bundle(); |
| 1991 | arg.putString(Settings.NameValueTable.VALUE, value); |
Christopher Tate | d5fe147 | 2012-09-10 15:48:38 -0700 | [diff] [blame] | 1992 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1993 | if (tag != null) { |
| 1994 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 1995 | } |
| 1996 | if (makeDefault) { |
| 1997 | arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); |
| 1998 | } |
| 1999 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 2000 | cp.call(cr.getPackageName(), mCallSetCommand, name, arg); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2001 | } catch (RemoteException e) { |
| 2002 | Log.w(TAG, "Can't set key " + name + " in " + mUri, e); |
| 2003 | return false; |
| 2004 | } |
| 2005 | return true; |
| 2006 | } |
| 2007 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2008 | public String getStringForUser(ContentResolver cr, String name, final int userHandle) { |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2009 | final boolean isSelf = (userHandle == UserHandle.myUserId()); |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2010 | int currentGeneration = -1; |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2011 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2012 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2013 | if (mGenerationTracker != null) { |
| 2014 | if (mGenerationTracker.isGenerationChanged()) { |
| 2015 | if (DEBUG) { |
| 2016 | Log.i(TAG, "Generation changed for type:" |
| 2017 | + mUri.getPath() + " in package:" |
| 2018 | + cr.getPackageName() +" and user:" + userHandle); |
| 2019 | } |
| 2020 | mValues.clear(); |
| 2021 | } else if (mValues.containsKey(name)) { |
| 2022 | return mValues.get(name); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2023 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2024 | if (mGenerationTracker != null) { |
| 2025 | currentGeneration = mGenerationTracker.getCurrentGeneration(); |
| 2026 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2027 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2028 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2029 | } else { |
| 2030 | if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle |
| 2031 | + " by user " + UserHandle.myUserId() + " so skipping cache"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2032 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2033 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2034 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2035 | |
| 2036 | // Try the fast path first, not using query(). If this |
| 2037 | // fails (alternate Settings provider that doesn't support |
| 2038 | // this interface?) then we fall back to the query/table |
| 2039 | // interface. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2040 | if (mCallGetCommand != null) { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2041 | try { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2042 | Bundle args = null; |
Christopher Tate | 5e08af0 | 2012-09-21 17:17:22 -0700 | [diff] [blame] | 2043 | if (!isSelf) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2044 | args = new Bundle(); |
| 2045 | args.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 2046 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2047 | boolean needsGenerationTracker = false; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2048 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2049 | if (isSelf && mGenerationTracker == null) { |
| 2050 | needsGenerationTracker = true; |
| 2051 | if (args == null) { |
| 2052 | args = new Bundle(); |
| 2053 | } |
| 2054 | args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); |
| 2055 | if (DEBUG) { |
| 2056 | Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() |
| 2057 | + " in package:" + cr.getPackageName() +" and user:" |
| 2058 | + userHandle); |
| 2059 | } |
| 2060 | } |
| 2061 | } |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2062 | Bundle b; |
| 2063 | // If we're in system server and in a binder transaction we need to clear the |
| 2064 | // calling uid. This works around code in system server that did not call |
| 2065 | // clearCallingIdentity, previously this wasn't needed because reading settings |
| 2066 | // did not do permission checking but thats no longer the case. |
| 2067 | // Long term this should be removed and callers should properly call |
| 2068 | // clearCallingIdentity or use a ContentResolver from the caller as needed. |
| 2069 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2070 | final long token = Binder.clearCallingIdentity(); |
| 2071 | try { |
| 2072 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 2073 | } finally { |
| 2074 | Binder.restoreCallingIdentity(token); |
| 2075 | } |
| 2076 | } else { |
| 2077 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 2078 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2079 | if (b != null) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2080 | String value = b.getString(Settings.NameValueTable.VALUE); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2081 | // Don't update our cache for reads of other users' data |
| 2082 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2083 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2084 | if (needsGenerationTracker) { |
| 2085 | MemoryIntArray array = b.getParcelable( |
| 2086 | CALL_METHOD_TRACK_GENERATION_KEY); |
| 2087 | final int index = b.getInt( |
| 2088 | CALL_METHOD_GENERATION_INDEX_KEY, -1); |
| 2089 | if (array != null && index >= 0) { |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2090 | final int generation = b.getInt( |
| 2091 | CALL_METHOD_GENERATION_KEY, 0); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2092 | if (DEBUG) { |
| 2093 | Log.i(TAG, "Received generation tracker for type:" |
| 2094 | + mUri.getPath() + " in package:" |
| 2095 | + cr.getPackageName() + " and user:" |
| 2096 | + userHandle + " with index:" + index); |
| 2097 | } |
Svet Ganov | 9d723d3 | 2016-08-27 11:05:56 -0700 | [diff] [blame] | 2098 | if (mGenerationTracker != null) { |
| 2099 | mGenerationTracker.destroy(); |
| 2100 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2101 | mGenerationTracker = new GenerationTracker(array, index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2102 | generation, () -> { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2103 | synchronized (NameValueCache.this) { |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2104 | Log.e(TAG, "Error accessing generation" |
| 2105 | + " tracker - removing"); |
| 2106 | if (mGenerationTracker != null) { |
| 2107 | GenerationTracker generationTracker = |
| 2108 | mGenerationTracker; |
| 2109 | mGenerationTracker = null; |
| 2110 | generationTracker.destroy(); |
| 2111 | mValues.clear(); |
| 2112 | } |
| 2113 | } |
| 2114 | }); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2115 | } |
| 2116 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2117 | if (mGenerationTracker != null && currentGeneration == |
| 2118 | mGenerationTracker.getCurrentGeneration()) { |
| 2119 | mValues.put(name, value); |
| 2120 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2121 | } |
| 2122 | } else { |
| 2123 | if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle |
| 2124 | + " by " + UserHandle.myUserId() |
| 2125 | + " so not updating cache"); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2126 | } |
| 2127 | return value; |
| 2128 | } |
| 2129 | // If the response Bundle is null, we fall through |
| 2130 | // to the query interface below. |
| 2131 | } catch (RemoteException e) { |
| 2132 | // Not supported by the remote side? Fall through |
| 2133 | // to query(). |
| 2134 | } |
| 2135 | } |
| 2136 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2137 | Cursor c = null; |
| 2138 | try { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2139 | Bundle queryArgs = ContentResolver.createSqlQueryBundle( |
| 2140 | NAME_EQ_PLACEHOLDER, new String[]{name}, null); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2141 | // Same workaround as above. |
| 2142 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2143 | final long token = Binder.clearCallingIdentity(); |
| 2144 | try { |
| 2145 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2146 | null); |
| 2147 | } finally { |
| 2148 | Binder.restoreCallingIdentity(token); |
| 2149 | } |
| 2150 | } else { |
| 2151 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2152 | null); |
| 2153 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2154 | if (c == null) { |
| 2155 | Log.w(TAG, "Can't get key " + name + " from " + mUri); |
| 2156 | return null; |
| 2157 | } |
| 2158 | |
| 2159 | String value = c.moveToNext() ? c.getString(0) : null; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2160 | synchronized (NameValueCache.this) { |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2161 | if(mGenerationTracker != null && |
| 2162 | currentGeneration == mGenerationTracker.getCurrentGeneration()) { |
| 2163 | mValues.put(name, value); |
| 2164 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2165 | } |
| 2166 | if (LOCAL_LOGV) { |
| 2167 | Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + |
| 2168 | name + " = " + (value == null ? "(null)" : value)); |
| 2169 | } |
| 2170 | return value; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2171 | } catch (RemoteException e) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2172 | Log.w(TAG, "Can't get key " + name + " from " + mUri, e); |
| 2173 | return null; // Return null, but don't cache it. |
| 2174 | } finally { |
| 2175 | if (c != null) c.close(); |
| 2176 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2177 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2178 | |
| 2179 | public void clearGenerationTrackerForTest() { |
| 2180 | synchronized (NameValueCache.this) { |
| 2181 | if (mGenerationTracker != null) { |
| 2182 | mGenerationTracker.destroy(); |
| 2183 | } |
| 2184 | mValues.clear(); |
| 2185 | mGenerationTracker = null; |
| 2186 | } |
| 2187 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2188 | } |
| 2189 | |
| 2190 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2191 | * Checks if the specified context can draw on top of other apps. As of API |
| 2192 | * level 23, an app cannot draw on top of other apps unless it declares the |
| 2193 | * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its |
| 2194 | * manifest, <em>and</em> the user specifically grants the app this |
| 2195 | * capability. To prompt the user to grant this approval, the app must send an |
| 2196 | * intent with the action |
| 2197 | * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which |
| 2198 | * causes the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2199 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2200 | * @param context App context. |
| 2201 | * @return true if the specified context can draw on top of other apps, false otherwise |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2202 | */ |
| 2203 | public static boolean canDrawOverlays(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 2204 | return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), |
| 2205 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2206 | } |
| 2207 | |
| 2208 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2209 | * System settings, containing miscellaneous system preferences. This |
| 2210 | * table holds simple name/value pairs. There are convenience |
| 2211 | * functions for accessing individual settings entries. |
| 2212 | */ |
| 2213 | public static final class System extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 2214 | // NOTE: If you add new settings here, be sure to add them to |
| 2215 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. |
| 2216 | |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2217 | private static final float DEFAULT_FONT_SCALE = 1.0f; |
| 2218 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2219 | /** |
| 2220 | * The content:// style URL for this table |
| 2221 | */ |
| 2222 | public static final Uri CONTENT_URI = |
| 2223 | Uri.parse("content://" + AUTHORITY + "/system"); |
| 2224 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2225 | private static final ContentProviderHolder sProviderHolder = |
| 2226 | new ContentProviderHolder(CONTENT_URI); |
| 2227 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2228 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2229 | CONTENT_URI, |
| 2230 | CALL_METHOD_GET_SYSTEM, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2231 | CALL_METHOD_PUT_SYSTEM, |
| 2232 | sProviderHolder); |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2233 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2234 | private static final HashSet<String> MOVED_TO_SECURE; |
| 2235 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2236 | MOVED_TO_SECURE = new HashSet<>(30); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2237 | MOVED_TO_SECURE.add(Secure.ANDROID_ID); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2238 | MOVED_TO_SECURE.add(Secure.HTTP_PROXY); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2239 | MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 2240 | MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2241 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); |
| 2242 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); |
| 2243 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2244 | MOVED_TO_SECURE.add(Secure.LOGGING_ID); |
| 2245 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); |
| 2246 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); |
| 2247 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); |
| 2248 | MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2249 | MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); |
| 2250 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 2251 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 2252 | MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 2253 | MOVED_TO_SECURE.add(Secure.WIFI_ON); |
| 2254 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); |
| 2255 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); |
| 2256 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); |
| 2257 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); |
| 2258 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); |
| 2259 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); |
| 2260 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); |
| 2261 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); |
| 2262 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); |
| 2263 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); |
| 2264 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 2265 | |
| 2266 | // At one time in System, then Global, but now back in Secure |
| 2267 | MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2268 | } |
| 2269 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2270 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2271 | private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2272 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2273 | MOVED_TO_GLOBAL = new HashSet<>(); |
| 2274 | MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2275 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2276 | // these were originally in system but migrated to secure in the past, |
| 2277 | // so are duplicated in the Secure.* namespace |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2278 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); |
| 2279 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); |
| 2280 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); |
| 2281 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2282 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); |
| 2283 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2284 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2285 | // these are moving directly from system to global |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2286 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); |
| 2287 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); |
| 2288 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); |
| 2289 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); |
| 2290 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); |
| 2291 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); |
| 2292 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); |
| 2293 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); |
| 2294 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); |
| 2295 | MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); |
| 2296 | MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); |
| 2297 | MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); |
| 2298 | MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); |
| 2299 | MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); |
| 2300 | MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); |
| 2301 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2302 | MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2303 | MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); |
| 2304 | MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); |
| 2305 | MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); |
| 2306 | MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); |
| 2307 | MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); |
| 2308 | MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); |
| 2309 | MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); |
| 2310 | MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); |
| 2311 | MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2312 | MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 2313 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); |
| 2314 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); |
| 2315 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); |
| 2316 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); |
| 2317 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); |
| 2318 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); |
| 2319 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); |
| 2320 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2321 | } |
| 2322 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2323 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2324 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2325 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2326 | outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); |
| 2327 | } |
| 2328 | |
| 2329 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2330 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 2331 | outKeySet.addAll(MOVED_TO_SECURE); |
| 2332 | } |
| 2333 | |
| 2334 | /** @hide */ |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2335 | public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { |
| 2336 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2337 | } |
| 2338 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2339 | /** @hide */ |
| 2340 | public static void clearProviderForTest() { |
| 2341 | sProviderHolder.clearProviderForTest(); |
| 2342 | sNameValueCache.clearGenerationTrackerForTest(); |
| 2343 | } |
| 2344 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2345 | /** |
| 2346 | * Look up a name in the database. |
| 2347 | * @param resolver to access the database with |
| 2348 | * @param name to look up in the table |
| 2349 | * @return the corresponding value, or null if not present |
| 2350 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2351 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2352 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2353 | } |
| 2354 | |
| 2355 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2356 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2357 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2358 | if (MOVED_TO_SECURE.contains(name)) { |
| 2359 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2360 | + " to android.provider.Settings.Secure, returning read-only value."); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2361 | return Secure.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2362 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2363 | if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2364 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2365 | + " to android.provider.Settings.Global, returning read-only value."); |
| 2366 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2367 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2368 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2369 | } |
| 2370 | |
| 2371 | /** |
| 2372 | * Store a name/value pair into the database. |
| 2373 | * @param resolver to access the database with |
| 2374 | * @param name to store |
| 2375 | * @param value to associate with the name |
| 2376 | * @return true if the value was set, false on database errors |
| 2377 | */ |
| 2378 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2379 | return putStringForUser(resolver, name, value, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2380 | } |
| 2381 | |
| 2382 | /** @hide */ |
| 2383 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 2384 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2385 | if (MOVED_TO_SECURE.contains(name)) { |
| 2386 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2387 | + " to android.provider.Settings.Secure, value is unchanged."); |
| 2388 | return false; |
| 2389 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2390 | if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2391 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2392 | + " to android.provider.Settings.Global, value is unchanged."); |
| 2393 | return false; |
| 2394 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2395 | return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2396 | } |
| 2397 | |
| 2398 | /** |
| 2399 | * Construct the content URI for a particular name/value pair, |
| 2400 | * useful for monitoring changes with a ContentObserver. |
| 2401 | * @param name to look up in the table |
| 2402 | * @return the corresponding content URI, or null if not present |
| 2403 | */ |
| 2404 | public static Uri getUriFor(String name) { |
| 2405 | if (MOVED_TO_SECURE.contains(name)) { |
| 2406 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2407 | + " to android.provider.Settings.Secure, returning Secure URI."); |
| 2408 | return Secure.getUriFor(Secure.CONTENT_URI, name); |
| 2409 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2410 | if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2411 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2412 | + " to android.provider.Settings.Global, returning read-only global URI."); |
| 2413 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 2414 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2415 | return getUriFor(CONTENT_URI, name); |
| 2416 | } |
| 2417 | |
| 2418 | /** |
| 2419 | * Convenience function for retrieving a single system settings value |
| 2420 | * as an integer. Note that internally setting values are always |
| 2421 | * stored as strings; this function converts the string to an integer |
| 2422 | * for you. The default value will be returned if the setting is |
| 2423 | * not defined or not an integer. |
| 2424 | * |
| 2425 | * @param cr The ContentResolver to access. |
| 2426 | * @param name The name of the setting to retrieve. |
| 2427 | * @param def Value to return if the setting is not defined. |
| 2428 | * |
| 2429 | * @return The setting's current value, or 'def' if it is not defined |
| 2430 | * or not a valid integer. |
| 2431 | */ |
| 2432 | public static int getInt(ContentResolver cr, String name, int def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2433 | return getIntForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2434 | } |
| 2435 | |
| 2436 | /** @hide */ |
| 2437 | public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { |
| 2438 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2439 | try { |
| 2440 | return v != null ? Integer.parseInt(v) : def; |
| 2441 | } catch (NumberFormatException e) { |
| 2442 | return def; |
| 2443 | } |
| 2444 | } |
| 2445 | |
| 2446 | /** |
| 2447 | * Convenience function for retrieving a single system settings value |
| 2448 | * as an integer. Note that internally setting values are always |
| 2449 | * stored as strings; this function converts the string to an integer |
| 2450 | * for you. |
| 2451 | * <p> |
| 2452 | * This version does not take a default value. If the setting has not |
| 2453 | * been set, or the string value is not a number, |
| 2454 | * it throws {@link SettingNotFoundException}. |
| 2455 | * |
| 2456 | * @param cr The ContentResolver to access. |
| 2457 | * @param name The name of the setting to retrieve. |
| 2458 | * |
| 2459 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2460 | * name can't be found or the setting value is not an integer. |
| 2461 | * |
| 2462 | * @return The setting's current value. |
| 2463 | */ |
| 2464 | public static int getInt(ContentResolver cr, String name) |
| 2465 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2466 | return getIntForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2467 | } |
| 2468 | |
| 2469 | /** @hide */ |
| 2470 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 2471 | throws SettingNotFoundException { |
| 2472 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2473 | try { |
| 2474 | return Integer.parseInt(v); |
| 2475 | } catch (NumberFormatException e) { |
| 2476 | throw new SettingNotFoundException(name); |
| 2477 | } |
| 2478 | } |
| 2479 | |
| 2480 | /** |
| 2481 | * Convenience function for updating a single settings value as an |
| 2482 | * integer. This will either create a new entry in the table if the |
| 2483 | * given name does not exist, or modify the value of the existing row |
| 2484 | * with that name. Note that internally setting values are always |
| 2485 | * stored as strings, so this function converts the given value to a |
| 2486 | * string before storing it. |
| 2487 | * |
| 2488 | * @param cr The ContentResolver to access. |
| 2489 | * @param name The name of the setting to modify. |
| 2490 | * @param value The new value for the setting. |
| 2491 | * @return true if the value was set, false on database errors |
| 2492 | */ |
| 2493 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2494 | return putIntForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2495 | } |
| 2496 | |
| 2497 | /** @hide */ |
| 2498 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 2499 | int userHandle) { |
| 2500 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2501 | } |
| 2502 | |
| 2503 | /** |
| 2504 | * Convenience function for retrieving a single system settings value |
| 2505 | * as a {@code long}. Note that internally setting values are always |
| 2506 | * stored as strings; this function converts the string to a {@code long} |
| 2507 | * for you. The default value will be returned if the setting is |
| 2508 | * not defined or not a {@code long}. |
| 2509 | * |
| 2510 | * @param cr The ContentResolver to access. |
| 2511 | * @param name The name of the setting to retrieve. |
| 2512 | * @param def Value to return if the setting is not defined. |
| 2513 | * |
| 2514 | * @return The setting's current value, or 'def' if it is not defined |
| 2515 | * or not a valid {@code long}. |
| 2516 | */ |
| 2517 | public static long getLong(ContentResolver cr, String name, long def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2518 | return getLongForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2519 | } |
| 2520 | |
| 2521 | /** @hide */ |
| 2522 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 2523 | int userHandle) { |
| 2524 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2525 | long value; |
| 2526 | try { |
| 2527 | value = valString != null ? Long.parseLong(valString) : def; |
| 2528 | } catch (NumberFormatException e) { |
| 2529 | value = def; |
| 2530 | } |
| 2531 | return value; |
| 2532 | } |
| 2533 | |
| 2534 | /** |
| 2535 | * Convenience function for retrieving a single system settings value |
| 2536 | * as a {@code long}. Note that internally setting values are always |
| 2537 | * stored as strings; this function converts the string to a {@code long} |
| 2538 | * for you. |
| 2539 | * <p> |
| 2540 | * This version does not take a default value. If the setting has not |
| 2541 | * been set, or the string value is not a number, |
| 2542 | * it throws {@link SettingNotFoundException}. |
| 2543 | * |
| 2544 | * @param cr The ContentResolver to access. |
| 2545 | * @param name The name of the setting to retrieve. |
| 2546 | * |
| 2547 | * @return The setting's current value. |
| 2548 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2549 | * name can't be found or the setting value is not an integer. |
| 2550 | */ |
| 2551 | public static long getLong(ContentResolver cr, String name) |
| 2552 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2553 | return getLongForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2554 | } |
| 2555 | |
| 2556 | /** @hide */ |
| 2557 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 2558 | throws SettingNotFoundException { |
| 2559 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2560 | try { |
| 2561 | return Long.parseLong(valString); |
| 2562 | } catch (NumberFormatException e) { |
| 2563 | throw new SettingNotFoundException(name); |
| 2564 | } |
| 2565 | } |
| 2566 | |
| 2567 | /** |
| 2568 | * Convenience function for updating a single settings value as a long |
| 2569 | * integer. This will either create a new entry in the table if the |
| 2570 | * given name does not exist, or modify the value of the existing row |
| 2571 | * with that name. Note that internally setting values are always |
| 2572 | * stored as strings, so this function converts the given value to a |
| 2573 | * string before storing it. |
| 2574 | * |
| 2575 | * @param cr The ContentResolver to access. |
| 2576 | * @param name The name of the setting to modify. |
| 2577 | * @param value The new value for the setting. |
| 2578 | * @return true if the value was set, false on database errors |
| 2579 | */ |
| 2580 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2581 | return putLongForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2582 | } |
| 2583 | |
| 2584 | /** @hide */ |
| 2585 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 2586 | int userHandle) { |
| 2587 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2588 | } |
| 2589 | |
| 2590 | /** |
| 2591 | * Convenience function for retrieving a single system settings value |
| 2592 | * as a floating point number. Note that internally setting values are |
| 2593 | * always stored as strings; this function converts the string to an |
| 2594 | * float for you. The default value will be returned if the setting |
| 2595 | * is not defined or not a valid float. |
| 2596 | * |
| 2597 | * @param cr The ContentResolver to access. |
| 2598 | * @param name The name of the setting to retrieve. |
| 2599 | * @param def Value to return if the setting is not defined. |
| 2600 | * |
| 2601 | * @return The setting's current value, or 'def' if it is not defined |
| 2602 | * or not a valid float. |
| 2603 | */ |
| 2604 | public static float getFloat(ContentResolver cr, String name, float def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2605 | return getFloatForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2606 | } |
| 2607 | |
| 2608 | /** @hide */ |
| 2609 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 2610 | int userHandle) { |
| 2611 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2612 | try { |
| 2613 | return v != null ? Float.parseFloat(v) : def; |
| 2614 | } catch (NumberFormatException e) { |
| 2615 | return def; |
| 2616 | } |
| 2617 | } |
| 2618 | |
| 2619 | /** |
| 2620 | * Convenience function for retrieving a single system settings value |
| 2621 | * as a float. Note that internally setting values are always |
| 2622 | * stored as strings; this function converts the string to a float |
| 2623 | * for you. |
| 2624 | * <p> |
| 2625 | * This version does not take a default value. If the setting has not |
| 2626 | * been set, or the string value is not a number, |
| 2627 | * it throws {@link SettingNotFoundException}. |
| 2628 | * |
| 2629 | * @param cr The ContentResolver to access. |
| 2630 | * @param name The name of the setting to retrieve. |
| 2631 | * |
| 2632 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2633 | * name can't be found or the setting value is not a float. |
| 2634 | * |
| 2635 | * @return The setting's current value. |
| 2636 | */ |
| 2637 | public static float getFloat(ContentResolver cr, String name) |
| 2638 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2639 | return getFloatForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2640 | } |
| 2641 | |
| 2642 | /** @hide */ |
| 2643 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 2644 | throws SettingNotFoundException { |
| 2645 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 2646 | if (v == null) { |
| 2647 | throw new SettingNotFoundException(name); |
| 2648 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2649 | try { |
| 2650 | return Float.parseFloat(v); |
| 2651 | } catch (NumberFormatException e) { |
| 2652 | throw new SettingNotFoundException(name); |
| 2653 | } |
| 2654 | } |
| 2655 | |
| 2656 | /** |
| 2657 | * Convenience function for updating a single settings value as a |
| 2658 | * floating point number. This will either create a new entry in the |
| 2659 | * table if the given name does not exist, or modify the value of the |
| 2660 | * existing row with that name. Note that internally setting values |
| 2661 | * are always stored as strings, so this function converts the given |
| 2662 | * value to a string before storing it. |
| 2663 | * |
| 2664 | * @param cr The ContentResolver to access. |
| 2665 | * @param name The name of the setting to modify. |
| 2666 | * @param value The new value for the setting. |
| 2667 | * @return true if the value was set, false on database errors |
| 2668 | */ |
| 2669 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2670 | return putFloatForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2671 | } |
| 2672 | |
| 2673 | /** @hide */ |
| 2674 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 2675 | int userHandle) { |
| 2676 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2677 | } |
| 2678 | |
| 2679 | /** |
| 2680 | * Convenience function to read all of the current |
| 2681 | * configuration-related settings into a |
| 2682 | * {@link Configuration} object. |
| 2683 | * |
| 2684 | * @param cr The ContentResolver to access. |
| 2685 | * @param outConfig Where to place the configuration settings. |
| 2686 | */ |
| 2687 | public static void getConfiguration(ContentResolver cr, Configuration outConfig) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2688 | adjustConfigurationForUser(cr, outConfig, cr.getUserId(), |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2689 | false /* updateSettingsIfEmpty */); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2690 | } |
| 2691 | |
| 2692 | /** @hide */ |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2693 | public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, |
| 2694 | int userHandle, boolean updateSettingsIfEmpty) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2695 | outConfig.fontScale = Settings.System.getFloatForUser( |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2696 | cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2697 | if (outConfig.fontScale < 0) { |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2698 | outConfig.fontScale = DEFAULT_FONT_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2699 | } |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2700 | |
| 2701 | final String localeValue = |
| 2702 | Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); |
| 2703 | if (localeValue != null) { |
| 2704 | outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); |
| 2705 | } else { |
| 2706 | // Do not update configuration with emtpy settings since we need to take over the |
| 2707 | // locale list of previous user if the settings value is empty. This happens when a |
| 2708 | // new user is created. |
| 2709 | |
| 2710 | if (updateSettingsIfEmpty) { |
| 2711 | // Make current configuration persistent. This is necessary the first time a |
| 2712 | // user log in. At the first login, the configuration settings are empty, so we |
| 2713 | // need to store the adjusted configuration as the initial settings. |
| 2714 | Settings.System.putStringForUser( |
| 2715 | cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), |
| 2716 | userHandle); |
| 2717 | } |
| 2718 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2719 | } |
| 2720 | |
| 2721 | /** |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2722 | * @hide Erase the fields in the Configuration that should be applied |
| 2723 | * by the settings. |
| 2724 | */ |
| 2725 | public static void clearConfiguration(Configuration inoutConfig) { |
| 2726 | inoutConfig.fontScale = 0; |
Seigo Nonaka | d403151 | 2016-03-17 21:18:53 +0900 | [diff] [blame] | 2727 | if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { |
Seigo Nonaka | bd5cac6 | 2016-05-13 15:11:37 +0900 | [diff] [blame] | 2728 | inoutConfig.clearLocales(); |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2729 | } |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2730 | } |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2731 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2732 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2733 | * Convenience function to write a batch of configuration-related |
| 2734 | * settings from a {@link Configuration} object. |
| 2735 | * |
| 2736 | * @param cr The ContentResolver to access. |
| 2737 | * @param config The settings to write. |
| 2738 | * @return true if the values were set, false on database errors |
| 2739 | */ |
| 2740 | public static boolean putConfiguration(ContentResolver cr, Configuration config) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2741 | return putConfigurationForUser(cr, config, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2742 | } |
| 2743 | |
| 2744 | /** @hide */ |
| 2745 | public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, |
| 2746 | int userHandle) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2747 | return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && |
| 2748 | Settings.System.putStringForUser( |
| 2749 | cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2750 | } |
| 2751 | |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2752 | /** @hide */ |
| 2753 | public static boolean hasInterestingConfigurationChanges(int changes) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2754 | return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || |
| 2755 | (changes & ActivityInfo.CONFIG_LOCALE) != 0; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2756 | } |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2757 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2758 | /** @deprecated - Do not use */ |
| 2759 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2760 | public static boolean getShowGTalkServiceStatus(ContentResolver cr) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2761 | return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2762 | } |
| 2763 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2764 | /** |
| 2765 | * @hide |
| 2766 | * @deprecated - Do not use |
| 2767 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 2768 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2769 | public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, |
| 2770 | int userHandle) { |
| 2771 | return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; |
| 2772 | } |
| 2773 | |
| 2774 | /** @deprecated - Do not use */ |
| 2775 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2776 | public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2777 | setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2778 | } |
| 2779 | |
| 2780 | /** |
| 2781 | * @hide |
| 2782 | * @deprecated - Do not use |
| 2783 | */ |
| 2784 | @Deprecated |
| 2785 | public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, |
| 2786 | int userHandle) { |
| 2787 | putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2788 | } |
| 2789 | |
| 2790 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2791 | * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2792 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2793 | @Deprecated |
| 2794 | public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2795 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2796 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 2797 | @Override |
| 2798 | public boolean validate(String value) { |
| 2799 | try { |
| 2800 | int val = Integer.parseInt(value); |
| 2801 | return (val == 0) |
| 2802 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 2803 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 2804 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 2805 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2806 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 2807 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2808 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2809 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 2810 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2811 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2812 | | BatteryManager.BATTERY_PLUGGED_USB |
| 2813 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 2814 | } catch (NumberFormatException e) { |
| 2815 | return false; |
| 2816 | } |
| 2817 | } |
| 2818 | }; |
| 2819 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2820 | /** |
| 2821 | * What happens when the user presses the end call button if they're not |
| 2822 | * on a call.<br/> |
| 2823 | * <b>Values:</b><br/> |
| 2824 | * 0 - The end button does nothing.<br/> |
| 2825 | * 1 - The end button goes to the home screen.<br/> |
| 2826 | * 2 - The end button puts the device to sleep and locks the keyguard.<br/> |
| 2827 | * 3 - The end button goes to the home screen. If the user is already on the |
| 2828 | * home screen, it puts the device to sleep. |
| 2829 | */ |
| 2830 | public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; |
| 2831 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2832 | private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2833 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2834 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2835 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 2836 | * END_BUTTON_BEHAVIOR value for "go home". |
| 2837 | * @hide |
| 2838 | */ |
| 2839 | public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; |
| 2840 | |
| 2841 | /** |
| 2842 | * END_BUTTON_BEHAVIOR value for "go to sleep". |
| 2843 | * @hide |
| 2844 | */ |
| 2845 | public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; |
| 2846 | |
| 2847 | /** |
| 2848 | * END_BUTTON_BEHAVIOR default value. |
| 2849 | * @hide |
| 2850 | */ |
| 2851 | public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; |
| 2852 | |
| 2853 | /** |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2854 | * Is advanced settings mode turned on. 0 == no, 1 == yes |
| 2855 | * @hide |
| 2856 | */ |
| 2857 | public static final String ADVANCED_SETTINGS = "advanced_settings"; |
| 2858 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2859 | private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2860 | |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2861 | /** |
| 2862 | * ADVANCED_SETTINGS default value. |
| 2863 | * @hide |
| 2864 | */ |
| 2865 | public static final int ADVANCED_SETTINGS_DEFAULT = 0; |
| 2866 | |
| 2867 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2868 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2869 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2870 | @Deprecated |
| 2871 | public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2872 | |
| 2873 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2874 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2875 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2876 | @Deprecated |
| 2877 | public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2878 | |
| 2879 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2880 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2881 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2882 | @Deprecated |
| 2883 | public static final String RADIO_WIFI = Global.RADIO_WIFI; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2884 | |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2885 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2886 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2887 | * {@hide} |
| 2888 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2889 | @Deprecated |
| 2890 | public static final String RADIO_WIMAX = Global.RADIO_WIMAX; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2891 | |
| 2892 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2893 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2894 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2895 | @Deprecated |
| 2896 | public static final String RADIO_CELL = Global.RADIO_CELL; |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2897 | |
| 2898 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2899 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2900 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2901 | @Deprecated |
| 2902 | public static final String RADIO_NFC = Global.RADIO_NFC; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2903 | |
| 2904 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2905 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead |
| 2906 | */ |
| 2907 | @Deprecated |
| 2908 | public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; |
| 2909 | |
| 2910 | /** |
| 2911 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2912 | * |
| 2913 | * {@hide} |
| 2914 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2915 | @Deprecated |
| 2916 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = |
| 2917 | Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2918 | |
| 2919 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2920 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2922 | @Deprecated |
| 2923 | public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2924 | |
| 2925 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2926 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2927 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2928 | @Deprecated |
| 2929 | public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2930 | |
| 2931 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2932 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2933 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2934 | @Deprecated |
| 2935 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = |
| 2936 | Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2937 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2938 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2939 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2940 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2941 | @Deprecated |
| 2942 | public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2943 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2944 | /** |
| 2945 | * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead |
| 2946 | */ |
| 2947 | @Deprecated |
| 2948 | public static final String MODE_RINGER = Global.MODE_RINGER; |
| 2949 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2950 | /** |
| 2951 | * Whether to use static IP and other static network attributes. |
| 2952 | * <p> |
| 2953 | * Set to 1 for true and 0 for false. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2954 | * |
| 2955 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2956 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2957 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2958 | public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; |
| 2959 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2960 | private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2961 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2962 | /** |
| 2963 | * The static IP address. |
| 2964 | * <p> |
| 2965 | * Example: "192.168.1.51" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2966 | * |
| 2967 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2968 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2969 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2970 | public static final String WIFI_STATIC_IP = "wifi_static_ip"; |
| 2971 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2972 | private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2973 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2974 | /** |
| 2975 | * If using static IP, the gateway's IP address. |
| 2976 | * <p> |
| 2977 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2978 | * |
| 2979 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2980 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2981 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2982 | public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; |
| 2983 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2984 | private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2985 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2986 | /** |
| 2987 | * If using static IP, the net mask. |
| 2988 | * <p> |
| 2989 | * Example: "255.255.255.0" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2990 | * |
| 2991 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2992 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2993 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2994 | public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; |
| 2995 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2996 | private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2997 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2998 | /** |
| 2999 | * If using static IP, the primary DNS's IP address. |
| 3000 | * <p> |
| 3001 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 3002 | * |
| 3003 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3004 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 3005 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3006 | public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; |
| 3007 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3008 | private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3009 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3010 | /** |
| 3011 | * If using static IP, the secondary DNS's IP address. |
| 3012 | * <p> |
| 3013 | * Example: "192.168.1.2" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 3014 | * |
| 3015 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3016 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 3017 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3018 | public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; |
| 3019 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3020 | private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3021 | |
| 3022 | /** |
| 3023 | * Determines whether remote devices may discover and/or connect to |
| 3024 | * this device. |
| 3025 | * <P>Type: INT</P> |
| 3026 | * 2 -- discoverable and connectable |
| 3027 | * 1 -- connectable but not discoverable |
| 3028 | * 0 -- neither connectable nor discoverable |
| 3029 | */ |
| 3030 | public static final String BLUETOOTH_DISCOVERABILITY = |
| 3031 | "bluetooth_discoverability"; |
| 3032 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3033 | private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3034 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3035 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3036 | /** |
| 3037 | * Bluetooth discoverability timeout. If this value is nonzero, then |
| 3038 | * Bluetooth becomes discoverable for a certain number of seconds, |
| 3039 | * after which is becomes simply connectable. The value is in seconds. |
| 3040 | */ |
| 3041 | public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = |
| 3042 | "bluetooth_discoverability_timeout"; |
| 3043 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3044 | private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3045 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3046 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3047 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3048 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} |
| 3049 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3050 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3051 | @Deprecated |
| 3052 | public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3053 | |
| 3054 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3055 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} |
| 3056 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3057 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3058 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3059 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 3060 | |
| 3061 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 3062 | * @deprecated Use |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3063 | * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} |
| 3064 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3065 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3066 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3067 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 3068 | "lock_pattern_tactile_feedback_enabled"; |
| 3069 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3070 | /** |
| 3071 | * A formatted string of the next alarm that is set, or the empty string |
| 3072 | * if there is no alarm set. |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3073 | * |
| 3074 | * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3075 | */ |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3076 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3077 | public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; |
| 3078 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3079 | private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { |
| 3080 | private static final int MAX_LENGTH = 1000; |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 3081 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3082 | @Override |
| 3083 | public boolean validate(String value) { |
| 3084 | // TODO: No idea what the correct format is. |
Svetoslav | 64d6e9c | 2015-02-12 11:30:36 -0800 | [diff] [blame] | 3085 | return value == null || value.length() < MAX_LENGTH; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3086 | } |
| 3087 | }; |
| 3088 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3089 | /** |
| 3090 | * Scaling factor for fonts, float. |
| 3091 | */ |
| 3092 | public static final String FONT_SCALE = "font_scale"; |
| 3093 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3094 | private static final Validator FONT_SCALE_VALIDATOR = new Validator() { |
| 3095 | @Override |
| 3096 | public boolean validate(String value) { |
| 3097 | try { |
| 3098 | return Float.parseFloat(value) >= 0; |
| 3099 | } catch (NumberFormatException e) { |
| 3100 | return false; |
| 3101 | } |
| 3102 | } |
| 3103 | }; |
| 3104 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3105 | /** |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3106 | * The serialized system locale value. |
| 3107 | * |
| 3108 | * Do not use this value directory. |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 3109 | * To get system locale, use {@link LocaleList#getDefault} instead. |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3110 | * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} |
| 3111 | * instead. |
| 3112 | * @hide |
| 3113 | */ |
| 3114 | public static final String SYSTEM_LOCALES = "system_locales"; |
| 3115 | |
| 3116 | |
| 3117 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3118 | * Name of an application package to be debugged. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3119 | * |
| 3120 | * @deprecated Use {@link Global#DEBUG_APP} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3121 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3122 | @Deprecated |
| 3123 | public static final String DEBUG_APP = Global.DEBUG_APP; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3124 | |
| 3125 | /** |
| 3126 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 3127 | * starting user code. If 0, it will run normally. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3128 | * |
| 3129 | * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3130 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3131 | @Deprecated |
| 3132 | public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3133 | |
| 3134 | /** |
| 3135 | * Whether or not to dim the screen. 0=no 1=yes |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3136 | * @deprecated This setting is no longer used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3137 | */ |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3138 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3139 | public static final String DIM_SCREEN = "dim_screen"; |
| 3140 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3141 | private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3142 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3143 | /** |
Christine Franks | 8ad7149 | 2017-10-24 19:04:22 -0700 | [diff] [blame] | 3144 | * The display color mode. |
| 3145 | * @hide |
| 3146 | */ |
| 3147 | public static final String DISPLAY_COLOR_MODE = "display_color_mode"; |
| 3148 | |
Christine Franks | 1269960 | 2017-10-30 18:38:48 -0700 | [diff] [blame] | 3149 | private static final Validator DISPLAY_COLOR_MODE_VALIDATOR = |
| 3150 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
| 3151 | |
Christine Franks | 8ad7149 | 2017-10-24 19:04:22 -0700 | [diff] [blame] | 3152 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 3153 | * The amount of time in milliseconds before the device goes to sleep or begins |
| 3154 | * to dream after a period of inactivity. This value is also known as the |
| 3155 | * user activity timeout period since the screen isn't necessarily turned off |
| 3156 | * when it expires. |
yuemingw | 0de748d | 2017-11-15 19:22:27 +0000 | [diff] [blame] | 3157 | * |
| 3158 | * <p> |
| 3159 | * This value is bounded by maximum timeout set by |
| 3160 | * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3161 | */ |
| 3162 | public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; |
| 3163 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3164 | private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = |
| 3165 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3166 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3167 | /** |
| 3168 | * The screen backlight brightness between 0 and 255. |
| 3169 | */ |
| 3170 | public static final String SCREEN_BRIGHTNESS = "screen_brightness"; |
| 3171 | |
| 3172 | /** |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3173 | * The screen backlight brightness between 0 and 255. |
| 3174 | * @hide |
| 3175 | */ |
| 3176 | public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; |
| 3177 | |
| 3178 | private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3179 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3180 | |
| 3181 | /** |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3182 | * Control whether to enable automatic brightness mode. |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3183 | */ |
| 3184 | public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; |
| 3185 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3186 | private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3187 | |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3188 | /** |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3189 | * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) |
| 3190 | * or less (<0.0 >-1.0) bright. |
Dianne Hackborn | 518a3d8 | 2012-05-09 16:30:49 -0700 | [diff] [blame] | 3191 | * @hide |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3192 | */ |
| 3193 | public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; |
| 3194 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3195 | private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3196 | new SettingsValidators.InclusiveFloatRangeValidator(-1, 1); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3197 | |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3198 | /** |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3199 | * SCREEN_BRIGHTNESS_MODE value for manual mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3200 | */ |
| 3201 | public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; |
| 3202 | |
| 3203 | /** |
Scott Main | 52bfc24 | 2012-02-09 10:09:14 -0800 | [diff] [blame] | 3204 | * SCREEN_BRIGHTNESS_MODE value for automatic mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3205 | */ |
| 3206 | public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; |
| 3207 | |
| 3208 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | * Control whether the process CPU usage meter should be shown. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3210 | * |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 3211 | * @deprecated This functionality is no longer available as of |
| 3212 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3213 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3214 | @Deprecated |
| 3215 | public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3216 | |
| 3217 | /** |
| 3218 | * If 1, the activity manager will aggressively finish activities and |
| 3219 | * processes as soon as they are no longer needed. If 0, the normal |
| 3220 | * extended lifetime is used. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3221 | * |
| 3222 | * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3223 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3224 | @Deprecated |
| 3225 | public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3226 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3227 | /** |
Beverly | d696476 | 2018-02-16 14:07:03 -0500 | [diff] [blame] | 3228 | * Determines which streams are affected by ringer and zen mode changes. The |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3229 | * stream type's bit should be set to 1 if it should be muted when going |
| 3230 | * into an inaudible ringer mode. |
| 3231 | */ |
| 3232 | public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; |
| 3233 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3234 | private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3235 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3236 | |
| 3237 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3238 | * Determines which streams are affected by mute. The |
| 3239 | * stream type's bit should be set to 1 if it should be muted when a mute request |
| 3240 | * is received. |
| 3241 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3242 | public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; |
| 3243 | |
| 3244 | private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3245 | NON_NEGATIVE_INTEGER_VALIDATOR; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3246 | |
| 3247 | /** |
| 3248 | * Whether vibrate is on for different events. This is used internally, |
| 3249 | * changing this value will not change the vibrate. See AudioManager. |
| 3250 | */ |
| 3251 | public static final String VIBRATE_ON = "vibrate_on"; |
| 3252 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3253 | private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3254 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3255 | /** |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3256 | * If 1, redirects the system vibrator to all currently attached input devices |
| 3257 | * that support vibration. If there are no such input devices, then the system |
| 3258 | * vibrator is used instead. |
| 3259 | * If 0, does not register the system vibrator. |
| 3260 | * |
| 3261 | * This setting is mainly intended to provide a compatibility mechanism for |
| 3262 | * applications that only know about the system vibrator and do not use the |
| 3263 | * input device vibrator API. |
| 3264 | * |
| 3265 | * @hide |
| 3266 | */ |
| 3267 | public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; |
| 3268 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3269 | private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3270 | |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3271 | /** |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 3272 | * The intensity of notification vibrations, if configurable. |
| 3273 | * |
| 3274 | * Not all devices are capable of changing their vibration intensity; on these devices |
| 3275 | * there will likely be no difference between the various vibration intensities except for |
| 3276 | * intensity 0 (off) and the rest. |
| 3277 | * |
| 3278 | * <b>Values:</b><br/> |
| 3279 | * 0 - Vibration is disabled<br/> |
| 3280 | * 1 - Weak vibrations<br/> |
| 3281 | * 2 - Medium vibrations<br/> |
| 3282 | * 3 - Strong vibrations |
| 3283 | * @hide |
| 3284 | */ |
| 3285 | public static final String NOTIFICATION_VIBRATION_INTENSITY = |
| 3286 | "notification_vibration_intensity"; |
| 3287 | |
| 3288 | /** |
| 3289 | * The intensity of haptic feedback vibrations, if configurable. |
| 3290 | * |
| 3291 | * Not all devices are capable of changing their feedback intensity; on these devices |
| 3292 | * there will likely be no difference between the various vibration intensities except for |
| 3293 | * intensity 0 (off) and the rest. |
| 3294 | * |
| 3295 | * <b>Values:</b><br/> |
| 3296 | * 0 - Vibration is disabled<br/> |
| 3297 | * 1 - Weak vibrations<br/> |
| 3298 | * 2 - Medium vibrations<br/> |
| 3299 | * 3 - Strong vibrations |
| 3300 | * @hide |
| 3301 | */ |
| 3302 | public static final String HAPTIC_FEEDBACK_INTENSITY = |
| 3303 | "haptic_feedback_intensity"; |
| 3304 | |
| 3305 | private static final Validator VIBRATION_INTENSITY_VALIDATOR = |
| 3306 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
| 3307 | |
| 3308 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3309 | * Ringer volume. This is used internally, changing this value will not |
| 3310 | * change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3311 | * |
| 3312 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3313 | */ |
| 3314 | public static final String VOLUME_RING = "volume_ring"; |
| 3315 | |
| 3316 | /** |
| 3317 | * System/notifications volume. This is used internally, changing this |
| 3318 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3319 | * |
| 3320 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3321 | */ |
| 3322 | public static final String VOLUME_SYSTEM = "volume_system"; |
| 3323 | |
| 3324 | /** |
| 3325 | * Voice call volume. This is used internally, changing this value will |
| 3326 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3327 | * |
| 3328 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3329 | */ |
| 3330 | public static final String VOLUME_VOICE = "volume_voice"; |
| 3331 | |
| 3332 | /** |
| 3333 | * Music/media/gaming volume. This is used internally, changing this |
| 3334 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3335 | * |
| 3336 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3337 | */ |
| 3338 | public static final String VOLUME_MUSIC = "volume_music"; |
| 3339 | |
| 3340 | /** |
| 3341 | * Alarm volume. This is used internally, changing this |
| 3342 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3343 | * |
| 3344 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3345 | */ |
| 3346 | public static final String VOLUME_ALARM = "volume_alarm"; |
| 3347 | |
| 3348 | /** |
| 3349 | * Notification volume. This is used internally, changing this |
| 3350 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3351 | * |
| 3352 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3353 | */ |
| 3354 | public static final String VOLUME_NOTIFICATION = "volume_notification"; |
| 3355 | |
| 3356 | /** |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3357 | * Bluetooth Headset volume. This is used internally, changing this value will |
| 3358 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3359 | * |
| 3360 | * @removed Not used by anything since API 2. |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3361 | */ |
| 3362 | public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; |
| 3363 | |
| 3364 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3365 | * @hide |
| 3366 | * Acessibility volume. This is used internally, changing this |
| 3367 | * value will not change the volume. |
| 3368 | */ |
| 3369 | public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; |
| 3370 | |
| 3371 | /** |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3372 | * Master volume (float in the range 0.0f to 1.0f). |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3373 | * |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3374 | * @hide |
| 3375 | */ |
| 3376 | public static final String VOLUME_MASTER = "volume_master"; |
| 3377 | |
| 3378 | /** |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3379 | * Master mono (int 1 = mono, 0 = normal). |
| 3380 | * |
| 3381 | * @hide |
| 3382 | */ |
| 3383 | public static final String MASTER_MONO = "master_mono"; |
| 3384 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3385 | private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR; |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3386 | |
| 3387 | /** |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3388 | * Whether the notifications should use the ring volume (value of 1) or |
| 3389 | * a separate notification volume (value of 0). In most cases, users |
| 3390 | * will have this enabled so the notification and ringer volumes will be |
| 3391 | * the same. However, power users can disable this and use the separate |
| 3392 | * notification volume control. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3393 | * <p> |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3394 | * Note: This is a one-off setting that will be removed in the future |
| 3395 | * when there is profile support. For this reason, it is kept hidden |
| 3396 | * from the public APIs. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3397 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3398 | * @hide |
Amith Yamasani | 42722bf | 2011-07-22 10:34:27 -0700 | [diff] [blame] | 3399 | * @deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3400 | */ |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 3401 | @Deprecated |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3402 | public static final String NOTIFICATIONS_USE_RING_VOLUME = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3403 | "notifications_use_ring_volume"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3404 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3405 | private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3406 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3407 | /** |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3408 | * Whether silent mode should allow vibration feedback. This is used |
| 3409 | * internally in AudioService and the Sound settings activity to |
| 3410 | * coordinate decoupling of vibrate and silent modes. This setting |
| 3411 | * will likely be removed in a future release with support for |
| 3412 | * audio/vibe feedback profiles. |
| 3413 | * |
Eric Laurent | bffc3d1 | 2012-05-07 17:43:49 -0700 | [diff] [blame] | 3414 | * Not used anymore. On devices with vibrator, the user explicitly selects |
| 3415 | * silent or vibrate mode. |
| 3416 | * Kept for use by legacy database upgrade code in DatabaseHelper. |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3417 | * @hide |
| 3418 | */ |
| 3419 | public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; |
| 3420 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3421 | private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3422 | |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3423 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3424 | * The mapping of stream type (integer) to its setting. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3425 | * |
| 3426 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3427 | */ |
| 3428 | public static final String[] VOLUME_SETTINGS = { |
| 3429 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3430 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3431 | }; |
| 3432 | |
| 3433 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3434 | * @hide |
| 3435 | * The mapping of stream type (integer) to its setting. |
| 3436 | * Unlike the VOLUME_SETTINGS array, this one contains as many entries as |
| 3437 | * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes |
| 3438 | * are never persisted. |
| 3439 | */ |
| 3440 | public static final String[] VOLUME_SETTINGS_INT = { |
| 3441 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
| 3442 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, |
| 3443 | "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, |
| 3444 | "" /*STREAM_DTMF, no setting for this stream*/, |
| 3445 | "" /*STREAM_TTS, no setting for this stream*/, |
| 3446 | VOLUME_ACCESSIBILITY |
| 3447 | }; |
| 3448 | |
| 3449 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3450 | * Appended to various volume related settings to record the previous |
| 3451 | * values before they the settings were affected by a silent/vibrate |
| 3452 | * ringer mode change. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3453 | * |
| 3454 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3455 | */ |
| 3456 | public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; |
| 3457 | |
| 3458 | /** |
| 3459 | * Persistent store for the system-wide default ringtone URI. |
| 3460 | * <p> |
| 3461 | * If you need to play the default ringtone at any given time, it is recommended |
| 3462 | * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve |
| 3463 | * to the set default ringtone at the time of playing. |
| 3464 | * |
| 3465 | * @see #DEFAULT_RINGTONE_URI |
| 3466 | */ |
| 3467 | public static final String RINGTONE = "ringtone"; |
| 3468 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3469 | private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3470 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3471 | /** |
| 3472 | * A {@link Uri} that will point to the current default ringtone at any |
| 3473 | * given time. |
| 3474 | * <p> |
| 3475 | * If the current default ringtone is in the DRM provider and the caller |
| 3476 | * does not have permission, the exception will be a |
| 3477 | * FileNotFoundException. |
| 3478 | */ |
| 3479 | public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); |
| 3480 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3481 | /** {@hide} */ |
| 3482 | public static final String RINGTONE_CACHE = "ringtone_cache"; |
| 3483 | /** {@hide} */ |
| 3484 | public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); |
| 3485 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3486 | /** |
| 3487 | * Persistent store for the system-wide default notification sound. |
| 3488 | * |
| 3489 | * @see #RINGTONE |
| 3490 | * @see #DEFAULT_NOTIFICATION_URI |
| 3491 | */ |
| 3492 | public static final String NOTIFICATION_SOUND = "notification_sound"; |
| 3493 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3494 | private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3495 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3496 | /** |
| 3497 | * A {@link Uri} that will point to the current default notification |
| 3498 | * sound at any given time. |
| 3499 | * |
| 3500 | * @see #DEFAULT_RINGTONE_URI |
| 3501 | */ |
| 3502 | public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); |
| 3503 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3504 | /** {@hide} */ |
| 3505 | public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; |
| 3506 | /** {@hide} */ |
| 3507 | public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); |
| 3508 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3509 | /** |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3510 | * Persistent store for the system-wide default alarm alert. |
| 3511 | * |
| 3512 | * @see #RINGTONE |
| 3513 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3514 | */ |
| 3515 | public static final String ALARM_ALERT = "alarm_alert"; |
| 3516 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3517 | private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3518 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3519 | /** |
| 3520 | * A {@link Uri} that will point to the current default alarm alert at |
| 3521 | * any given time. |
| 3522 | * |
| 3523 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3524 | */ |
| 3525 | public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); |
| 3526 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3527 | /** {@hide} */ |
| 3528 | public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; |
| 3529 | /** {@hide} */ |
| 3530 | public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); |
| 3531 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3532 | /** |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3533 | * Persistent store for the system default media button event receiver. |
| 3534 | * |
| 3535 | * @hide |
| 3536 | */ |
| 3537 | public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; |
| 3538 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3539 | private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3540 | |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3541 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3542 | * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off |
| 3543 | */ |
| 3544 | public static final String TEXT_AUTO_REPLACE = "auto_replace"; |
| 3545 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3546 | private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3547 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3548 | /** |
| 3549 | * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off |
| 3550 | */ |
| 3551 | public static final String TEXT_AUTO_CAPS = "auto_caps"; |
| 3552 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3553 | private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3554 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3555 | /** |
| 3556 | * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This |
| 3557 | * feature converts two spaces to a "." and space. |
| 3558 | */ |
| 3559 | public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3560 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3561 | private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3562 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3563 | /** |
| 3564 | * Setting to showing password characters in text editors. 1 = On, 0 = Off |
| 3565 | */ |
| 3566 | public static final String TEXT_SHOW_PASSWORD = "show_password"; |
| 3567 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3568 | private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3569 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3570 | public static final String SHOW_GTALK_SERVICE_STATUS = |
| 3571 | "SHOW_GTALK_SERVICE_STATUS"; |
| 3572 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3573 | private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3574 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3575 | /** |
| 3576 | * Name of activity to use for wallpaper on the home screen. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3577 | * |
| 3578 | * @deprecated Use {@link WallpaperManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3579 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3580 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3581 | public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; |
| 3582 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3583 | private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { |
| 3584 | private static final int MAX_LENGTH = 1000; |
| 3585 | |
| 3586 | @Override |
| 3587 | public boolean validate(String value) { |
| 3588 | if (value != null && value.length() > MAX_LENGTH) { |
| 3589 | return false; |
| 3590 | } |
| 3591 | return ComponentName.unflattenFromString(value) != null; |
| 3592 | } |
| 3593 | }; |
| 3594 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3595 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3596 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} |
| 3597 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3598 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3599 | @Deprecated |
| 3600 | public static final String AUTO_TIME = Global.AUTO_TIME; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3601 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3602 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3603 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3604 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3605 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} |
| 3606 | * instead |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3607 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3608 | @Deprecated |
| 3609 | public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3610 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3611 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3612 | |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3613 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3614 | * Display times as 12 or 24 hours |
| 3615 | * 12 |
| 3616 | * 24 |
| 3617 | */ |
| 3618 | public static final String TIME_12_24 = "time_12_24"; |
| 3619 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3620 | /** @hide */ |
| 3621 | public static final Validator TIME_12_24_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3622 | new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3623 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3624 | /** |
| 3625 | * Date format string |
| 3626 | * mm/dd/yyyy |
| 3627 | * dd/mm/yyyy |
| 3628 | * yyyy/mm/dd |
| 3629 | */ |
| 3630 | public static final String DATE_FORMAT = "date_format"; |
| 3631 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3632 | /** @hide */ |
| 3633 | public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { |
| 3634 | @Override |
| 3635 | public boolean validate(String value) { |
| 3636 | try { |
| 3637 | new SimpleDateFormat(value); |
| 3638 | return true; |
| 3639 | } catch (IllegalArgumentException e) { |
| 3640 | return false; |
| 3641 | } |
| 3642 | } |
| 3643 | }; |
| 3644 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3645 | /** |
| 3646 | * Whether the setup wizard has been run before (on first boot), or if |
| 3647 | * it still needs to be run. |
| 3648 | * |
| 3649 | * nonzero = it has been run in the past |
| 3650 | * 0 = it has not been run in the past |
| 3651 | */ |
| 3652 | public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; |
| 3653 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3654 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3655 | public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3656 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3657 | /** |
| 3658 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 3659 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3660 | * |
| 3661 | * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3662 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3663 | @Deprecated |
| 3664 | public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3665 | |
| 3666 | /** |
| 3667 | * Scaling factor for activity transition animations. Setting to 0 will disable window |
| 3668 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3669 | * |
| 3670 | * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3671 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3672 | @Deprecated |
| 3673 | public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3674 | |
| 3675 | /** |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3676 | * Scaling factor for Animator-based animations. This affects both the start delay and |
| 3677 | * duration of all such animations. Setting to 0 will cause animations to end immediately. |
| 3678 | * The default value is 1. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3679 | * |
| 3680 | * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3681 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3682 | @Deprecated |
| 3683 | public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3684 | |
| 3685 | /** |
| 3686 | * Control whether the accelerometer will be used to change screen |
| 3687 | * orientation. If 0, it will not be used unless explicitly requested |
| 3688 | * by the application; if 1, it will be used by default unless explicitly |
| 3689 | * disabled by the application. |
| 3690 | */ |
| 3691 | public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; |
| 3692 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3693 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3694 | public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3695 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3696 | /** |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3697 | * Default screen rotation when no other policy applies. |
| 3698 | * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a |
| 3699 | * preference, this rotation value will be used. Must be one of the |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 3700 | * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3701 | * |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3702 | * @see android.view.Display#getRotation |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3703 | */ |
| 3704 | public static final String USER_ROTATION = "user_rotation"; |
| 3705 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3706 | /** @hide */ |
| 3707 | public static final Validator USER_ROTATION_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3708 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3709 | |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3710 | /** |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3711 | * Control whether the rotation lock toggle in the System UI should be hidden. |
| 3712 | * Typically this is done for accessibility purposes to make it harder for |
| 3713 | * the user to accidentally toggle the rotation lock while the display rotation |
| 3714 | * has been locked for accessibility. |
| 3715 | * |
| 3716 | * If 0, then rotation lock toggle is not hidden for accessibility (although it may be |
| 3717 | * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. |
| 3718 | * |
| 3719 | * @hide |
| 3720 | */ |
| 3721 | public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = |
| 3722 | "hide_rotation_lock_toggle_for_accessibility"; |
| 3723 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3724 | /** @hide */ |
| 3725 | public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3726 | BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3727 | |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3728 | /** |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3729 | * Whether the phone vibrates when it is ringing due to an incoming call. This will |
| 3730 | * be used by Phone and Setting apps; it shouldn't affect other apps. |
| 3731 | * The value is boolean (1 or 0). |
| 3732 | * |
| 3733 | * Note: this is not same as "vibrate on ring", which had been available until ICS. |
| 3734 | * It was about AudioManager's setting and thus affected all the applications which |
| 3735 | * relied on the setting, while this is purely about the vibration setting for incoming |
| 3736 | * calls. |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3737 | */ |
| 3738 | public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; |
| 3739 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3740 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3741 | public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3742 | |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3743 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3744 | * Whether the audible DTMF tones are played by the dialer when dialing. The value is |
| 3745 | * boolean (1 or 0). |
| 3746 | */ |
| 3747 | public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; |
| 3748 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3749 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3750 | public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3751 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3752 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3753 | * CDMA only settings |
| 3754 | * DTMF tone type played by the dialer when dialing. |
| 3755 | * 0 = Normal |
| 3756 | * 1 = Long |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3757 | */ |
| 3758 | public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; |
| 3759 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3760 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3761 | public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3762 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3763 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3764 | * Whether the hearing aid is enabled. The value is |
| 3765 | * boolean (1 or 0). |
| 3766 | * @hide |
| 3767 | */ |
| 3768 | public static final String HEARING_AID = "hearing_aid"; |
| 3769 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3770 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3771 | public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3772 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3773 | /** |
| 3774 | * CDMA only settings |
| 3775 | * TTY Mode |
| 3776 | * 0 = OFF |
| 3777 | * 1 = FULL |
| 3778 | * 2 = VCO |
| 3779 | * 3 = HCO |
| 3780 | * @hide |
| 3781 | */ |
| 3782 | public static final String TTY_MODE = "tty_mode"; |
| 3783 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3784 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3785 | public static final Validator TTY_MODE_VALIDATOR = |
| 3786 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3787 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3788 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3789 | * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is |
| 3790 | * boolean (1 or 0). |
| 3791 | */ |
| 3792 | public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3793 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3794 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3795 | public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3796 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3797 | /** |
Antony Sargent | 4457bb8 | 2018-03-12 16:10:56 -0700 | [diff] [blame] | 3798 | * Whether haptic feedback (Vibrate on tap) is enabled. The value is |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3799 | * boolean (1 or 0). |
| 3800 | */ |
| 3801 | public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 3802 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3803 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3804 | public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3805 | |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3806 | /** |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3807 | * @deprecated Each application that shows web suggestions should have its own |
| 3808 | * setting for this. |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3809 | */ |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3810 | @Deprecated |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3811 | public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3812 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3813 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3814 | public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3815 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3816 | /** |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3817 | * Whether the notification LED should repeatedly flash when a notification is |
| 3818 | * pending. The value is boolean (1 or 0). |
| 3819 | * @hide |
| 3820 | */ |
| 3821 | public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; |
| 3822 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3823 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3824 | public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3825 | |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3826 | /** |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3827 | * Show pointer location on screen? |
| 3828 | * 0 = no |
| 3829 | * 1 = yes |
| 3830 | * @hide |
| 3831 | */ |
| 3832 | public static final String POINTER_LOCATION = "pointer_location"; |
| 3833 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3834 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3835 | public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3836 | |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3837 | /** |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3838 | * Show touch positions on screen? |
| 3839 | * 0 = no |
| 3840 | * 1 = yes |
| 3841 | * @hide |
| 3842 | */ |
| 3843 | public static final String SHOW_TOUCHES = "show_touches"; |
| 3844 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3845 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3846 | public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3847 | |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3848 | /** |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3849 | * Log raw orientation data from |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 3850 | * {@link com.android.server.policy.WindowOrientationListener} for use with the |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3851 | * orientationplot.py tool. |
| 3852 | * 0 = no |
| 3853 | * 1 = yes |
| 3854 | * @hide |
| 3855 | */ |
| 3856 | public static final String WINDOW_ORIENTATION_LISTENER_LOG = |
| 3857 | "window_orientation_listener_log"; |
| 3858 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3859 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3860 | public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3861 | |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3862 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3863 | * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} |
| 3864 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3865 | * @hide |
| 3866 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3867 | @Deprecated |
| 3868 | public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3869 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3870 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3871 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3872 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3873 | * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} |
| 3874 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3875 | * @hide |
| 3876 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3877 | @Deprecated |
| 3878 | public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3879 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3880 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3881 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3882 | /** |
| 3883 | * Whether to play sounds when the keyguard is shown and dismissed. |
| 3884 | * @hide |
| 3885 | */ |
| 3886 | public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; |
| 3887 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3888 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3889 | public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3890 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3891 | /** |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3892 | * Whether the lockscreen should be completely disabled. |
| 3893 | * @hide |
| 3894 | */ |
| 3895 | public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; |
| 3896 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3897 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3898 | public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3899 | |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3900 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3901 | * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} |
| 3902 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3903 | * @hide |
| 3904 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3905 | @Deprecated |
| 3906 | public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3907 | |
| 3908 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3909 | * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} |
| 3910 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3911 | * @hide |
| 3912 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3913 | @Deprecated |
| 3914 | public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3915 | |
| 3916 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3917 | * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} |
| 3918 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3919 | * @hide |
| 3920 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3921 | @Deprecated |
| 3922 | public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3923 | |
| 3924 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3925 | * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} |
| 3926 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3927 | * @hide |
| 3928 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3929 | @Deprecated |
| 3930 | public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3931 | |
| 3932 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3933 | * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} |
| 3934 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3935 | * @hide |
| 3936 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3937 | @Deprecated |
| 3938 | public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3939 | |
| 3940 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3941 | * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} |
| 3942 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3943 | * @hide |
| 3944 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3945 | @Deprecated |
| 3946 | public static final String LOCK_SOUND = Global.LOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3947 | |
| 3948 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3949 | * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} |
| 3950 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3951 | * @hide |
| 3952 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3953 | @Deprecated |
| 3954 | public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3955 | |
| 3956 | /** |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3957 | * Receive incoming SIP calls? |
| 3958 | * 0 = no |
| 3959 | * 1 = yes |
| 3960 | * @hide |
| 3961 | */ |
| 3962 | public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; |
| 3963 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3964 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3965 | public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3966 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3967 | /** |
| 3968 | * Call Preference String. |
| 3969 | * "SIP_ALWAYS" : Always use SIP with network access |
| 3970 | * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3971 | * @hide |
| 3972 | */ |
| 3973 | public static final String SIP_CALL_OPTIONS = "sip_call_options"; |
| 3974 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3975 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3976 | public static final Validator SIP_CALL_OPTIONS_VALIDATOR = |
| 3977 | new SettingsValidators.DiscreteValueValidator( |
| 3978 | new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3979 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3980 | /** |
| 3981 | * One of the sip call options: Always use SIP with network access. |
| 3982 | * @hide |
| 3983 | */ |
| 3984 | public static final String SIP_ALWAYS = "SIP_ALWAYS"; |
| 3985 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3986 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3987 | public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3988 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3989 | /** |
| 3990 | * One of the sip call options: Only if destination is a SIP address. |
| 3991 | * @hide |
| 3992 | */ |
| 3993 | public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; |
| 3994 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3995 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3996 | public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3997 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3998 | /** |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3999 | * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that |
| 4000 | * the user should be prompted each time a call is made whether it should be placed using |
| 4001 | * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with |
| 4002 | * SIP_ADDRESS_ONLY. |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4003 | * @hide |
| 4004 | */ |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 4005 | @Deprecated |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4006 | public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; |
| 4007 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4008 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4009 | public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4010 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4011 | /** |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 4012 | * Pointer speed setting. |
| 4013 | * This is an integer value in a range between -7 and +7, so there are 15 possible values. |
| 4014 | * -7 = slowest |
| 4015 | * 0 = default speed |
| 4016 | * +7 = fastest |
| 4017 | * @hide |
| 4018 | */ |
| 4019 | public static final String POINTER_SPEED = "pointer_speed"; |
| 4020 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4021 | /** @hide */ |
| 4022 | public static final Validator POINTER_SPEED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4023 | new SettingsValidators.InclusiveFloatRangeValidator(-7, 7); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4024 | |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 4025 | /** |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 4026 | * Whether lock-to-app will be triggered by long-press on recents. |
| 4027 | * @hide |
| 4028 | */ |
| 4029 | public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; |
| 4030 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4031 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4032 | public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4033 | |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 4034 | /** |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 4035 | * I am the lolrus. |
| 4036 | * <p> |
| 4037 | * Nonzero values indicate that the user has a bukkit. |
| 4038 | * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. |
| 4039 | * @hide |
| 4040 | */ |
| 4041 | public static final String EGG_MODE = "egg_mode"; |
| 4042 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4043 | /** @hide */ |
Svet Ganov | b1918a0 | 2015-05-15 09:32:55 -0700 | [diff] [blame] | 4044 | public static final Validator EGG_MODE_VALIDATOR = new Validator() { |
| 4045 | @Override |
| 4046 | public boolean validate(String value) { |
| 4047 | try { |
| 4048 | return Long.parseLong(value) >= 0; |
| 4049 | } catch (NumberFormatException e) { |
| 4050 | return false; |
| 4051 | } |
| 4052 | } |
| 4053 | }; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4054 | |
| 4055 | /** |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4056 | * Setting to determine whether or not to show the battery percentage in the status bar. |
| 4057 | * 0 - Don't show percentage |
| 4058 | * 1 - Show percentage |
| 4059 | * @hide |
| 4060 | */ |
| 4061 | public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; |
| 4062 | |
| 4063 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4064 | private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4065 | |
| 4066 | /** |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4067 | * IMPORTANT: If you add a new public settings you also have to add it to |
| 4068 | * PUBLIC_SETTINGS below. If the new setting is hidden you have to add |
| 4069 | * it to PRIVATE_SETTINGS below. Also add a validator that can validate |
| 4070 | * the setting value. See an example above. |
| 4071 | */ |
| 4072 | |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 4073 | /** |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4074 | * Settings to backup. This is here so that it's in the same place as the settings |
| 4075 | * keys and easy to update. |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 4076 | * |
| 4077 | * NOTE: Settings are backed up and restored in the order they appear |
| 4078 | * in this array. If you have one setting depending on another, |
| 4079 | * make sure that they are ordered appropriately. |
| 4080 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4081 | * @hide |
| 4082 | */ |
| 4083 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4084 | STAY_ON_WHILE_PLUGGED_IN, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4085 | WIFI_USE_STATIC_IP, |
| 4086 | WIFI_STATIC_IP, |
| 4087 | WIFI_STATIC_GATEWAY, |
| 4088 | WIFI_STATIC_NETMASK, |
| 4089 | WIFI_STATIC_DNS1, |
| 4090 | WIFI_STATIC_DNS2, |
| 4091 | BLUETOOTH_DISCOVERABILITY, |
| 4092 | BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
Casey Burkhardt | 86b867f | 2015-12-29 18:03:36 -0800 | [diff] [blame] | 4093 | FONT_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4094 | DIM_SCREEN, |
| 4095 | SCREEN_OFF_TIMEOUT, |
Christopher Tate | 362aca6 | 2009-09-25 15:58:03 -0700 | [diff] [blame] | 4096 | SCREEN_BRIGHTNESS_MODE, |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 4097 | SCREEN_AUTO_BRIGHTNESS_ADJ, |
Santos Cordon | bd9dd55 | 2017-02-13 13:37:45 -0800 | [diff] [blame] | 4098 | SCREEN_BRIGHTNESS_FOR_VR, |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 4099 | VIBRATE_INPUT_DEVICES, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 4100 | MODE_RINGER_STREAMS_AFFECTED, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4101 | TEXT_AUTO_REPLACE, |
| 4102 | TEXT_AUTO_CAPS, |
| 4103 | TEXT_AUTO_PUNCTUATE, |
| 4104 | TEXT_SHOW_PASSWORD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4105 | AUTO_TIME, // moved to global |
| 4106 | AUTO_TIME_ZONE, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4107 | TIME_12_24, |
| 4108 | DATE_FORMAT, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4109 | DTMF_TONE_WHEN_DIALING, |
| 4110 | DTMF_TONE_TYPE_WHEN_DIALING, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4111 | HEARING_AID, |
| 4112 | TTY_MODE, |
Christopher Tate | ea2d6e8 | 2016-05-19 16:55:49 -0700 | [diff] [blame] | 4113 | MASTER_MONO, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4114 | SOUND_EFFECTS_ENABLED, |
| 4115 | HAPTIC_FEEDBACK_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4116 | POWER_SOUNDS_ENABLED, // moved to global |
| 4117 | DOCK_SOUNDS_ENABLED, // moved to global |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 4118 | LOCKSCREEN_SOUNDS_ENABLED, |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 4119 | SHOW_WEB_SUGGESTIONS, |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4120 | SIP_CALL_OPTIONS, |
Nick Pelly | 038cabe | 2010-09-23 16:12:11 -0700 | [diff] [blame] | 4121 | SIP_RECEIVE_CALLS, |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 4122 | POINTER_SPEED, |
Amith Yamasani | 622bf222 | 2013-09-06 13:54:28 -0700 | [diff] [blame] | 4123 | VIBRATE_WHEN_RINGING, |
| 4124 | RINGTONE, |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 4125 | LOCK_TO_APP_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 4126 | NOTIFICATION_SOUND, |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4127 | ACCELEROMETER_ROTATION, |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 4128 | SHOW_BATTERY_PERCENT, |
| 4129 | NOTIFICATION_VIBRATION_INTENSITY, |
| 4130 | HAPTIC_FEEDBACK_INTENSITY, |
Christine Franks | 1269960 | 2017-10-30 18:38:48 -0700 | [diff] [blame] | 4131 | DISPLAY_COLOR_MODE |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4132 | }; |
| 4133 | |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4134 | /** |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4135 | * Keys we no longer back up under the current schema, but want to continue to |
| 4136 | * process when restoring historical backup datasets. |
| 4137 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4138 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 4139 | * otherwise they won't be restored. |
| 4140 | * |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4141 | * @hide |
| 4142 | */ |
| 4143 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 4144 | }; |
| 4145 | |
| 4146 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4147 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4148 | * |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4149 | * @hide |
| 4150 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4151 | public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); |
| 4152 | static { |
| 4153 | PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4154 | PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4155 | PUBLIC_SETTINGS.add(WIFI_STATIC_IP); |
| 4156 | PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); |
| 4157 | PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); |
| 4158 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); |
| 4159 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); |
| 4160 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); |
| 4161 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); |
| 4162 | PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); |
| 4163 | PUBLIC_SETTINGS.add(FONT_SCALE); |
| 4164 | PUBLIC_SETTINGS.add(DIM_SCREEN); |
| 4165 | PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); |
| 4166 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); |
| 4167 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); |
| 4168 | PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); |
| 4169 | PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); |
| 4170 | PUBLIC_SETTINGS.add(VIBRATE_ON); |
| 4171 | PUBLIC_SETTINGS.add(VOLUME_RING); |
| 4172 | PUBLIC_SETTINGS.add(VOLUME_SYSTEM); |
| 4173 | PUBLIC_SETTINGS.add(VOLUME_VOICE); |
| 4174 | PUBLIC_SETTINGS.add(VOLUME_MUSIC); |
| 4175 | PUBLIC_SETTINGS.add(VOLUME_ALARM); |
| 4176 | PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); |
| 4177 | PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); |
| 4178 | PUBLIC_SETTINGS.add(RINGTONE); |
| 4179 | PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); |
| 4180 | PUBLIC_SETTINGS.add(ALARM_ALERT); |
| 4181 | PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4182 | PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4183 | PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4184 | PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4185 | PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); |
| 4186 | PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); |
| 4187 | PUBLIC_SETTINGS.add(TIME_12_24); |
| 4188 | PUBLIC_SETTINGS.add(DATE_FORMAT); |
| 4189 | PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); |
| 4190 | PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); |
| 4191 | PUBLIC_SETTINGS.add(USER_ROTATION); |
| 4192 | PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); |
| 4193 | PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
| 4194 | PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4195 | PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); |
Svetoslav Ganov | d263163 | 2015-12-09 16:29:22 -0800 | [diff] [blame] | 4196 | PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4197 | } |
| 4198 | |
| 4199 | /** |
| 4200 | * These are all hidden system settings. |
| 4201 | * |
| 4202 | * @hide |
| 4203 | */ |
| 4204 | public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); |
| 4205 | static { |
| 4206 | PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4207 | PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4208 | PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); |
| 4209 | PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); |
| 4210 | PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); |
| 4211 | PRIVATE_SETTINGS.add(VOLUME_MASTER); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4212 | PRIVATE_SETTINGS.add(MASTER_MONO); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4213 | PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); |
| 4214 | PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); |
| 4215 | PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); |
| 4216 | PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4217 | PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); |
| 4218 | PRIVATE_SETTINGS.add(HEARING_AID); |
| 4219 | PRIVATE_SETTINGS.add(TTY_MODE); |
| 4220 | PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); |
| 4221 | PRIVATE_SETTINGS.add(POINTER_LOCATION); |
| 4222 | PRIVATE_SETTINGS.add(SHOW_TOUCHES); |
| 4223 | PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); |
| 4224 | PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); |
| 4225 | PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); |
| 4226 | PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); |
| 4227 | PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); |
| 4228 | PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); |
| 4229 | PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); |
| 4230 | PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); |
| 4231 | PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); |
| 4232 | PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); |
| 4233 | PRIVATE_SETTINGS.add(LOCK_SOUND); |
| 4234 | PRIVATE_SETTINGS.add(UNLOCK_SOUND); |
| 4235 | PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); |
| 4236 | PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); |
| 4237 | PRIVATE_SETTINGS.add(SIP_ALWAYS); |
| 4238 | PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); |
| 4239 | PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); |
| 4240 | PRIVATE_SETTINGS.add(POINTER_SPEED); |
| 4241 | PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); |
| 4242 | PRIVATE_SETTINGS.add(EGG_MODE); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4243 | PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); |
Christine Franks | 1269960 | 2017-10-30 18:38:48 -0700 | [diff] [blame] | 4244 | PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4245 | } |
| 4246 | |
| 4247 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4248 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4249 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4250 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 4251 | * otherwise they won't be restored. |
| 4252 | * |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4253 | * @hide |
| 4254 | */ |
| 4255 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 4256 | static { |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4257 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 4258 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4259 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4260 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); |
| 4261 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
| 4262 | BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); |
| 4263 | VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); |
| 4264 | VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); |
| 4265 | VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); |
Christine Franks | 1269960 | 2017-10-30 18:38:48 -0700 | [diff] [blame] | 4266 | VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4267 | VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 4268 | VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4269 | VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); |
| 4270 | VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); |
| 4271 | VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); |
| 4272 | VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 4273 | VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); |
| 4274 | VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4275 | VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); |
| 4276 | VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); |
| 4277 | VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); |
| 4278 | VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); |
| 4279 | VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); |
| 4280 | VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); |
| 4281 | VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4282 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 4283 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4284 | VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); |
| 4285 | VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); |
| 4286 | VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); |
| 4287 | VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); |
| 4288 | VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); |
| 4289 | VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); |
| 4290 | VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); |
| 4291 | VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); |
| 4292 | VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); |
| 4293 | VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4294 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 4295 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4296 | VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); |
| 4297 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4298 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
| 4299 | VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); |
| 4300 | VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); |
| 4301 | VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4302 | VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4303 | VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); |
| 4304 | VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); |
| 4305 | VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); |
| 4306 | VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, |
| 4307 | HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); |
| 4308 | VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); |
| 4309 | VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); |
| 4310 | VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); |
| 4311 | VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); |
| 4312 | VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); |
| 4313 | VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); |
| 4314 | VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); |
| 4315 | VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, |
| 4316 | WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); |
| 4317 | VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); |
| 4318 | VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); |
| 4319 | VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); |
| 4320 | VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); |
| 4321 | VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); |
| 4322 | VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); |
| 4323 | VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); |
| 4324 | VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); |
| 4325 | VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); |
| 4326 | VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); |
| 4327 | VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); |
| 4328 | VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); |
| 4329 | VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); |
| 4330 | VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); |
| 4331 | VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4332 | VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4333 | } |
| 4334 | |
| 4335 | /** |
| 4336 | * These entries are considered common between the personal and the managed profile, |
| 4337 | * since the managed profile doesn't get to change them. |
| 4338 | */ |
| 4339 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
| 4340 | static { |
| 4341 | CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); |
| 4342 | CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); |
| 4343 | CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); |
| 4344 | CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); |
| 4345 | CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); |
| 4346 | } |
| 4347 | |
| 4348 | /** @hide */ |
| 4349 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 4350 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 4351 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4352 | |
| 4353 | /** |
Andre Lago | 3fa139c | 2016-08-04 13:53:44 +0100 | [diff] [blame] | 4354 | * These entries should be cloned from this profile's parent only if the dependency's |
| 4355 | * value is true ("1") |
| 4356 | * |
| 4357 | * Note: the dependencies must be Secure settings |
| 4358 | * |
| 4359 | * @hide |
| 4360 | */ |
| 4361 | public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); |
| 4362 | static { |
| 4363 | CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); |
| 4364 | CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); |
| 4365 | CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); |
| 4366 | } |
| 4367 | |
| 4368 | /** @hide */ |
| 4369 | public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { |
| 4370 | outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); |
| 4371 | } |
| 4372 | |
| 4373 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4374 | * System settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4375 | * @hide |
| 4376 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4377 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4378 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4379 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4380 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4381 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4382 | INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4383 | INSTANT_APP_SETTINGS.add(DATE_FORMAT); |
| 4384 | INSTANT_APP_SETTINGS.add(FONT_SCALE); |
| 4385 | INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4386 | INSTANT_APP_SETTINGS.add(TIME_12_24); |
| 4387 | INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 4388 | INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4389 | } |
| 4390 | |
| 4391 | /** |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4392 | * When to use Wi-Fi calling |
| 4393 | * |
| 4394 | * @see android.telephony.TelephonyManager.WifiCallingChoices |
| 4395 | * @hide |
| 4396 | */ |
| 4397 | public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; |
| 4398 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4399 | // Settings moved to Settings.Secure |
| 4400 | |
| 4401 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4402 | * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4403 | * instead |
| 4404 | */ |
| 4405 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4406 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4407 | |
| 4408 | /** |
| 4409 | * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead |
| 4410 | */ |
| 4411 | @Deprecated |
| 4412 | public static final String ANDROID_ID = Secure.ANDROID_ID; |
| 4413 | |
| 4414 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4415 | * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4416 | */ |
| 4417 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4418 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4419 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4420 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4421 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4422 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4423 | * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4424 | */ |
| 4425 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4426 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4427 | |
| 4428 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4429 | * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4430 | */ |
| 4431 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4432 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4433 | |
| 4434 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4435 | * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4436 | */ |
| 4437 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4438 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4439 | |
| 4440 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4441 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4442 | */ |
| 4443 | @Deprecated |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4444 | public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4445 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4446 | /** |
| 4447 | * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} |
| 4448 | * instead |
| 4449 | */ |
| 4450 | @Deprecated |
| 4451 | public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; |
| 4452 | |
| 4453 | /** |
| 4454 | * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead |
| 4455 | */ |
| 4456 | @Deprecated |
| 4457 | public static final String LOGGING_ID = Secure.LOGGING_ID; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4458 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4459 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4460 | * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4461 | */ |
| 4462 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4463 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4464 | |
| 4465 | /** |
| 4466 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} |
| 4467 | * instead |
| 4468 | */ |
| 4469 | @Deprecated |
| 4470 | public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; |
| 4471 | |
| 4472 | /** |
| 4473 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} |
| 4474 | * instead |
| 4475 | */ |
| 4476 | @Deprecated |
| 4477 | public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; |
| 4478 | |
| 4479 | /** |
| 4480 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} |
| 4481 | * instead |
| 4482 | */ |
| 4483 | @Deprecated |
| 4484 | public static final String PARENTAL_CONTROL_REDIRECT_URL = |
| 4485 | Secure.PARENTAL_CONTROL_REDIRECT_URL; |
| 4486 | |
| 4487 | /** |
| 4488 | * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead |
| 4489 | */ |
| 4490 | @Deprecated |
| 4491 | public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; |
| 4492 | |
| 4493 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4494 | * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4495 | */ |
| 4496 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4497 | public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4498 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4499 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4500 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4501 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4502 | * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4503 | */ |
| 4504 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4505 | public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4506 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4507 | /** |
| 4508 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4509 | * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4510 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4511 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4512 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4513 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4514 | /** |
| 4515 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4516 | * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4517 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4518 | @Deprecated |
| 4519 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4520 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4521 | |
| 4522 | /** |
| 4523 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4524 | * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4525 | */ |
| 4526 | @Deprecated |
| 4527 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4528 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4529 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4530 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 4531 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4532 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4533 | /** |
| 4534 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4535 | * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4536 | */ |
| 4537 | @Deprecated |
| 4538 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4539 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4540 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4541 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 4542 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4543 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4544 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4545 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4546 | * instead |
| 4547 | */ |
| 4548 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4549 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4550 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4551 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 4552 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4553 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4554 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4555 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4556 | */ |
| 4557 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4558 | public static final String WIFI_ON = Global.WIFI_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4559 | |
| 4560 | /** |
| 4561 | * @deprecated Use |
| 4562 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} |
| 4563 | * instead |
| 4564 | */ |
| 4565 | @Deprecated |
| 4566 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 4567 | Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; |
| 4568 | |
| 4569 | /** |
| 4570 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead |
| 4571 | */ |
| 4572 | @Deprecated |
| 4573 | public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; |
| 4574 | |
| 4575 | /** |
| 4576 | * @deprecated Use |
| 4577 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead |
| 4578 | */ |
| 4579 | @Deprecated |
| 4580 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 4581 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4582 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4583 | /** |
| 4584 | * @deprecated Use |
| 4585 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead |
| 4586 | */ |
| 4587 | @Deprecated |
| 4588 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 4589 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; |
| 4590 | |
| 4591 | /** |
| 4592 | * @deprecated Use |
| 4593 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} |
| 4594 | * instead |
| 4595 | */ |
| 4596 | @Deprecated |
| 4597 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 4598 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; |
| 4599 | |
| 4600 | /** |
| 4601 | * @deprecated Use |
| 4602 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead |
| 4603 | */ |
| 4604 | @Deprecated |
| 4605 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 4606 | Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; |
| 4607 | |
| 4608 | /** |
| 4609 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} |
| 4610 | * instead |
| 4611 | */ |
| 4612 | @Deprecated |
| 4613 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; |
| 4614 | |
| 4615 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4616 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4617 | */ |
| 4618 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4619 | public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4620 | |
| 4621 | /** |
| 4622 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead |
| 4623 | */ |
| 4624 | @Deprecated |
| 4625 | public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; |
| 4626 | |
| 4627 | /** |
| 4628 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} |
| 4629 | * instead |
| 4630 | */ |
| 4631 | @Deprecated |
| 4632 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; |
| 4633 | |
| 4634 | /** |
| 4635 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} |
| 4636 | * instead |
| 4637 | */ |
| 4638 | @Deprecated |
| 4639 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = |
| 4640 | Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4641 | |
| 4642 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4643 | * Checks if the specified app can modify system settings. As of API |
| 4644 | * level 23, an app cannot modify system settings unless it declares the |
| 4645 | * {@link android.Manifest.permission#WRITE_SETTINGS} |
| 4646 | * permission in its manifest, <em>and</em> the user specifically grants |
| 4647 | * the app this capability. To prompt the user to grant this approval, |
| 4648 | * the app must send an intent with the action {@link |
| 4649 | * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes |
| 4650 | * the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4651 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4652 | * @param context App context. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4653 | * @return true if the calling app can write to system settings, false otherwise |
| 4654 | */ |
| 4655 | public static boolean canWrite(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 4656 | return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), |
| 4657 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4658 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4659 | } |
| 4660 | |
| 4661 | /** |
| 4662 | * Secure system settings, containing system preferences that applications |
| 4663 | * can read but are not allowed to write. These are for preferences that |
| 4664 | * the user must explicitly modify through the system UI or specialized |
| 4665 | * APIs for those values, not modified directly by applications. |
| 4666 | */ |
| 4667 | public static final class Secure extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 4668 | // NOTE: If you add new settings here, be sure to add them to |
| 4669 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. |
| 4670 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4671 | /** |
| 4672 | * The content:// style URL for this table |
| 4673 | */ |
| 4674 | public static final Uri CONTENT_URI = |
| 4675 | Uri.parse("content://" + AUTHORITY + "/secure"); |
| 4676 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4677 | private static final ContentProviderHolder sProviderHolder = |
| 4678 | new ContentProviderHolder(CONTENT_URI); |
| 4679 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 4680 | // Populated lazily, guarded by class object: |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4681 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4682 | CONTENT_URI, |
| 4683 | CALL_METHOD_GET_SECURE, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4684 | CALL_METHOD_PUT_SECURE, |
| 4685 | sProviderHolder); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4686 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4687 | private static ILockSettings sLockSettings = null; |
| 4688 | |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 4689 | private static boolean sIsSystemProcess; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4690 | private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4691 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4692 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4693 | MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4694 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); |
| 4695 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); |
| 4696 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4697 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4698 | MOVED_TO_GLOBAL = new HashSet<>(); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4699 | MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); |
| 4700 | MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); |
| 4701 | MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 4702 | MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4703 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); |
| 4704 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); |
| 4705 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); |
| 4706 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); |
| 4707 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); |
| 4708 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); |
| 4709 | MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); |
| 4710 | MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4711 | MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); |
| 4712 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); |
| 4713 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4714 | MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); |
| 4715 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); |
| 4716 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); |
| 4717 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); |
| 4718 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); |
| 4719 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); |
| 4720 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); |
| 4721 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4722 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); |
| 4723 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); |
| 4724 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); |
| 4725 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); |
| 4726 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); |
| 4727 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); |
| 4728 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); |
| 4729 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); |
| 4730 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); |
| 4731 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); |
| 4732 | MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); |
| 4733 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); |
| 4734 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); |
| 4735 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); |
| 4736 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); |
| 4737 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); |
| 4738 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); |
| 4739 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); |
| 4740 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); |
| 4741 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4742 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); |
| 4743 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); |
| 4744 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); |
| 4745 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); |
| 4746 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); |
| 4747 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4748 | MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); |
| 4749 | MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 4750 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4751 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); |
| 4752 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); |
| 4753 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); |
| 4754 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); |
| 4755 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); |
| 4756 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 4757 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 4758 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 4759 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); |
| 4760 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); |
| 4761 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); |
| 4762 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); |
| 4763 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 4764 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 4765 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); |
| 4766 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4767 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); |
| 4768 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4769 | MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 4770 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); |
| 4771 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); |
| 4772 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); |
| 4773 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); |
| 4774 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); |
| 4775 | MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4776 | MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4777 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); |
| 4778 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); |
| 4779 | MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); |
| 4780 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); |
| 4781 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); |
| 4782 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); |
| 4783 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); |
| 4784 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); |
| 4785 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); |
| 4786 | MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); |
| 4787 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); |
| 4788 | MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); |
| 4789 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); |
| 4790 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); |
| 4791 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); |
| 4792 | MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); |
| 4793 | MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); |
| 4794 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); |
| 4795 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); |
| 4796 | MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); |
| 4797 | MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); |
| 4798 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); |
| 4799 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); |
| 4800 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); |
| 4801 | MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); |
| 4802 | MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); |
| 4803 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); |
| 4804 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); |
| 4805 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); |
| 4806 | MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); |
| 4807 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 4808 | MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 4809 | MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4810 | } |
| 4811 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4812 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4813 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4814 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 4815 | } |
| 4816 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 4817 | /** @hide */ |
| 4818 | public static void clearProviderForTest() { |
| 4819 | sProviderHolder.clearProviderForTest(); |
| 4820 | sNameValueCache.clearGenerationTrackerForTest(); |
| 4821 | } |
| 4822 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4823 | /** |
| 4824 | * Look up a name in the database. |
| 4825 | * @param resolver to access the database with |
| 4826 | * @param name to look up in the table |
| 4827 | * @return the corresponding value, or null if not present |
| 4828 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4829 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4830 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4831 | } |
| 4832 | |
| 4833 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4834 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4835 | int userHandle) { |
| 4836 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4837 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4838 | + " to android.provider.Settings.Global."); |
| 4839 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4840 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4841 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4842 | if (MOVED_TO_LOCK_SETTINGS.contains(name)) { |
| 4843 | synchronized (Secure.class) { |
| 4844 | if (sLockSettings == null) { |
| 4845 | sLockSettings = ILockSettings.Stub.asInterface( |
| 4846 | (IBinder) ServiceManager.getService("lock_settings")); |
| 4847 | sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; |
| 4848 | } |
| 4849 | } |
| 4850 | if (sLockSettings != null && !sIsSystemProcess) { |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 4851 | // No context; use the ActivityThread's context as an approximation for |
| 4852 | // determining the target API level. |
| 4853 | Application application = ActivityThread.currentApplication(); |
| 4854 | |
| 4855 | boolean isPreMnc = application != null |
| 4856 | && application.getApplicationInfo() != null |
| 4857 | && application.getApplicationInfo().targetSdkVersion |
| 4858 | <= VERSION_CODES.LOLLIPOP_MR1; |
| 4859 | if (isPreMnc) { |
| 4860 | try { |
| 4861 | return sLockSettings.getString(name, "0", userHandle); |
| 4862 | } catch (RemoteException re) { |
| 4863 | // Fall through |
| 4864 | } |
| 4865 | } else { |
| 4866 | throw new SecurityException("Settings.Secure." + name |
| 4867 | + " is deprecated and no longer accessible." |
| 4868 | + " See API documentation for potential replacements."); |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4869 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4870 | } |
| 4871 | } |
| 4872 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4873 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4874 | } |
| 4875 | |
| 4876 | /** |
| 4877 | * Store a name/value pair into the database. |
| 4878 | * @param resolver to access the database with |
| 4879 | * @param name to store |
| 4880 | * @param value to associate with the name |
| 4881 | * @return true if the value was set, false on database errors |
| 4882 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4883 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4884 | return putStringForUser(resolver, name, value, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4885 | } |
| 4886 | |
| 4887 | /** @hide */ |
| 4888 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 4889 | int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4890 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 4891 | } |
| 4892 | |
| 4893 | /** @hide */ |
| 4894 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 4895 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4896 | boolean makeDefault, @UserIdInt int userHandle) { |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4897 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4898 | // Map LOCATION_MODE to underlying location provider storage API |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4899 | return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); |
| 4900 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4901 | if (MOVED_TO_GLOBAL.contains(name)) { |
Robin Lee | 7af9a74 | 2017-02-20 14:47:30 +0000 | [diff] [blame] | 4902 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4903 | + " to android.provider.Settings.Global"); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4904 | return Global.putStringForUser(resolver, name, value, |
| 4905 | tag, makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4906 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4907 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 4908 | makeDefault, userHandle); |
| 4909 | } |
| 4910 | |
| 4911 | /** |
| 4912 | * Store a name/value pair into the database. |
| 4913 | * <p> |
| 4914 | * The method takes an optional tag to associate with the setting |
| 4915 | * which can be used to clear only settings made by your package and |
| 4916 | * associated with this tag by passing the tag to {@link |
| 4917 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 4918 | * the current tag. Also if another package changes the setting |
| 4919 | * then the tag will be set to the one specified in the set call |
| 4920 | * which can be null. Also any of the settings setters that do not |
| 4921 | * take a tag as an argument effectively clears the tag. |
| 4922 | * </p><p> |
| 4923 | * For example, if you set settings A and B with tags T1 and T2 and |
| 4924 | * another app changes setting A (potentially to the same value), it |
| 4925 | * can assign to it a tag T3 (note that now the package that changed |
| 4926 | * the setting is not yours). Now if you reset your changes for T1 and |
| 4927 | * T2 only setting B will be reset and A not (as it was changed by |
| 4928 | * another package) but since A did not change you are in the desired |
| 4929 | * initial state. Now if the other app changes the value of A (assuming |
| 4930 | * you registered an observer in the beginning) you would detect that |
| 4931 | * the setting was changed by another app and handle this appropriately |
| 4932 | * (ignore, set back to some value, etc). |
| 4933 | * </p><p> |
| 4934 | * Also the method takes an argument whether to make the value the |
| 4935 | * default for this setting. If the system already specified a default |
| 4936 | * value, then the one passed in here will <strong>not</strong> |
| 4937 | * be set as the default. |
| 4938 | * </p> |
| 4939 | * |
| 4940 | * @param resolver to access the database with. |
| 4941 | * @param name to store. |
| 4942 | * @param value to associate with the name. |
| 4943 | * @param tag to associate with the setting. |
| 4944 | * @param makeDefault whether to make the value the default one. |
| 4945 | * @return true if the value was set, false on database errors. |
| 4946 | * |
| 4947 | * @see #resetToDefaults(ContentResolver, String) |
| 4948 | * |
| 4949 | * @hide |
| 4950 | */ |
| 4951 | @SystemApi |
| 4952 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4953 | public static boolean putString(@NonNull ContentResolver resolver, |
| 4954 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4955 | boolean makeDefault) { |
| 4956 | return putStringForUser(resolver, name, value, tag, makeDefault, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4957 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4958 | } |
| 4959 | |
| 4960 | /** |
| 4961 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 4962 | * settings set by the caller's package. Think of it of a way to undo your own |
| 4963 | * changes to the global settings. Passing in the optional tag will reset only |
| 4964 | * settings changed by your package and associated with this tag. |
| 4965 | * |
| 4966 | * @param resolver Handle to the content resolver. |
| 4967 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4968 | * |
| 4969 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 4970 | * |
| 4971 | * @hide |
| 4972 | */ |
| 4973 | @SystemApi |
| 4974 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4975 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 4976 | @Nullable String tag) { |
| 4977 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4978 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4979 | } |
| 4980 | |
| 4981 | /** |
| 4982 | * |
| 4983 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 4984 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 4985 | * allowing resetting the settings made by a package and associated with the tag. |
| 4986 | * |
| 4987 | * @param resolver Handle to the content resolver. |
| 4988 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4989 | * @param mode The reset mode. |
| 4990 | * @param userHandle The user for which to reset to defaults. |
| 4991 | * |
| 4992 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 4993 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 4994 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 4995 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 4996 | * |
| 4997 | * @hide |
| 4998 | */ |
| 4999 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 5000 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 5001 | try { |
| 5002 | Bundle arg = new Bundle(); |
| 5003 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 5004 | if (tag != null) { |
| 5005 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 5006 | } |
| 5007 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 5008 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 5009 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); |
| 5010 | } catch (RemoteException e) { |
| 5011 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 5012 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5013 | } |
| 5014 | |
| 5015 | /** |
| 5016 | * Construct the content URI for a particular name/value pair, |
| 5017 | * useful for monitoring changes with a ContentObserver. |
| 5018 | * @param name to look up in the table |
| 5019 | * @return the corresponding content URI, or null if not present |
| 5020 | */ |
| 5021 | public static Uri getUriFor(String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5022 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 5023 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 5024 | + " to android.provider.Settings.Global, returning global URI."); |
| 5025 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 5026 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5027 | return getUriFor(CONTENT_URI, name); |
| 5028 | } |
| 5029 | |
| 5030 | /** |
| 5031 | * Convenience function for retrieving a single secure settings value |
| 5032 | * as an integer. Note that internally setting values are always |
| 5033 | * stored as strings; this function converts the string to an integer |
| 5034 | * for you. The default value will be returned if the setting is |
| 5035 | * not defined or not an integer. |
| 5036 | * |
| 5037 | * @param cr The ContentResolver to access. |
| 5038 | * @param name The name of the setting to retrieve. |
| 5039 | * @param def Value to return if the setting is not defined. |
| 5040 | * |
| 5041 | * @return The setting's current value, or 'def' if it is not defined |
| 5042 | * or not a valid integer. |
| 5043 | */ |
| 5044 | public static int getInt(ContentResolver cr, String name, int def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5045 | return getIntForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5046 | } |
| 5047 | |
| 5048 | /** @hide */ |
| 5049 | public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5050 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 5051 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5052 | return getLocationModeForUser(cr, userHandle); |
| 5053 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5054 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5055 | try { |
| 5056 | return v != null ? Integer.parseInt(v) : def; |
| 5057 | } catch (NumberFormatException e) { |
| 5058 | return def; |
| 5059 | } |
| 5060 | } |
| 5061 | |
| 5062 | /** |
| 5063 | * Convenience function for retrieving a single secure settings value |
| 5064 | * as an integer. Note that internally setting values are always |
| 5065 | * stored as strings; this function converts the string to an integer |
| 5066 | * for you. |
| 5067 | * <p> |
| 5068 | * This version does not take a default value. If the setting has not |
| 5069 | * been set, or the string value is not a number, |
| 5070 | * it throws {@link SettingNotFoundException}. |
| 5071 | * |
| 5072 | * @param cr The ContentResolver to access. |
| 5073 | * @param name The name of the setting to retrieve. |
| 5074 | * |
| 5075 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5076 | * name can't be found or the setting value is not an integer. |
| 5077 | * |
| 5078 | * @return The setting's current value. |
| 5079 | */ |
| 5080 | public static int getInt(ContentResolver cr, String name) |
| 5081 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5082 | return getIntForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5083 | } |
| 5084 | |
| 5085 | /** @hide */ |
| 5086 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 5087 | throws SettingNotFoundException { |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5088 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 5089 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5090 | return getLocationModeForUser(cr, userHandle); |
| 5091 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5092 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5093 | try { |
| 5094 | return Integer.parseInt(v); |
| 5095 | } catch (NumberFormatException e) { |
| 5096 | throw new SettingNotFoundException(name); |
| 5097 | } |
| 5098 | } |
| 5099 | |
| 5100 | /** |
| 5101 | * Convenience function for updating a single settings value as an |
| 5102 | * integer. This will either create a new entry in the table if the |
| 5103 | * given name does not exist, or modify the value of the existing row |
| 5104 | * with that name. Note that internally setting values are always |
| 5105 | * stored as strings, so this function converts the given value to a |
| 5106 | * string before storing it. |
| 5107 | * |
| 5108 | * @param cr The ContentResolver to access. |
| 5109 | * @param name The name of the setting to modify. |
| 5110 | * @param value The new value for the setting. |
| 5111 | * @return true if the value was set, false on database errors |
| 5112 | */ |
| 5113 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5114 | return putIntForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5115 | } |
| 5116 | |
| 5117 | /** @hide */ |
| 5118 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 5119 | int userHandle) { |
| 5120 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5121 | } |
| 5122 | |
| 5123 | /** |
| 5124 | * Convenience function for retrieving a single secure settings value |
| 5125 | * as a {@code long}. Note that internally setting values are always |
| 5126 | * stored as strings; this function converts the string to a {@code long} |
| 5127 | * for you. The default value will be returned if the setting is |
| 5128 | * not defined or not a {@code long}. |
| 5129 | * |
| 5130 | * @param cr The ContentResolver to access. |
| 5131 | * @param name The name of the setting to retrieve. |
| 5132 | * @param def Value to return if the setting is not defined. |
| 5133 | * |
| 5134 | * @return The setting's current value, or 'def' if it is not defined |
| 5135 | * or not a valid {@code long}. |
| 5136 | */ |
| 5137 | public static long getLong(ContentResolver cr, String name, long def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5138 | return getLongForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5139 | } |
| 5140 | |
| 5141 | /** @hide */ |
| 5142 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 5143 | int userHandle) { |
| 5144 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5145 | long value; |
| 5146 | try { |
| 5147 | value = valString != null ? Long.parseLong(valString) : def; |
| 5148 | } catch (NumberFormatException e) { |
| 5149 | value = def; |
| 5150 | } |
| 5151 | return value; |
| 5152 | } |
| 5153 | |
| 5154 | /** |
| 5155 | * Convenience function for retrieving a single secure settings value |
| 5156 | * as a {@code long}. Note that internally setting values are always |
| 5157 | * stored as strings; this function converts the string to a {@code long} |
| 5158 | * for you. |
| 5159 | * <p> |
| 5160 | * This version does not take a default value. If the setting has not |
| 5161 | * been set, or the string value is not a number, |
| 5162 | * it throws {@link SettingNotFoundException}. |
| 5163 | * |
| 5164 | * @param cr The ContentResolver to access. |
| 5165 | * @param name The name of the setting to retrieve. |
| 5166 | * |
| 5167 | * @return The setting's current value. |
| 5168 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5169 | * name can't be found or the setting value is not an integer. |
| 5170 | */ |
| 5171 | public static long getLong(ContentResolver cr, String name) |
| 5172 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5173 | return getLongForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5174 | } |
| 5175 | |
| 5176 | /** @hide */ |
| 5177 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 5178 | throws SettingNotFoundException { |
| 5179 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5180 | try { |
| 5181 | return Long.parseLong(valString); |
| 5182 | } catch (NumberFormatException e) { |
| 5183 | throw new SettingNotFoundException(name); |
| 5184 | } |
| 5185 | } |
| 5186 | |
| 5187 | /** |
| 5188 | * Convenience function for updating a secure settings value as a long |
| 5189 | * integer. This will either create a new entry in the table if the |
| 5190 | * given name does not exist, or modify the value of the existing row |
| 5191 | * with that name. Note that internally setting values are always |
| 5192 | * stored as strings, so this function converts the given value to a |
| 5193 | * string before storing it. |
| 5194 | * |
| 5195 | * @param cr The ContentResolver to access. |
| 5196 | * @param name The name of the setting to modify. |
| 5197 | * @param value The new value for the setting. |
| 5198 | * @return true if the value was set, false on database errors |
| 5199 | */ |
| 5200 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5201 | return putLongForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5202 | } |
| 5203 | |
| 5204 | /** @hide */ |
| 5205 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 5206 | int userHandle) { |
| 5207 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5208 | } |
| 5209 | |
| 5210 | /** |
| 5211 | * Convenience function for retrieving a single secure settings value |
| 5212 | * as a floating point number. Note that internally setting values are |
| 5213 | * always stored as strings; this function converts the string to an |
| 5214 | * float for you. The default value will be returned if the setting |
| 5215 | * is not defined or not a valid float. |
| 5216 | * |
| 5217 | * @param cr The ContentResolver to access. |
| 5218 | * @param name The name of the setting to retrieve. |
| 5219 | * @param def Value to return if the setting is not defined. |
| 5220 | * |
| 5221 | * @return The setting's current value, or 'def' if it is not defined |
| 5222 | * or not a valid float. |
| 5223 | */ |
| 5224 | public static float getFloat(ContentResolver cr, String name, float def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5225 | return getFloatForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5226 | } |
| 5227 | |
| 5228 | /** @hide */ |
| 5229 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 5230 | int userHandle) { |
| 5231 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5232 | try { |
| 5233 | return v != null ? Float.parseFloat(v) : def; |
| 5234 | } catch (NumberFormatException e) { |
| 5235 | return def; |
| 5236 | } |
| 5237 | } |
| 5238 | |
| 5239 | /** |
| 5240 | * Convenience function for retrieving a single secure settings value |
| 5241 | * as a float. Note that internally setting values are always |
| 5242 | * stored as strings; this function converts the string to a float |
| 5243 | * for you. |
| 5244 | * <p> |
| 5245 | * This version does not take a default value. If the setting has not |
| 5246 | * been set, or the string value is not a number, |
| 5247 | * it throws {@link SettingNotFoundException}. |
| 5248 | * |
| 5249 | * @param cr The ContentResolver to access. |
| 5250 | * @param name The name of the setting to retrieve. |
| 5251 | * |
| 5252 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5253 | * name can't be found or the setting value is not a float. |
| 5254 | * |
| 5255 | * @return The setting's current value. |
| 5256 | */ |
| 5257 | public static float getFloat(ContentResolver cr, String name) |
| 5258 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5259 | return getFloatForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5260 | } |
| 5261 | |
| 5262 | /** @hide */ |
| 5263 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 5264 | throws SettingNotFoundException { |
| 5265 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 5266 | if (v == null) { |
| 5267 | throw new SettingNotFoundException(name); |
| 5268 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5269 | try { |
| 5270 | return Float.parseFloat(v); |
| 5271 | } catch (NumberFormatException e) { |
| 5272 | throw new SettingNotFoundException(name); |
| 5273 | } |
| 5274 | } |
| 5275 | |
| 5276 | /** |
| 5277 | * Convenience function for updating a single settings value as a |
| 5278 | * floating point number. This will either create a new entry in the |
| 5279 | * table if the given name does not exist, or modify the value of the |
| 5280 | * existing row with that name. Note that internally setting values |
| 5281 | * are always stored as strings, so this function converts the given |
| 5282 | * value to a string before storing it. |
| 5283 | * |
| 5284 | * @param cr The ContentResolver to access. |
| 5285 | * @param name The name of the setting to modify. |
| 5286 | * @param value The new value for the setting. |
| 5287 | * @return true if the value was set, false on database errors |
| 5288 | */ |
| 5289 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5290 | return putFloatForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5291 | } |
| 5292 | |
| 5293 | /** @hide */ |
| 5294 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 5295 | int userHandle) { |
| 5296 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5297 | } |
| 5298 | |
| 5299 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5300 | * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} |
| 5301 | * instead |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5302 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5303 | @Deprecated |
| 5304 | public static final String DEVELOPMENT_SETTINGS_ENABLED = |
| 5305 | Global.DEVELOPMENT_SETTINGS_ENABLED; |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5306 | |
| 5307 | /** |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5308 | * When the user has enable the option to have a "bug report" command |
| 5309 | * in the power menu. |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5310 | * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5311 | * @hide |
| 5312 | */ |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5313 | @Deprecated |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5314 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 5315 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5316 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5317 | |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5318 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5319 | * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5320 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5321 | @Deprecated |
| 5322 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5323 | |
| 5324 | /** |
| 5325 | * Setting to allow mock locations and location provider status to be injected into the |
| 5326 | * LocationManager service for testing purposes during application development. These |
| 5327 | * locations and status values override actual location and status information generated |
| 5328 | * by network, gps, or other location providers. |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5329 | * |
| 5330 | * @deprecated This settings is not used anymore. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5331 | */ |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5332 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5333 | public static final String ALLOW_MOCK_LOCATION = "mock_location"; |
| 5334 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5335 | private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5336 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5337 | /** |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5338 | * On Android 8.0 (API level 26) and higher versions of the platform, |
| 5339 | * a 64-bit number (expressed as a hexadecimal string), unique to |
| 5340 | * each combination of app-signing key, user, and device. |
| 5341 | * Values of {@code ANDROID_ID} are scoped by signing key and user. |
| 5342 | * The value may change if a factory reset is performed on the |
| 5343 | * device or if an APK signing key changes. |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5344 | * |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5345 | * For more information about how the platform handles {@code ANDROID_ID} |
| 5346 | * in Android 8.0 (API level 26) and higher, see <a |
| 5347 | * href="{@docRoot}preview/behavior-changes.html#privacy-all"> |
| 5348 | * Android 8.0 Behavior Changes</a>. |
| 5349 | * |
| 5350 | * <p class="note"><strong>Note:</strong> For apps that were installed |
| 5351 | * prior to updating the device to a version of Android 8.0 |
| 5352 | * (API level 26) or higher, the value of {@code ANDROID_ID} changes |
| 5353 | * if the app is uninstalled and then reinstalled after the OTA. |
| 5354 | * To preserve values across uninstalls after an OTA to Android 8.0 |
| 5355 | * or higher, developers can use |
| 5356 | * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> |
| 5357 | * Key/Value Backup</a>.</p> |
| 5358 | * |
| 5359 | * <p>In versions of the platform lower than Android 8.0 (API level 26), |
| 5360 | * a 64-bit number (expressed as a hexadecimal string) that is randomly |
| 5361 | * generated when the user first sets up the device and should remain |
| 5362 | * constant for the lifetime of the user's device. |
| 5363 | * |
| 5364 | * On devices that have |
| 5365 | * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> |
| 5366 | * multiple users</a>, each user appears as a |
| 5367 | * completely separate device, so the {@code ANDROID_ID} value is |
| 5368 | * unique to each user.</p> |
| 5369 | * |
| 5370 | * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5371 | * to the Instant App, it is generated when the Instant App is first installed and reset if |
| 5372 | * the user clears the Instant App. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5373 | */ |
| 5374 | public static final String ANDROID_ID = "android_id"; |
| 5375 | |
| 5376 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5377 | * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5378 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5379 | @Deprecated |
| 5380 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5381 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5382 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5383 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5384 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5385 | * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5386 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 5387 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5388 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5389 | |
| 5390 | /** |
| 5391 | * Setting to record the input method used by default, holding the ID |
| 5392 | * of the desired method. |
| 5393 | */ |
| 5394 | public static final String DEFAULT_INPUT_METHOD = "default_input_method"; |
| 5395 | |
| 5396 | /** |
satok | ab751aa | 2010-09-14 19:17:36 +0900 | [diff] [blame] | 5397 | * Setting to record the input method subtype used by default, holding the ID |
| 5398 | * of the desired method. |
| 5399 | */ |
| 5400 | public static final String SELECTED_INPUT_METHOD_SUBTYPE = |
| 5401 | "selected_input_method_subtype"; |
| 5402 | |
| 5403 | /** |
satok | 723a27e | 2010-11-11 14:58:11 +0900 | [diff] [blame] | 5404 | * Setting to record the history of input method subtype, holding the pair of ID of IME |
| 5405 | * and its last used subtype. |
| 5406 | * @hide |
| 5407 | */ |
| 5408 | public static final String INPUT_METHODS_SUBTYPE_HISTORY = |
| 5409 | "input_methods_subtype_history"; |
| 5410 | |
| 5411 | /** |
satok | 5c58dfc | 2010-12-14 21:54:47 +0900 | [diff] [blame] | 5412 | * Setting to record the visibility of input method selector |
| 5413 | */ |
| 5414 | public static final String INPUT_METHOD_SELECTOR_VISIBILITY = |
| 5415 | "input_method_selector_visibility"; |
| 5416 | |
| 5417 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5418 | * The currently selected voice interaction service flattened ComponentName. |
| 5419 | * @hide |
| 5420 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 5421 | @TestApi |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5422 | public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; |
| 5423 | |
| 5424 | /** |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5425 | * The currently selected autofill service flattened ComponentName. |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5426 | * @hide |
| 5427 | */ |
| 5428 | @TestApi |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5429 | public static final String AUTOFILL_SERVICE = "autofill_service"; |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5430 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5431 | private static final Validator AUTOFILL_SERVICE_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 5432 | |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5433 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5434 | * Boolean indicating if Autofill supports field classification. |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5435 | * |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5436 | * @see android.service.autofill.AutofillService |
| 5437 | * |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5438 | * @hide |
| 5439 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5440 | @SystemApi |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5441 | @TestApi |
Felipe Leme | 329d040 | 2017-12-06 09:22:43 -0800 | [diff] [blame] | 5442 | public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = |
| 5443 | "autofill_field_classification"; |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5444 | |
| 5445 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5446 | * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5447 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5448 | * @hide |
| 5449 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5450 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5451 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5452 | public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = |
| 5453 | "autofill_user_data_max_user_data_size"; |
| 5454 | |
| 5455 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5456 | * Defines value returned by |
| 5457 | * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5458 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5459 | * @hide |
| 5460 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5461 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5462 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5463 | public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = |
| 5464 | "autofill_user_data_max_field_classification_size"; |
| 5465 | |
| 5466 | /** |
Felipe Leme | febb733 | 2018-02-12 18:12:55 -0800 | [diff] [blame] | 5467 | * Defines value returned by |
| 5468 | * {@link android.service.autofill.UserData#getMaxCategoryCount()}. |
| 5469 | * |
| 5470 | * @hide |
| 5471 | */ |
| 5472 | @SystemApi |
| 5473 | @TestApi |
| 5474 | public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = |
| 5475 | "autofill_user_data_max_category_count"; |
| 5476 | |
| 5477 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5478 | * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5479 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5480 | * @hide |
| 5481 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5482 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5483 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5484 | public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = |
| 5485 | "autofill_user_data_max_value_length"; |
| 5486 | |
| 5487 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5488 | * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5489 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5490 | * @hide |
| 5491 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5492 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5493 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5494 | public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = |
| 5495 | "autofill_user_data_min_value_length"; |
| 5496 | |
| 5497 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5498 | * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5499 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5500 | @Deprecated |
| 5501 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5502 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5503 | /** |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5504 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5505 | * @hide |
| 5506 | */ |
Felipe Leme | 9923012 | 2017-06-12 14:33:02 -0700 | [diff] [blame] | 5507 | @TestApi |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5508 | public static final String USER_SETUP_COMPLETE = "user_setup_complete"; |
| 5509 | |
| 5510 | /** |
Ajay Nadathur | 702fc64 | 2018-03-09 11:56:01 -0800 | [diff] [blame] | 5511 | * The current state of device personalization. |
| 5512 | * |
| 5513 | * @hide |
| 5514 | * @see UserSetupPersonalization |
| 5515 | */ |
| 5516 | public static final String USER_SETUP_PERSONALIZATION_STATE = |
| 5517 | "user_setup_personalization_state"; |
| 5518 | |
| 5519 | /** |
Sujith Ramakrishnan | 314df16 | 2017-06-16 18:03:18 -0700 | [diff] [blame] | 5520 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5521 | * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 |
| 5522 | * in case SetupWizard has been re-enabled on TV devices. |
| 5523 | * |
| 5524 | * @hide |
| 5525 | */ |
| 5526 | public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; |
| 5527 | |
| 5528 | /** |
Ido Ofir | d193c67 | 2016-03-01 13:27:54 -0800 | [diff] [blame] | 5529 | * Prefix for category name that marks whether a suggested action from that category was |
| 5530 | * completed. |
| 5531 | * @hide |
| 5532 | */ |
| 5533 | public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; |
| 5534 | |
| 5535 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5536 | * List of input methods that are currently enabled. This is a string |
| 5537 | * containing the IDs of all enabled input methods, each ID separated |
| 5538 | * by ':'. |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5539 | * |
| 5540 | * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" |
| 5541 | * where imeId is ComponentName and subtype is int32. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5542 | */ |
| 5543 | public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5544 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5545 | /** |
Amith Yamasani | e861ec1 | 2010-03-24 21:39:27 -0700 | [diff] [blame] | 5546 | * List of system input methods that are currently disabled. This is a string |
| 5547 | * containing the IDs of all disabled input methods, each ID separated |
| 5548 | * by ':'. |
| 5549 | * @hide |
| 5550 | */ |
| 5551 | public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; |
| 5552 | |
| 5553 | /** |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5554 | * Whether to show the IME when a hard keyboard is connected. This is a boolean that |
| 5555 | * determines if the IME should be shown when a hard keyboard is attached. |
| 5556 | * @hide |
| 5557 | */ |
| 5558 | public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; |
| 5559 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5560 | private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5561 | |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5562 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5563 | * Host name and port for global http proxy. Uses ':' seperator for |
| 5564 | * between host and port. |
| 5565 | * |
| 5566 | * @deprecated Use {@link Global#HTTP_PROXY} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5567 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5568 | @Deprecated |
| 5569 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
Robert Greenwalt | e90aa5e | 2010-09-01 11:34:05 -0700 | [diff] [blame] | 5570 | |
| 5571 | /** |
Robin Lee | 244ce8e | 2016-01-05 18:03:46 +0000 | [diff] [blame] | 5572 | * Package designated as always-on VPN provider. |
| 5573 | * |
| 5574 | * @hide |
| 5575 | */ |
| 5576 | public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; |
| 5577 | |
| 5578 | /** |
Robin Lee | 17e6183 | 2016-05-09 13:46:28 +0100 | [diff] [blame] | 5579 | * Whether to block networking outside of VPN connections while always-on is set. |
| 5580 | * @see #ALWAYS_ON_VPN_APP |
| 5581 | * |
| 5582 | * @hide |
| 5583 | */ |
| 5584 | public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; |
| 5585 | |
| 5586 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5587 | * Whether applications can be installed for this user via the system's |
| 5588 | * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. |
| 5589 | * |
| 5590 | * <p>1 = permit app installation via the system package installer intent |
| 5591 | * <p>0 = do not allow use of the package installer |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5592 | * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use |
| 5593 | * {@link PackageManager#canRequestPackageInstalls()} |
| 5594 | * @see PackageManager#canRequestPackageInstalls() |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5595 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5596 | public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5597 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5598 | /** |
Suprabh Shukla | 0b1356f | 2017-02-21 14:33:50 -0800 | [diff] [blame] | 5599 | * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that |
| 5600 | * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it |
| 5601 | * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} |
| 5602 | * on behalf of the profile owner if needed to make the change transparent for profile |
| 5603 | * owners. |
| 5604 | * |
| 5605 | * @hide |
| 5606 | */ |
| 5607 | public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = |
| 5608 | "unknown_sources_default_reversed"; |
| 5609 | |
| 5610 | /** |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5611 | * Comma-separated list of location providers that activities may access. Do not rely on |
| 5612 | * this value being present in settings.db or on ContentObserver notifications on the |
| 5613 | * corresponding Uri. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5614 | * |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5615 | * @deprecated use {@link #LOCATION_MODE} and |
| 5616 | * {@link LocationManager#MODE_CHANGED_ACTION} (or |
| 5617 | * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5618 | */ |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5619 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5620 | public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5621 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5622 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5623 | * The degree of location access enabled by the user. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5624 | * <p> |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5625 | * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link |
| 5626 | * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link |
| 5627 | * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link |
| 5628 | * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location |
| 5629 | * modes that might be added in the future. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5630 | * <p> |
| 5631 | * Note: do not rely on this value being present in settings.db or on ContentObserver |
| 5632 | * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} |
| 5633 | * to receive changes in this value. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5634 | * |
| 5635 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5636 | * get the status of a location provider, use |
| 5637 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5638 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5639 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5640 | public static final String LOCATION_MODE = "location_mode"; |
| 5641 | |
| 5642 | /** |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 5643 | * The App or module that changes the location mode. |
| 5644 | * @hide |
| 5645 | */ |
| 5646 | public static final String LOCATION_CHANGER = "location_changer"; |
| 5647 | /** |
| 5648 | * The location changer is unknown or unable to detect. |
| 5649 | * @hide |
| 5650 | */ |
| 5651 | public static final int LOCATION_CHANGER_UNKNOWN = 0; |
| 5652 | /** |
| 5653 | * Location settings in system settings. |
| 5654 | * @hide |
| 5655 | */ |
| 5656 | public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; |
| 5657 | /** |
| 5658 | * The location icon in drop down notification drawer. |
| 5659 | * @hide |
| 5660 | */ |
| 5661 | public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; |
| 5662 | |
| 5663 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5664 | * Location access disabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5665 | * |
| 5666 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5667 | * get the status of a location provider, use |
| 5668 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5669 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5670 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5671 | public static final int LOCATION_MODE_OFF = 0; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5672 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5673 | /** |
| 5674 | * Network Location Provider disabled, but GPS and other sensors enabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5675 | * |
| 5676 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5677 | * get the status of a location provider, use |
| 5678 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5679 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5680 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5681 | public static final int LOCATION_MODE_SENSORS_ONLY = 1; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5682 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5683 | /** |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 5684 | * Reduced power usage, such as limiting the number of GPS updates per hour. Requests |
| 5685 | * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to |
| 5686 | * {@link android.location.Criteria#POWER_MEDIUM}. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5687 | * |
| 5688 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5689 | * get the status of a location provider, use |
| 5690 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5691 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5692 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5693 | public static final int LOCATION_MODE_BATTERY_SAVING = 2; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5694 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5695 | /** |
| 5696 | * Best-effort location computation allowed. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5697 | * |
| 5698 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5699 | * get the status of a location provider, use |
| 5700 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5701 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5702 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5703 | public static final int LOCATION_MODE_HIGH_ACCURACY = 3; |
| 5704 | |
| 5705 | /** |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5706 | * A flag containing settings used for biometric weak |
| 5707 | * @hide |
| 5708 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5709 | @Deprecated |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5710 | public static final String LOCK_BIOMETRIC_WEAK_FLAGS = |
| 5711 | "lock_biometric_weak_flags"; |
| 5712 | |
| 5713 | /** |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 5714 | * Whether lock-to-app will lock the keyguard when exiting. |
| 5715 | * @hide |
| 5716 | */ |
| 5717 | public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; |
| 5718 | |
| 5719 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5720 | * Whether autolock is enabled (0 = false, 1 = true) |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5721 | * |
| 5722 | * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5723 | * level of the keyguard. Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5724 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5725 | */ |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5726 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5727 | public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; |
| 5728 | |
| 5729 | /** |
| 5730 | * Whether lock pattern is visible as user enters (0 = false, 1 = true) |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5731 | * |
| 5732 | * @deprecated Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5733 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5734 | */ |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5735 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5736 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 5737 | |
| 5738 | /** |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5739 | * Whether lock pattern will vibrate as user enters (0 = false, 1 = |
| 5740 | * true) |
| 5741 | * |
| 5742 | * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the |
| 5743 | * lockscreen uses |
| 5744 | * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5745 | * Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5746 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5747 | */ |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5748 | @Deprecated |
| 5749 | public static final String |
| 5750 | LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5751 | |
| 5752 | /** |
Jim Miller | bc4603b | 2010-08-30 21:21:34 -0700 | [diff] [blame] | 5753 | * This preference allows the device to be locked given time after screen goes off, |
| 5754 | * subject to current DeviceAdmin policy limits. |
| 5755 | * @hide |
| 5756 | */ |
| 5757 | public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; |
| 5758 | |
| 5759 | |
| 5760 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5761 | * This preference contains the string that shows for owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5762 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5763 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5764 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5765 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5766 | public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; |
| 5767 | |
| 5768 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5769 | * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5770 | * @hide |
| 5771 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5772 | @Deprecated |
Michael Jurka | aa2859a | 2012-10-24 12:46:49 -0700 | [diff] [blame] | 5773 | public static final String LOCK_SCREEN_APPWIDGET_IDS = |
| 5774 | "lock_screen_appwidget_ids"; |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5775 | |
| 5776 | /** |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5777 | * Id of the appwidget shown on the lock screen when appwidgets are disabled. |
| 5778 | * @hide |
| 5779 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5780 | @Deprecated |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5781 | public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = |
| 5782 | "lock_screen_fallback_appwidget_id"; |
| 5783 | |
| 5784 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5785 | * Index of the lockscreen appwidget to restore, -1 if none. |
| 5786 | * @hide |
| 5787 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5788 | @Deprecated |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5789 | public static final String LOCK_SCREEN_STICKY_APPWIDGET = |
| 5790 | "lock_screen_sticky_appwidget"; |
| 5791 | |
| 5792 | /** |
| 5793 | * This preference enables showing the owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5794 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5795 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5796 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5797 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5798 | public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = |
| 5799 | "lock_screen_owner_info_enabled"; |
| 5800 | |
| 5801 | /** |
Dan Sandler | 5d7c3cc | 2014-02-18 17:35:15 -0500 | [diff] [blame] | 5802 | * When set by a user, allows notifications to be shown atop a securely locked screen |
| 5803 | * in their full "private" form (same as when the device is unlocked). |
Dan Sandler | fd16d56 | 2014-02-13 18:43:31 -0800 | [diff] [blame] | 5804 | * @hide |
| 5805 | */ |
| 5806 | public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = |
| 5807 | "lock_screen_allow_private_notifications"; |
| 5808 | |
| 5809 | /** |
Adrian Roos | 3aec638 | 2016-02-05 14:19:01 -0800 | [diff] [blame] | 5810 | * When set by a user, allows notification remote input atop a securely locked screen |
| 5811 | * without having to unlock |
| 5812 | * @hide |
| 5813 | */ |
| 5814 | public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = |
| 5815 | "lock_screen_allow_remote_input"; |
| 5816 | |
| 5817 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 5818 | * Set by the system to track if the user needs to see the call to action for |
| 5819 | * the lockscreen notification policy. |
| 5820 | * @hide |
| 5821 | */ |
| 5822 | public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = |
| 5823 | "show_note_about_notification_hiding"; |
| 5824 | |
| 5825 | /** |
Adrian Roos | 3870d45 | 2014-09-05 18:22:28 +0200 | [diff] [blame] | 5826 | * Set to 1 by the system after trust agents have been initialized. |
| 5827 | * @hide |
| 5828 | */ |
| 5829 | public static final String TRUST_AGENTS_INITIALIZED = |
| 5830 | "trust_agents_initialized"; |
| 5831 | |
| 5832 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5833 | * The Logging ID (a unique 64-bit value) as a hex string. |
| 5834 | * Used as a pseudonymous identifier for logging. |
| 5835 | * @deprecated This identifier is poorly initialized and has |
| 5836 | * many collisions. It should not be used. |
| 5837 | */ |
| 5838 | @Deprecated |
| 5839 | public static final String LOGGING_ID = "logging_id"; |
| 5840 | |
| 5841 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5842 | * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5843 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5844 | @Deprecated |
| 5845 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5846 | |
| 5847 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5848 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5849 | */ |
| 5850 | public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5851 | |
| 5852 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5853 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5854 | */ |
| 5855 | public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5856 | |
| 5857 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5858 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5859 | */ |
| 5860 | public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5861 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5862 | /** |
| 5863 | * Settings classname to launch when Settings is clicked from All |
| 5864 | * Applications. Needed because of user testing between the old |
| 5865 | * and new Settings apps. |
| 5866 | */ |
| 5867 | // TODO: 881807 |
| 5868 | public static final String SETTINGS_CLASSNAME = "settings_classname"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5869 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5870 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5871 | * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5872 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5873 | @Deprecated |
| 5874 | public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5875 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5876 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5877 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5878 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5879 | * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5880 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5881 | @Deprecated |
| 5882 | public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5883 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5884 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5885 | * If accessibility is enabled. |
| 5886 | */ |
| 5887 | public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; |
| 5888 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5889 | private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5890 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5891 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5892 | * Setting specifying if the accessibility shortcut is enabled. |
| 5893 | * @hide |
| 5894 | */ |
| 5895 | public static final String ACCESSIBILITY_SHORTCUT_ENABLED = |
| 5896 | "accessibility_shortcut_enabled"; |
| 5897 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5898 | private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5899 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5900 | /** |
| 5901 | * Setting specifying if the accessibility shortcut is enabled. |
| 5902 | * @hide |
| 5903 | */ |
| 5904 | public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = |
| 5905 | "accessibility_shortcut_on_lock_screen"; |
| 5906 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5907 | private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR = |
| 5908 | BOOLEAN_VALIDATOR; |
| 5909 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5910 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5911 | * Setting specifying if the accessibility shortcut dialog has been shown to this user. |
| 5912 | * @hide |
| 5913 | */ |
| 5914 | public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = |
| 5915 | "accessibility_shortcut_dialog_shown"; |
| 5916 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5917 | private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR = |
| 5918 | BOOLEAN_VALIDATOR; |
| 5919 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5920 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5921 | * Setting specifying the accessibility service to be toggled via the accessibility |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5922 | * shortcut. Must be its flattened {@link ComponentName}. |
| 5923 | * @hide |
| 5924 | */ |
| 5925 | public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = |
| 5926 | "accessibility_shortcut_target_service"; |
| 5927 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5928 | private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR = |
| 5929 | COMPONENT_NAME_VALIDATOR; |
| 5930 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5931 | /** |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5932 | * Setting specifying the accessibility service or feature to be toggled via the |
| 5933 | * accessibility button in the navigation bar. This is either a flattened |
| 5934 | * {@link ComponentName} or the class name of a system class implementing a supported |
| 5935 | * accessibility feature. |
| 5936 | * @hide |
| 5937 | */ |
| 5938 | public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = |
| 5939 | "accessibility_button_target_component"; |
| 5940 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5941 | private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR = |
| 5942 | new Validator() { |
| 5943 | @Override |
| 5944 | public boolean validate(String value) { |
| 5945 | // technically either ComponentName or class name, but there's proper value |
| 5946 | // validation at callsites, so allow any non-null string |
| 5947 | return value != null; |
| 5948 | } |
| 5949 | }; |
| 5950 | |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5951 | /** |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5952 | * If touch exploration is enabled. |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5953 | */ |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5954 | public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5955 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5956 | private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5957 | |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5958 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5959 | * List of the enabled accessibility providers. |
| 5960 | */ |
| 5961 | public static final String ENABLED_ACCESSIBILITY_SERVICES = |
| 5962 | "enabled_accessibility_services"; |
| 5963 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5964 | private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5965 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5966 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5967 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 5968 | * List of the accessibility services to which the user has granted |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5969 | * permission to put the device into touch exploration mode. |
| 5970 | * |
| 5971 | * @hide |
| 5972 | */ |
| 5973 | public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = |
| 5974 | "touch_exploration_granted_accessibility_services"; |
| 5975 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5976 | private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5977 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5978 | |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5979 | /** |
Lucas Dupin | 6bd8601 | 2017-12-05 17:58:57 -0800 | [diff] [blame] | 5980 | * Uri of the slice that's presented on the keyguard. |
| 5981 | * Defaults to a slice with the date and next alarm. |
| 5982 | * |
| 5983 | * @hide |
| 5984 | */ |
| 5985 | public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; |
| 5986 | |
| 5987 | /** |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5988 | * Whether to speak passwords while in accessibility mode. |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5989 | * |
| 5990 | * @deprecated The speaking of passwords is controlled by individual accessibility services. |
| 5991 | * Apps should ignore this setting and provide complete information to accessibility |
| 5992 | * at all times, which was the behavior when this value was {@code true}. |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5993 | */ |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5994 | @Deprecated |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5995 | public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; |
| 5996 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5997 | private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5998 | |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5999 | /** |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 6000 | * Whether to draw text with high contrast while in accessibility mode. |
| 6001 | * |
| 6002 | * @hide |
| 6003 | */ |
| 6004 | public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = |
| 6005 | "high_text_contrast_enabled"; |
| 6006 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6007 | private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR = |
| 6008 | BOOLEAN_VALIDATOR; |
| 6009 | |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 6010 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6011 | * Setting that specifies whether the display magnification is enabled via a system-wide |
| 6012 | * triple tap gesture. Display magnifications allows the user to zoom in the display content |
| 6013 | * and is targeted to low vision users. The current magnification scale is controlled by |
| 6014 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6015 | * |
| 6016 | * @hide |
| 6017 | */ |
Eugene Susla | a55f74e | 2017-09-21 13:48:50 -0700 | [diff] [blame] | 6018 | @TestApi |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6019 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = |
| 6020 | "accessibility_display_magnification_enabled"; |
| 6021 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6022 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR = |
| 6023 | BOOLEAN_VALIDATOR; |
| 6024 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6025 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6026 | * Setting that specifies whether the display magnification is enabled via a shortcut |
| 6027 | * affordance within the system's navigation area. Display magnifications allows the user to |
| 6028 | * zoom in the display content and is targeted to low vision users. The current |
| 6029 | * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
| 6030 | * |
| 6031 | * @hide |
| 6032 | */ |
| 6033 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = |
| 6034 | "accessibility_display_magnification_navbar_enabled"; |
| 6035 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6036 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR |
| 6037 | = BOOLEAN_VALIDATOR; |
| 6038 | |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6039 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6040 | * Setting that specifies what the display magnification scale is. |
| 6041 | * Display magnifications allows the user to zoom in the display |
| 6042 | * content and is targeted to low vision users. Whether a display |
| 6043 | * magnification is performed is controlled by |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6044 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and |
| 6045 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6046 | * |
| 6047 | * @hide |
| 6048 | */ |
| 6049 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = |
| 6050 | "accessibility_display_magnification_scale"; |
| 6051 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6052 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR = |
| 6053 | new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE); |
| 6054 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6055 | /** |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 6056 | * Unused mangnification setting |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6057 | * |
| 6058 | * @hide |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 6059 | * @deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6060 | */ |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 6061 | @Deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6062 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = |
| 6063 | "accessibility_display_magnification_auto_update"; |
| 6064 | |
| 6065 | /** |
Anna Galusza | 9b27811 | 2016-01-04 11:37:37 -0800 | [diff] [blame] | 6066 | * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be |
| 6067 | * modified from an AccessibilityService using the SoftKeyboardController. |
| 6068 | * |
| 6069 | * @hide |
| 6070 | */ |
| 6071 | public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = |
| 6072 | "accessibility_soft_keyboard_mode"; |
| 6073 | |
| 6074 | /** |
| 6075 | * Default soft keyboard behavior. |
| 6076 | * |
| 6077 | * @hide |
| 6078 | */ |
| 6079 | public static final int SHOW_MODE_AUTO = 0; |
| 6080 | |
| 6081 | /** |
| 6082 | * Soft keyboard is never shown. |
| 6083 | * |
| 6084 | * @hide |
| 6085 | */ |
| 6086 | public static final int SHOW_MODE_HIDDEN = 1; |
| 6087 | |
| 6088 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6089 | * Setting that specifies whether timed text (captions) should be |
| 6090 | * displayed in video content. Text display properties are controlled by |
| 6091 | * the following settings: |
| 6092 | * <ul> |
| 6093 | * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} |
| 6094 | * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} |
| 6095 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} |
| 6096 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} |
| 6097 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} |
| 6098 | * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6099 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6100 | * </ul> |
| 6101 | * |
| 6102 | * @hide |
| 6103 | */ |
| 6104 | public static final String ACCESSIBILITY_CAPTIONING_ENABLED = |
| 6105 | "accessibility_captioning_enabled"; |
| 6106 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6107 | private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR = |
| 6108 | BOOLEAN_VALIDATOR; |
| 6109 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6110 | /** |
| 6111 | * Setting that specifies the language for captions as a locale string, |
| 6112 | * e.g. en_US. |
| 6113 | * |
| 6114 | * @see java.util.Locale#toString |
| 6115 | * @hide |
| 6116 | */ |
| 6117 | public static final String ACCESSIBILITY_CAPTIONING_LOCALE = |
| 6118 | "accessibility_captioning_locale"; |
| 6119 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6120 | private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR; |
| 6121 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6122 | /** |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6123 | * Integer property that specifies the preset style for captions, one |
| 6124 | * of: |
| 6125 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6126 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} |
| 6127 | * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6128 | * </ul> |
| 6129 | * |
| 6130 | * @see java.util.Locale#toString |
| 6131 | * @hide |
| 6132 | */ |
| 6133 | public static final String ACCESSIBILITY_CAPTIONING_PRESET = |
| 6134 | "accessibility_captioning_preset"; |
| 6135 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6136 | private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR = |
| 6137 | new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2", |
| 6138 | "3", "4"}); |
| 6139 | |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6140 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6141 | * Integer property that specifes the background color for captions as a |
| 6142 | * packed 32-bit color. |
| 6143 | * |
| 6144 | * @see android.graphics.Color#argb |
| 6145 | * @hide |
| 6146 | */ |
| 6147 | public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = |
| 6148 | "accessibility_captioning_background_color"; |
| 6149 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6150 | private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR = |
| 6151 | ANY_INTEGER_VALIDATOR; |
| 6152 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6153 | /** |
| 6154 | * Integer property that specifes the foreground color for captions as a |
| 6155 | * packed 32-bit color. |
| 6156 | * |
| 6157 | * @see android.graphics.Color#argb |
| 6158 | * @hide |
| 6159 | */ |
| 6160 | public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = |
| 6161 | "accessibility_captioning_foreground_color"; |
| 6162 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6163 | private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR = |
| 6164 | ANY_INTEGER_VALIDATOR; |
| 6165 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6166 | /** |
| 6167 | * Integer property that specifes the edge type for captions, one of: |
| 6168 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6169 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} |
| 6170 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} |
| 6171 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6172 | * </ul> |
| 6173 | * |
| 6174 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR |
| 6175 | * @hide |
| 6176 | */ |
| 6177 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = |
| 6178 | "accessibility_captioning_edge_type"; |
| 6179 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6180 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR = |
| 6181 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"}); |
| 6182 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6183 | /** |
| 6184 | * Integer property that specifes the edge color for captions as a |
| 6185 | * packed 32-bit color. |
| 6186 | * |
| 6187 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE |
| 6188 | * @see android.graphics.Color#argb |
| 6189 | * @hide |
| 6190 | */ |
| 6191 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = |
| 6192 | "accessibility_captioning_edge_color"; |
| 6193 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6194 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR = |
| 6195 | ANY_INTEGER_VALIDATOR; |
| 6196 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6197 | /** |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6198 | * Integer property that specifes the window color for captions as a |
| 6199 | * packed 32-bit color. |
| 6200 | * |
| 6201 | * @see android.graphics.Color#argb |
| 6202 | * @hide |
| 6203 | */ |
| 6204 | public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = |
| 6205 | "accessibility_captioning_window_color"; |
| 6206 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6207 | private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR = |
| 6208 | ANY_INTEGER_VALIDATOR; |
| 6209 | |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6210 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6211 | * String property that specifies the typeface for captions, one of: |
| 6212 | * <ul> |
| 6213 | * <li>DEFAULT |
| 6214 | * <li>MONOSPACE |
| 6215 | * <li>SANS_SERIF |
| 6216 | * <li>SERIF |
| 6217 | * </ul> |
| 6218 | * |
| 6219 | * @see android.graphics.Typeface |
| 6220 | * @hide |
| 6221 | */ |
| 6222 | public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = |
| 6223 | "accessibility_captioning_typeface"; |
| 6224 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6225 | private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR = |
| 6226 | new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT", |
| 6227 | "MONOSPACE", "SANS_SERIF", "SERIF"}); |
| 6228 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6229 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6230 | * Floating point property that specifies font scaling for captions. |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6231 | * |
| 6232 | * @hide |
| 6233 | */ |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6234 | public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = |
| 6235 | "accessibility_captioning_font_scale"; |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6236 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6237 | private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR = |
| 6238 | new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f); |
| 6239 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6240 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6241 | * Setting that specifies whether display color inversion is enabled. |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6242 | */ |
| 6243 | public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = |
| 6244 | "accessibility_display_inversion_enabled"; |
| 6245 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6246 | private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR = |
| 6247 | BOOLEAN_VALIDATOR; |
| 6248 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6249 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6250 | * Setting that specifies whether display color space adjustment is |
| 6251 | * enabled. |
| 6252 | * |
| 6253 | * @hide |
| 6254 | */ |
| 6255 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = |
| 6256 | "accessibility_display_daltonizer_enabled"; |
| 6257 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6258 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR = |
| 6259 | BOOLEAN_VALIDATOR; |
| 6260 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6261 | /** |
| 6262 | * Integer property that specifies the type of color space adjustment to |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6263 | * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6264 | * - AccessibilityManager.DALTONIZER_DISABLED = -1 |
| 6265 | * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6266 | * - <item>@string/daltonizer_mode_protanomaly</item> = 11 |
| 6267 | * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and |
| 6268 | * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 |
| 6269 | * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6270 | * |
| 6271 | * @hide |
| 6272 | */ |
| 6273 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = |
| 6274 | "accessibility_display_daltonizer"; |
| 6275 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6276 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR = |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6277 | new SettingsValidators.DiscreteValueValidator( |
| 6278 | new String[] {"-1", "0", "11", "12", "13"}); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6279 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6280 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6281 | * Setting that specifies whether automatic click when the mouse pointer stops moving is |
| 6282 | * enabled. |
| 6283 | * |
| 6284 | * @hide |
| 6285 | */ |
| 6286 | public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = |
| 6287 | "accessibility_autoclick_enabled"; |
| 6288 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6289 | private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR = |
| 6290 | BOOLEAN_VALIDATOR; |
| 6291 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6292 | /** |
| 6293 | * Integer setting specifying amount of time in ms the mouse pointer has to stay still |
| 6294 | * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. |
| 6295 | * |
| 6296 | * @see #ACCESSIBILITY_AUTOCLICK_ENABLED |
| 6297 | * @hide |
| 6298 | */ |
| 6299 | public static final String ACCESSIBILITY_AUTOCLICK_DELAY = |
| 6300 | "accessibility_autoclick_delay"; |
| 6301 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6302 | private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR = |
| 6303 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6304 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6305 | /** |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6306 | * Whether or not larger size icons are used for the pointer of mouse/trackpad for |
| 6307 | * accessibility. |
| 6308 | * (0 = false, 1 = true) |
| 6309 | * @hide |
| 6310 | */ |
| 6311 | public static final String ACCESSIBILITY_LARGE_POINTER_ICON = |
| 6312 | "accessibility_large_pointer_icon"; |
| 6313 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6314 | private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR = |
| 6315 | BOOLEAN_VALIDATOR; |
| 6316 | |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6317 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6318 | * The timeout for considering a press to be a long press in milliseconds. |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 6319 | * @hide |
| 6320 | */ |
| 6321 | public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; |
| 6322 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6323 | private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR = |
| 6324 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6325 | |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 6326 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 6327 | * The duration in milliseconds between the first tap's up event and the second tap's |
| 6328 | * down event for an interaction to be considered part of the same multi-press. |
| 6329 | * @hide |
| 6330 | */ |
| 6331 | public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; |
| 6332 | |
| 6333 | /** |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6334 | * List of the enabled print services. |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6335 | * |
| 6336 | * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade |
| 6337 | * from pre-N. |
| 6338 | * |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 6339 | * @hide |
| 6340 | */ |
| 6341 | public static final String ENABLED_PRINT_SERVICES = |
| 6342 | "enabled_print_services"; |
| 6343 | |
| 6344 | /** |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6345 | * List of the disabled print services. |
| 6346 | * |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6347 | * @hide |
| 6348 | */ |
Svetoslav Ganov | 2dcedc12 | 2017-06-07 18:50:02 -0700 | [diff] [blame] | 6349 | @TestApi |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6350 | public static final String DISABLED_PRINT_SERVICES = |
| 6351 | "disabled_print_services"; |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6352 | |
| 6353 | /** |
Alan Viverette | 5e8d837 | 2016-02-03 15:38:59 -0500 | [diff] [blame] | 6354 | * The saved value for WindowManagerService.setForcedDisplayDensity() |
| 6355 | * formatted as a single integer representing DPI. If unset, then use |
| 6356 | * the real display density. |
| 6357 | * |
| 6358 | * @hide |
| 6359 | */ |
| 6360 | public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; |
| 6361 | |
| 6362 | /** |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6363 | * Setting to always use the default text-to-speech settings regardless |
| 6364 | * of the application settings. |
| 6365 | * 1 = override application settings, |
| 6366 | * 0 = use application settings (if specified). |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6367 | * |
| 6368 | * @deprecated The value of this setting is no longer respected by |
| 6369 | * the framework text to speech APIs as of the Ice Cream Sandwich release. |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6370 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6371 | @Deprecated |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6372 | public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; |
| 6373 | |
| 6374 | /** |
| 6375 | * Default text-to-speech engine speech rate. 100 = 1x |
| 6376 | */ |
| 6377 | public static final String TTS_DEFAULT_RATE = "tts_default_rate"; |
| 6378 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6379 | private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6380 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6381 | /** |
| 6382 | * Default text-to-speech engine pitch. 100 = 1x |
| 6383 | */ |
| 6384 | public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; |
| 6385 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6386 | private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6387 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6388 | /** |
| 6389 | * Default text-to-speech engine. |
| 6390 | */ |
| 6391 | public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; |
| 6392 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6393 | private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR; |
| 6394 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6395 | /** |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6396 | * Default text-to-speech language. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6397 | * |
| 6398 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6399 | * Sandwich release. Apps should never need to read this setting directly, |
| 6400 | * instead can query the TextToSpeech framework classes for the default |
| 6401 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6402 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6403 | @Deprecated |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6404 | public static final String TTS_DEFAULT_LANG = "tts_default_lang"; |
| 6405 | |
| 6406 | /** |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6407 | * Default text-to-speech country. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6408 | * |
| 6409 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6410 | * Sandwich release. Apps should never need to read this setting directly, |
| 6411 | * instead can query the TextToSpeech framework classes for the default |
| 6412 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6413 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6414 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6415 | public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; |
| 6416 | |
| 6417 | /** |
| 6418 | * Default text-to-speech locale variant. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6419 | * |
| 6420 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6421 | * Sandwich release. Apps should never need to read this setting directly, |
| 6422 | * instead can query the TextToSpeech framework classes for the |
| 6423 | * locale that is in use {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6424 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6425 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6426 | public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; |
| 6427 | |
| 6428 | /** |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6429 | * Stores the default tts locales on a per engine basis. Stored as |
| 6430 | * a comma seperated list of values, each value being of the form |
| 6431 | * {@code engine_name:locale} for example, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6432 | * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This |
| 6433 | * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and |
| 6434 | * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this |
| 6435 | * setting directly, and can query the TextToSpeech framework classes |
| 6436 | * for the locale that is in use. |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6437 | * |
| 6438 | * @hide |
| 6439 | */ |
| 6440 | public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; |
| 6441 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6442 | private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() { |
| 6443 | @Override |
| 6444 | public boolean validate(String value) { |
| 6445 | if (value == null || value.length() == 0) { |
| 6446 | return false; |
| 6447 | } |
| 6448 | String[] ttsLocales = value.split(","); |
| 6449 | boolean valid = true; |
| 6450 | for (String ttsLocale : ttsLocales) { |
| 6451 | String[] parts = ttsLocale.split(":"); |
| 6452 | valid |= ((parts.length == 2) |
| 6453 | && (parts[0].length() > 0) |
| 6454 | && ANY_STRING_VALIDATOR.validate(parts[0]) |
| 6455 | && LOCALE_VALIDATOR.validate(parts[1])); |
| 6456 | } |
| 6457 | return valid; |
| 6458 | } |
| 6459 | }; |
| 6460 | |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6461 | /** |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6462 | * Space delimited list of plugin packages that are enabled. |
| 6463 | */ |
| 6464 | public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; |
| 6465 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6466 | private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR = |
| 6467 | new SettingsValidators.PackageNameListValidator(" "); |
| 6468 | |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6469 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6470 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} |
| 6471 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6472 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6473 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6474 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6475 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6476 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6477 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 6478 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 6479 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6480 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6481 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} |
| 6482 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6483 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6484 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6485 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6486 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6487 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6488 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 6489 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6490 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6491 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6492 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} |
| 6493 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6494 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6495 | @Deprecated |
| 6496 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = |
| 6497 | Global.WIFI_NUM_OPEN_NETWORKS_KEPT; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6498 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6499 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 6500 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6501 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6502 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6503 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} |
| 6504 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6505 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6506 | @Deprecated |
| 6507 | public static final String WIFI_ON = Global.WIFI_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6508 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6509 | /** |
| 6510 | * The acceptable packet loss percentage (range 0 - 100) before trying |
| 6511 | * another AP on the same network. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6512 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6513 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6514 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6515 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 6516 | "wifi_watchdog_acceptable_packet_loss_percentage"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6517 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6518 | /** |
| 6519 | * The number of access points required for a network in order for the |
| 6520 | * watchdog to monitor it. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6521 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6522 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6523 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6524 | public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6525 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6526 | /** |
| 6527 | * The delay between background checks. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6528 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6529 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6530 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6531 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 6532 | "wifi_watchdog_background_check_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6533 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6534 | /** |
| 6535 | * Whether the Wi-Fi watchdog is enabled for background checking even |
| 6536 | * after it thinks the user has connected to a good access point. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6537 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6538 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6539 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6540 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 6541 | "wifi_watchdog_background_check_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6542 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6543 | /** |
| 6544 | * The timeout for a background ping |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6545 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6546 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6547 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6548 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 6549 | "wifi_watchdog_background_check_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6550 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6551 | /** |
| 6552 | * The number of initial pings to perform that *may* be ignored if they |
| 6553 | * fail. Again, if these fail, they will *not* be used in packet loss |
| 6554 | * calculation. For example, one network always seemed to time out for |
| 6555 | * the first couple pings, so this is set to 3 by default. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6556 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6557 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6558 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6559 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 6560 | "wifi_watchdog_initial_ignored_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6561 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6562 | /** |
| 6563 | * The maximum number of access points (per network) to attempt to test. |
| 6564 | * If this number is reached, the watchdog will no longer monitor the |
| 6565 | * initial connection state for the network. This is a safeguard for |
| 6566 | * networks containing multiple APs whose DNS does not respond to pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6567 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6568 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6569 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6570 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6571 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6572 | /** |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6573 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6574 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6575 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6576 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 6577 | |
| 6578 | /** |
| 6579 | * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6580 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6581 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6582 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6583 | public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; |
| 6584 | |
| 6585 | /** |
| 6586 | * The number of pings to test if an access point is a good connection. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6587 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6588 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6589 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6590 | public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6591 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6592 | /** |
| 6593 | * The delay between pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6594 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6595 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6596 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6597 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6598 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6599 | /** |
| 6600 | * The timeout per ping. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6601 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6602 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6603 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6604 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6605 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6606 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6607 | * @deprecated Use |
| 6608 | * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6609 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6610 | @Deprecated |
| 6611 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6612 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6613 | /** |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6614 | * @deprecated Use |
| 6615 | * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6616 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6617 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6618 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6619 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6620 | |
| 6621 | /** |
Jeremy Joslin | 7929484 | 2014-12-03 17:15:28 -0800 | [diff] [blame] | 6622 | * The number of milliseconds to hold on to a PendingIntent based request. This delay gives |
| 6623 | * the receivers of the PendingIntent an opportunity to make a new network request before |
| 6624 | * the Network satisfying the request is potentially removed. |
| 6625 | * |
| 6626 | * @hide |
| 6627 | */ |
| 6628 | public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = |
| 6629 | "connectivity_release_pending_intent_delay_ms"; |
| 6630 | |
| 6631 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 6632 | * Whether background data usage is allowed. |
| 6633 | * |
| 6634 | * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, |
| 6635 | * availability of background data depends on several |
| 6636 | * combined factors. When background data is unavailable, |
| 6637 | * {@link ConnectivityManager#getActiveNetworkInfo()} will |
| 6638 | * now appear disconnected. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6639 | */ |
Jeff Sharkey | 3a844fc | 2011-08-16 14:37:57 -0700 | [diff] [blame] | 6640 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6641 | public static final String BACKGROUND_DATA = "background_data"; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6642 | |
| 6643 | /** |
Bjorn Bringert | 98bfa39 | 2010-03-24 10:59:48 +0000 | [diff] [blame] | 6644 | * Origins for which browsers should allow geolocation by default. |
| 6645 | * The value is a space-separated list of origins. |
| 6646 | */ |
| 6647 | public static final String ALLOWED_GEOLOCATION_ORIGINS |
| 6648 | = "allowed_geolocation_origins"; |
| 6649 | |
| 6650 | /** |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 6651 | * The preferred TTY mode 0 = TTy Off, CDMA default |
| 6652 | * 1 = TTY Full |
| 6653 | * 2 = TTY HCO |
| 6654 | * 3 = TTY VCO |
| 6655 | * @hide |
| 6656 | */ |
| 6657 | public static final String PREFERRED_TTY_MODE = |
| 6658 | "preferred_tty_mode"; |
| 6659 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6660 | private static final Validator PREFERRED_TTY_MODE_VALIDATOR = |
| 6661 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"}); |
| 6662 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6663 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6664 | * Whether the enhanced voice privacy mode is enabled. |
| 6665 | * 0 = normal voice privacy |
| 6666 | * 1 = enhanced voice privacy |
| 6667 | * @hide |
| 6668 | */ |
| 6669 | public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; |
| 6670 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6671 | private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6672 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6673 | /** |
| 6674 | * Whether the TTY mode mode is enabled. |
| 6675 | * 0 = disabled |
| 6676 | * 1 = enabled |
| 6677 | * @hide |
| 6678 | */ |
| 6679 | public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6680 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6681 | private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6682 | |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6683 | /** |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 6684 | * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT |
| 6685 | * calls when supported by the device and carrier. Boolean value. |
| 6686 | * 0 = OFF |
| 6687 | * 1 = ON |
| 6688 | */ |
| 6689 | public static final String RTT_CALLING_MODE = "rtt_calling_mode"; |
| 6690 | |
| 6691 | private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6692 | |
| 6693 | /** |
| 6694 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6695 | * Controls whether settings backup is enabled. |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6696 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6697 | * @hide |
| 6698 | */ |
| 6699 | public static final String BACKUP_ENABLED = "backup_enabled"; |
| 6700 | |
| 6701 | /** |
Christopher Tate | cce9da5 | 2010-02-03 15:11:15 -0800 | [diff] [blame] | 6702 | * Controls whether application data is automatically restored from backup |
| 6703 | * at install time. |
| 6704 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6705 | * @hide |
| 6706 | */ |
| 6707 | public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; |
| 6708 | |
| 6709 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6710 | * Indicates whether settings backup has been fully provisioned. |
| 6711 | * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) |
| 6712 | * @hide |
| 6713 | */ |
| 6714 | public static final String BACKUP_PROVISIONED = "backup_provisioned"; |
| 6715 | |
| 6716 | /** |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6717 | * Component of the transport to use for backup/restore. |
| 6718 | * @hide |
| 6719 | */ |
| 6720 | public static final String BACKUP_TRANSPORT = "backup_transport"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 6721 | |
Dianne Hackborn | d7cd29d | 2009-07-01 11:22:45 -0700 | [diff] [blame] | 6722 | /** |
| 6723 | * Version for which the setup wizard was last shown. Bumped for |
| 6724 | * each release when there is new setup information to show. |
| 6725 | * @hide |
| 6726 | */ |
| 6727 | public static final String LAST_SETUP_SHOWN = "last_setup_shown"; |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6728 | |
| 6729 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6730 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 6731 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 6732 | * the mobile data network. |
| 6733 | * @hide |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6734 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} |
| 6735 | * instead. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6736 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6737 | @Deprecated |
| 6738 | public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6739 | |
| 6740 | /** |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 6741 | * The global search provider chosen by the user (if multiple global |
| 6742 | * search providers are installed). This will be the provider returned |
| 6743 | * by {@link SearchManager#getGlobalSearchActivity()} if it's still |
| 6744 | * installed. This setting is stored as a flattened component name as |
| 6745 | * per {@link ComponentName#flattenToString()}. |
| 6746 | * |
| 6747 | * @hide |
| 6748 | */ |
| 6749 | public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = |
| 6750 | "search_global_search_activity"; |
| 6751 | |
| 6752 | /** |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6753 | * The number of promoted sources in GlobalSearch. |
| 6754 | * @hide |
| 6755 | */ |
| 6756 | public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; |
| 6757 | /** |
| 6758 | * The maximum number of suggestions returned by GlobalSearch. |
| 6759 | * @hide |
| 6760 | */ |
| 6761 | public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; |
| 6762 | /** |
| 6763 | * The number of suggestions GlobalSearch will ask each non-web search source for. |
| 6764 | * @hide |
| 6765 | */ |
| 6766 | public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; |
| 6767 | /** |
| 6768 | * The number of suggestions the GlobalSearch will ask the web search source for. |
| 6769 | * @hide |
| 6770 | */ |
| 6771 | public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = |
| 6772 | "search_web_results_override_limit"; |
| 6773 | /** |
| 6774 | * The number of milliseconds that GlobalSearch will wait for suggestions from |
| 6775 | * promoted sources before continuing with all other sources. |
| 6776 | * @hide |
| 6777 | */ |
| 6778 | public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = |
| 6779 | "search_promoted_source_deadline_millis"; |
| 6780 | /** |
| 6781 | * The number of milliseconds before GlobalSearch aborts search suggesiton queries. |
| 6782 | * @hide |
| 6783 | */ |
| 6784 | public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; |
| 6785 | /** |
| 6786 | * The maximum number of milliseconds that GlobalSearch shows the previous results |
| 6787 | * after receiving a new query. |
| 6788 | * @hide |
| 6789 | */ |
| 6790 | public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; |
| 6791 | /** |
| 6792 | * The maximum age of log data used for shortcuts in GlobalSearch. |
| 6793 | * @hide |
| 6794 | */ |
| 6795 | public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; |
| 6796 | /** |
| 6797 | * The maximum age of log data used for source ranking in GlobalSearch. |
| 6798 | * @hide |
| 6799 | */ |
| 6800 | public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = |
| 6801 | "search_max_source_event_age_millis"; |
| 6802 | /** |
| 6803 | * The minimum number of impressions needed to rank a source in GlobalSearch. |
| 6804 | * @hide |
| 6805 | */ |
| 6806 | public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = |
| 6807 | "search_min_impressions_for_source_ranking"; |
| 6808 | /** |
| 6809 | * The minimum number of clicks needed to rank a source in GlobalSearch. |
| 6810 | * @hide |
| 6811 | */ |
| 6812 | public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = |
| 6813 | "search_min_clicks_for_source_ranking"; |
| 6814 | /** |
| 6815 | * The maximum number of shortcuts shown by GlobalSearch. |
| 6816 | * @hide |
| 6817 | */ |
| 6818 | public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; |
| 6819 | /** |
| 6820 | * The size of the core thread pool for suggestion queries in GlobalSearch. |
| 6821 | * @hide |
| 6822 | */ |
| 6823 | public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = |
| 6824 | "search_query_thread_core_pool_size"; |
| 6825 | /** |
| 6826 | * The maximum size of the thread pool for suggestion queries in GlobalSearch. |
| 6827 | * @hide |
| 6828 | */ |
| 6829 | public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = |
| 6830 | "search_query_thread_max_pool_size"; |
| 6831 | /** |
| 6832 | * The size of the core thread pool for shortcut refreshing in GlobalSearch. |
| 6833 | * @hide |
| 6834 | */ |
| 6835 | public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = |
| 6836 | "search_shortcut_refresh_core_pool_size"; |
| 6837 | /** |
| 6838 | * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. |
| 6839 | * @hide |
| 6840 | */ |
| 6841 | public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = |
| 6842 | "search_shortcut_refresh_max_pool_size"; |
| 6843 | /** |
| 6844 | * The maximun time that excess threads in the GlobalSeach thread pools will |
| 6845 | * wait before terminating. |
| 6846 | * @hide |
| 6847 | */ |
| 6848 | public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = |
| 6849 | "search_thread_keepalive_seconds"; |
| 6850 | /** |
| 6851 | * The maximum number of concurrent suggestion queries to each source. |
| 6852 | * @hide |
| 6853 | */ |
| 6854 | public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = |
| 6855 | "search_per_source_concurrent_query_limit"; |
| 6856 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6857 | /** |
Sudheer Shanka | 2250d56 | 2016-11-07 15:41:02 -0800 | [diff] [blame] | 6858 | * Whether or not alert sounds are played on StorageManagerService events. |
| 6859 | * (0 = false, 1 = true) |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6860 | * @hide |
| 6861 | */ |
| 6862 | public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; |
| 6863 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6864 | private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6865 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6866 | /** |
| 6867 | * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) |
| 6868 | * @hide |
| 6869 | */ |
| 6870 | public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; |
| 6871 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6872 | private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6873 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6874 | /** |
| 6875 | * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) |
| 6876 | * @hide |
| 6877 | */ |
| 6878 | public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; |
| 6879 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6880 | private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6881 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6882 | /** |
| 6883 | * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) |
| 6884 | * @hide |
| 6885 | */ |
| 6886 | public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6887 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6888 | private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6889 | |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6890 | /** |
| 6891 | * If nonzero, ANRs in invisible background processes bring up a dialog. |
| 6892 | * Otherwise, the process will be silently killed. |
Adrian Roos | 6a7e089 | 2016-08-23 14:26:39 +0200 | [diff] [blame] | 6893 | * |
| 6894 | * Also prevents ANRs and crash dialogs from being suppressed. |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6895 | * @hide |
| 6896 | */ |
| 6897 | public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6898 | |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6899 | /** |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6900 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 6901 | * Otherwise, the process will be silently killed. |
| 6902 | * @hide |
| 6903 | */ |
| 6904 | public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = |
| 6905 | "show_first_crash_dialog_dev_option"; |
| 6906 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6907 | private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR = |
| 6908 | BOOLEAN_VALIDATOR; |
| 6909 | |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6910 | /** |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6911 | * The {@link ComponentName} string of the service to be used as the voice recognition |
| 6912 | * service. |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6913 | * |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6914 | * @hide |
| 6915 | */ |
| 6916 | public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6917 | |
William Luh | 623a428 | 2013-06-24 12:14:18 -0700 | [diff] [blame] | 6918 | /** |
| 6919 | * Stores whether an user has consented to have apps verified through PAM. |
| 6920 | * The value is boolean (1 or 0). |
| 6921 | * |
| 6922 | * @hide |
| 6923 | */ |
| 6924 | public static final String PACKAGE_VERIFIER_USER_CONSENT = |
| 6925 | "package_verifier_user_consent"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6926 | |
| 6927 | /** |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6928 | * The {@link ComponentName} string of the selected spell checker service which is |
| 6929 | * one of the services managed by the text service manager. |
| 6930 | * |
| 6931 | * @hide |
| 6932 | */ |
| 6933 | public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; |
| 6934 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6935 | private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 6936 | |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6937 | /** |
| 6938 | * The {@link ComponentName} string of the selected subtype of the selected spell checker |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6939 | * service which is one of the services managed by the text service manager. |
| 6940 | * |
| 6941 | * @hide |
| 6942 | */ |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6943 | public static final String SELECTED_SPELL_CHECKER_SUBTYPE = |
| 6944 | "selected_spell_checker_subtype"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6945 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6946 | private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR = |
| 6947 | COMPONENT_NAME_VALIDATOR; |
| 6948 | |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6949 | /** |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6950 | * Whether spell checker is enabled or not. |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6951 | * |
| 6952 | * @hide |
| 6953 | */ |
| 6954 | public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; |
| 6955 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6956 | private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6957 | |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6958 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6959 | * What happens when the user presses the Power button while in-call |
| 6960 | * and the screen is on.<br/> |
| 6961 | * <b>Values:</b><br/> |
| 6962 | * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> |
| 6963 | * 2 - The Power button hangs up the current call.<br/> |
| 6964 | * |
| 6965 | * @hide |
| 6966 | */ |
| 6967 | public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; |
| 6968 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6969 | private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR = |
| 6970 | new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"}); |
| 6971 | |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6972 | /** |
| 6973 | * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". |
| 6974 | * @hide |
| 6975 | */ |
| 6976 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; |
| 6977 | |
| 6978 | /** |
| 6979 | * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". |
| 6980 | * @hide |
| 6981 | */ |
| 6982 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; |
| 6983 | |
| 6984 | /** |
| 6985 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6986 | * @hide |
| 6987 | */ |
| 6988 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = |
| 6989 | INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; |
| 6990 | |
| 6991 | /** |
Bryce Lee | db776ce | 2016-09-03 15:02:00 -0700 | [diff] [blame] | 6992 | * What happens when the user presses the Back button while in-call |
| 6993 | * and the screen is on.<br/> |
| 6994 | * <b>Values:</b><br/> |
| 6995 | * 0 - The Back buttons does nothing different.<br/> |
| 6996 | * 1 - The Back button hangs up the current call.<br/> |
| 6997 | * |
| 6998 | * @hide |
| 6999 | */ |
| 7000 | public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; |
| 7001 | |
| 7002 | /** |
| 7003 | * INCALL_BACK_BUTTON_BEHAVIOR value for no action. |
| 7004 | * @hide |
| 7005 | */ |
| 7006 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; |
| 7007 | |
| 7008 | /** |
| 7009 | * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". |
| 7010 | * @hide |
| 7011 | */ |
| 7012 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; |
| 7013 | |
| 7014 | /** |
| 7015 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 7016 | * @hide |
| 7017 | */ |
| 7018 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = |
| 7019 | INCALL_BACK_BUTTON_BEHAVIOR_NONE; |
| 7020 | |
| 7021 | /** |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 7022 | * Whether the device should wake when the wake gesture sensor detects motion. |
| 7023 | * @hide |
| 7024 | */ |
| 7025 | public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; |
| 7026 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7027 | private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7028 | |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 7029 | /** |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 7030 | * Whether the device should doze if configured. |
| 7031 | * @hide |
| 7032 | */ |
| 7033 | public static final String DOZE_ENABLED = "doze_enabled"; |
| 7034 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7035 | private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7036 | |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 7037 | /** |
Adrian Roos | ebea7a7 | 2016-10-26 12:51:26 -0700 | [diff] [blame] | 7038 | * Whether doze should be always on. |
| 7039 | * @hide |
| 7040 | */ |
| 7041 | public static final String DOZE_ALWAYS_ON = "doze_always_on"; |
| 7042 | |
| 7043 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7044 | * Whether the device should pulse on pick up gesture. |
| 7045 | * @hide |
| 7046 | */ |
| 7047 | public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; |
| 7048 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7049 | private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7050 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7051 | /** |
Adrian Roos | d0963a0 | 2017-05-15 14:33:37 -0700 | [diff] [blame] | 7052 | * Whether the device should pulse on long press gesture. |
| 7053 | * @hide |
| 7054 | */ |
| 7055 | public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; |
| 7056 | |
| 7057 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7058 | * Whether the device should pulse on double tap gesture. |
| 7059 | * @hide |
| 7060 | */ |
| 7061 | public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; |
| 7062 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7063 | private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7064 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7065 | /** |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7066 | * The current night mode that has been selected by the user. Owned |
| 7067 | * and controlled by UiModeManagerService. Constants are as per |
| 7068 | * UiModeManager. |
| 7069 | * @hide |
| 7070 | */ |
| 7071 | public static final String UI_NIGHT_MODE = "ui_night_mode"; |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 7072 | |
| 7073 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7074 | * Whether screensavers are enabled. |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7075 | * @hide |
| 7076 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7077 | public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7078 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7079 | private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7080 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7081 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7082 | * The user's chosen screensaver components. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7083 | * |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7084 | * These will be launched by the PhoneWindowManager after a timeout when not on |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7085 | * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7086 | * @hide |
| 7087 | */ |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7088 | public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7089 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7090 | private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR = |
| 7091 | new SettingsValidators.ComponentNameListValidator(","); |
| 7092 | |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7093 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7094 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 7095 | * when the device is inserted into a (desk) dock. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7096 | * @hide |
| 7097 | */ |
| 7098 | public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7099 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7100 | private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7101 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7102 | /** |
| 7103 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 7104 | * when the screen times out when not on battery. |
| 7105 | * @hide |
| 7106 | */ |
| 7107 | public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; |
| 7108 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7109 | private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7110 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7111 | /** |
| 7112 | * If screensavers are enabled, the default screensaver component. |
| 7113 | * @hide |
| 7114 | */ |
| 7115 | public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; |
| 7116 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7117 | /** |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 7118 | * The default NFC payment component |
| 7119 | * @hide |
| 7120 | */ |
| 7121 | public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; |
| 7122 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7123 | private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR = |
| 7124 | COMPONENT_NAME_VALIDATOR; |
| 7125 | |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 7126 | /** |
Martijn Coenen | 2f6f3a01 | 2014-04-25 17:00:21 -0700 | [diff] [blame] | 7127 | * Whether NFC payment is handled by the foreground application or a default. |
| 7128 | * @hide |
| 7129 | */ |
| 7130 | public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; |
| 7131 | |
| 7132 | /** |
David Braun | f5d8319 | 2013-09-16 13:43:51 -0700 | [diff] [blame] | 7133 | * Specifies the package name currently configured to be the primary sms application |
| 7134 | * @hide |
| 7135 | */ |
| 7136 | public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; |
| 7137 | |
| 7138 | /** |
Yorke Lee | 014de02 | 2015-04-21 17:15:47 -0700 | [diff] [blame] | 7139 | * Specifies the package name currently configured to be the default dialer application |
| 7140 | * @hide |
| 7141 | */ |
| 7142 | public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; |
| 7143 | |
| 7144 | /** |
Adrian Roos | 943eb86 | 2015-03-26 12:31:16 -0700 | [diff] [blame] | 7145 | * Specifies the package name currently configured to be the emergency assistance application |
| 7146 | * |
| 7147 | * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE |
| 7148 | * |
| 7149 | * @hide |
| 7150 | */ |
| 7151 | public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; |
| 7152 | |
| 7153 | /** |
Jorim Jaggi | 9d91083 | 2015-05-18 17:35:26 -0700 | [diff] [blame] | 7154 | * Specifies whether the current app context on scren (assist data) will be sent to the |
| 7155 | * assist application (active voice interaction service). |
| 7156 | * |
| 7157 | * @hide |
| 7158 | */ |
| 7159 | public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; |
| 7160 | |
| 7161 | /** |
Jorim Jaggi | a133f0b | 2015-06-26 16:40:00 -0700 | [diff] [blame] | 7162 | * Specifies whether a screenshot of the screen contents will be sent to the assist |
| 7163 | * application (active voice interaction service). |
| 7164 | * |
| 7165 | * @hide |
| 7166 | */ |
| 7167 | public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; |
| 7168 | |
| 7169 | /** |
Adrian Roos | 2335bd6 | 2016-08-11 15:42:40 -0700 | [diff] [blame] | 7170 | * Specifies whether the screen will show an animation if screen contents are sent to the |
| 7171 | * assist application (active voice interaction service). |
| 7172 | * |
| 7173 | * Note that the disclosure will be forced for third-party assistants or if the device |
| 7174 | * does not support disabling it. |
| 7175 | * |
| 7176 | * @hide |
| 7177 | */ |
| 7178 | public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; |
| 7179 | |
| 7180 | /** |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7181 | * Control if rotation suggestions are sent to System UI when in rotation locked mode. |
| 7182 | * Done to enable screen rotation while the the screen rotation is locked. Enabling will |
| 7183 | * poll the accelerometer in rotation locked mode. |
| 7184 | * |
| 7185 | * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. |
| 7186 | * |
| 7187 | * @hide |
| 7188 | */ |
| 7189 | |
| 7190 | public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; |
| 7191 | |
| 7192 | /** |
| 7193 | * The disabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7194 | * @hide |
| 7195 | */ |
| 7196 | public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; |
| 7197 | |
| 7198 | /** |
| 7199 | * The enabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7200 | * @hide |
| 7201 | */ |
| 7202 | public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; |
| 7203 | |
| 7204 | /** |
| 7205 | * The default state of SHOW_ROTATION_SUGGESTIONS. |
| 7206 | * @hide |
| 7207 | */ |
| 7208 | public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = |
Mike Digman | 02856ba | 2018-01-16 11:21:23 -0800 | [diff] [blame] | 7209 | SHOW_ROTATION_SUGGESTIONS_ENABLED; |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7210 | |
| 7211 | /** |
Mike Digman | 5075264 | 2018-02-15 13:36:09 -0800 | [diff] [blame] | 7212 | * The number of accepted rotation suggestions. Used to determine if the user has been |
| 7213 | * introduced to rotation suggestions. |
| 7214 | * @hide |
| 7215 | */ |
| 7216 | public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = |
| 7217 | "num_rotation_suggestions_accepted"; |
| 7218 | |
| 7219 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7220 | * Read only list of the service components that the current user has explicitly allowed to |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7221 | * see and assist with all of the user's notifications. |
| 7222 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7223 | * @deprecated Use |
| 7224 | * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7225 | * @hide |
| 7226 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7227 | @Deprecated |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7228 | public static final String ENABLED_NOTIFICATION_ASSISTANT = |
| 7229 | "enabled_notification_assistant"; |
| 7230 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7231 | private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR = |
| 7232 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7233 | |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7234 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7235 | * Read only list of the service components that the current user has explicitly allowed to |
Chris Wren | 8326a8a | 2014-10-22 14:13:32 -0400 | [diff] [blame] | 7236 | * see all of the user's notifications, separated by ':'. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7237 | * |
| 7238 | * @hide |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7239 | * @deprecated Use |
| 7240 | * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7241 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7242 | @Deprecated |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7243 | public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; |
| 7244 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7245 | private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR = |
| 7246 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7247 | |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 7248 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7249 | * Read only list of the packages that the current user has explicitly allowed to |
| 7250 | * manage do not disturb, separated by ':'. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7251 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7252 | * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7253 | * @hide |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7254 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7255 | @Deprecated |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7256 | @TestApi |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7257 | public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = |
| 7258 | "enabled_notification_policy_access_packages"; |
| 7259 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7260 | private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR = |
| 7261 | new SettingsValidators.PackageNameListValidator(":"); |
| 7262 | |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7263 | /** |
| 7264 | * Defines whether managed profile ringtones should be synced from it's parent profile |
| 7265 | * <p> |
| 7266 | * 0 = ringtones are not synced |
| 7267 | * 1 = ringtones are synced from the profile's parent (default) |
| 7268 | * <p> |
| 7269 | * This value is only used for managed profiles. |
| 7270 | * @hide |
| 7271 | */ |
Robin Lee | c74d85f | 2017-03-16 17:19:42 +0000 | [diff] [blame] | 7272 | @TestApi |
| 7273 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7274 | public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; |
| 7275 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7276 | private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7277 | |
John Spurlock | cdb57ae | 2015-02-11 19:04:11 -0500 | [diff] [blame] | 7278 | /** @hide */ |
John Spurlock | f1a3664 | 2013-10-12 17:50:42 -0400 | [diff] [blame] | 7279 | public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; |
John Spurlock | d67ec25 | 2013-09-05 11:31:54 -0400 | [diff] [blame] | 7280 | |
Yorke Lee | 647f8f3 | 2013-05-07 10:49:44 -0700 | [diff] [blame] | 7281 | /** |
Svetoslav | f43e851 | 2013-09-30 17:33:05 -0700 | [diff] [blame] | 7282 | * This is the query URI for finding a print service to install. |
| 7283 | * |
| 7284 | * @hide |
| 7285 | */ |
| 7286 | public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; |
| 7287 | |
| 7288 | /** |
| 7289 | * This is the query URI for finding a NFC payment service to install. |
| 7290 | * |
| 7291 | * @hide |
| 7292 | */ |
| 7293 | public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; |
| 7294 | |
| 7295 | /** |
Philip P. Moltmann | a30d6e0 | 2017-04-27 15:40:02 -0700 | [diff] [blame] | 7296 | * This is the query URI for finding a auto fill service to install. |
| 7297 | * |
| 7298 | * @hide |
| 7299 | */ |
| 7300 | public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; |
| 7301 | |
| 7302 | /** |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7303 | * If enabled, apps should try to skip any introductory hints on first launch. This might |
Amith Yamasani | 0c41639 | 2014-06-13 15:54:39 -0700 | [diff] [blame] | 7304 | * apply to users that are already familiar with the environment or temporary users. |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7305 | * <p> |
| 7306 | * Type : int (0 to show hints, 1 to skip showing hints) |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7307 | */ |
| 7308 | public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; |
| 7309 | |
| 7310 | /** |
John Spurlock | aa5ee4d | 2014-07-25 13:05:12 -0400 | [diff] [blame] | 7311 | * Persisted playback time after a user confirmation of an unsafe volume level. |
| 7312 | * |
| 7313 | * @hide |
| 7314 | */ |
| 7315 | public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; |
| 7316 | |
| 7317 | /** |
Dan Sandler | 52e5701e | 2014-07-22 23:14:54 -0400 | [diff] [blame] | 7318 | * This preference enables notification display on the lockscreen. |
| 7319 | * @hide |
| 7320 | */ |
| 7321 | public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = |
| 7322 | "lock_screen_show_notifications"; |
| 7323 | |
| 7324 | /** |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7325 | * List of TV inputs that are currently hidden. This is a string |
Jaewan Kim | f0e530e | 2014-08-22 00:43:31 +0900 | [diff] [blame] | 7326 | * containing the IDs of all hidden TV inputs. Each ID is encoded by |
| 7327 | * {@link android.net.Uri#encode(String)} and separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7328 | * @hide |
| 7329 | */ |
| 7330 | public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; |
| 7331 | |
| 7332 | /** |
| 7333 | * List of custom TV input labels. This is a string containing <TV input id, custom name> |
Jaewan Kim | f0e530e | 2014-08-22 00:43:31 +0900 | [diff] [blame] | 7334 | * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} |
| 7335 | * and separated by ','. Each pair is separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7336 | * @hide |
| 7337 | */ |
| 7338 | public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; |
| 7339 | |
| 7340 | /** |
Glenn Kasten | 34cc4db | 2014-08-13 10:56:38 -0700 | [diff] [blame] | 7341 | * Whether automatic routing of system audio to USB audio peripheral is disabled. |
| 7342 | * The value is boolean (1 or 0), where 1 means automatic routing is disabled, |
| 7343 | * and 0 means automatic routing is enabled. |
| 7344 | * |
| 7345 | * @hide |
| 7346 | */ |
| 7347 | public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = |
| 7348 | "usb_audio_automatic_routing_disabled"; |
| 7349 | |
| 7350 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7351 | * The timeout in milliseconds before the device fully goes to sleep after |
| 7352 | * a period of inactivity. This value sets an upper bound on how long the device |
| 7353 | * will stay awake or dreaming without user activity. It should generally |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 7354 | * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7355 | * will sleep before it ever has a chance to dream. |
| 7356 | * <p> |
| 7357 | * Use -1 to disable this timeout. |
| 7358 | * </p> |
| 7359 | * |
| 7360 | * @hide |
| 7361 | */ |
| 7362 | public static final String SLEEP_TIMEOUT = "sleep_timeout"; |
| 7363 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7364 | private static final Validator SLEEP_TIMEOUT_VALIDATOR = |
| 7365 | new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE); |
| 7366 | |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7367 | /** |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7368 | * Controls whether double tap to wake is enabled. |
| 7369 | * @hide |
| 7370 | */ |
| 7371 | public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; |
| 7372 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7373 | private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7374 | |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7375 | /** |
Xiyuan Xia | e6de8b9 | 2015-06-06 22:18:05 -0700 | [diff] [blame] | 7376 | * The current assistant component. It could be a voice interaction service, |
| 7377 | * or an activity that handles ACTION_ASSIST, or empty which means using the default |
| 7378 | * handling. |
| 7379 | * |
| 7380 | * @hide |
| 7381 | */ |
| 7382 | public static final String ASSISTANT = "assistant"; |
| 7383 | |
| 7384 | /** |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7385 | * Whether the camera launch gesture should be disabled. |
| 7386 | * |
| 7387 | * @hide |
| 7388 | */ |
| 7389 | public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; |
| 7390 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7391 | private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7392 | |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7393 | /** |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7394 | * Whether the camera launch gesture to double tap the power button when the screen is off |
| 7395 | * should be disabled. |
| 7396 | * |
| 7397 | * @hide |
| 7398 | */ |
| 7399 | public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = |
| 7400 | "camera_double_tap_power_gesture_disabled"; |
| 7401 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7402 | private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR = |
| 7403 | BOOLEAN_VALIDATOR; |
| 7404 | |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7405 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7406 | * Whether the camera double twist gesture to flip between front and back mode should be |
| 7407 | * enabled. |
| 7408 | * |
| 7409 | * @hide |
| 7410 | */ |
| 7411 | public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = |
| 7412 | "camera_double_twist_to_flip_enabled"; |
| 7413 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7414 | private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR = |
| 7415 | BOOLEAN_VALIDATOR; |
| 7416 | |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7417 | /** |
Mehdi Alizadeh | 1264d88 | 2018-04-03 18:38:34 -0700 | [diff] [blame] | 7418 | * Whether the swipe up gesture to switch apps should be enabled. |
| 7419 | * |
| 7420 | * @hide |
| 7421 | */ |
| 7422 | public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED = |
| 7423 | "swipe_up_to_switch_apps_enabled"; |
| 7424 | |
| 7425 | private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR = |
| 7426 | BOOLEAN_VALIDATOR; |
| 7427 | |
| 7428 | /** |
Daniel Sheng | 45e0d34 | 2017-04-17 17:27:22 -0700 | [diff] [blame] | 7429 | * Whether or not the smart camera lift trigger that launches the camera when the user moves |
| 7430 | * the phone into a position for taking photos should be enabled. |
| 7431 | * |
| 7432 | * @hide |
| 7433 | */ |
| 7434 | public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; |
| 7435 | |
| 7436 | /** |
Daniel Sheng | 834e572 | 2017-05-30 09:28:52 -0700 | [diff] [blame] | 7437 | * The default enable state of the camera lift trigger. |
| 7438 | * |
| 7439 | * @hide |
| 7440 | */ |
| 7441 | public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; |
| 7442 | |
| 7443 | /** |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7444 | * Whether the assist gesture should be enabled. |
| 7445 | * |
| 7446 | * @hide |
| 7447 | */ |
| 7448 | public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; |
| 7449 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7450 | private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR = |
| 7451 | BOOLEAN_VALIDATOR; |
| 7452 | |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7453 | /** |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7454 | * Sensitivity control for the assist gesture. |
| 7455 | * |
| 7456 | * @hide |
| 7457 | */ |
| 7458 | public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; |
| 7459 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7460 | private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR = |
| 7461 | new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f); |
| 7462 | |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7463 | /** |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7464 | * Whether the assist gesture should silence alerts. |
| 7465 | * |
| 7466 | * @hide |
| 7467 | */ |
| 7468 | public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = |
| 7469 | "assist_gesture_silence_alerts_enabled"; |
| 7470 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7471 | private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR = |
| 7472 | BOOLEAN_VALIDATOR; |
| 7473 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7474 | /** |
| 7475 | * Whether the assist gesture should wake the phone. |
| 7476 | * |
| 7477 | * @hide |
| 7478 | */ |
| 7479 | public static final String ASSIST_GESTURE_WAKE_ENABLED = |
| 7480 | "assist_gesture_wake_enabled"; |
| 7481 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7482 | private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR = |
| 7483 | BOOLEAN_VALIDATOR; |
| 7484 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7485 | /** |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7486 | * Whether Assist Gesture Deferred Setup has been completed |
| 7487 | * |
| 7488 | * @hide |
| 7489 | */ |
| 7490 | public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; |
| 7491 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7492 | private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7493 | |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7494 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7495 | * Control whether Night display is currently activated. |
| 7496 | * @hide |
| 7497 | */ |
| 7498 | public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; |
| 7499 | |
| 7500 | /** |
| 7501 | * Control whether Night display will automatically activate/deactivate. |
| 7502 | * @hide |
| 7503 | */ |
| 7504 | public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; |
| 7505 | |
Christine Franks | eafb541 | 2018-02-06 11:09:39 -0800 | [diff] [blame] | 7506 | private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR = |
| 7507 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7508 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7509 | /** |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7510 | * Control the color temperature of Night Display, represented in Kelvin. |
| 7511 | * @hide |
| 7512 | */ |
| 7513 | public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = |
| 7514 | "night_display_color_temperature"; |
| 7515 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7516 | private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR = |
| 7517 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7518 | |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7519 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7520 | * Custom time when Night display is scheduled to activate. |
| 7521 | * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). |
| 7522 | * @hide |
| 7523 | */ |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7524 | public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = |
| 7525 | "night_display_custom_start_time"; |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7526 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7527 | private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR = |
| 7528 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7529 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7530 | /** |
| 7531 | * Custom time when Night display is scheduled to deactivate. |
| 7532 | * Represented as milliseconds from midnight (e.g. 21600000 == 6am). |
| 7533 | * @hide |
| 7534 | */ |
| 7535 | public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 7536 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7537 | private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR = |
| 7538 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7539 | |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 7540 | /** |
Christine Franks | 0321346 | 2017-08-25 13:57:26 -0700 | [diff] [blame] | 7541 | * A String representing the LocalDateTime when Night display was last activated. Use to |
| 7542 | * decide whether to apply the current activated state after a reboot or user change. In |
| 7543 | * legacy cases, this is represented by the time in milliseconds (since epoch). |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7544 | * @hide |
| 7545 | */ |
| 7546 | public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = |
| 7547 | "night_display_last_activated_time"; |
| 7548 | |
| 7549 | /** |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7550 | * Names of the service components that the current user has explicitly allowed to |
| 7551 | * be a VR mode listener, separated by ':'. |
| 7552 | * |
| 7553 | * @hide |
| 7554 | */ |
| 7555 | public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; |
| 7556 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7557 | private static final Validator ENABLED_VR_LISTENERS_VALIDATOR = |
| 7558 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7559 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7560 | /** |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7561 | * Behavior of the display while in VR mode. |
| 7562 | * |
| 7563 | * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. |
| 7564 | * |
| 7565 | * @hide |
| 7566 | */ |
| 7567 | public static final String VR_DISPLAY_MODE = "vr_display_mode"; |
| 7568 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7569 | private static final Validator VR_DISPLAY_MODE_VALIDATOR = |
| 7570 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"}); |
| 7571 | |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7572 | /** |
| 7573 | * Lower the display persistence while the system is in VR mode. |
| 7574 | * |
| 7575 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7576 | * |
| 7577 | * @hide. |
| 7578 | */ |
| 7579 | public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; |
| 7580 | |
| 7581 | /** |
| 7582 | * Do not alter the display persistence while the system is in VR mode. |
| 7583 | * |
| 7584 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7585 | * |
| 7586 | * @hide. |
| 7587 | */ |
| 7588 | public static final int VR_DISPLAY_MODE_OFF = 1; |
| 7589 | |
| 7590 | /** |
Jeff Davidson | 24b9d96 | 2016-07-21 12:35:10 -0700 | [diff] [blame] | 7591 | * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least |
| 7592 | * once. |
| 7593 | * |
| 7594 | * <p>This is used to ensure that we only take one pass which will disable apps that are not |
| 7595 | * privileged (if any). From then on, we only want to enable apps (when a matching SIM is |
| 7596 | * inserted), to avoid disabling an app that the user might actively be using. |
| 7597 | * |
| 7598 | * <p>Will be set to 1 once executed. |
| 7599 | * |
| 7600 | * @hide |
| 7601 | */ |
| 7602 | public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; |
| 7603 | |
| 7604 | /** |
Tony Mak | c820cc5 | 2016-05-03 18:58:28 +0100 | [diff] [blame] | 7605 | * Whether parent user can access remote contact in managed profile. |
| 7606 | * |
| 7607 | * @hide |
| 7608 | */ |
| 7609 | public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = |
| 7610 | "managed_profile_contact_remote_search"; |
| 7611 | |
| 7612 | /** |
Daniel Nishi | 395d387 | 2016-05-23 13:25:21 -0700 | [diff] [blame] | 7613 | * Whether or not the automatic storage manager is enabled and should run on the device. |
| 7614 | * |
| 7615 | * @hide |
| 7616 | */ |
| 7617 | public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = |
| 7618 | "automatic_storage_manager_enabled"; |
| 7619 | |
| 7620 | /** |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7621 | * How many days of information for the automatic storage manager to retain on the device. |
| 7622 | * |
| 7623 | * @hide |
| 7624 | */ |
| 7625 | public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = |
| 7626 | "automatic_storage_manager_days_to_retain"; |
| 7627 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7628 | private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR = |
| 7629 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7630 | |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7631 | /** |
| 7632 | * Default number of days of information for the automatic storage manager to retain. |
| 7633 | * |
| 7634 | * @hide |
| 7635 | */ |
| 7636 | public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; |
| 7637 | |
| 7638 | /** |
Daniel Nishi | f678cc9 | 2016-06-24 15:49:25 -0700 | [diff] [blame] | 7639 | * How many bytes the automatic storage manager has cleared out. |
| 7640 | * |
| 7641 | * @hide |
| 7642 | */ |
| 7643 | public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = |
| 7644 | "automatic_storage_manager_bytes_cleared"; |
| 7645 | |
| 7646 | |
| 7647 | /** |
| 7648 | * Last run time for the automatic storage manager. |
| 7649 | * |
| 7650 | * @hide |
| 7651 | */ |
| 7652 | public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = |
| 7653 | "automatic_storage_manager_last_run"; |
| 7654 | |
Jorge Gil | 6825a77 | 2016-06-30 11:07:18 -0700 | [diff] [blame] | 7655 | /** |
Daniel Nishi | da7332c | 2017-06-12 10:17:33 -0700 | [diff] [blame] | 7656 | * If the automatic storage manager has been disabled by policy. Note that this doesn't |
| 7657 | * mean that the automatic storage manager is prevented from being re-enabled -- this only |
| 7658 | * means that it was turned off by policy at least once. |
| 7659 | * |
| 7660 | * @hide |
| 7661 | */ |
| 7662 | public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = |
| 7663 | "automatic_storage_manager_turned_off_by_policy"; |
| 7664 | |
| 7665 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7666 | * Whether SystemUI navigation keys is enabled. |
| 7667 | * @hide |
| 7668 | */ |
| 7669 | public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = |
| 7670 | "system_navigation_keys_enabled"; |
| 7671 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7672 | private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7673 | |
Allison Babick | f0bc866 | 2016-07-11 15:39:16 -0700 | [diff] [blame] | 7674 | /** |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7675 | * Holds comma separated list of ordering of QS tiles. |
| 7676 | * @hide |
| 7677 | */ |
| 7678 | public static final String QS_TILES = "sysui_qs_tiles"; |
| 7679 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7680 | private static final Validator QS_TILES_VALIDATOR = new Validator() { |
| 7681 | @Override |
| 7682 | public boolean validate(String value) { |
| 7683 | if (value == null) { |
| 7684 | return false; |
| 7685 | } |
| 7686 | String[] tiles = value.split(","); |
| 7687 | boolean valid = true; |
| 7688 | for (String tile : tiles) { |
| 7689 | // tile can be any non-empty string as specified by OEM |
| 7690 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7691 | } |
| 7692 | return valid; |
| 7693 | } |
| 7694 | }; |
| 7695 | |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7696 | /** |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7697 | * Specifies whether the web action API is enabled. |
| 7698 | * |
| 7699 | * @hide |
| 7700 | */ |
Jesse Evans | fc1bfc4 | 2017-04-07 16:11:26 -0700 | [diff] [blame] | 7701 | @SystemApi |
| 7702 | public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7703 | |
| 7704 | /** |
Greg Plesur | 3514404 | 2016-10-10 16:23:49 -0400 | [diff] [blame] | 7705 | * Has this pairable device been paired or upgraded from a previously paired system. |
| 7706 | * @hide |
| 7707 | */ |
| 7708 | public static final String DEVICE_PAIRED = "device_paired"; |
| 7709 | |
| 7710 | /** |
Shahriyar Amini | 9343f57 | 2017-01-12 12:03:24 -0800 | [diff] [blame] | 7711 | * Integer state indicating whether package verifier is enabled. |
| 7712 | * TODO(b/34259924): Remove this setting. |
| 7713 | * |
| 7714 | * @hide |
| 7715 | */ |
| 7716 | public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; |
| 7717 | |
| 7718 | /** |
Jack Yu | 3902857 | 2017-02-23 09:49:25 -0800 | [diff] [blame] | 7719 | * Specifies additional package name for broadcasting the CMAS messages. |
| 7720 | * @hide |
| 7721 | */ |
| 7722 | public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; |
| 7723 | |
| 7724 | /** |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7725 | * Whether the launcher should show any notification badges. |
| 7726 | * The value is boolean (1 or 0). |
| 7727 | * @hide |
| 7728 | */ |
| 7729 | public static final String NOTIFICATION_BADGING = "notification_badging"; |
| 7730 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7731 | private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7732 | |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7733 | /** |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7734 | * Comma separated list of QS tiles that have been auto-added already. |
| 7735 | * @hide |
| 7736 | */ |
| 7737 | public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; |
| 7738 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7739 | private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() { |
| 7740 | @Override |
| 7741 | public boolean validate(String value) { |
| 7742 | if (value == null) { |
| 7743 | return false; |
| 7744 | } |
| 7745 | String[] tiles = value.split(","); |
| 7746 | boolean valid = true; |
| 7747 | for (String tile : tiles) { |
| 7748 | // tile can be any non-empty string as specified by OEM |
| 7749 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7750 | } |
| 7751 | return valid; |
| 7752 | } |
| 7753 | }; |
| 7754 | |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7755 | /** |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7756 | * Whether the Lockdown button should be shown in the power menu. |
| 7757 | * @hide |
| 7758 | */ |
| 7759 | public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7760 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7761 | private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7762 | |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7763 | /** |
| 7764 | * Backup manager behavioral parameters. |
| 7765 | * This is encoded as a key=value list, separated by commas. Ex: |
| 7766 | * |
| 7767 | * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" |
| 7768 | * |
| 7769 | * The following keys are supported: |
| 7770 | * |
| 7771 | * <pre> |
| 7772 | * key_value_backup_interval_milliseconds (long) |
| 7773 | * key_value_backup_fuzz_milliseconds (long) |
| 7774 | * key_value_backup_require_charging (boolean) |
| 7775 | * key_value_backup_required_network_type (int) |
| 7776 | * full_backup_interval_milliseconds (long) |
| 7777 | * full_backup_require_charging (boolean) |
| 7778 | * full_backup_required_network_type (int) |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7779 | * backup_finished_notification_receivers (String[]) |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7780 | * </pre> |
| 7781 | * |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7782 | * backup_finished_notification_receivers uses ":" as delimeter for values. |
| 7783 | * |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7784 | * <p> |
| 7785 | * Type: string |
| 7786 | * @hide |
| 7787 | */ |
| 7788 | public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; |
| 7789 | |
Bernardo Rufino | eaa78b9 | 2018-01-26 11:25:37 +0000 | [diff] [blame] | 7790 | |
| 7791 | /** |
| 7792 | * Local transport parameters so we can configure it for tests. |
| 7793 | * This is encoded as a key=value list, separated by commas. |
| 7794 | * |
| 7795 | * The following keys are supported: |
| 7796 | * |
| 7797 | * <pre> |
| 7798 | * fake_encryption_flag (boolean) |
| 7799 | * </pre> |
| 7800 | * |
| 7801 | * <p> |
| 7802 | * Type: string |
| 7803 | * @hide |
| 7804 | */ |
| 7805 | public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = |
| 7806 | "backup_local_transport_parameters"; |
| 7807 | |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7808 | /** |
Daniel Nishi | 79764127 | 2018-01-02 16:48:33 -0800 | [diff] [blame] | 7809 | * Flag to set if the system should predictively attempt to re-enable Bluetooth while |
| 7810 | * the user is driving. |
| 7811 | * @hide |
| 7812 | */ |
| 7813 | public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; |
| 7814 | |
| 7815 | /** |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 7816 | * What behavior should be invoked when the volume hush gesture is triggered |
| 7817 | * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. |
| 7818 | * |
| 7819 | * @hide |
| 7820 | */ |
| 7821 | public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; |
| 7822 | |
| 7823 | /** @hide */ public static final int VOLUME_HUSH_OFF = 0; |
| 7824 | /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1; |
| 7825 | /** @hide */ public static final int VOLUME_HUSH_MUTE = 2; |
| 7826 | |
| 7827 | private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR = |
| 7828 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7829 | |
| 7830 | /** |
Makoto Onuki | 16a0dd2 | 2018-03-20 10:40:37 -0700 | [diff] [blame] | 7831 | * The number of times (integer) the user has manually enabled battery saver. |
| 7832 | * @hide |
| 7833 | */ |
| 7834 | public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = |
| 7835 | "low_power_manual_activation_count"; |
| 7836 | |
| 7837 | /** |
| 7838 | * Whether the "first time battery saver warning" dialog needs to be shown (0: default) |
| 7839 | * or not (1). |
| 7840 | * |
| 7841 | * @hide |
| 7842 | */ |
| 7843 | public static final String LOW_POWER_WARNING_ACKNOWLEDGED = |
| 7844 | "low_power_warning_acknowledged"; |
| 7845 | |
| 7846 | /** |
Makoto Onuki | 52c6295 | 2018-03-22 10:43:03 -0700 | [diff] [blame] | 7847 | * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been |
| 7848 | * suppressed. |
| 7849 | * @hide |
| 7850 | */ |
| 7851 | public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = |
| 7852 | "suppress_auto_battery_saver_suggestion"; |
| 7853 | |
| 7854 | /** |
Artem Iglikov | 5b53875 | 2018-03-27 15:12:18 +0100 | [diff] [blame] | 7855 | * List of packages, which data need to be unconditionally cleared before full restore. |
| 7856 | * Type: string |
| 7857 | * @hide |
| 7858 | */ |
| 7859 | public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = |
| 7860 | "packages_to_clear_data_before_full_restore"; |
| 7861 | |
| 7862 | /** |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7863 | * This are the settings to be backed up. |
| 7864 | * |
| 7865 | * NOTE: Settings are backed up and restored in the order they appear |
| 7866 | * in this array. If you have one setting depending on another, |
| 7867 | * make sure that they are ordered appropriately. |
| 7868 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7869 | * @hide |
| 7870 | */ |
| 7871 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 7872 | BUGREPORT_IN_POWER_MENU, // moved to global |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 7873 | ALLOW_MOCK_LOCATION, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7874 | USB_MASS_STORAGE_ENABLED, // moved to global |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7875 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7876 | ACCESSIBILITY_DISPLAY_DALTONIZER, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7877 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7878 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 7879 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
Svetoslav Ganov | d8561a2 | 2017-04-25 15:26:03 -0700 | [diff] [blame] | 7880 | AUTOFILL_SERVICE, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7881 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7882 | ENABLED_ACCESSIBILITY_SERVICES, |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7883 | ENABLED_VR_LISTENERS, |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 7884 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
Svetoslav Ganov | a28a16d | 2011-07-28 11:24:21 -0700 | [diff] [blame] | 7885 | TOUCH_EXPLORATION_ENABLED, |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7886 | ACCESSIBILITY_ENABLED, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7887 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 7888 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7889 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 7890 | ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7891 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 7892 | ACCESSIBILITY_SPEAK_PASSWORD, |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 7893 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7894 | ACCESSIBILITY_CAPTIONING_PRESET, |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 7895 | ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7896 | ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7897 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7898 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7899 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7900 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7901 | ACCESSIBILITY_CAPTIONING_TYPEFACE, |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 7902 | ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7903 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7904 | TTS_DEFAULT_RATE, |
| 7905 | TTS_DEFAULT_PITCH, |
| 7906 | TTS_DEFAULT_SYNTH, |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 7907 | TTS_ENABLED_PLUGINS, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 7908 | TTS_DEFAULT_LOCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7909 | SHOW_IME_WITH_HARD_KEYBOARD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7910 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global |
| 7911 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global |
| 7912 | WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global |
Christopher Tate | 06cbadd | 2015-03-16 18:29:42 -0700 | [diff] [blame] | 7913 | SELECTED_SPELL_CHECKER, |
| 7914 | SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7915 | SPELL_CHECKER_ENABLED, |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 7916 | MOUNT_PLAY_NOTIFICATION_SND, |
| 7917 | MOUNT_UMS_AUTOSTART, |
| 7918 | MOUNT_UMS_PROMPT, |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7919 | MOUNT_UMS_NOTIFY_ENABLED, |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7920 | SLEEP_TIMEOUT, |
| 7921 | DOUBLE_TAP_TO_WAKE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7922 | WAKE_GESTURE_ENABLED, |
| 7923 | LONG_PRESS_TIMEOUT, |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7924 | CAMERA_GESTURE_DISABLED, |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 7925 | ACCESSIBILITY_AUTOCLICK_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7926 | ACCESSIBILITY_AUTOCLICK_DELAY, |
| 7927 | ACCESSIBILITY_LARGE_POINTER_ICON, |
| 7928 | PREFERRED_TTY_MODE, |
| 7929 | ENHANCED_VOICE_PRIVACY_ENABLED, |
| 7930 | TTY_MODE_ENABLED, |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 7931 | RTT_CALLING_MODE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7932 | INCALL_POWER_BUTTON_BEHAVIOR, |
| 7933 | NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 7934 | NIGHT_DISPLAY_CUSTOM_END_TIME, |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7935 | NIGHT_DISPLAY_COLOR_TEMPERATURE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7936 | NIGHT_DISPLAY_AUTO_MODE, |
Doris Ling | 5fafa3c | 2016-08-26 15:00:49 -0700 | [diff] [blame] | 7937 | SYNC_PARENT_SOUNDS, |
Doris Ling | 8a33273 | 2016-08-24 15:05:43 -0700 | [diff] [blame] | 7938 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
Mehdi Alizadeh | 1264d88 | 2018-04-03 18:38:34 -0700 | [diff] [blame] | 7939 | SWIPE_UP_TO_SWITCH_APPS_ENABLED, |
Doris Ling | 8a33273 | 2016-08-24 15:05:43 -0700 | [diff] [blame] | 7940 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7941 | SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 7942 | QS_TILES, |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7943 | DOZE_ENABLED, |
| 7944 | DOZE_PULSE_ON_PICK_UP, |
Ruchi Kandoi | 104e0b4 | 2016-12-29 13:31:43 -0800 | [diff] [blame] | 7945 | DOZE_PULSE_ON_DOUBLE_TAP, |
Daniel Nishi | eb70ad4 | 2017-01-27 10:51:35 -0800 | [diff] [blame] | 7946 | NFC_PAYMENT_DEFAULT_COMPONENT, |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7947 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
Santos Cordon | 5bce494 | 2017-02-27 11:50:18 -0800 | [diff] [blame] | 7948 | ASSIST_GESTURE_ENABLED, |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7949 | ASSIST_GESTURE_SENSITIVITY, |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7950 | ASSIST_GESTURE_SETUP_COMPLETE, |
| 7951 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 7952 | ASSIST_GESTURE_WAKE_ENABLED, |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7953 | VR_DISPLAY_MODE, |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7954 | NOTIFICATION_BADGING, |
| 7955 | QS_AUTO_ADDED_TILES, |
Jason Monk | df31eff | 2017-07-10 11:14:19 -0400 | [diff] [blame] | 7956 | SCREENSAVER_ENABLED, |
| 7957 | SCREENSAVER_COMPONENTS, |
| 7958 | SCREENSAVER_ACTIVATE_ON_DOCK, |
| 7959 | SCREENSAVER_ACTIVATE_ON_SLEEP, |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7960 | LOCKDOWN_IN_POWER_MENU, |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 7961 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 7962 | VOLUME_HUSH_GESTURE |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7963 | }; |
| 7964 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7965 | /** |
| 7966 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 7967 | * otherwise they won't be restored. |
| 7968 | * |
| 7969 | * @hide |
| 7970 | */ |
| 7971 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 7972 | static { |
| 7973 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 7974 | VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR); |
| 7975 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 7976 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7977 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR); |
| 7978 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, |
| 7979 | ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR); |
| 7980 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
| 7981 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR); |
| 7982 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
| 7983 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR); |
| 7984 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
| 7985 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR); |
| 7986 | VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); |
| 7987 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
| 7988 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR); |
| 7989 | VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, |
| 7990 | ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7991 | VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7992 | VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
| 7993 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7994 | VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR); |
| 7995 | VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR); |
| 7996 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
| 7997 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR); |
| 7998 | VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
| 7999 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR); |
| 8000 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
| 8001 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR); |
| 8002 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, |
| 8003 | ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR); |
| 8004 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
| 8005 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR); |
| 8006 | VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR); |
| 8007 | VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
| 8008 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR); |
| 8009 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, |
| 8010 | ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR); |
| 8011 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, |
| 8012 | ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR); |
| 8013 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, |
| 8014 | ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR); |
| 8015 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 8016 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR); |
| 8017 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 8018 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR); |
| 8019 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 8020 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR); |
| 8021 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 8022 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR); |
| 8023 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, |
| 8024 | ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR); |
| 8025 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
| 8026 | ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR); |
| 8027 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
| 8028 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR); |
| 8029 | VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR); |
| 8030 | VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR); |
| 8031 | VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR); |
| 8032 | VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR); |
| 8033 | VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR); |
| 8034 | VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR); |
| 8035 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 8036 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 8037 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, |
| 8038 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR); |
| 8039 | VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR); |
| 8040 | VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR); |
| 8041 | VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE, |
| 8042 | SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR); |
| 8043 | VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR); |
| 8044 | VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR); |
| 8045 | VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR); |
| 8046 | VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR); |
| 8047 | VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR); |
| 8048 | VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR); |
| 8049 | VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR); |
| 8050 | VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR); |
| 8051 | VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR); |
| 8052 | VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR); |
| 8053 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, |
| 8054 | ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR); |
| 8055 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR); |
| 8056 | VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, |
| 8057 | ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR); |
| 8058 | VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR); |
| 8059 | VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, |
| 8060 | ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR); |
| 8061 | VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR); |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 8062 | VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 8063 | VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR); |
| 8064 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 8065 | NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR); |
| 8066 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR); |
| 8067 | VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, |
| 8068 | NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR); |
| 8069 | VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR); |
| 8070 | VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR); |
| 8071 | VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 8072 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR); |
Mehdi Alizadeh | 1264d88 | 2018-04-03 18:38:34 -0700 | [diff] [blame] | 8073 | VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED, |
| 8074 | SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 8075 | VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
| 8076 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR); |
| 8077 | VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 8078 | SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR); |
| 8079 | VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR); |
| 8080 | VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR); |
| 8081 | VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR); |
| 8082 | VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR); |
| 8083 | VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR); |
| 8084 | VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
| 8085 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR); |
| 8086 | VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR); |
| 8087 | VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR); |
| 8088 | VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR); |
| 8089 | VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 8090 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR); |
| 8091 | VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR); |
| 8092 | VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR); |
| 8093 | VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR); |
| 8094 | VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR); |
| 8095 | VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR); |
| 8096 | VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR); |
| 8097 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR); |
| 8098 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR); |
| 8099 | VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR); |
| 8100 | VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
| 8101 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR); |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 8102 | VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 8103 | VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, |
| 8104 | ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting |
| 8105 | VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, |
| 8106 | ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting |
| 8107 | VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, |
| 8108 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting |
| 8109 | } |
| 8110 | |
| 8111 | /** |
| 8112 | * Keys we no longer back up under the current schema, but want to continue to |
| 8113 | * process when restoring historical backup datasets. |
| 8114 | * |
| 8115 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 8116 | * otherwise they won't be restored. |
| 8117 | * |
| 8118 | * @hide |
| 8119 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 8120 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 8121 | ENABLED_NOTIFICATION_LISTENERS, |
| 8122 | ENABLED_NOTIFICATION_ASSISTANT, |
| 8123 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 8124 | }; |
| 8125 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 8126 | /** |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8127 | * These entries are considered common between the personal and the managed profile, |
| 8128 | * since the managed profile doesn't get to change them. |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8129 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8130 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 8131 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8132 | static { |
| 8133 | CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); |
| 8134 | CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); |
| 8135 | CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); |
Felipe Leme | aa00896 | 2017-04-18 14:54:33 -0700 | [diff] [blame] | 8136 | CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8137 | CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); |
| 8138 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 8139 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 8140 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8141 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); |
| 8142 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8143 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); |
Yohei Yukawa | 3f8c568 | 2018-03-01 13:10:23 -0800 | [diff] [blame] | 8144 | if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) { |
| 8145 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER); |
| 8146 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE); |
| 8147 | } |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8148 | } |
| 8149 | |
| 8150 | /** @hide */ |
| 8151 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 8152 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 8153 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8154 | |
| 8155 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8156 | * Secure settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8157 | * @hide |
| 8158 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8159 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8160 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8161 | INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 8162 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); |
| 8163 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); |
Chad Brubaker | 9408d51 | 2017-03-28 16:11:38 -0700 | [diff] [blame] | 8164 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); |
| 8165 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); |
| 8166 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); |
| 8167 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); |
| 8168 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); |
| 8169 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); |
| 8170 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); |
| 8171 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); |
| 8172 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); |
Chad Brubaker | d9285b5 | 2017-04-27 15:28:57 -0700 | [diff] [blame] | 8173 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); |
| 8174 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); |
| 8175 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); |
| 8176 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); |
| 8177 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); |
| 8178 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8179 | |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8180 | INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); |
| 8181 | INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); |
Chad Brubaker | 1bed937 | 2017-03-20 10:52:52 -0700 | [diff] [blame] | 8182 | |
| 8183 | INSTANT_APP_SETTINGS.add(ANDROID_ID); |
Chad Brubaker | 8d7b36f | 2017-04-06 22:57:18 -0700 | [diff] [blame] | 8184 | |
| 8185 | INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 8186 | INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8187 | } |
| 8188 | |
| 8189 | /** |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8190 | * Helper method for determining if a location provider is enabled. |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 8191 | * |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8192 | * @param cr the content resolver to use |
| 8193 | * @param provider the location provider to query |
| 8194 | * @return true if the provider is enabled |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 8195 | * |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8196 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8197 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8198 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8199 | public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 8200 | return isLocationProviderEnabledForUser(cr, provider, cr.getUserId()); |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8201 | } |
| 8202 | |
| 8203 | /** |
| 8204 | * Helper method for determining if a location provider is enabled. |
| 8205 | * @param cr the content resolver to use |
| 8206 | * @param provider the location provider to query |
| 8207 | * @param userId the userId to query |
| 8208 | * @return true if the provider is enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8209 | * |
| 8210 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8211 | * @hide |
| 8212 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8213 | @Deprecated |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8214 | public static final boolean isLocationProviderEnabledForUser( |
| 8215 | ContentResolver cr, String provider, int userId) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8216 | String allowedProviders = Settings.Secure.getStringForUser(cr, |
| 8217 | LOCATION_PROVIDERS_ALLOWED, userId); |
Brad Fitzpatrick | 11fe181 | 2010-09-10 16:07:52 -0700 | [diff] [blame] | 8218 | return TextUtils.delimitedStringContains(allowedProviders, ',', provider); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8219 | } |
| 8220 | |
| 8221 | /** |
| 8222 | * Thread-safe method for enabling or disabling a single location provider. |
| 8223 | * @param cr the content resolver to use |
| 8224 | * @param provider the location provider to enable or disable |
| 8225 | * @param enabled true if the provider should be enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8226 | * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to |
| 8227 | * change location settings. |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8228 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8229 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8230 | public static final void setLocationProviderEnabled(ContentResolver cr, |
| 8231 | String provider, boolean enabled) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 8232 | setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId()); |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8233 | } |
| 8234 | |
| 8235 | /** |
| 8236 | * Thread-safe method for enabling or disabling a single location provider. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8237 | * |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8238 | * @param cr the content resolver to use |
| 8239 | * @param provider the location provider to enable or disable |
| 8240 | * @param enabled true if the provider should be enabled |
| 8241 | * @param userId the userId for which to enable/disable providers |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8242 | * @return true if the value was set, false on database errors |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8243 | * |
| 8244 | * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8245 | * @hide |
| 8246 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8247 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8248 | public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8249 | String provider, boolean enabled, int userId) { |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8250 | synchronized (mLocationSettingsLock) { |
| 8251 | // to ensure thread safety, we write the provider name with a '+' or '-' |
| 8252 | // and let the SettingsProvider handle it rather than reading and modifying |
| 8253 | // the list of enabled providers. |
| 8254 | if (enabled) { |
| 8255 | provider = "+" + provider; |
| 8256 | } else { |
| 8257 | provider = "-" + provider; |
| 8258 | } |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8259 | return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8260 | userId); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8261 | } |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8262 | } |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8263 | |
| 8264 | /** |
| 8265 | * Thread-safe method for setting the location mode to one of |
| 8266 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
| 8267 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8268 | * Necessary because the mode is a composite of the underlying location provider |
| 8269 | * settings. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8270 | * |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8271 | * @param cr the content resolver to use |
| 8272 | * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} |
| 8273 | * @param userId the userId for which to change mode |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8274 | * @return true if the value was set, false on database errors |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8275 | * |
| 8276 | * @throws IllegalArgumentException if mode is not one of the supported values |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8277 | * |
| 8278 | * @deprecated To enable/disable location, use |
| 8279 | * {@link LocationManager#setLocationEnabledForUser(boolean, int)}. |
| 8280 | * To enable/disable a specific location provider, use |
| 8281 | * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8282 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8283 | @Deprecated |
| 8284 | private static boolean setLocationModeForUser( |
| 8285 | ContentResolver cr, int mode, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8286 | synchronized (mLocationSettingsLock) { |
| 8287 | boolean gps = false; |
| 8288 | boolean network = false; |
| 8289 | switch (mode) { |
| 8290 | case LOCATION_MODE_OFF: |
| 8291 | break; |
| 8292 | case LOCATION_MODE_SENSORS_ONLY: |
| 8293 | gps = true; |
| 8294 | break; |
| 8295 | case LOCATION_MODE_BATTERY_SAVING: |
| 8296 | network = true; |
| 8297 | break; |
| 8298 | case LOCATION_MODE_HIGH_ACCURACY: |
| 8299 | gps = true; |
| 8300 | network = true; |
| 8301 | break; |
| 8302 | default: |
| 8303 | throw new IllegalArgumentException("Invalid location mode: " + mode); |
| 8304 | } |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8305 | |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8306 | boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8307 | cr, LocationManager.NETWORK_PROVIDER, network, userId); |
Tom O'Neill | 7731a99 | 2014-10-09 11:30:49 -0700 | [diff] [blame] | 8308 | boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
| 8309 | cr, LocationManager.GPS_PROVIDER, gps, userId); |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8310 | return gpsSuccess && nlpSuccess; |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8311 | } |
| 8312 | } |
| 8313 | |
| 8314 | /** |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8315 | * Thread-safe method for reading the location mode, returns one of |
| 8316 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8317 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary |
| 8318 | * because the mode is a composite of the underlying location provider settings. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8319 | * |
| 8320 | * @param cr the content resolver to use |
| 8321 | * @param userId the userId for which to read the mode |
| 8322 | * @return the location mode |
| 8323 | */ |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 8324 | private static final int getLocationModeForUser(ContentResolver cr, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8325 | synchronized (mLocationSettingsLock) { |
| 8326 | boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8327 | cr, LocationManager.GPS_PROVIDER, userId); |
| 8328 | boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8329 | cr, LocationManager.NETWORK_PROVIDER, userId); |
| 8330 | if (gpsEnabled && networkEnabled) { |
| 8331 | return LOCATION_MODE_HIGH_ACCURACY; |
| 8332 | } else if (gpsEnabled) { |
| 8333 | return LOCATION_MODE_SENSORS_ONLY; |
| 8334 | } else if (networkEnabled) { |
| 8335 | return LOCATION_MODE_BATTERY_SAVING; |
| 8336 | } else { |
| 8337 | return LOCATION_MODE_OFF; |
| 8338 | } |
| 8339 | } |
| 8340 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8341 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 8342 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8343 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8344 | * Global system settings, containing preferences that always apply identically |
| 8345 | * to all defined users. Applications can read these but are not allowed to write; |
| 8346 | * like the "Secure" settings, these are for preferences that the user must |
| 8347 | * explicitly modify through the system UI or specialized APIs for those values. |
| 8348 | */ |
| 8349 | public static final class Global extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 8350 | // NOTE: If you add new settings here, be sure to add them to |
| 8351 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. |
| 8352 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8353 | /** |
| 8354 | * The content:// style URL for global secure settings items. Not public. |
| 8355 | */ |
| 8356 | public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); |
| 8357 | |
| 8358 | /** |
Amith Yamasani | 23a0f05 | 2014-07-25 12:26:53 -0700 | [diff] [blame] | 8359 | * Whether users are allowed to add more users or guest from lockscreen. |
| 8360 | * <p> |
| 8361 | * Type: int |
| 8362 | * @hide |
| 8363 | */ |
| 8364 | public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; |
| 8365 | |
| 8366 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8367 | * Setting whether the global gesture for enabling accessibility is enabled. |
| 8368 | * If this gesture is enabled the user will be able to perfrom it to enable |
| 8369 | * the accessibility state without visiting the settings app. |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8370 | * |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8371 | * @hide |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8372 | * No longer used. Should be removed once all dependencies have been updated. |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8373 | */ |
| 8374 | public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = |
| 8375 | "enable_accessibility_global_gesture_enabled"; |
| 8376 | |
| 8377 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8378 | * Whether Airplane Mode is on. |
| 8379 | */ |
| 8380 | public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; |
| 8381 | |
| 8382 | /** |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8383 | * Whether Theater Mode is on. |
| 8384 | * {@hide} |
| 8385 | */ |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 8386 | @SystemApi |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8387 | public static final String THEATER_MODE_ON = "theater_mode_on"; |
| 8388 | |
| 8389 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8390 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. |
| 8391 | */ |
| 8392 | public static final String RADIO_BLUETOOTH = "bluetooth"; |
| 8393 | |
| 8394 | /** |
| 8395 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. |
| 8396 | */ |
| 8397 | public static final String RADIO_WIFI = "wifi"; |
| 8398 | |
| 8399 | /** |
| 8400 | * {@hide} |
| 8401 | */ |
| 8402 | public static final String RADIO_WIMAX = "wimax"; |
| 8403 | /** |
| 8404 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
| 8405 | */ |
| 8406 | public static final String RADIO_CELL = "cell"; |
| 8407 | |
| 8408 | /** |
| 8409 | * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. |
| 8410 | */ |
| 8411 | public static final String RADIO_NFC = "nfc"; |
| 8412 | |
| 8413 | /** |
| 8414 | * A comma separated list of radios that need to be disabled when airplane mode |
| 8415 | * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are |
| 8416 | * included in the comma separated list. |
| 8417 | */ |
| 8418 | public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; |
| 8419 | |
| 8420 | /** |
| 8421 | * A comma separated list of radios that should to be disabled when airplane mode |
| 8422 | * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is |
| 8423 | * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi |
| 8424 | * will be turned off when entering airplane mode, but the user will be able to reenable |
| 8425 | * Wifi in the Settings app. |
| 8426 | * |
| 8427 | * {@hide} |
| 8428 | */ |
| 8429 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; |
| 8430 | |
| 8431 | /** |
Pulkit Bhuwalka | 547853d | 2017-09-25 17:55:12 -0700 | [diff] [blame] | 8432 | * An integer representing the Bluetooth Class of Device (CoD). |
| 8433 | * |
| 8434 | * @hide |
| 8435 | */ |
| 8436 | public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; |
| 8437 | |
| 8438 | /** |
Bryce Lee | ec85f34 | 2015-12-16 13:32:28 -0800 | [diff] [blame] | 8439 | * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. |
| 8440 | * See {@link android.bluetooth.BluetoothProfile}. |
| 8441 | * {@hide} |
| 8442 | */ |
| 8443 | public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; |
| 8444 | |
| 8445 | /** |
Andre Eisenbach | 82a94d9 | 2016-01-14 14:20:34 -0800 | [diff] [blame] | 8446 | * A semi-colon separated list of Bluetooth interoperability workarounds. |
| 8447 | * Each entry is a partial Bluetooth device address string and an integer representing |
| 8448 | * the feature to be disabled, separated by a comma. The integer must correspond |
| 8449 | * to a interoperability feature as defined in "interop.h" in /system/bt. |
| 8450 | * <p> |
| 8451 | * Example: <br/> |
| 8452 | * "00:11:22,0;01:02:03:04,2" |
| 8453 | * @hide |
| 8454 | */ |
| 8455 | public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; |
| 8456 | |
| 8457 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8458 | * The policy for deciding when Wi-Fi should go to sleep (which will in |
| 8459 | * turn switch to using the mobile data as an Internet connection). |
| 8460 | * <p> |
| 8461 | * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, |
| 8462 | * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or |
| 8463 | * {@link #WIFI_SLEEP_POLICY_NEVER}. |
| 8464 | */ |
| 8465 | public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; |
| 8466 | |
| 8467 | /** |
| 8468 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep |
| 8469 | * policy, which is to sleep shortly after the turning off |
| 8470 | * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. |
| 8471 | */ |
| 8472 | public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; |
| 8473 | |
| 8474 | /** |
| 8475 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when |
| 8476 | * the device is on battery, and never go to sleep when the device is |
| 8477 | * plugged in. |
| 8478 | */ |
| 8479 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; |
| 8480 | |
| 8481 | /** |
| 8482 | * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. |
| 8483 | */ |
| 8484 | public static final int WIFI_SLEEP_POLICY_NEVER = 2; |
| 8485 | |
| 8486 | /** |
| 8487 | * Value to specify if the user prefers the date, time and time zone |
| 8488 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8489 | */ |
| 8490 | public static final String AUTO_TIME = "auto_time"; |
| 8491 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8492 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8493 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8494 | /** |
| 8495 | * Value to specify if the user prefers the time zone |
| 8496 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8497 | */ |
| 8498 | public static final String AUTO_TIME_ZONE = "auto_time_zone"; |
| 8499 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8500 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8501 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8502 | /** |
| 8503 | * URI for the car dock "in" event sound. |
| 8504 | * @hide |
| 8505 | */ |
| 8506 | public static final String CAR_DOCK_SOUND = "car_dock_sound"; |
| 8507 | |
| 8508 | /** |
| 8509 | * URI for the car dock "out" event sound. |
| 8510 | * @hide |
| 8511 | */ |
| 8512 | public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; |
| 8513 | |
| 8514 | /** |
| 8515 | * URI for the desk dock "in" event sound. |
| 8516 | * @hide |
| 8517 | */ |
| 8518 | public static final String DESK_DOCK_SOUND = "desk_dock_sound"; |
| 8519 | |
| 8520 | /** |
| 8521 | * URI for the desk dock "out" event sound. |
| 8522 | * @hide |
| 8523 | */ |
| 8524 | public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; |
| 8525 | |
| 8526 | /** |
| 8527 | * Whether to play a sound for dock events. |
| 8528 | * @hide |
| 8529 | */ |
| 8530 | public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; |
| 8531 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8532 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8533 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8534 | /** |
Vinod Krishnan | cf11cea | 2016-10-20 22:57:02 -0700 | [diff] [blame] | 8535 | * Whether to play a sound for dock events, only when an accessibility service is on. |
| 8536 | * @hide |
| 8537 | */ |
| 8538 | public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; |
| 8539 | |
| 8540 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8541 | * URI for the "device locked" (keyguard shown) sound. |
| 8542 | * @hide |
| 8543 | */ |
| 8544 | public static final String LOCK_SOUND = "lock_sound"; |
| 8545 | |
| 8546 | /** |
| 8547 | * URI for the "device unlocked" sound. |
| 8548 | * @hide |
| 8549 | */ |
| 8550 | public static final String UNLOCK_SOUND = "unlock_sound"; |
| 8551 | |
| 8552 | /** |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 8553 | * URI for the "device is trusted" sound, which is played when the device enters the trusted |
| 8554 | * state without unlocking. |
| 8555 | * @hide |
| 8556 | */ |
| 8557 | public static final String TRUSTED_SOUND = "trusted_sound"; |
| 8558 | |
| 8559 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8560 | * URI for the low battery sound file. |
| 8561 | * @hide |
| 8562 | */ |
| 8563 | public static final String LOW_BATTERY_SOUND = "low_battery_sound"; |
| 8564 | |
| 8565 | /** |
| 8566 | * Whether to play a sound for low-battery alerts. |
| 8567 | * @hide |
| 8568 | */ |
| 8569 | public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; |
| 8570 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8571 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8572 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8573 | /** |
Beverly | c1313eb | 2018-01-31 18:07:21 -0500 | [diff] [blame] | 8574 | * URI for the "wireless charging started" and "wired charging started" sound. |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 8575 | * @hide |
| 8576 | */ |
Beverly | c1313eb | 2018-01-31 18:07:21 -0500 | [diff] [blame] | 8577 | public static final String CHARGING_STARTED_SOUND = |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 8578 | "wireless_charging_started_sound"; |
| 8579 | |
| 8580 | /** |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8581 | * Whether to play a sound for charging events. |
| 8582 | * @hide |
| 8583 | */ |
| 8584 | public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; |
| 8585 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8586 | private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8587 | |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8588 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8589 | * Whether we keep the device on while the device is plugged in. |
| 8590 | * Supported values are: |
| 8591 | * <ul> |
| 8592 | * <li>{@code 0} to never stay on while plugged in</li> |
| 8593 | * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> |
| 8594 | * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> |
| 8595 | * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> |
| 8596 | * </ul> |
| 8597 | * These values can be OR-ed together. |
| 8598 | */ |
| 8599 | public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; |
| 8600 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8601 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 8602 | @Override |
| 8603 | public boolean validate(String value) { |
| 8604 | try { |
| 8605 | int val = Integer.parseInt(value); |
| 8606 | return (val == 0) |
| 8607 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 8608 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 8609 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 8610 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8611 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 8612 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8613 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8614 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 8615 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8616 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8617 | | BatteryManager.BATTERY_PLUGGED_USB |
| 8618 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 8619 | } catch (NumberFormatException e) { |
| 8620 | return false; |
| 8621 | } |
| 8622 | } |
| 8623 | }; |
| 8624 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8625 | /** |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8626 | * When the user has enable the option to have a "bug report" command |
| 8627 | * in the power menu. |
| 8628 | * @hide |
| 8629 | */ |
| 8630 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 8631 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8632 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8633 | |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8634 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8635 | * Whether ADB is enabled. |
| 8636 | */ |
| 8637 | public static final String ADB_ENABLED = "adb_enabled"; |
| 8638 | |
| 8639 | /** |
Jon Miranda | 836c0a8 | 2014-08-11 12:32:26 -0700 | [diff] [blame] | 8640 | * Whether Views are allowed to save their attribute data. |
| 8641 | * @hide |
| 8642 | */ |
| 8643 | public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; |
| 8644 | |
| 8645 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8646 | * Whether assisted GPS should be enabled or not. |
| 8647 | * @hide |
| 8648 | */ |
| 8649 | public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; |
| 8650 | |
| 8651 | /** |
| 8652 | * Whether bluetooth is enabled/disabled |
| 8653 | * 0=disabled. 1=enabled. |
| 8654 | */ |
| 8655 | public static final String BLUETOOTH_ON = "bluetooth_on"; |
| 8656 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8657 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8658 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8659 | /** |
| 8660 | * CDMA Cell Broadcast SMS |
| 8661 | * 0 = CDMA Cell Broadcast SMS disabled |
| 8662 | * 1 = CDMA Cell Broadcast SMS enabled |
| 8663 | * @hide |
| 8664 | */ |
| 8665 | public static final String CDMA_CELL_BROADCAST_SMS = |
| 8666 | "cdma_cell_broadcast_sms"; |
| 8667 | |
| 8668 | /** |
| 8669 | * The CDMA roaming mode 0 = Home Networks, CDMA default |
| 8670 | * 1 = Roaming on Affiliated networks |
| 8671 | * 2 = Roaming on any networks |
| 8672 | * @hide |
| 8673 | */ |
| 8674 | public static final String CDMA_ROAMING_MODE = "roaming_settings"; |
| 8675 | |
| 8676 | /** |
| 8677 | * The CDMA subscription mode 0 = RUIM/SIM (default) |
| 8678 | * 1 = NV |
| 8679 | * @hide |
| 8680 | */ |
| 8681 | public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; |
| 8682 | |
Narayan Kamath | 94bcdbc | 2017-07-17 15:32:53 +0100 | [diff] [blame] | 8683 | /** |
| 8684 | * The default value for whether background data is enabled or not. |
| 8685 | * |
| 8686 | * Used by {@code NetworkPolicyManagerService}. |
| 8687 | * |
| 8688 | * @hide |
| 8689 | */ |
| 8690 | public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = |
| 8691 | "default_restrict_background_data"; |
| 8692 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8693 | /** Inactivity timeout to track mobile data activity. |
| 8694 | * |
| 8695 | * If set to a positive integer, it indicates the inactivity timeout value in seconds to |
| 8696 | * infer the data activity of mobile network. After a period of no activity on mobile |
| 8697 | * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} |
| 8698 | * intent is fired to indicate a transition of network status from "active" to "idle". Any |
| 8699 | * subsequent activity on mobile networks triggers the firing of {@code |
| 8700 | * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". |
| 8701 | * |
| 8702 | * Network activity refers to transmitting or receiving data on the network interfaces. |
| 8703 | * |
| 8704 | * Tracking is disabled if set to zero or negative value. |
| 8705 | * |
| 8706 | * @hide |
| 8707 | */ |
| 8708 | public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; |
| 8709 | |
| 8710 | /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} |
| 8711 | * but for Wifi network. |
| 8712 | * @hide |
| 8713 | */ |
| 8714 | public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; |
| 8715 | |
| 8716 | /** |
| 8717 | * Whether or not data roaming is enabled. (0 = false, 1 = true) |
| 8718 | */ |
| 8719 | public static final String DATA_ROAMING = "data_roaming"; |
| 8720 | |
| 8721 | /** |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 8722 | * The value passed to a Mobile DataConnection via bringUp which defines the |
| 8723 | * number of retries to preform when setting up the initial connection. The default |
| 8724 | * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. |
| 8725 | * @hide |
| 8726 | */ |
| 8727 | public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; |
| 8728 | |
| 8729 | /** |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8730 | * Whether any package can be on external storage. When this is true, any |
| 8731 | * package, regardless of manifest values, is a candidate for installing |
| 8732 | * or moving onto external storage. (0 = false, 1 = true) |
| 8733 | * @hide |
| 8734 | */ |
| 8735 | public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; |
| 8736 | |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8737 | /** |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8738 | * The default SM-DP+ configured for this device. |
| 8739 | * |
| 8740 | * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to |
| 8741 | * download profiles. If this value is set, the LPA will query this server for any profiles |
| 8742 | * available to this device. If any are available, they may be downloaded during device |
| 8743 | * provisioning or in settings without needing the user to enter an activation code. |
| 8744 | * |
| 8745 | * @see android.service.euicc.EuiccService |
| 8746 | * @hide |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8747 | */ |
Holly Jiuyu Sun | 4f73b9c | 2017-12-12 20:17:09 -0800 | [diff] [blame] | 8748 | @SystemApi |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8749 | public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; |
| 8750 | |
| 8751 | /** |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 8752 | * Whether any profile has ever been downloaded onto a eUICC on the device. |
| 8753 | * |
| 8754 | * <p>Used to hide eUICC UI from users who have never made use of it and would only be |
| 8755 | * confused by seeing references to it in settings. |
| 8756 | * (0 = false, 1 = true) |
| 8757 | * @hide |
| 8758 | */ |
Holly Jiuyu Sun | b85013a | 2018-02-21 20:34:22 -0800 | [diff] [blame] | 8759 | @SystemApi |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 8760 | public static final String EUICC_PROVISIONED = "euicc_provisioned"; |
| 8761 | |
| 8762 | /** |
Qingxi Li | ead1271 | 2018-04-11 15:14:56 -0700 | [diff] [blame] | 8763 | * List of ISO country codes in which eUICC UI is shown. Country codes should be separated |
| 8764 | * by comma. |
| 8765 | * |
| 8766 | * <p>Used to hide eUICC UI from users who are currently in countries no carriers support |
| 8767 | * eUICC. |
| 8768 | * @hide |
| 8769 | */ |
| 8770 | //TODO(b/77914569) Changes this to System Api. |
| 8771 | public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries"; |
| 8772 | |
| 8773 | /** |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8774 | * Whether any activity can be resized. When this is true, any |
| 8775 | * activity, regardless of manifest values, can be resized for multi-window. |
| 8776 | * (0 = false, 1 = true) |
| 8777 | * @hide |
| 8778 | */ |
| 8779 | public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES |
| 8780 | = "force_resizable_activities"; |
| 8781 | |
Jorim Jaggi | 6f2efd3 | 2015-12-23 12:04:39 +0100 | [diff] [blame] | 8782 | /** |
| 8783 | * Whether to enable experimental freeform support for windows. |
| 8784 | * @hide |
| 8785 | */ |
| 8786 | public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT |
| 8787 | = "enable_freeform_support"; |
| 8788 | |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8789 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8790 | * Whether user has enabled development settings. |
| 8791 | */ |
| 8792 | public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; |
| 8793 | |
| 8794 | /** |
Amith Yamasani | cb15d66 | 2015-11-10 11:11:15 -0800 | [diff] [blame] | 8795 | * Whether the device has been provisioned (0 = false, 1 = true). |
| 8796 | * <p>On a multiuser device with a separate system user, the screen may be locked |
| 8797 | * as soon as this is set to true and further activities cannot be launched on the |
| 8798 | * system user unless they are marked to show over keyguard. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8799 | */ |
| 8800 | public static final String DEVICE_PROVISIONED = "device_provisioned"; |
| 8801 | |
| 8802 | /** |
Robert Greenwalt | beb482c | 2016-03-28 15:40:56 -0700 | [diff] [blame] | 8803 | * Whether mobile data should be allowed while the device is being provisioned. |
| 8804 | * This allows the provisioning process to turn off mobile data before the user |
| 8805 | * has an opportunity to set things up, preventing other processes from burning |
| 8806 | * precious bytes before wifi is setup. |
| 8807 | * (0 = false, 1 = true) |
| 8808 | * @hide |
| 8809 | */ |
| 8810 | public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = |
| 8811 | "device_provisioning_mobile_data"; |
| 8812 | |
| 8813 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8814 | * The saved value for WindowManagerService.setForcedDisplaySize(). |
| 8815 | * Two integers separated by a comma. If unset, then use the real display size. |
| 8816 | * @hide |
| 8817 | */ |
| 8818 | public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; |
| 8819 | |
| 8820 | /** |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 8821 | * The saved value for WindowManagerService.setForcedDisplayScalingMode(). |
| 8822 | * 0 or unset if scaling is automatic, 1 if scaling is disabled. |
| 8823 | * @hide |
| 8824 | */ |
| 8825 | public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; |
| 8826 | |
| 8827 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8828 | * The maximum size, in bytes, of a download that the download manager will transfer over |
| 8829 | * a non-wifi connection. |
| 8830 | * @hide |
| 8831 | */ |
| 8832 | public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = |
| 8833 | "download_manager_max_bytes_over_mobile"; |
| 8834 | |
| 8835 | /** |
| 8836 | * The recommended maximum size, in bytes, of a download that the download manager should |
| 8837 | * transfer over a non-wifi connection. Over this size, the use will be warned, but will |
| 8838 | * have the option to start the download over the mobile connection anyway. |
| 8839 | * @hide |
| 8840 | */ |
| 8841 | public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = |
| 8842 | "download_manager_recommended_max_bytes_over_mobile"; |
| 8843 | |
| 8844 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8845 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8846 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8847 | @Deprecated |
| 8848 | public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8849 | |
| 8850 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8851 | * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be |
| 8852 | * sent or processed. (0 = false, 1 = true) |
| 8853 | * @hide |
| 8854 | */ |
| 8855 | public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; |
| 8856 | |
| 8857 | /** |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8858 | * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on |
| 8859 | * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will |
| 8860 | * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be |
| 8861 | * activated. |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8862 | * @hide |
| 8863 | */ |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8864 | public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = |
| 8865 | "hdmi_system_audio_control_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8866 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8867 | /** |
| 8868 | * Whether TV will automatically turn on upon reception of the CEC command |
| 8869 | * <Text View On> or <Image View On>. (0 = false, 1 = true) |
| 8870 | * |
| 8871 | * @hide |
| 8872 | */ |
| 8873 | public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = |
| 8874 | "hdmi_control_auto_wakeup_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8875 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8876 | /** |
| 8877 | * Whether TV will also turn off other CEC devices when it goes to standby mode. |
| 8878 | * (0 = false, 1 = true) |
| 8879 | * |
| 8880 | * @hide |
| 8881 | */ |
| 8882 | public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = |
| 8883 | "hdmi_control_auto_device_off_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8884 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8885 | /** |
| 8886 | * If <b>true</b>, enables out-of-the-box execution for priv apps. |
| 8887 | * Default: false |
| 8888 | * Values: 0 = false, 1 = true |
| 8889 | * |
| 8890 | * @hide |
| 8891 | */ |
| 8892 | public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled"; |
| 8893 | |
| 8894 | /** |
| 8895 | * The interval in milliseconds at which location requests will be throttled when they are |
| 8896 | * coming from the background. |
| 8897 | * |
| 8898 | * @hide |
| 8899 | */ |
| 8900 | public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = |
Soonil Nagarkar | 7decfb6 | 2017-01-18 12:18:49 -0800 | [diff] [blame] | 8901 | "location_background_throttle_interval_ms"; |
| 8902 | |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8903 | /** |
Lifu Tang | c94ef4d | 2017-03-23 23:48:00 -0700 | [diff] [blame] | 8904 | * Most frequent location update interval in milliseconds that proximity alert is allowed |
| 8905 | * to request. |
| 8906 | * @hide |
| 8907 | */ |
| 8908 | public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = |
| 8909 | "location_background_throttle_proximity_alert_interval_ms"; |
| 8910 | |
| 8911 | /** |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8912 | * Packages that are whitelisted for background throttling (throttling will not be applied). |
| 8913 | * @hide |
| 8914 | */ |
| 8915 | public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8916 | "location_background_throttle_package_whitelist"; |
| 8917 | |
Wei Wang | cdbffa9 | 2017-04-17 19:49:29 -0700 | [diff] [blame] | 8918 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8919 | * Whether TV will switch to MHL port when a mobile device is plugged in. |
| 8920 | * (0 = false, 1 = true) |
| 8921 | * @hide |
| 8922 | */ |
| 8923 | public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; |
| 8924 | |
| 8925 | /** |
| 8926 | * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) |
| 8927 | * @hide |
| 8928 | */ |
| 8929 | public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; |
| 8930 | |
| 8931 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8932 | * Whether mobile data connections are allowed by the user. See |
| 8933 | * ConnectivityManager for more info. |
| 8934 | * @hide |
| 8935 | */ |
| 8936 | public static final String MOBILE_DATA = "mobile_data"; |
| 8937 | |
Erik Kline | da4bfa8 | 2015-04-30 12:58:40 +0900 | [diff] [blame] | 8938 | /** |
| 8939 | * Whether the mobile data connection should remain active even when higher |
| 8940 | * priority networks like WiFi are active, to help make network switching faster. |
| 8941 | * |
| 8942 | * See ConnectivityService for more info. |
| 8943 | * |
| 8944 | * (0 = disabled, 1 = enabled) |
| 8945 | * @hide |
| 8946 | */ |
| 8947 | public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; |
| 8948 | |
Hugo Benichi | 05686db | 2016-10-19 11:17:28 +0900 | [diff] [blame] | 8949 | /** |
| 8950 | * Size of the event buffer for IP connectivity metrics. |
| 8951 | * @hide |
| 8952 | */ |
| 8953 | public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = |
| 8954 | "connectivity_metrics_buffer_size"; |
| 8955 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8956 | /** {@hide} */ |
| 8957 | public static final String NETSTATS_ENABLED = "netstats_enabled"; |
| 8958 | /** {@hide} */ |
| 8959 | public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; |
| 8960 | /** {@hide} */ |
Jeff Sharkey | 9911a28 | 2018-02-14 22:29:11 -0700 | [diff] [blame] | 8961 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8962 | public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; |
| 8963 | /** {@hide} */ |
| 8964 | public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; |
| 8965 | /** {@hide} */ |
| 8966 | public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; |
Jeff Sharkey | f4de294 | 2017-08-29 15:32:13 -0600 | [diff] [blame] | 8967 | /** {@hide} */ |
| 8968 | public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8969 | |
| 8970 | /** {@hide} */ |
| 8971 | public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; |
| 8972 | /** {@hide} */ |
| 8973 | public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; |
| 8974 | /** {@hide} */ |
| 8975 | public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; |
| 8976 | /** {@hide} */ |
| 8977 | public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; |
| 8978 | |
| 8979 | /** {@hide} */ |
| 8980 | public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; |
| 8981 | /** {@hide} */ |
| 8982 | public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; |
| 8983 | /** {@hide} */ |
| 8984 | public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; |
| 8985 | /** {@hide} */ |
| 8986 | public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; |
| 8987 | |
| 8988 | /** {@hide} */ |
| 8989 | public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; |
| 8990 | /** {@hide} */ |
| 8991 | public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; |
| 8992 | /** {@hide} */ |
| 8993 | public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; |
| 8994 | /** {@hide} */ |
| 8995 | public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; |
| 8996 | |
Jeff Sharkey | 36b414b | 2018-03-30 11:00:03 -0600 | [diff] [blame] | 8997 | /** {@hide} */ |
| 8998 | public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled"; |
| 8999 | /** {@hide} */ |
| 9000 | public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited"; |
| 9001 | /** {@hide} */ |
| 9002 | public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited"; |
| 9003 | /** {@hide} */ |
| 9004 | public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs"; |
| 9005 | /** {@hide} */ |
| 9006 | public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath"; |
| 9007 | |
| 9008 | /** {@hide} */ |
| 9009 | public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled"; |
| 9010 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9011 | /** |
| 9012 | * User preference for which network(s) should be used. Only the |
| 9013 | * connectivity service should touch this. |
| 9014 | */ |
| 9015 | public static final String NETWORK_PREFERENCE = "network_preference"; |
| 9016 | |
| 9017 | /** |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 9018 | * Which package name to use for network scoring. If null, or if the package is not a valid |
| 9019 | * scorer app, external network scores will neither be requested nor accepted. |
| 9020 | * @hide |
| 9021 | */ |
| 9022 | public static final String NETWORK_SCORER_APP = "network_scorer_app"; |
| 9023 | |
Christine Franks | 8ad6f6d | 2017-12-13 18:40:43 -0800 | [diff] [blame] | 9024 | /** |
| 9025 | * Whether night display forced auto mode is available. |
| 9026 | * 0 = unavailable, 1 = available. |
| 9027 | * @hide |
| 9028 | */ |
| 9029 | public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = |
| 9030 | "night_display_forced_auto_mode_available"; |
| 9031 | |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 9032 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9033 | * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment |
| 9034 | * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been |
| 9035 | * exceeded. |
| 9036 | * @hide |
| 9037 | */ |
| 9038 | public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; |
| 9039 | |
| 9040 | /** |
| 9041 | * The length of time in milli-seconds that automatic small adjustments to |
| 9042 | * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. |
| 9043 | * @hide |
| 9044 | */ |
| 9045 | public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; |
| 9046 | |
| 9047 | /** Preferred NTP server. {@hide} */ |
| 9048 | public static final String NTP_SERVER = "ntp_server"; |
| 9049 | /** Timeout in milliseconds to wait for NTP server. {@hide} */ |
| 9050 | public static final String NTP_TIMEOUT = "ntp_timeout"; |
| 9051 | |
Jeff Sharkey | e8a4b66 | 2015-06-27 15:43:45 -0700 | [diff] [blame] | 9052 | /** {@hide} */ |
| 9053 | public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; |
| 9054 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9055 | /** |
Pierre Imai | 8e48e67 | 2016-04-21 13:30:43 +0900 | [diff] [blame] | 9056 | * Sample validity in seconds to configure for the system DNS resolver. |
| 9057 | * {@hide} |
| 9058 | */ |
| 9059 | public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = |
| 9060 | "dns_resolver_sample_validity_seconds"; |
| 9061 | |
| 9062 | /** |
| 9063 | * Success threshold in percent for use with the system DNS resolver. |
| 9064 | * {@hide} |
| 9065 | */ |
| 9066 | public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = |
| 9067 | "dns_resolver_success_threshold_percent"; |
| 9068 | |
| 9069 | /** |
| 9070 | * Minimum number of samples needed for statistics to be considered meaningful in the |
| 9071 | * system DNS resolver. |
| 9072 | * {@hide} |
| 9073 | */ |
| 9074 | public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; |
| 9075 | |
| 9076 | /** |
| 9077 | * Maximum number taken into account for statistics purposes in the system DNS resolver. |
| 9078 | * {@hide} |
| 9079 | */ |
| 9080 | public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; |
| 9081 | |
| 9082 | /** |
Tao Bao | fdf7c5d | 2016-02-15 20:59:15 -0800 | [diff] [blame] | 9083 | * Whether to disable the automatic scheduling of system updates. |
| 9084 | * 1 = system updates won't be automatically scheduled (will always |
| 9085 | * present notification instead). |
| 9086 | * 0 = system updates will be automatically scheduled. (default) |
| 9087 | * @hide |
| 9088 | */ |
| 9089 | @SystemApi |
| 9090 | public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; |
| 9091 | |
| 9092 | /** |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9093 | * Whether the package manager should send package verification broadcasts for verifiers to |
| 9094 | * review apps prior to installation. |
| 9095 | * 1 = request apps to be verified prior to installation, if a verifier exists. |
| 9096 | * 0 = do not verify apps before installation |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9097 | * @hide |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9098 | */ |
| 9099 | public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; |
| 9100 | |
| 9101 | /** Timeout for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9102 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9103 | public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; |
| 9104 | |
| 9105 | /** Default response code for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9106 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9107 | public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; |
| 9108 | |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9109 | /** |
| 9110 | * Show package verification setting in the Settings app. |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 9111 | * 1 = show (default) |
| 9112 | * 0 = hide |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9113 | * @hide |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 9114 | */ |
| 9115 | public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; |
| 9116 | |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9117 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 9118 | * Run package verification on apps installed through ADB/ADT/USB |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9119 | * 1 = perform package verification on ADB installs (default) |
| 9120 | * 0 = bypass package verification on ADB installs |
| 9121 | * @hide |
| 9122 | */ |
| 9123 | public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; |
| 9124 | |
| 9125 | /** |
Christopher Tate | 7265abe | 2014-11-21 13:54:45 -0800 | [diff] [blame] | 9126 | * Time since last fstrim (milliseconds) after which we force one to happen |
| 9127 | * during device startup. If unset, the default is 3 days. |
| 9128 | * @hide |
| 9129 | */ |
| 9130 | public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; |
| 9131 | |
| 9132 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9133 | * The interval in milliseconds at which to check packet counts on the |
| 9134 | * mobile data interface when screen is on, to detect possible data |
| 9135 | * connection problems. |
| 9136 | * @hide |
| 9137 | */ |
| 9138 | public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = |
| 9139 | "pdp_watchdog_poll_interval_ms"; |
| 9140 | |
| 9141 | /** |
| 9142 | * The interval in milliseconds at which to check packet counts on the |
| 9143 | * mobile data interface when screen is off, to detect possible data |
| 9144 | * connection problems. |
| 9145 | * @hide |
| 9146 | */ |
| 9147 | public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = |
| 9148 | "pdp_watchdog_long_poll_interval_ms"; |
| 9149 | |
| 9150 | /** |
| 9151 | * The interval in milliseconds at which to check packet counts on the |
| 9152 | * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} |
| 9153 | * outgoing packets has been reached without incoming packets. |
| 9154 | * @hide |
| 9155 | */ |
| 9156 | public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = |
| 9157 | "pdp_watchdog_error_poll_interval_ms"; |
| 9158 | |
| 9159 | /** |
| 9160 | * The number of outgoing packets sent without seeing an incoming packet |
| 9161 | * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} |
| 9162 | * device is logged to the event log |
| 9163 | * @hide |
| 9164 | */ |
| 9165 | public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = |
| 9166 | "pdp_watchdog_trigger_packet_count"; |
| 9167 | |
| 9168 | /** |
| 9169 | * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) |
| 9170 | * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before |
| 9171 | * attempting data connection recovery. |
| 9172 | * @hide |
| 9173 | */ |
| 9174 | public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = |
| 9175 | "pdp_watchdog_error_poll_count"; |
| 9176 | |
| 9177 | /** |
| 9178 | * The number of failed PDP reset attempts before moving to something more |
| 9179 | * drastic: re-registering to the network. |
| 9180 | * @hide |
| 9181 | */ |
| 9182 | public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = |
| 9183 | "pdp_watchdog_max_pdp_reset_fail_count"; |
| 9184 | |
| 9185 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9186 | * URL to open browser on to allow user to manage a prepay account |
| 9187 | * @hide |
| 9188 | */ |
| 9189 | public static final String SETUP_PREPAID_DATA_SERVICE_URL = |
| 9190 | "setup_prepaid_data_service_url"; |
| 9191 | |
| 9192 | /** |
| 9193 | * URL to attempt a GET on to see if this is a prepay device |
| 9194 | * @hide |
| 9195 | */ |
| 9196 | public static final String SETUP_PREPAID_DETECTION_TARGET_URL = |
| 9197 | "setup_prepaid_detection_target_url"; |
| 9198 | |
| 9199 | /** |
| 9200 | * Host to check for a redirect to after an attempt to GET |
| 9201 | * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, |
| 9202 | * this is a prepaid device with zero balance.) |
| 9203 | * @hide |
| 9204 | */ |
| 9205 | public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = |
| 9206 | "setup_prepaid_detection_redir_host"; |
| 9207 | |
| 9208 | /** |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 9209 | * The interval in milliseconds at which to check the number of SMS sent out without asking |
| 9210 | * for use permit, to limit the un-authorized SMS usage. |
| 9211 | * |
| 9212 | * @hide |
| 9213 | */ |
| 9214 | public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = |
| 9215 | "sms_outgoing_check_interval_ms"; |
| 9216 | |
| 9217 | /** |
| 9218 | * The number of outgoing SMS sent without asking for user permit (of {@link |
| 9219 | * #SMS_OUTGOING_CHECK_INTERVAL_MS} |
| 9220 | * |
| 9221 | * @hide |
| 9222 | */ |
| 9223 | public static final String SMS_OUTGOING_CHECK_MAX_COUNT = |
| 9224 | "sms_outgoing_check_max_count"; |
| 9225 | |
| 9226 | /** |
| 9227 | * Used to disable SMS short code confirmation - defaults to true. |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 9228 | * True indcates we will do the check, etc. Set to false to disable. |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 9229 | * @see com.android.internal.telephony.SmsUsageMonitor |
| 9230 | * @hide |
| 9231 | */ |
| 9232 | public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; |
| 9233 | |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 9234 | /** |
| 9235 | * Used to select which country we use to determine premium sms codes. |
| 9236 | * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, |
| 9237 | * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, |
| 9238 | * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. |
| 9239 | * @hide |
| 9240 | */ |
| 9241 | public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; |
| 9242 | |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 9243 | /** |
JP Abgrall | 32d1ac4d | 2014-02-21 12:05:20 -0800 | [diff] [blame] | 9244 | * Used to select TCP's default initial receiver window size in segments - defaults to a build config value |
| 9245 | * @hide |
| 9246 | */ |
| 9247 | public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; |
| 9248 | |
| 9249 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9250 | * Used to disable Tethering on a device - defaults to true |
| 9251 | * @hide |
| 9252 | */ |
| 9253 | public static final String TETHER_SUPPORTED = "tether_supported"; |
| 9254 | |
| 9255 | /** |
| 9256 | * Used to require DUN APN on the device or not - defaults to a build config value |
| 9257 | * which defaults to false |
| 9258 | * @hide |
| 9259 | */ |
| 9260 | public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; |
| 9261 | |
| 9262 | /** |
| 9263 | * Used to hold a gservices-provisioned apn value for DUN. If set, or the |
| 9264 | * corresponding build config values are set it will override the APN DB |
| 9265 | * values. |
| 9266 | * Consists of a comma seperated list of strings: |
| 9267 | * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" |
| 9268 | * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" |
| 9269 | * @hide |
| 9270 | */ |
| 9271 | public static final String TETHER_DUN_APN = "tether_dun_apn"; |
| 9272 | |
Erik Kline | 92c4db0 | 2017-05-31 10:21:32 +0900 | [diff] [blame] | 9273 | /** |
| 9274 | * Used to disable trying to talk to any available tethering offload HAL. |
| 9275 | * |
| 9276 | * Integer values are interpreted as boolean, and the absence of an explicit setting |
| 9277 | * is interpreted as |false|. |
| 9278 | * @hide |
| 9279 | */ |
| 9280 | public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; |
| 9281 | |
goneil | 6db18a9b | 2018-01-10 16:23:11 -0800 | [diff] [blame] | 9282 | /** |
| 9283 | * List of certificate (hex string representation of the application's certificate - SHA-1 |
| 9284 | * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for |
| 9285 | * install when a sim card with matching UICC carrier privilege rules is inserted. The |
| 9286 | * certificate is used as a key, so the certificate encoding here must be the same as the |
| 9287 | * certificate encoding used on the SIM. |
| 9288 | * |
| 9289 | * The value is "cert1:package1;cert2:package2;..." |
| 9290 | * @hide |
| 9291 | */ |
| 9292 | @SystemApi |
| 9293 | public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 9294 | |
goneil | 15f5a7e | 2018-02-16 17:33:56 -0800 | [diff] [blame] | 9295 | /** |
goneil | 986fae2 | 2018-03-29 17:30:58 -0700 | [diff] [blame] | 9296 | * Map of package name to application names. The application names cannot and will not be |
| 9297 | * localized. App names may not contain colons or semicolons. |
goneil | 15f5a7e | 2018-02-16 17:33:56 -0800 | [diff] [blame] | 9298 | * |
| 9299 | * The value is "packageName1:appName1;packageName2:appName2;..." |
| 9300 | * @hide |
| 9301 | */ |
| 9302 | @SystemApi |
| 9303 | public static final String CARRIER_APP_NAMES = "carrier_app_names"; |
| 9304 | |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 9305 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9306 | * USB Mass Storage Enabled |
| 9307 | */ |
| 9308 | public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; |
| 9309 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9310 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9311 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9312 | /** |
| 9313 | * If this setting is set (to anything), then all references |
| 9314 | * to Gmail on the device must change to Google Mail. |
| 9315 | */ |
| 9316 | public static final String USE_GOOGLE_MAIL = "use_google_mail"; |
| 9317 | |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 9318 | /** |
| 9319 | * Webview Data reduction proxy key. |
| 9320 | * @hide |
| 9321 | */ |
| 9322 | public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = |
| 9323 | "webview_data_reduction_proxy_key"; |
| 9324 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9325 | /** |
| 9326 | * Whether or not the WebView fallback mechanism should be enabled. |
| 9327 | * 0=disabled, 1=enabled. |
| 9328 | * @hide |
| 9329 | */ |
| 9330 | public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = |
| 9331 | "webview_fallback_logic_enabled"; |
Gustav Sennton | c83e3fa | 2016-02-18 12:19:13 +0000 | [diff] [blame] | 9332 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9333 | /** |
| 9334 | * Name of the package used as WebView provider (if unset the provider is instead determined |
| 9335 | * by the system). |
| 9336 | * @hide |
| 9337 | */ |
| 9338 | public static final String WEBVIEW_PROVIDER = "webview_provider"; |
Gustav Sennton | 14c033c | 2016-02-11 12:51:27 +0000 | [diff] [blame] | 9339 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9340 | /** |
| 9341 | * Developer setting to enable WebView multiprocess rendering. |
| 9342 | * @hide |
| 9343 | */ |
| 9344 | @SystemApi |
| 9345 | public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; |
| 9346 | |
| 9347 | /** |
| 9348 | * The maximum number of notifications shown in 24 hours when switching networks. |
| 9349 | * @hide |
| 9350 | */ |
| 9351 | public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = |
| 9352 | "network_switch_notification_daily_limit"; |
| 9353 | |
| 9354 | /** |
| 9355 | * The minimum time in milliseconds between notifications when switching networks. |
| 9356 | * @hide |
| 9357 | */ |
| 9358 | public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = |
| 9359 | "network_switch_notification_rate_limit_millis"; |
Tobias Sargeant | da85710 | 2016-02-11 14:52:28 +0000 | [diff] [blame] | 9360 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9361 | /** |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9362 | * Whether to automatically switch away from wifi networks that lose Internet access. |
Lorenzo Colitti | 165c51c | 2016-09-19 01:00:19 +0900 | [diff] [blame] | 9363 | * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always |
| 9364 | * avoids such networks. Valid values are: |
| 9365 | * |
| 9366 | * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. |
| 9367 | * null: Ask the user whether to switch away from bad wifi. |
| 9368 | * 1: Avoid bad wifi. |
| 9369 | * |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9370 | * @hide |
| 9371 | */ |
| 9372 | public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; |
| 9373 | |
| 9374 | /** |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9375 | * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be |
| 9376 | * overridden by the system based on device or application state. If null, the value |
| 9377 | * specified by config_networkMeteredMultipathPreference is used. |
| 9378 | * |
| 9379 | * @hide |
| 9380 | */ |
| 9381 | public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = |
| 9382 | "network_metered_multipath_preference"; |
| 9383 | |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 9384 | /** |
Remi NGUYEN VAN | e0ec992 | 2018-03-29 16:17:19 +0900 | [diff] [blame] | 9385 | * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() |
| 9386 | * on metered networks. This default quota is only used if quota could not be determined |
| 9387 | * from data plan or data limit/warning set by the user. |
| 9388 | * @hide |
| 9389 | */ |
| 9390 | public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = |
| 9391 | "network_default_daily_multipath_quota_bytes"; |
| 9392 | |
| 9393 | /** |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 9394 | * Network watchlist last report time. |
| 9395 | * @hide |
| 9396 | */ |
| 9397 | public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = |
| 9398 | "network_watchlist_last_report_time"; |
| 9399 | |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9400 | /** |
William Mee | cd62f3a | 2017-01-24 18:01:38 -0800 | [diff] [blame] | 9401 | * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of |
| 9402 | * colon-delimited key-value pairs. The key is the badging enum value defined in |
| 9403 | * android.net.ScoredNetwork and the value is the minimum sustained network throughput in |
| 9404 | * kbps required for the badge. For example: "10:3000,20:5000,30:25000" |
| 9405 | * |
| 9406 | * @hide |
| 9407 | */ |
| 9408 | @SystemApi |
| 9409 | public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; |
| 9410 | |
| 9411 | /** |
Jeff Brown | 89d5546 | 2012-09-19 11:33:42 -0700 | [diff] [blame] | 9412 | * Whether Wifi display is enabled/disabled |
| 9413 | * 0=disabled. 1=enabled. |
| 9414 | * @hide |
| 9415 | */ |
| 9416 | public static final String WIFI_DISPLAY_ON = "wifi_display_on"; |
| 9417 | |
| 9418 | /** |
Chong Zhang | 1f3ecaa | 2013-05-03 15:55:36 -0700 | [diff] [blame] | 9419 | * Whether Wifi display certification mode is enabled/disabled |
| 9420 | * 0=disabled. 1=enabled. |
| 9421 | * @hide |
| 9422 | */ |
| 9423 | public static final String WIFI_DISPLAY_CERTIFICATION_ON = |
| 9424 | "wifi_display_certification_on"; |
| 9425 | |
| 9426 | /** |
Chong Zhang | e38af81 | 2013-08-29 17:25:17 -0700 | [diff] [blame] | 9427 | * WPS Configuration method used by Wifi display, this setting only |
| 9428 | * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). |
| 9429 | * |
| 9430 | * Possible values are: |
| 9431 | * |
| 9432 | * WpsInfo.INVALID: use default WPS method chosen by framework |
| 9433 | * WpsInfo.PBC : use Push button |
| 9434 | * WpsInfo.KEYPAD : use Keypad |
| 9435 | * WpsInfo.DISPLAY: use Display |
| 9436 | * @hide |
| 9437 | */ |
| 9438 | public static final String WIFI_DISPLAY_WPS_CONFIG = |
| 9439 | "wifi_display_wps_config"; |
| 9440 | |
| 9441 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9442 | * Whether to notify the user of open networks. |
| 9443 | * <p> |
| 9444 | * If not connected and the scan results have an open network, we will |
| 9445 | * put this notification up. If we attempt to connect to a network or |
| 9446 | * the open network(s) disappear, we remove the notification. When we |
| 9447 | * show the notification, we will not show it again for |
| 9448 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9449 | * |
| 9450 | * @deprecated This feature is no longer controlled by this setting in |
| 9451 | * {@link android.os.Build.VERSION_CODES#O}. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9452 | */ |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9453 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9454 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9455 | "wifi_networks_available_notification_on"; |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9456 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9457 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9458 | BOOLEAN_VALIDATOR; |
| 9459 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9460 | /** |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 9461 | * Whether to notify the user of carrier networks. |
| 9462 | * <p> |
| 9463 | * If not connected and the scan results have a carrier network, we will |
| 9464 | * put this notification up. If we attempt to connect to a network or |
| 9465 | * the carrier network(s) disappear, we remove the notification. When we |
| 9466 | * show the notification, we will not show it again for |
| 9467 | * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
| 9468 | * @hide |
| 9469 | */ |
| 9470 | public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9471 | "wifi_carrier_networks_available_notification_on"; |
| 9472 | |
| 9473 | private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9474 | BOOLEAN_VALIDATOR; |
| 9475 | |
| 9476 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9477 | * {@hide} |
| 9478 | */ |
| 9479 | public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9480 | "wimax_networks_available_notification_on"; |
| 9481 | |
| 9482 | /** |
| 9483 | * Delay (in seconds) before repeating the Wi-Fi networks available notification. |
| 9484 | * Connecting to a network will reset the timer. |
| 9485 | */ |
| 9486 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 9487 | "wifi_networks_available_repeat_delay"; |
| 9488 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9489 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 9490 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9491 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9492 | /** |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 9493 | * 802.11 country code in ISO 3166 format |
| 9494 | * @hide |
| 9495 | */ |
| 9496 | public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; |
| 9497 | |
| 9498 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9499 | * The interval in milliseconds to issue wake up scans when wifi needs |
| 9500 | * to connect. This is necessary to connect to an access point when |
| 9501 | * device is on the move and the screen is off. |
| 9502 | * @hide |
| 9503 | */ |
| 9504 | public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = |
| 9505 | "wifi_framework_scan_interval_ms"; |
| 9506 | |
| 9507 | /** |
| 9508 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 9509 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 9510 | * the mobile data network. |
| 9511 | * @hide |
| 9512 | */ |
| 9513 | public static final String WIFI_IDLE_MS = "wifi_idle_ms"; |
| 9514 | |
| 9515 | /** |
| 9516 | * When the number of open networks exceeds this number, the |
| 9517 | * least-recently-used excess networks will be removed. |
| 9518 | */ |
| 9519 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; |
| 9520 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9521 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 9522 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9523 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9524 | /** |
| 9525 | * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. |
| 9526 | */ |
| 9527 | public static final String WIFI_ON = "wifi_on"; |
| 9528 | |
| 9529 | /** |
Irfan Sheriff | 11aefad | 2013-03-06 07:57:41 -0800 | [diff] [blame] | 9530 | * Setting to allow scans to be enabled even wifi is turned off for connectivity. |
| 9531 | * @hide |
| 9532 | */ |
| 9533 | public static final String WIFI_SCAN_ALWAYS_AVAILABLE = |
| 9534 | "wifi_scan_always_enabled"; |
| 9535 | |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9536 | /** |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9537 | * Whether soft AP will shut down after a timeout period when no devices are connected. |
Mehdi Alizadeh | 57ae55c | 2018-01-08 16:41:19 -0800 | [diff] [blame] | 9538 | * |
| 9539 | * Type: int (0 for false, 1 for true) |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9540 | * @hide |
| 9541 | */ |
| 9542 | public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; |
| 9543 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9544 | private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9545 | |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9546 | /** |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9547 | * Value to specify if Wi-Fi Wakeup feature is enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9548 | * |
| 9549 | * Type: int (0 for false, 1 for true) |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9550 | * @hide |
| 9551 | */ |
| 9552 | @SystemApi |
| 9553 | public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; |
| 9554 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9555 | private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9556 | |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9557 | /** |
Sundeep Ghuman | e869d83 | 2017-01-25 16:23:43 -0800 | [diff] [blame] | 9558 | * Value to specify whether network quality scores and badging should be shown in the UI. |
| 9559 | * |
| 9560 | * Type: int (0 for false, 1 for true) |
| 9561 | * @hide |
| 9562 | */ |
| 9563 | public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; |
| 9564 | |
| 9565 | /** |
Sundeep Ghuman | 9bb85d3 | 2017-08-28 17:04:16 -0700 | [diff] [blame] | 9566 | * Value to specify how long in milliseconds to retain seen score cache curves to be used |
| 9567 | * when generating SSID only bases score curves. |
| 9568 | * |
| 9569 | * Type: long |
| 9570 | * @hide |
| 9571 | */ |
| 9572 | public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = |
| 9573 | "speed_label_cache_eviction_age_millis"; |
| 9574 | |
| 9575 | /** |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9576 | * Value to specify if network recommendations from |
| 9577 | * {@link com.android.server.NetworkScoreService} are enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9578 | * |
Jeremy Joslin | 9925c6a | 2017-03-06 10:39:35 -0800 | [diff] [blame] | 9579 | * Type: int |
| 9580 | * Valid values: |
| 9581 | * -1 = Forced off |
| 9582 | * 0 = Disabled |
| 9583 | * 1 = Enabled |
| 9584 | * |
| 9585 | * Most readers of this setting should simply check if value == 1 to determined the |
| 9586 | * enabled state. |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9587 | * @hide |
| 9588 | */ |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9589 | public static final String NETWORK_RECOMMENDATIONS_ENABLED = |
| 9590 | "network_recommendations_enabled"; |
| 9591 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9592 | private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR = |
| 9593 | new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"}); |
| 9594 | |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9595 | /** |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 9596 | * Which package name to use for network recommendations. If null, network recommendations |
| 9597 | * will neither be requested nor accepted. |
| 9598 | * |
| 9599 | * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and |
| 9600 | * {@link NetworkScoreManager#setActiveScorer(String)} to write it. |
| 9601 | * |
| 9602 | * Type: string - package name |
| 9603 | * @hide |
| 9604 | */ |
| 9605 | public static final String NETWORK_RECOMMENDATIONS_PACKAGE = |
| 9606 | "network_recommendations_package"; |
| 9607 | |
| 9608 | /** |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9609 | * The package name of the application that connect and secures high quality open wifi |
| 9610 | * networks automatically. |
| 9611 | * |
| 9612 | * Type: string package name or null if the feature is either not provided or disabled. |
| 9613 | * @hide |
| 9614 | */ |
Eric Enslen | 1e423b9 | 2017-12-18 11:30:21 -0800 | [diff] [blame] | 9615 | @TestApi |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9616 | public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; |
| 9617 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9618 | private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() { |
| 9619 | @Override |
| 9620 | public boolean validate(String value) { |
| 9621 | return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value); |
| 9622 | } |
| 9623 | }; |
| 9624 | |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9625 | /** |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9626 | * The number of milliseconds the {@link com.android.server.NetworkScoreService} |
| 9627 | * will give a recommendation request to complete before returning a default response. |
| 9628 | * |
| 9629 | * Type: long |
| 9630 | * @hide |
Jeremy Joslin | b1a0139 | 2017-04-14 13:35:48 -0700 | [diff] [blame] | 9631 | * @deprecated to be removed |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9632 | */ |
| 9633 | public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = |
| 9634 | "network_recommendation_request_timeout_ms"; |
| 9635 | |
Amin Shaikh | d3c8193 | 2017-02-06 16:22:42 -0800 | [diff] [blame] | 9636 | /** |
| 9637 | * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in |
| 9638 | * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. |
| 9639 | * |
| 9640 | * Type: long |
| 9641 | * @hide |
| 9642 | */ |
| 9643 | public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = |
| 9644 | "recommended_network_evaluator_cache_expiry_ms"; |
| 9645 | |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9646 | /** |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9647 | * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for |
| 9648 | * connectivity. |
| 9649 | * @hide |
| 9650 | */ |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9651 | public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; |
| 9652 | |
| 9653 | /** |
| 9654 | * The length in milliseconds of a BLE scan window in a low-power scan mode. |
| 9655 | * @hide |
| 9656 | */ |
| 9657 | public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; |
| 9658 | |
| 9659 | /** |
| 9660 | * The length in milliseconds of a BLE scan window in a balanced scan mode. |
| 9661 | * @hide |
| 9662 | */ |
| 9663 | public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; |
| 9664 | |
| 9665 | /** |
| 9666 | * The length in milliseconds of a BLE scan window in a low-latency scan mode. |
| 9667 | * @hide |
| 9668 | */ |
| 9669 | public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = |
| 9670 | "ble_scan_low_latency_window_ms"; |
| 9671 | |
| 9672 | /** |
| 9673 | * The length in milliseconds of a BLE scan interval in a low-power scan mode. |
| 9674 | * @hide |
| 9675 | */ |
| 9676 | public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = |
| 9677 | "ble_scan_low_power_interval_ms"; |
| 9678 | |
| 9679 | /** |
| 9680 | * The length in milliseconds of a BLE scan interval in a balanced scan mode. |
| 9681 | * @hide |
| 9682 | */ |
| 9683 | public static final String BLE_SCAN_BALANCED_INTERVAL_MS = |
| 9684 | "ble_scan_balanced_interval_ms"; |
| 9685 | |
| 9686 | /** |
| 9687 | * The length in milliseconds of a BLE scan interval in a low-latency scan mode. |
| 9688 | * @hide |
| 9689 | */ |
| 9690 | public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = |
| 9691 | "ble_scan_low_latency_interval_ms"; |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9692 | |
Anthony Stange | c97870a | 2018-03-14 01:09:45 +0000 | [diff] [blame] | 9693 | /** |
| 9694 | * The mode that BLE scanning clients will be moved to when in the background. |
| 9695 | * @hide |
| 9696 | */ |
| 9697 | public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; |
| 9698 | |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9699 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9700 | * Used to save the Wifi_ON state prior to tethering. |
| 9701 | * This state will be checked to restore Wifi after |
| 9702 | * the user turns off tethering. |
| 9703 | * |
| 9704 | * @hide |
| 9705 | */ |
| 9706 | public static final String WIFI_SAVED_STATE = "wifi_saved_state"; |
| 9707 | |
| 9708 | /** |
| 9709 | * The interval in milliseconds to scan as used by the wifi supplicant |
| 9710 | * @hide |
| 9711 | */ |
| 9712 | public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = |
| 9713 | "wifi_supplicant_scan_interval_ms"; |
| 9714 | |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 9715 | /** |
| 9716 | * whether frameworks handles wifi auto-join |
| 9717 | * @hide |
| 9718 | */ |
| 9719 | public static final String WIFI_ENHANCED_AUTO_JOIN = |
| 9720 | "wifi_enhanced_auto_join"; |
| 9721 | |
| 9722 | /** |
| 9723 | * whether settings show RSSI |
| 9724 | * @hide |
| 9725 | */ |
| 9726 | public static final String WIFI_NETWORK_SHOW_RSSI = |
| 9727 | "wifi_network_show_rssi"; |
| 9728 | |
| 9729 | /** |
Irfan Sheriff | 3809f50 | 2012-09-17 16:04:57 -0700 | [diff] [blame] | 9730 | * The interval in milliseconds to scan at supplicant when p2p is connected |
| 9731 | * @hide |
| 9732 | */ |
| 9733 | public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = |
| 9734 | "wifi_scan_interval_p2p_connected_ms"; |
| 9735 | |
| 9736 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9737 | * Whether the Wi-Fi watchdog is enabled. |
| 9738 | */ |
| 9739 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 9740 | |
| 9741 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9742 | * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and |
| 9743 | * the setting needs to be set to 0 to disable it. |
| 9744 | * @hide |
| 9745 | */ |
| 9746 | public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = |
| 9747 | "wifi_watchdog_poor_network_test_enabled"; |
| 9748 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9749 | private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR = |
| 9750 | ANY_STRING_VALIDATOR; |
| 9751 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9752 | /** |
| 9753 | * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and |
| 9754 | * needs to be set to 0 to disable it. |
| 9755 | * @hide |
| 9756 | */ |
| 9757 | public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = |
| 9758 | "wifi_suspend_optimizations_enabled"; |
| 9759 | |
| 9760 | /** |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9761 | * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 |
| 9762 | * will enable it. In the future, additional values may be supported. |
| 9763 | * @hide |
| 9764 | */ |
| 9765 | public static final String WIFI_VERBOSE_LOGGING_ENABLED = |
| 9766 | "wifi_verbose_logging_enabled"; |
| 9767 | |
Jong Wook Kim | 0a20eda | 2018-01-05 18:40:25 -0800 | [diff] [blame] | 9768 | /** |
| 9769 | * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and |
| 9770 | * setting to 1 will enable it. In the future, additional values may be supported. |
| 9771 | * @hide |
| 9772 | */ |
| 9773 | public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = |
| 9774 | "wifi_connected_mac_randomization_enabled"; |
| 9775 | |
Michael Plass | f1510fb | 2018-02-28 16:08:47 -0800 | [diff] [blame] | 9776 | /** |
| 9777 | * Parameters to adjust the performance of framework wifi scoring methods. |
| 9778 | * <p> |
| 9779 | * Encoded as a comma-separated key=value list, for example: |
| 9780 | * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" |
| 9781 | * This is intended for experimenting with new parameter values, |
| 9782 | * and is normally unset or empty. The example does not include all |
| 9783 | * parameters that may be honored. |
| 9784 | * Default values are provided by code or device configurations. |
| 9785 | * Errors in the parameters will cause the entire setting to be ignored. |
| 9786 | * @hide |
| 9787 | */ |
| 9788 | public static final String WIFI_SCORE_PARAMS = |
| 9789 | "wifi_score_params"; |
| 9790 | |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9791 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9792 | * The maximum number of times we will retry a connection to an access |
| 9793 | * point for which we have failed in acquiring an IP address from DHCP. |
| 9794 | * A value of N means that we will make N+1 connection attempts in all. |
| 9795 | */ |
| 9796 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; |
| 9797 | |
| 9798 | /** |
| 9799 | * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile |
| 9800 | * data connectivity to be established after a disconnect from Wi-Fi. |
| 9801 | */ |
| 9802 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 9803 | "wifi_mobile_data_transition_wakelock_timeout_ms"; |
| 9804 | |
| 9805 | /** |
Zoltan Szatmary-Ban | 4045d24 | 2015-05-27 12:42:39 +0100 | [diff] [blame] | 9806 | * This setting controls whether WiFi configurations created by a Device Owner app |
| 9807 | * should be locked down (that is, be editable or removable only by the Device Owner App, |
| 9808 | * not even by Settings app). |
| 9809 | * This setting takes integer values. Non-zero values mean DO created configurations |
| 9810 | * are locked down. Value of zero means they are not. Default value in the absence of |
| 9811 | * actual value to this setting is 0. |
| 9812 | */ |
| 9813 | public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = |
| 9814 | "wifi_device_owner_configs_lockdown"; |
| 9815 | |
| 9816 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9817 | * The operational wifi frequency band |
| 9818 | * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, |
| 9819 | * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or |
| 9820 | * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} |
| 9821 | * |
| 9822 | * @hide |
| 9823 | */ |
| 9824 | public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; |
| 9825 | |
| 9826 | /** |
| 9827 | * The Wi-Fi peer-to-peer device name |
| 9828 | * @hide |
| 9829 | */ |
| 9830 | public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; |
| 9831 | |
| 9832 | /** |
Robert Greenwalt | c12783a | 2013-05-16 12:48:20 -0700 | [diff] [blame] | 9833 | * The min time between wifi disable and wifi enable |
| 9834 | * @hide |
| 9835 | */ |
| 9836 | public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; |
| 9837 | |
| 9838 | /** |
Jeff Davidson | a20ca67d | 2014-12-16 11:48:54 -0800 | [diff] [blame] | 9839 | * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect |
| 9840 | * from an ephemeral network if there is no BSSID for that network with a non-null score that |
| 9841 | * has been seen in this time period. |
| 9842 | * |
| 9843 | * If this is less than or equal to zero, we use a more conservative behavior and only check |
| 9844 | * for a non-null score from the currently connected or target BSSID. |
| 9845 | * @hide |
| 9846 | */ |
| 9847 | public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = |
| 9848 | "wifi_ephemeral_out_of_range_timeout_ms"; |
| 9849 | |
| 9850 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9851 | * The number of milliseconds to delay when checking for data stalls during |
| 9852 | * non-aggressive detection. (screen is turned off.) |
| 9853 | * @hide |
| 9854 | */ |
| 9855 | public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = |
| 9856 | "data_stall_alarm_non_aggressive_delay_in_ms"; |
| 9857 | |
| 9858 | /** |
| 9859 | * The number of milliseconds to delay when checking for data stalls during |
| 9860 | * aggressive detection. (screen on or suspected data stall) |
| 9861 | * @hide |
| 9862 | */ |
| 9863 | public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = |
| 9864 | "data_stall_alarm_aggressive_delay_in_ms"; |
| 9865 | |
| 9866 | /** |
Wink Saville | ce1e379 | 2013-09-03 16:41:44 -0700 | [diff] [blame] | 9867 | * The number of milliseconds to allow the provisioning apn to remain active |
| 9868 | * @hide |
| 9869 | */ |
| 9870 | public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = |
| 9871 | "provisioning_apn_alarm_delay_in_ms"; |
| 9872 | |
| 9873 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9874 | * The interval in milliseconds at which to check gprs registration |
| 9875 | * after the first registration mismatch of gprs and voice service, |
| 9876 | * to detect possible data network registration problems. |
| 9877 | * |
| 9878 | * @hide |
| 9879 | */ |
| 9880 | public static final String GPRS_REGISTER_CHECK_PERIOD_MS = |
| 9881 | "gprs_register_check_period_ms"; |
| 9882 | |
| 9883 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9884 | * Nonzero causes Log.wtf() to crash. |
| 9885 | * @hide |
| 9886 | */ |
| 9887 | public static final String WTF_IS_FATAL = "wtf_is_fatal"; |
| 9888 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 9889 | /** |
| 9890 | * Ringer mode. This is used internally, changing this value will not |
| 9891 | * change the ringer mode. See AudioManager. |
| 9892 | */ |
| 9893 | public static final String MODE_RINGER = "mode_ringer"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9894 | |
Jeff Brown | d493596 | 2012-09-25 13:27:20 -0700 | [diff] [blame] | 9895 | /** |
| 9896 | * Overlay display devices setting. |
| 9897 | * The associated value is a specially formatted string that describes the |
| 9898 | * size and density of simulated secondary display devices. |
| 9899 | * <p> |
| 9900 | * Format: {width}x{height}/{dpi};... |
| 9901 | * </p><p> |
| 9902 | * Example: |
| 9903 | * <ul> |
| 9904 | * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> |
| 9905 | * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first |
| 9906 | * at 1080p and the second at 720p.</li> |
| 9907 | * <li>If the value is empty, then no overlay display devices are created.</li> |
| 9908 | * </ul></p> |
| 9909 | * |
| 9910 | * @hide |
| 9911 | */ |
| 9912 | public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9913 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9914 | /** |
| 9915 | * Threshold values for the duration and level of a discharge cycle, |
| 9916 | * under which we log discharge cycle info. |
| 9917 | * |
| 9918 | * @hide |
| 9919 | */ |
| 9920 | public static final String |
| 9921 | BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; |
| 9922 | |
| 9923 | /** @hide */ |
| 9924 | public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; |
| 9925 | |
| 9926 | /** |
| 9927 | * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR |
| 9928 | * intents on application crashes and ANRs. If this is disabled, the |
| 9929 | * crash/ANR dialog will never display the "Report" button. |
| 9930 | * <p> |
| 9931 | * Type: int (0 = disallow, 1 = allow) |
| 9932 | * |
| 9933 | * @hide |
| 9934 | */ |
| 9935 | public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; |
| 9936 | |
| 9937 | /** |
| 9938 | * Maximum age of entries kept by {@link DropBoxManager}. |
| 9939 | * |
| 9940 | * @hide |
| 9941 | */ |
| 9942 | public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; |
| 9943 | |
| 9944 | /** |
| 9945 | * Maximum number of entry files which {@link DropBoxManager} will keep |
| 9946 | * around. |
| 9947 | * |
| 9948 | * @hide |
| 9949 | */ |
| 9950 | public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; |
| 9951 | |
| 9952 | /** |
| 9953 | * Maximum amount of disk space used by {@link DropBoxManager} no matter |
| 9954 | * what. |
| 9955 | * |
| 9956 | * @hide |
| 9957 | */ |
| 9958 | public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; |
| 9959 | |
| 9960 | /** |
| 9961 | * Percent of free disk (excluding reserve) which {@link DropBoxManager} |
| 9962 | * will use. |
| 9963 | * |
| 9964 | * @hide |
| 9965 | */ |
| 9966 | public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; |
| 9967 | |
| 9968 | /** |
| 9969 | * Percent of total disk which {@link DropBoxManager} will never dip |
| 9970 | * into. |
| 9971 | * |
| 9972 | * @hide |
| 9973 | */ |
| 9974 | public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; |
| 9975 | |
| 9976 | /** |
| 9977 | * Prefix for per-tag dropbox disable/enable settings. |
| 9978 | * |
| 9979 | * @hide |
| 9980 | */ |
| 9981 | public static final String DROPBOX_TAG_PREFIX = "dropbox:"; |
| 9982 | |
| 9983 | /** |
| 9984 | * Lines of logcat to include with system crash/ANR/etc. reports, as a |
| 9985 | * prefix of the dropbox tag of the report type. For example, |
| 9986 | * "logcat_for_system_server_anr" controls the lines of logcat captured |
| 9987 | * with system server ANR reports. 0 to disable. |
| 9988 | * |
| 9989 | * @hide |
| 9990 | */ |
| 9991 | public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; |
| 9992 | |
| 9993 | /** |
| 9994 | * The interval in minutes after which the amount of free storage left |
| 9995 | * on the device is logged to the event log |
| 9996 | * |
| 9997 | * @hide |
| 9998 | */ |
| 9999 | public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; |
| 10000 | |
| 10001 | /** |
| 10002 | * Threshold for the amount of change in disk free space required to |
| 10003 | * report the amount of free space. Used to prevent spamming the logs |
| 10004 | * when the disk free space isn't changing frequently. |
| 10005 | * |
| 10006 | * @hide |
| 10007 | */ |
| 10008 | public static final String |
| 10009 | DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; |
| 10010 | |
| 10011 | /** |
| 10012 | * Minimum percentage of free storage on the device that is used to |
| 10013 | * determine if the device is running low on storage. The default is 10. |
| 10014 | * <p> |
| 10015 | * Say this value is set to 10, the device is considered running low on |
| 10016 | * storage if 90% or more of the device storage is filled up. |
| 10017 | * |
| 10018 | * @hide |
| 10019 | */ |
| 10020 | public static final String |
| 10021 | SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; |
| 10022 | |
| 10023 | /** |
| 10024 | * Maximum byte size of the low storage threshold. This is to ensure |
| 10025 | * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an |
| 10026 | * overly large threshold for large storage devices. Currently this must |
| 10027 | * be less than 2GB. This default is 500MB. |
| 10028 | * |
| 10029 | * @hide |
| 10030 | */ |
| 10031 | public static final String |
| 10032 | SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; |
| 10033 | |
| 10034 | /** |
| 10035 | * Minimum bytes of free storage on the device before the data partition |
| 10036 | * is considered full. By default, 1 MB is reserved to avoid system-wide |
| 10037 | * SQLite disk full exceptions. |
| 10038 | * |
| 10039 | * @hide |
| 10040 | */ |
| 10041 | public static final String |
| 10042 | SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; |
| 10043 | |
| 10044 | /** |
Jeff Sharkey | d5d5e92 | 2017-02-21 10:51:23 -0700 | [diff] [blame] | 10045 | * Minimum percentage of storage on the device that is reserved for |
| 10046 | * cached data. |
| 10047 | * |
| 10048 | * @hide |
| 10049 | */ |
| 10050 | public static final String |
| 10051 | SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; |
| 10052 | |
| 10053 | /** |
| 10054 | * Maximum bytes of storage on the device that is reserved for cached |
| 10055 | * data. |
| 10056 | * |
| 10057 | * @hide |
| 10058 | */ |
| 10059 | public static final String |
| 10060 | SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; |
| 10061 | |
| 10062 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10063 | * The maximum reconnect delay for short network outages or when the |
| 10064 | * network is suspended due to phone use. |
| 10065 | * |
| 10066 | * @hide |
| 10067 | */ |
| 10068 | public static final String |
| 10069 | SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; |
| 10070 | |
| 10071 | /** |
| 10072 | * The number of milliseconds to delay before sending out |
Erik Kline | 8f29dcf | 2014-12-08 16:25:20 +0900 | [diff] [blame] | 10073 | * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10074 | * |
| 10075 | * @hide |
| 10076 | */ |
| 10077 | public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; |
| 10078 | |
Vinit Deshapnde | 1f12cb5 | 2013-08-21 13:09:01 -0700 | [diff] [blame] | 10079 | |
| 10080 | /** |
| 10081 | * Network sampling interval, in seconds. We'll generate link information |
| 10082 | * about bytes/packets sent and error rates based on data sampled in this interval |
| 10083 | * |
| 10084 | * @hide |
| 10085 | */ |
| 10086 | |
| 10087 | public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = |
| 10088 | "connectivity_sampling_interval_in_seconds"; |
| 10089 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10090 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 10091 | * The series of successively longer delays used in retrying to download PAC file. |
| 10092 | * Last delay is used between successful PAC downloads. |
| 10093 | * |
| 10094 | * @hide |
| 10095 | */ |
| 10096 | public static final String PAC_CHANGE_DELAY = "pac_change_delay"; |
| 10097 | |
| 10098 | /** |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 10099 | * Don't attempt to detect captive portals. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10100 | * |
| 10101 | * @hide |
| 10102 | */ |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 10103 | public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; |
| 10104 | |
| 10105 | /** |
| 10106 | * When detecting a captive portal, display a notification that |
| 10107 | * prompts the user to sign in. |
| 10108 | * |
| 10109 | * @hide |
| 10110 | */ |
| 10111 | public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; |
| 10112 | |
| 10113 | /** |
| 10114 | * When detecting a captive portal, immediately disconnect from the |
| 10115 | * network and do not reconnect to that network in the future. |
| 10116 | * |
| 10117 | * @hide |
| 10118 | */ |
| 10119 | public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; |
| 10120 | |
| 10121 | /** |
| 10122 | * What to do when connecting a network that presents a captive portal. |
| 10123 | * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. |
| 10124 | * |
| 10125 | * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. |
| 10126 | * @hide |
| 10127 | */ |
| 10128 | public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; |
| 10129 | |
| 10130 | /** |
| 10131 | * Setting to turn off captive portal detection. Feature is enabled by |
| 10132 | * default and the setting needs to be set to 0 to disable it. |
| 10133 | * |
| 10134 | * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection |
| 10135 | * @hide |
| 10136 | */ |
| 10137 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10138 | public static final String |
| 10139 | CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; |
| 10140 | |
| 10141 | /** |
| 10142 | * The server used for captive portal detection upon a new conection. A |
| 10143 | * 204 response code from the server is used for validation. |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10144 | * TODO: remove this deprecated symbol. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10145 | * |
| 10146 | * @hide |
| 10147 | */ |
| 10148 | public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; |
| 10149 | |
| 10150 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10151 | * The URL used for HTTPS captive portal detection upon a new connection. |
| 10152 | * A 204 response code from the server is used for validation. |
| 10153 | * |
| 10154 | * @hide |
| 10155 | */ |
| 10156 | public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; |
| 10157 | |
| 10158 | /** |
| 10159 | * The URL used for HTTP captive portal detection upon a new connection. |
| 10160 | * A 204 response code from the server is used for validation. |
| 10161 | * |
| 10162 | * @hide |
| 10163 | */ |
| 10164 | public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; |
| 10165 | |
| 10166 | /** |
| 10167 | * The URL used for fallback HTTP captive portal detection when previous HTTP |
| 10168 | * and HTTPS captive portal detection attemps did not return a conclusive answer. |
| 10169 | * |
| 10170 | * @hide |
| 10171 | */ |
| 10172 | public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; |
| 10173 | |
| 10174 | /** |
Hugo Benichi | eef918a | 2017-04-10 17:43:08 +0900 | [diff] [blame] | 10175 | * A comma separated list of URLs used for captive portal detection in addition to the |
| 10176 | * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. |
| 10177 | * |
| 10178 | * @hide |
| 10179 | */ |
| 10180 | public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = |
| 10181 | "captive_portal_other_fallback_urls"; |
| 10182 | |
| 10183 | /** |
Lorenzo Colitti | c5be12e | 2016-04-19 21:57:31 +0900 | [diff] [blame] | 10184 | * Whether to use HTTPS for network validation. This is enabled by default and the setting |
| 10185 | * needs to be set to 0 to disable it. This setting is a misnomer because captive portals |
| 10186 | * don't actually use HTTPS, but it's consistent with the other settings. |
| 10187 | * |
| 10188 | * @hide |
| 10189 | */ |
| 10190 | public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; |
| 10191 | |
| 10192 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10193 | * Which User-Agent string to use in the header of the captive portal detection probes. |
| 10194 | * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). |
| 10195 | * |
| 10196 | * @hide |
| 10197 | */ |
| 10198 | public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; |
| 10199 | |
| 10200 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10201 | * Whether network service discovery is enabled. |
| 10202 | * |
| 10203 | * @hide |
| 10204 | */ |
| 10205 | public static final String NSD_ON = "nsd_on"; |
| 10206 | |
| 10207 | /** |
| 10208 | * Let user pick default install location. |
| 10209 | * |
| 10210 | * @hide |
| 10211 | */ |
| 10212 | public static final String SET_INSTALL_LOCATION = "set_install_location"; |
| 10213 | |
| 10214 | /** |
| 10215 | * Default install location value. |
| 10216 | * 0 = auto, let system decide |
| 10217 | * 1 = internal |
| 10218 | * 2 = sdcard |
| 10219 | * @hide |
| 10220 | */ |
| 10221 | public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; |
| 10222 | |
| 10223 | /** |
| 10224 | * ms during which to consume extra events related to Inet connection |
| 10225 | * condition after a transtion to fully-connected |
| 10226 | * |
| 10227 | * @hide |
| 10228 | */ |
| 10229 | public static final String |
| 10230 | INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; |
| 10231 | |
| 10232 | /** |
| 10233 | * ms during which to consume extra events related to Inet connection |
| 10234 | * condtion after a transtion to partly-connected |
| 10235 | * |
| 10236 | * @hide |
| 10237 | */ |
| 10238 | public static final String |
| 10239 | INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; |
| 10240 | |
| 10241 | /** {@hide} */ |
| 10242 | public static final String |
| 10243 | READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; |
| 10244 | |
| 10245 | /** |
| 10246 | * Host name and port for global http proxy. Uses ':' seperator for |
| 10247 | * between host and port. |
| 10248 | */ |
| 10249 | public static final String HTTP_PROXY = "http_proxy"; |
| 10250 | |
| 10251 | /** |
| 10252 | * Host name for global http proxy. Set via ConnectivityManager. |
| 10253 | * |
| 10254 | * @hide |
| 10255 | */ |
| 10256 | public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; |
| 10257 | |
| 10258 | /** |
| 10259 | * Integer host port for global http proxy. Set via ConnectivityManager. |
| 10260 | * |
| 10261 | * @hide |
| 10262 | */ |
| 10263 | public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; |
| 10264 | |
| 10265 | /** |
| 10266 | * Exclusion list for global proxy. This string contains a list of |
| 10267 | * comma-separated domains where the global proxy does not apply. |
| 10268 | * Domains should be listed in a comma- separated list. Example of |
| 10269 | * acceptable formats: ".domain1.com,my.domain2.com" Use |
| 10270 | * ConnectivityManager to set/get. |
| 10271 | * |
| 10272 | * @hide |
| 10273 | */ |
| 10274 | public static final String |
| 10275 | GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; |
| 10276 | |
| 10277 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 10278 | * The location PAC File for the proxy. |
| 10279 | * @hide |
| 10280 | */ |
| 10281 | public static final String |
| 10282 | GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; |
| 10283 | |
| 10284 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10285 | * Enables the UI setting to allow the user to specify the global HTTP |
| 10286 | * proxy and associated exclusion list. |
| 10287 | * |
| 10288 | * @hide |
| 10289 | */ |
| 10290 | public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; |
| 10291 | |
| 10292 | /** |
| 10293 | * Setting for default DNS in case nobody suggests one |
| 10294 | * |
| 10295 | * @hide |
| 10296 | */ |
| 10297 | public static final String DEFAULT_DNS_SERVER = "default_dns_server"; |
| 10298 | |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10299 | /** |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10300 | * The requested Private DNS mode (string), and an accompanying specifier (string). |
| 10301 | * |
| 10302 | * Currently, the specifier holds the chosen provider name when the mode requests |
| 10303 | * a specific provider. It may be used to store the provider name even when the |
| 10304 | * mode changes so that temporarily disabling and re-enabling the specific |
| 10305 | * provider mode does not necessitate retyping the provider hostname. |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10306 | * |
| 10307 | * @hide |
| 10308 | */ |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10309 | public static final String PRIVATE_DNS_MODE = "private_dns_mode"; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10310 | |
| 10311 | private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10312 | |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10313 | /** |
| 10314 | * @hide |
| 10315 | */ |
| 10316 | public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10317 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10318 | private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10319 | |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10320 | /** {@hide} */ |
| 10321 | public static final String |
| 10322 | BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; |
| 10323 | /** {@hide} */ |
| 10324 | public static final String |
| 10325 | BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; |
| 10326 | /** {@hide} */ |
| 10327 | public static final String |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10328 | BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; |
| 10329 | /** {@hide} */ |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10330 | public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = |
| 10331 | "bluetooth_a2dp_supports_optional_codecs_"; |
| 10332 | /** {@hide} */ |
| 10333 | public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = |
| 10334 | "bluetooth_a2dp_optional_codecs_enabled_"; |
| 10335 | /** {@hide} */ |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10336 | public static final String |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10337 | BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10338 | /** {@hide} */ |
| 10339 | public static final String |
| 10340 | BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10341 | /** {@hide} */ |
| 10342 | public static final String |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10343 | BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; |
| 10344 | /** {@hide} */ |
| 10345 | public static final String |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 10346 | BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; |
| 10347 | /** {@hide} */ |
| 10348 | public static final String |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10349 | BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10350 | /** {@hide} */ |
| 10351 | public static final String |
| 10352 | BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10353 | /** {@hide} */ |
| 10354 | public static final String |
| 10355 | BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10356 | |
| 10357 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10358 | * Activity manager specific settings. |
| 10359 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10360 | * |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10361 | * "gc_timeout=5000,max_cached_processes=24" |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10362 | * |
| 10363 | * The following keys are supported: |
| 10364 | * |
| 10365 | * <pre> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10366 | * max_cached_processes (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10367 | * background_settle_time (long) |
Dianne Hackborn | cb01563 | 2017-06-14 17:30:15 -0700 | [diff] [blame] | 10368 | * fgservice_min_shown_time (long) |
| 10369 | * fgservice_min_report_time (long) |
| 10370 | * fgservice_screen_on_before_time (long) |
| 10371 | * fgservice_screen_on_after_time (long) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10372 | * content_provider_retain_time (long) |
| 10373 | * gc_timeout (long) |
| 10374 | * gc_min_interval (long) |
| 10375 | * full_pss_min_interval (long) |
| 10376 | * full_pss_lowered_interval (long) |
Dianne Hackborn | ffca58b | 2017-05-24 16:15:45 -0700 | [diff] [blame] | 10377 | * power_check_interval (long) |
| 10378 | * power_check_max_cpu_1 (int) |
| 10379 | * power_check_max_cpu_2 (int) |
| 10380 | * power_check_max_cpu_3 (int) |
| 10381 | * power_check_max_cpu_4 (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10382 | * service_usage_interaction_time (long) |
| 10383 | * usage_stats_interaction_interval (long) |
| 10384 | * service_restart_duration (long) |
| 10385 | * service_reset_run_duration (long) |
| 10386 | * service_restart_duration_factor (int) |
| 10387 | * service_min_restart_time_between (long) |
| 10388 | * service_max_inactivity (long) |
| 10389 | * service_bg_start_timeout (long) |
Sudheer Shanka | f669010 | 2017-10-16 10:20:32 -0700 | [diff] [blame] | 10390 | * process_start_async (boolean) |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10391 | * </pre> |
| 10392 | * |
| 10393 | * <p> |
| 10394 | * Type: string |
| 10395 | * @hide |
| 10396 | * @see com.android.server.am.ActivityManagerConstants |
| 10397 | */ |
| 10398 | public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; |
| 10399 | |
| 10400 | /** |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10401 | * Device Idle (Doze) specific settings. |
| 10402 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10403 | * |
Henrik Baard | eac10ab | 2016-04-19 07:50:24 +0200 | [diff] [blame] | 10404 | * "inactive_to=60000,sensing_to=400000" |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10405 | * |
| 10406 | * The following keys are supported: |
| 10407 | * |
| 10408 | * <pre> |
| 10409 | * inactive_to (long) |
| 10410 | * sensing_to (long) |
| 10411 | * motion_inactive_to (long) |
| 10412 | * idle_after_inactive_to (long) |
| 10413 | * idle_pending_to (long) |
| 10414 | * max_idle_pending_to (long) |
| 10415 | * idle_pending_factor (float) |
| 10416 | * idle_to (long) |
| 10417 | * max_idle_to (long) |
| 10418 | * idle_factor (float) |
| 10419 | * min_time_to_alarm (long) |
| 10420 | * max_temp_app_whitelist_duration (long) |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 10421 | * notification_whitelist_duration (long) |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10422 | * </pre> |
| 10423 | * |
| 10424 | * <p> |
| 10425 | * Type: string |
| 10426 | * @hide |
| 10427 | * @see com.android.server.DeviceIdleController.Constants |
| 10428 | */ |
| 10429 | public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; |
| 10430 | |
| 10431 | /** |
jackqdyulei | 455e90a | 2017-02-09 15:29:16 -0800 | [diff] [blame] | 10432 | * Battery Saver specific settings |
| 10433 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10434 | * |
| 10435 | * "vibration_disabled=true,adjust_brightness_factor=0.5" |
| 10436 | * |
| 10437 | * The following keys are supported: |
| 10438 | * |
| 10439 | * <pre> |
| 10440 | * vibration_disabled (boolean) |
| 10441 | * animation_disabled (boolean) |
| 10442 | * soundtrigger_disabled (boolean) |
| 10443 | * fullbackup_deferred (boolean) |
| 10444 | * keyvaluebackup_deferred (boolean) |
| 10445 | * firewall_disabled (boolean) |
| 10446 | * gps_mode (int) |
| 10447 | * adjust_brightness_disabled (boolean) |
| 10448 | * adjust_brightness_factor (float) |
| 10449 | * </pre> |
| 10450 | * @hide |
| 10451 | * @see com.android.server.power.BatterySaverPolicy |
| 10452 | */ |
| 10453 | public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; |
| 10454 | |
| 10455 | /** |
Makoto Onuki | 66a7812 | 2017-11-14 15:03:21 -0800 | [diff] [blame] | 10456 | * Battery Saver device specific settings |
| 10457 | * This is encoded as a key=value list, separated by commas. |
| 10458 | * See {@link com.android.server.power.BatterySaverPolicy} for the details. |
| 10459 | * |
| 10460 | * @hide |
| 10461 | */ |
| 10462 | public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = |
| 10463 | "battery_saver_device_specific_constants"; |
| 10464 | |
| 10465 | /** |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10466 | * Battery tip specific settings |
| 10467 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10468 | * |
| 10469 | * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10470 | * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," |
| 10471 | * "high_usage_battery_draining=25,high_usage_period_ms=3000" |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10472 | * |
| 10473 | * The following keys are supported: |
| 10474 | * |
| 10475 | * <pre> |
| 10476 | * battery_tip_enabled (boolean) |
| 10477 | * summary_enabled (boolean) |
| 10478 | * battery_saver_tip_enabled (boolean) |
| 10479 | * high_usage_enabled (boolean) |
| 10480 | * high_usage_app_count (int) |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10481 | * high_usage_period_ms (long) |
| 10482 | * high_usage_battery_draining (int) |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10483 | * app_restriction_enabled (boolean) |
| 10484 | * reduced_battery_enabled (boolean) |
| 10485 | * reduced_battery_percent (int) |
| 10486 | * low_battery_enabled (boolean) |
| 10487 | * low_battery_hour (int) |
| 10488 | * </pre> |
| 10489 | * @hide |
| 10490 | */ |
| 10491 | public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; |
| 10492 | |
| 10493 | /** |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10494 | * Battery anomaly detection specific settings |
| 10495 | * This is encoded as a key=value list, separated by commas. |
| 10496 | * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via |
| 10497 | * {@link Uri#encode(String)}, separated by colons. Ex: |
| 10498 | * |
| 10499 | * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," |
| 10500 | * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" |
| 10501 | * |
| 10502 | * The following keys are supported: |
| 10503 | * |
| 10504 | * <pre> |
| 10505 | * anomaly_detection_enabled (boolean) |
| 10506 | * wakelock_enabled (boolean) |
| 10507 | * wakelock_threshold (long) |
| 10508 | * wakeup_alarm_enabled (boolean) |
| 10509 | * wakeup_alarm_threshold (long) |
| 10510 | * wakeup_blacklisted_tags (string) |
| 10511 | * bluetooth_scan_enabled (boolean) |
| 10512 | * bluetooth_scan_threshold (long) |
| 10513 | * </pre> |
| 10514 | * @hide |
| 10515 | */ |
| 10516 | public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; |
| 10517 | |
| 10518 | /** |
jackqdyulei | fa81bee | 2018-02-01 11:16:23 -0800 | [diff] [blame] | 10519 | * An integer to show the version of the anomaly config. Ex: 1, which means |
| 10520 | * current version is 1. |
| 10521 | * @hide |
| 10522 | */ |
| 10523 | public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; |
| 10524 | |
| 10525 | /** |
| 10526 | * A base64-encoded string represents anomaly stats config, used for |
| 10527 | * {@link android.app.StatsManager}. |
| 10528 | * @hide |
| 10529 | */ |
| 10530 | public static final String ANOMALY_CONFIG = "anomaly_config"; |
| 10531 | |
| 10532 | /** |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10533 | * Always on display(AOD) specific settings |
| 10534 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10535 | * |
| 10536 | * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" |
| 10537 | * |
| 10538 | * The following keys are supported: |
| 10539 | * |
| 10540 | * <pre> |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 10541 | * screen_brightness_array (int[]) |
| 10542 | * dimming_scrim_array (int[]) |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10543 | * prox_screen_off_delay (long) |
| 10544 | * prox_cooldown_trigger (long) |
| 10545 | * prox_cooldown_period (long) |
| 10546 | * </pre> |
| 10547 | * @hide |
| 10548 | */ |
| 10549 | public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; |
| 10550 | |
| 10551 | /** |
Shikhar Srivastav | 9a896a6c | 2018-01-09 16:58:36 -0800 | [diff] [blame] | 10552 | * System VDSO global setting. This links to the "sys.vdso" system property. |
| 10553 | * The following values are supported: |
| 10554 | * false -> both 32 and 64 bit vdso disabled |
| 10555 | * 32 -> 32 bit vdso enabled |
| 10556 | * 64 -> 64 bit vdso enabled |
| 10557 | * Any other value defaults to both 32 bit and 64 bit true. |
| 10558 | * @hide |
| 10559 | */ |
| 10560 | public static final String SYS_VDSO = "sys_vdso"; |
| 10561 | |
| 10562 | /** |
Marissa Wall | 04e7a9b | 2018-02-02 09:35:58 -0800 | [diff] [blame] | 10563 | * UidCpuPower global setting. This links the sys.uidcpupower system property. |
| 10564 | * The following values are supported: |
| 10565 | * 0 -> /proc/uid_cpupower/* are disabled |
| 10566 | * 1 -> /proc/uid_cpupower/* are enabled |
| 10567 | * Any other value defaults to enabled. |
| 10568 | * @hide |
| 10569 | */ |
| 10570 | public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; |
| 10571 | |
| 10572 | /** |
Hector Dearman | cf92ca1 | 2018-03-07 11:12:35 +0000 | [diff] [blame] | 10573 | * traced global setting. This controls weather the deamons: traced and |
| 10574 | * traced_probes run. This links the sys.traced system property. |
| 10575 | * The following values are supported: |
| 10576 | * 0 -> traced and traced_probes are disabled |
| 10577 | * 1 -> traced and traced_probes are enabled |
| 10578 | * Any other value defaults to disabled. |
| 10579 | * @hide |
| 10580 | */ |
| 10581 | public static final String SYS_TRACED = "sys_traced"; |
| 10582 | |
| 10583 | /** |
Makoto Onuki | 3c9c998 | 2018-01-17 10:46:48 -0800 | [diff] [blame] | 10584 | * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the |
| 10585 | * device for this setting to take full effect. |
| 10586 | * |
| 10587 | * @hide |
| 10588 | */ |
| 10589 | public static final String FPS_DEVISOR = "fps_divisor"; |
| 10590 | |
| 10591 | /** |
Ajay Dudani | bcfcd6c | 2018-02-05 10:44:27 -0800 | [diff] [blame] | 10592 | * Flag to enable or disable display panel low power mode (lpm) |
| 10593 | * false -> Display panel power saving mode is disabled. |
| 10594 | * true -> Display panel power saving mode is enabled. |
| 10595 | * |
| 10596 | * @hide |
| 10597 | */ |
| 10598 | public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; |
| 10599 | |
| 10600 | /** |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10601 | * App standby (app idle) specific settings. |
| 10602 | * This is encoded as a key=value list, separated by commas. Ex: |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10603 | * <p> |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10604 | * "idle_duration=5000,parole_interval=4500" |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10605 | * <p> |
| 10606 | * All durations are in millis. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10607 | * The following keys are supported: |
| 10608 | * |
| 10609 | * <pre> |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10610 | * idle_duration2 (long) |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10611 | * wallclock_threshold (long) |
| 10612 | * parole_interval (long) |
| 10613 | * parole_duration (long) |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10614 | * |
| 10615 | * idle_duration (long) // This is deprecated and used to circumvent b/26355386. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10616 | * </pre> |
| 10617 | * |
| 10618 | * <p> |
| 10619 | * Type: string |
| 10620 | * @hide |
| 10621 | * @see com.android.server.usage.UsageStatsService.SettingsObserver |
| 10622 | */ |
| 10623 | public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; |
| 10624 | |
| 10625 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10626 | * Power manager specific settings. |
| 10627 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10628 | * |
| 10629 | * "no_cached_wake_locks=1" |
| 10630 | * |
| 10631 | * The following keys are supported: |
| 10632 | * |
| 10633 | * <pre> |
| 10634 | * no_cached_wake_locks (boolean) |
| 10635 | * </pre> |
| 10636 | * |
| 10637 | * <p> |
| 10638 | * Type: string |
| 10639 | * @hide |
| 10640 | * @see com.android.server.power.PowerManagerConstants |
| 10641 | */ |
| 10642 | public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; |
| 10643 | |
| 10644 | /** |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 10645 | * Alarm manager specific settings. |
| 10646 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10647 | * |
| 10648 | * "min_futurity=5000,allow_while_idle_short_time=4500" |
| 10649 | * |
| 10650 | * The following keys are supported: |
| 10651 | * |
| 10652 | * <pre> |
| 10653 | * min_futurity (long) |
| 10654 | * min_interval (long) |
| 10655 | * allow_while_idle_short_time (long) |
| 10656 | * allow_while_idle_long_time (long) |
| 10657 | * allow_while_idle_whitelist_duration (long) |
| 10658 | * </pre> |
| 10659 | * |
| 10660 | * <p> |
| 10661 | * Type: string |
| 10662 | * @hide |
| 10663 | * @see com.android.server.AlarmManagerService.Constants |
| 10664 | */ |
| 10665 | public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; |
| 10666 | |
| 10667 | /** |
Dianne Hackborn | e9a988c | 2016-05-27 17:59:40 -0700 | [diff] [blame] | 10668 | * Job scheduler specific settings. |
| 10669 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10670 | * |
| 10671 | * "min_ready_jobs_count=2,moderate_use_factor=.5" |
| 10672 | * |
| 10673 | * The following keys are supported: |
| 10674 | * |
| 10675 | * <pre> |
| 10676 | * min_idle_count (int) |
| 10677 | * min_charging_count (int) |
| 10678 | * min_connectivity_count (int) |
| 10679 | * min_content_count (int) |
| 10680 | * min_ready_jobs_count (int) |
| 10681 | * heavy_use_factor (float) |
| 10682 | * moderate_use_factor (float) |
| 10683 | * fg_job_count (int) |
| 10684 | * bg_normal_job_count (int) |
| 10685 | * bg_moderate_job_count (int) |
| 10686 | * bg_low_job_count (int) |
| 10687 | * bg_critical_job_count (int) |
| 10688 | * </pre> |
| 10689 | * |
| 10690 | * <p> |
| 10691 | * Type: string |
| 10692 | * @hide |
| 10693 | * @see com.android.server.job.JobSchedulerService.Constants |
| 10694 | */ |
| 10695 | public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; |
| 10696 | |
| 10697 | /** |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10698 | * ShortcutManager specific settings. |
| 10699 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10700 | * |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10701 | * "reset_interval_sec=86400,max_updates_per_interval=1" |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10702 | * |
| 10703 | * The following keys are supported: |
| 10704 | * |
| 10705 | * <pre> |
| 10706 | * reset_interval_sec (long) |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10707 | * max_updates_per_interval (int) |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10708 | * max_icon_dimension_dp (int, DP) |
| 10709 | * max_icon_dimension_dp_lowram (int, DP) |
| 10710 | * max_shortcuts (int) |
| 10711 | * icon_quality (int, 0-100) |
| 10712 | * icon_format (String) |
| 10713 | * </pre> |
| 10714 | * |
| 10715 | * <p> |
| 10716 | * Type: string |
| 10717 | * @hide |
| 10718 | * @see com.android.server.pm.ShortcutService.ConfigConstants |
| 10719 | */ |
| 10720 | public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; |
| 10721 | |
| 10722 | /** |
Makoto Onuki | 09c529a | 2017-05-01 10:05:28 -0700 | [diff] [blame] | 10723 | * DevicePolicyManager specific settings. |
| 10724 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10725 | * |
| 10726 | * <pre> |
| 10727 | * das_died_service_reconnect_backoff_sec (long) |
| 10728 | * das_died_service_reconnect_backoff_increase (float) |
| 10729 | * das_died_service_reconnect_max_backoff_sec (long) |
| 10730 | * </pre> |
| 10731 | * |
| 10732 | * <p> |
| 10733 | * Type: string |
| 10734 | * @hide |
| 10735 | * see also com.android.server.devicepolicy.DevicePolicyConstants |
| 10736 | */ |
| 10737 | public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; |
| 10738 | |
| 10739 | /** |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10740 | * TextClassifier specific settings. |
Jan Althaus | 0aacdb6 | 2018-02-19 11:44:37 +0100 | [diff] [blame] | 10741 | * This is encoded as a key=value list, separated by commas. String[] types like |
| 10742 | * entity_list_default use ":" as delimiter for values. Ex: |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10743 | * |
| 10744 | * <pre> |
Abodunrinwa Toki | c7073a4 | 2018-02-28 23:02:13 +0000 | [diff] [blame] | 10745 | * smart_linkify_enabled (boolean) |
| 10746 | * system_textclassifier_enabled (boolean) |
Abodunrinwa Toki | db8fc31 | 2018-02-26 21:37:51 +0000 | [diff] [blame] | 10747 | * model_dark_launch_enabled (boolean) |
| 10748 | * smart_selection_enabled (boolean) |
| 10749 | * smart_text_share_enabled (boolean) |
| 10750 | * smart_linkify_enabled (boolean) |
| 10751 | * smart_select_animation_enabled (boolean) |
Jan Althaus | 108aad3 | 2018-01-30 15:26:55 +0100 | [diff] [blame] | 10752 | * suggest_selection_max_range_length (int) |
| 10753 | * classify_text_max_range_length (int) |
| 10754 | * generate_links_max_text_length (int) |
Jan Althaus | 31efdc3 | 2018-02-19 22:23:13 +0100 | [diff] [blame] | 10755 | * generate_links_log_sample_rate (int) |
Jan Althaus | 0aacdb6 | 2018-02-19 11:44:37 +0100 | [diff] [blame] | 10756 | * entity_list_default (String[]) |
| 10757 | * entity_list_not_editable (String[]) |
| 10758 | * entity_list_editable (String[]) |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10759 | * </pre> |
| 10760 | * |
| 10761 | * <p> |
| 10762 | * Type: string |
| 10763 | * @hide |
Abodunrinwa Toki | db8fc31 | 2018-02-26 21:37:51 +0000 | [diff] [blame] | 10764 | * see also android.view.textclassifier.TextClassificationConstants |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10765 | */ |
| 10766 | public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; |
| 10767 | |
| 10768 | /** |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10769 | * BatteryStats specific settings. |
| 10770 | * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" |
| 10771 | * |
| 10772 | * The following keys are supported: |
| 10773 | * <pre> |
| 10774 | * track_cpu_times_by_proc_state (boolean) |
Mike Ma | fae87da | 2018-01-19 20:07:20 -0800 | [diff] [blame] | 10775 | * track_cpu_active_cluster_time (boolean) |
| 10776 | * read_binary_cpu_time (boolean) |
Sudheer Shanka | c20379e | 2018-02-15 00:06:21 -0800 | [diff] [blame] | 10777 | * proc_state_cpu_times_read_delay_ms (long) |
Sudheer Shanka | e56013a | 2018-04-23 11:22:15 -0700 | [diff] [blame] | 10778 | * external_stats_collection_rate_limit_ms (long) |
Sudheer Shanka | 0719c6a | 2018-04-24 11:12:11 -0700 | [diff] [blame] | 10779 | * battery_level_collection_delay_ms (long) |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10780 | * </pre> |
| 10781 | * |
| 10782 | * <p> |
| 10783 | * Type: string |
| 10784 | * @hide |
| 10785 | * see also com.android.internal.os.BatteryStatsImpl.Constants |
| 10786 | */ |
| 10787 | public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; |
| 10788 | |
| 10789 | /** |
Makoto Onuki | aad2b51 | 2018-02-07 09:31:46 -0800 | [diff] [blame] | 10790 | * SyncManager specific settings. |
| 10791 | * |
| 10792 | * <p> |
| 10793 | * Type: string |
| 10794 | * @hide |
| 10795 | * @see com.android.server.content.SyncManagerConstants |
| 10796 | */ |
| 10797 | public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; |
| 10798 | |
| 10799 | /** |
Lei Yu | 4b976ad | 2018-04-19 10:38:58 -0700 | [diff] [blame] | 10800 | * Whether or not App Standby feature is enabled by system. This controls throttling of apps |
| 10801 | * based on usage patterns and predictions. Platform will turn on this feature if both this |
| 10802 | * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10803 | * Type: int (0 for false, 1 for true) |
| 10804 | * Default: 1 |
| 10805 | * @hide |
Lei Yu | 4b976ad | 2018-04-19 10:38:58 -0700 | [diff] [blame] | 10806 | * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10807 | */ |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10808 | public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10809 | |
| 10810 | /** |
Lei Yu | 4b976ad | 2018-04-19 10:38:58 -0700 | [diff] [blame] | 10811 | * Whether or not adaptive battery feature is enabled by user. Platform will turn on this |
| 10812 | * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on. |
| 10813 | * Type: int (0 for false, 1 for true) |
| 10814 | * Default: 1 |
| 10815 | * @hide |
| 10816 | * @see #APP_STANDBY_ENABLED |
| 10817 | */ |
| 10818 | public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED = |
| 10819 | "adaptive_battery_management_enabled"; |
| 10820 | |
| 10821 | /** |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 10822 | * Whether or not app auto restriction is enabled. When it is enabled, settings app will |
| 10823 | * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time). |
| 10824 | * |
| 10825 | * Type: boolean (0 for false, 1 for true) |
| 10826 | * Default: 1 |
| 10827 | * |
| 10828 | * @hide |
| 10829 | */ |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10830 | public static final String APP_AUTO_RESTRICTION_ENABLED = |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 10831 | "app_auto_restriction_enabled"; |
| 10832 | |
| 10833 | private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR = |
| 10834 | BOOLEAN_VALIDATOR; |
| 10835 | |
| 10836 | /** |
Suprabh Shukla | 4deb852 | 2018-01-08 16:27:10 -0800 | [diff] [blame] | 10837 | * Feature flag to enable or disable the Forced App Standby feature. |
| 10838 | * Type: int (0 for false, 1 for true) |
| 10839 | * Default: 1 |
| 10840 | * @hide |
| 10841 | */ |
| 10842 | public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; |
| 10843 | |
| 10844 | /** |
Nancy Zheng | 525aaa1 | 2018-01-12 11:45:37 -0800 | [diff] [blame] | 10845 | * Whether or not to enable Forced App Standby on small battery devices. |
| 10846 | * Type: int (0 for false, 1 for true) |
| 10847 | * Default: 0 |
| 10848 | * @hide |
| 10849 | */ |
| 10850 | public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED |
| 10851 | = "forced_app_standby_for_small_battery_enabled"; |
| 10852 | |
| 10853 | /** |
Damien Bargiacchi | 50b6110 | 2018-02-15 16:45:37 -0800 | [diff] [blame] | 10854 | * Whether or not to enable the Off Body, Radios Off feature on small battery devices. |
| 10855 | * Type: int (0 for false, 1 for true) |
| 10856 | * Default: 0 |
| 10857 | * @hide |
| 10858 | */ |
| 10859 | public static final String OFF_BODY_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED |
| 10860 | = "off_body_radios_off_for_small_battery_enabled"; |
| 10861 | |
| 10862 | /** |
| 10863 | * How long after the device goes off body to disable radios, in milliseconds. |
| 10864 | * Type: long |
| 10865 | * Default: 10 minutes |
| 10866 | * @hide |
| 10867 | */ |
| 10868 | public static final String OFF_BODY_RADIOS_OFF_DELAY_MS = "off_body_radios_off_delay_ms"; |
| 10869 | |
| 10870 | /** |
yuanlu | b6b0495 | 2018-02-20 14:28:13 -0800 | [diff] [blame] | 10871 | * Whether or not to turn on Wifi when proxy is disconnected. |
| 10872 | * Type: int (0 for false, 1 for true) |
| 10873 | * Default: 1 |
| 10874 | * @hide |
| 10875 | */ |
| 10876 | public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED |
| 10877 | = "wifi_on_when_proxy_disconnected"; |
| 10878 | |
| 10879 | /** |
Michael Kwan | 5f5a0bf | 2018-03-16 12:25:50 -0700 | [diff] [blame] | 10880 | * Time Only Mode specific settings. |
| 10881 | * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" |
| 10882 | * |
| 10883 | * The following keys are supported: |
| 10884 | * |
| 10885 | * <pre> |
| 10886 | * enabled (boolean) |
| 10887 | * disable_tilt_to_wake (boolean) |
| 10888 | * disable_touch_to_wake (boolean) |
| 10889 | * </pre> |
| 10890 | * Type: string |
Michael Kwan | 47abf8c | 2018-01-23 13:57:18 -0800 | [diff] [blame] | 10891 | * @hide |
| 10892 | */ |
Michael Kwan | 5f5a0bf | 2018-03-16 12:25:50 -0700 | [diff] [blame] | 10893 | public static final String TIME_ONLY_MODE_CONSTANTS |
| 10894 | = "time_only_mode_constants"; |
Michael Kwan | 47abf8c | 2018-01-23 13:57:18 -0800 | [diff] [blame] | 10895 | |
| 10896 | /** |
Robin Bennett | 1193a35 | 2018-03-28 14:49:58 +0100 | [diff] [blame] | 10897 | * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on |
| 10898 | * watch type devices. |
| 10899 | * Type: int (0 for false, 1 for true) |
| 10900 | * Default: 0 |
| 10901 | * @hide |
| 10902 | */ |
| 10903 | public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled"; |
| 10904 | |
| 10905 | /** |
Ricky Wai | eef5065 | 2017-12-21 16:27:40 +0000 | [diff] [blame] | 10906 | * Whether or not Network Watchlist feature is enabled. |
| 10907 | * Type: int (0 for false, 1 for true) |
| 10908 | * Default: 0 |
| 10909 | * @hide |
| 10910 | */ |
| 10911 | public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; |
| 10912 | |
| 10913 | /** |
Robin Lee | 81ad972 | 2018-01-19 16:34:31 +0100 | [diff] [blame] | 10914 | * Flag to keep background restricted profiles running after exiting. If disabled, |
| 10915 | * the restricted profile can be put into stopped state as soon as the user leaves it. |
| 10916 | * Type: int (0 for false, 1 for true) |
| 10917 | * |
| 10918 | * Overridden by the system based on device information. If null, the value specified |
| 10919 | * by {@code config_keepRestrictedProfilesInBackground} is used. |
| 10920 | * |
| 10921 | * @hide |
| 10922 | */ |
| 10923 | public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; |
| 10924 | |
| 10925 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10926 | * Get the key that retrieves a bluetooth headset's priority. |
| 10927 | * @hide |
| 10928 | */ |
| 10929 | public static final String getBluetoothHeadsetPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10930 | return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10931 | } |
| 10932 | |
| 10933 | /** |
| 10934 | * Get the key that retrieves a bluetooth a2dp sink's priority. |
| 10935 | * @hide |
| 10936 | */ |
| 10937 | public static final String getBluetoothA2dpSinkPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10938 | return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10939 | } |
| 10940 | |
| 10941 | /** |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10942 | * Get the key that retrieves a bluetooth a2dp src's priority. |
| 10943 | * @hide |
| 10944 | */ |
| 10945 | public static final String getBluetoothA2dpSrcPriorityKey(String address) { |
| 10946 | return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10947 | } |
| 10948 | |
| 10949 | /** |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10950 | * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs. |
| 10951 | * @hide |
| 10952 | */ |
| 10953 | public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) { |
| 10954 | return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX + |
| 10955 | address.toUpperCase(Locale.ROOT); |
| 10956 | } |
| 10957 | |
| 10958 | /** |
| 10959 | * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs |
| 10960 | * enabled. |
| 10961 | * @hide |
| 10962 | */ |
| 10963 | public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) { |
| 10964 | return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX + |
| 10965 | address.toUpperCase(Locale.ROOT); |
| 10966 | } |
| 10967 | |
| 10968 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10969 | * Get the key that retrieves a bluetooth Input Device's priority. |
| 10970 | * @hide |
| 10971 | */ |
Hansong Zhang | c26c76c | 2017-10-20 15:55:59 -0700 | [diff] [blame] | 10972 | public static final String getBluetoothHidHostPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10973 | return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10974 | } |
| 10975 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10976 | /** |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10977 | * Get the key that retrieves a bluetooth pan client priority. |
| 10978 | * @hide |
| 10979 | */ |
| 10980 | public static final String getBluetoothPanPriorityKey(String address) { |
| 10981 | return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10982 | } |
| 10983 | |
| 10984 | /** |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10985 | * Get the key that retrieves a bluetooth hearing aid priority. |
| 10986 | * @hide |
| 10987 | */ |
| 10988 | public static final String getBluetoothHearingAidPriorityKey(String address) { |
| 10989 | return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10990 | } |
| 10991 | |
| 10992 | /** |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10993 | * Get the key that retrieves a bluetooth map priority. |
| 10994 | * @hide |
| 10995 | */ |
| 10996 | public static final String getBluetoothMapPriorityKey(String address) { |
| 10997 | return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10998 | } |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10999 | |
| 11000 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 11001 | * Get the key that retrieves a bluetooth map client priority. |
| 11002 | * @hide |
| 11003 | */ |
| 11004 | public static final String getBluetoothMapClientPriorityKey(String address) { |
| 11005 | return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 11006 | } |
| 11007 | |
| 11008 | /** |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 11009 | * Get the key that retrieves a bluetooth pbap client priority. |
| 11010 | * @hide |
| 11011 | */ |
| 11012 | public static final String getBluetoothPbapClientPriorityKey(String address) { |
| 11013 | return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 11014 | } |
| 11015 | |
| 11016 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 11017 | * Get the key that retrieves a bluetooth sap priority. |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 11018 | * @hide |
| 11019 | */ |
| 11020 | public static final String getBluetoothSapPriorityKey(String address) { |
| 11021 | return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 11022 | } |
| 11023 | |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 11024 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11025 | * Scaling factor for normal window animations. Setting to 0 will |
| 11026 | * disable window animations. |
| 11027 | */ |
| 11028 | public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; |
| 11029 | |
| 11030 | /** |
| 11031 | * Scaling factor for activity transition animations. Setting to 0 will |
| 11032 | * disable window animations. |
| 11033 | */ |
| 11034 | public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; |
| 11035 | |
| 11036 | /** |
| 11037 | * Scaling factor for Animator-based animations. This affects both the |
| 11038 | * start delay and duration of all such animations. Setting to 0 will |
| 11039 | * cause animations to end immediately. The default value is 1. |
| 11040 | */ |
| 11041 | public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; |
| 11042 | |
| 11043 | /** |
| 11044 | * Scaling factor for normal window animations. Setting to 0 will |
| 11045 | * disable window animations. |
| 11046 | * |
| 11047 | * @hide |
| 11048 | */ |
| 11049 | public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; |
| 11050 | |
| 11051 | /** |
| 11052 | * If 0, the compatibility mode is off for all applications. |
| 11053 | * If 1, older applications run under compatibility mode. |
| 11054 | * TODO: remove this settings before code freeze (bug/1907571) |
| 11055 | * @hide |
| 11056 | */ |
| 11057 | public static final String COMPATIBILITY_MODE = "compatibility_mode"; |
| 11058 | |
| 11059 | /** |
| 11060 | * CDMA only settings |
| 11061 | * Emergency Tone 0 = Off |
| 11062 | * 1 = Alert |
| 11063 | * 2 = Vibrate |
| 11064 | * @hide |
| 11065 | */ |
| 11066 | public static final String EMERGENCY_TONE = "emergency_tone"; |
| 11067 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11068 | private static final Validator EMERGENCY_TONE_VALIDATOR = |
| 11069 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 11070 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11071 | /** |
| 11072 | * CDMA only settings |
| 11073 | * Whether the auto retry is enabled. The value is |
| 11074 | * boolean (1 or 0). |
| 11075 | * @hide |
| 11076 | */ |
| 11077 | public static final String CALL_AUTO_RETRY = "call_auto_retry"; |
| 11078 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11079 | private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR; |
| 11080 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11081 | /** |
Selim Cinek | 705442f | 2016-09-13 16:02:33 -0700 | [diff] [blame] | 11082 | * A setting that can be read whether the emergency affordance is currently needed. |
| 11083 | * The value is a boolean (1 or 0). |
| 11084 | * @hide |
| 11085 | */ |
| 11086 | public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; |
| 11087 | |
| 11088 | /** |
Sungmin Choi | e099ab1 | 2014-06-09 14:45:51 +0900 | [diff] [blame] | 11089 | * See RIL_PreferredNetworkType in ril.h |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11090 | * @hide |
| 11091 | */ |
| 11092 | public static final String PREFERRED_NETWORK_MODE = |
| 11093 | "preferred_network_mode"; |
| 11094 | |
| 11095 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11096 | * Name of an application package to be debugged. |
| 11097 | */ |
| 11098 | public static final String DEBUG_APP = "debug_app"; |
| 11099 | |
| 11100 | /** |
| 11101 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 11102 | * starting user code. If 0, it will run normally. |
| 11103 | */ |
| 11104 | public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; |
| 11105 | |
| 11106 | /** |
Cody Northrop | 86cedcb | 2017-10-20 09:03:13 -0600 | [diff] [blame] | 11107 | * Allow GPU debug layers? |
| 11108 | * 0 = no |
| 11109 | * 1 = yes |
| 11110 | * @hide |
| 11111 | */ |
| 11112 | public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; |
| 11113 | |
| 11114 | /** |
| 11115 | * App allowed to load GPU debug layers |
| 11116 | * @hide |
| 11117 | */ |
| 11118 | public static final String GPU_DEBUG_APP = "gpu_debug_app"; |
| 11119 | |
| 11120 | /** |
| 11121 | * Ordered GPU debug layer list |
| 11122 | * i.e. <layer1>:<layer2>:...:<layerN> |
| 11123 | * @hide |
| 11124 | */ |
| 11125 | public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; |
| 11126 | |
| 11127 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11128 | * Control whether the process CPU usage meter should be shown. |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 11129 | * |
| 11130 | * @deprecated This functionality is no longer available as of |
| 11131 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11132 | */ |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 11133 | @Deprecated |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11134 | public static final String SHOW_PROCESSES = "show_processes"; |
| 11135 | |
| 11136 | /** |
Makoto Onuki | a3cd7b9 | 2018-03-19 14:47:05 -0700 | [diff] [blame] | 11137 | * If 1 low power mode (aka battery saver) is enabled. |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 11138 | * @hide |
| 11139 | */ |
Makoto Onuki | f9046a2 | 2018-01-12 10:32:32 -0800 | [diff] [blame] | 11140 | @TestApi |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 11141 | public static final String LOW_POWER_MODE = "low_power"; |
| 11142 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 11143 | /** |
Makoto Onuki | a3cd7b9 | 2018-03-19 14:47:05 -0700 | [diff] [blame] | 11144 | * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device |
| 11145 | * is unplugged from a charger or rebooted. |
| 11146 | * @hide |
| 11147 | */ |
| 11148 | @TestApi |
| 11149 | public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; |
| 11150 | |
| 11151 | /** |
Makoto Onuki | 45a772e | 2018-02-01 15:27:53 -0800 | [diff] [blame] | 11152 | * Battery level [1-100] at which low power mode automatically turns on. |
Dianne Hackborn | 1427230 | 2014-06-10 23:13:02 -0700 | [diff] [blame] | 11153 | * If 0, it will not automatically turn on. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 11154 | * @hide |
| 11155 | */ |
| 11156 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; |
| 11157 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11158 | private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = |
Makoto Onuki | 45a772e | 2018-02-01 15:27:53 -0800 | [diff] [blame] | 11159 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 100); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11160 | |
Makoto Onuki | 524b4dfe | 2018-03-06 17:34:15 -0800 | [diff] [blame] | 11161 | |
| 11162 | /** |
| 11163 | * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set |
| 11164 | * or the value is 0, the default max will be used. |
| 11165 | * |
| 11166 | * @hide |
| 11167 | */ |
| 11168 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; |
| 11169 | |
Makoto Onuki | bc064d4b | 2018-03-27 14:48:42 -0700 | [diff] [blame] | 11170 | /** |
| 11171 | * See com.android.settingslib.fuelgauge.BatterySaverUtils. |
| 11172 | * @hide |
| 11173 | */ |
| 11174 | public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = |
| 11175 | "low_power_mode_suggestion_params"; |
| 11176 | |
| 11177 | /** |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 11178 | * If not 0, the activity manager will aggressively finish activities and |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11179 | * processes as soon as they are no longer needed. If 0, the normal |
| 11180 | * extended lifetime is used. |
| 11181 | */ |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 11182 | public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11183 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11184 | /** |
Dianne Hackborn | 82b17ca | 2018-04-06 16:00:08 -0700 | [diff] [blame] | 11185 | * If nonzero, all system error dialogs will be hidden. For example, the |
| 11186 | * crash and ANR dialogs will not be shown, and the system will just proceed |
| 11187 | * as if they had been accepted by the user. |
| 11188 | * @hide |
| 11189 | */ |
| 11190 | public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs"; |
| 11191 | |
| 11192 | /** |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 11193 | * Use Dock audio output for media: |
| 11194 | * 0 = disabled |
| 11195 | * 1 = enabled |
| 11196 | * @hide |
| 11197 | */ |
| 11198 | public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; |
| 11199 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11200 | private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 11201 | |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 11202 | /** |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11203 | * The surround sound formats AC3, DTS or IEC61937 are |
| 11204 | * available for use if they are detected. |
| 11205 | * This is the default mode. |
| 11206 | * |
| 11207 | * Note that AUTO is equivalent to ALWAYS for Android TVs and other |
| 11208 | * devices that have an S/PDIF output. This is because S/PDIF |
| 11209 | * is unidirectional and the TV cannot know if a decoder is |
| 11210 | * connected. So it assumes they are always available. |
| 11211 | * @hide |
| 11212 | */ |
| 11213 | public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; |
| 11214 | |
| 11215 | /** |
| 11216 | * AC3, DTS or IEC61937 are NEVER available, even if they |
| 11217 | * are detected by the hardware. Those formats will not be |
| 11218 | * reported. |
| 11219 | * |
| 11220 | * An example use case would be an AVR reports that it is capable of |
| 11221 | * surround sound decoding but is broken. If NEVER is chosen |
| 11222 | * then apps must use PCM output instead of encoded output. |
| 11223 | * @hide |
| 11224 | */ |
| 11225 | public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; |
| 11226 | |
| 11227 | /** |
| 11228 | * AC3, DTS or IEC61937 are ALWAYS available, even if they |
| 11229 | * are not detected by the hardware. Those formats will be |
| 11230 | * reported as part of the HDMI output capability. Applications |
| 11231 | * are then free to use either PCM or encoded output. |
| 11232 | * |
| 11233 | * An example use case would be a when TV was connected over |
| 11234 | * TOS-link to an AVR. But the TV could not see it because TOS-link |
| 11235 | * is unidirectional. |
| 11236 | * @hide |
| 11237 | */ |
| 11238 | public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; |
| 11239 | |
| 11240 | /** |
| 11241 | * Set to ENCODED_SURROUND_OUTPUT_AUTO, |
| 11242 | * ENCODED_SURROUND_OUTPUT_NEVER or |
| 11243 | * ENCODED_SURROUND_OUTPUT_ALWAYS |
| 11244 | * @hide |
| 11245 | */ |
| 11246 | public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; |
| 11247 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11248 | private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR = |
| 11249 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 11250 | |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11251 | /** |
Eric Laurent | 05274f3 | 2012-11-29 12:48:18 -0800 | [diff] [blame] | 11252 | * Persisted safe headphone volume management state by AudioService |
| 11253 | * @hide |
| 11254 | */ |
| 11255 | public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; |
| 11256 | |
| 11257 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11258 | * URL for tzinfo (time zone) updates |
| 11259 | * @hide |
| 11260 | */ |
| 11261 | public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; |
| 11262 | |
| 11263 | /** |
| 11264 | * URL for tzinfo (time zone) update metadata |
| 11265 | * @hide |
| 11266 | */ |
| 11267 | public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; |
| 11268 | |
| 11269 | /** |
| 11270 | * URL for selinux (mandatory access control) updates |
| 11271 | * @hide |
| 11272 | */ |
| 11273 | public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; |
| 11274 | |
| 11275 | /** |
| 11276 | * URL for selinux (mandatory access control) update metadata |
| 11277 | * @hide |
| 11278 | */ |
| 11279 | public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; |
| 11280 | |
| 11281 | /** |
| 11282 | * URL for sms short code updates |
| 11283 | * @hide |
| 11284 | */ |
| 11285 | public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = |
| 11286 | "sms_short_codes_content_url"; |
| 11287 | |
| 11288 | /** |
| 11289 | * URL for sms short code update metadata |
| 11290 | * @hide |
| 11291 | */ |
| 11292 | public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = |
| 11293 | "sms_short_codes_metadata_url"; |
| 11294 | |
| 11295 | /** |
Amit Mahajan | 9069fab | 2015-05-01 11:05:47 -0700 | [diff] [blame] | 11296 | * URL for apn_db updates |
| 11297 | * @hide |
| 11298 | */ |
| 11299 | public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; |
| 11300 | |
| 11301 | /** |
| 11302 | * URL for apn_db update metadata |
| 11303 | * @hide |
| 11304 | */ |
| 11305 | public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; |
| 11306 | |
| 11307 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11308 | * URL for cert pinlist updates |
| 11309 | * @hide |
| 11310 | */ |
| 11311 | public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; |
| 11312 | |
| 11313 | /** |
| 11314 | * URL for cert pinlist updates |
| 11315 | * @hide |
| 11316 | */ |
| 11317 | public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; |
| 11318 | |
Geremy Condra | 757ee52 | 2013-03-29 16:39:45 -0700 | [diff] [blame] | 11319 | /** |
Ben Gruver | 633dc9b | 2013-04-04 12:05:49 -0700 | [diff] [blame] | 11320 | * URL for intent firewall updates |
| 11321 | * @hide |
| 11322 | */ |
| 11323 | public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = |
| 11324 | "intent_firewall_content_url"; |
| 11325 | |
| 11326 | /** |
| 11327 | * URL for intent firewall update metadata |
| 11328 | * @hide |
| 11329 | */ |
| 11330 | public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = |
| 11331 | "intent_firewall_metadata_url"; |
| 11332 | |
| 11333 | /** |
Abodunrinwa Toki | 51c4203 | 2017-04-02 19:16:01 +0100 | [diff] [blame] | 11334 | * URL for lang id model updates |
| 11335 | * @hide |
| 11336 | */ |
| 11337 | public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; |
| 11338 | |
| 11339 | /** |
| 11340 | * URL for lang id model update metadata |
| 11341 | * @hide |
| 11342 | */ |
| 11343 | public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; |
| 11344 | |
| 11345 | /** |
Abodunrinwa Toki | bb957d1 | 2017-04-12 14:40:46 +0100 | [diff] [blame] | 11346 | * URL for smart selection model updates |
| 11347 | * @hide |
| 11348 | */ |
| 11349 | public static final String SMART_SELECTION_UPDATE_CONTENT_URL = |
| 11350 | "smart_selection_content_url"; |
| 11351 | |
| 11352 | /** |
| 11353 | * URL for smart selection model update metadata |
| 11354 | * @hide |
| 11355 | */ |
| 11356 | public static final String SMART_SELECTION_UPDATE_METADATA_URL = |
| 11357 | "smart_selection_metadata_url"; |
| 11358 | |
| 11359 | /** |
Geremy Condra | 4e7f7e8 | 2013-03-26 21:09:01 -0700 | [diff] [blame] | 11360 | * SELinux enforcement status. If 0, permissive; if 1, enforcing. |
| 11361 | * @hide |
| 11362 | */ |
| 11363 | public static final String SELINUX_STATUS = "selinux_status"; |
| 11364 | |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11365 | /** |
Amith Yamasani | d8415f4 | 2013-08-07 20:15:10 -0700 | [diff] [blame] | 11366 | * Developer setting to force RTL layout. |
| 11367 | * @hide |
| 11368 | */ |
| 11369 | public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; |
| 11370 | |
| 11371 | /** |
Daniel Sandler | dea6462 | 2013-09-23 16:05:57 -0400 | [diff] [blame] | 11372 | * Milliseconds after screen-off after which low battery sounds will be silenced. |
| 11373 | * |
| 11374 | * If zero, battery sounds will always play. |
| 11375 | * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. |
| 11376 | * |
| 11377 | * @hide |
| 11378 | */ |
| 11379 | public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; |
| 11380 | |
| 11381 | /** |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 11382 | * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 11383 | * the caller is done with this, they should call {@link ContentResolver#delete} to |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 11384 | * clean up any value that they may have written. |
| 11385 | * |
| 11386 | * @hide |
| 11387 | */ |
| 11388 | public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; |
| 11389 | |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 11390 | /** |
| 11391 | * Defines global runtime overrides to window policy. |
| 11392 | * |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 11393 | * See {@link com.android.server.policy.PolicyControl} for value format. |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 11394 | * |
| 11395 | * @hide |
| 11396 | */ |
| 11397 | public static final String POLICY_CONTROL = "policy_control"; |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 11398 | |
| 11399 | /** |
Adrian Roos | 000cf5e | 2017-11-10 15:55:18 +0100 | [diff] [blame] | 11400 | * {@link android.view.DisplayCutout DisplayCutout} emulation mode. |
| 11401 | * |
| 11402 | * @hide |
| 11403 | */ |
| 11404 | public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; |
| 11405 | |
| 11406 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; |
| 11407 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; |
| 11408 | |
| 11409 | /** |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11410 | * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, |
| 11411 | * or ZEN_MODE_NO_INTERRUPTIONS. |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11412 | * |
| 11413 | * @hide |
| 11414 | */ |
| 11415 | public static final String ZEN_MODE = "zen_mode"; |
| 11416 | |
| 11417 | /** @hide */ public static final int ZEN_MODE_OFF = 0; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11418 | /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; |
| 11419 | /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 11420 | /** @hide */ public static final int ZEN_MODE_ALARMS = 3; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11421 | |
| 11422 | /** @hide */ public static String zenModeToString(int mode) { |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11423 | if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 11424 | if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11425 | if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; |
| 11426 | return "ZEN_MODE_OFF"; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11427 | } |
| 11428 | |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 11429 | /** @hide */ public static boolean isValidZenMode(int value) { |
| 11430 | switch (value) { |
| 11431 | case Global.ZEN_MODE_OFF: |
| 11432 | case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: |
| 11433 | case Global.ZEN_MODE_ALARMS: |
| 11434 | case Global.ZEN_MODE_NO_INTERRUPTIONS: |
| 11435 | return true; |
| 11436 | default: |
| 11437 | return false; |
| 11438 | } |
| 11439 | } |
| 11440 | |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11441 | /** |
Julia Reynolds | 9b11fdb | 2015-07-31 09:49:55 -0400 | [diff] [blame] | 11442 | * Value of the ringer before entering zen mode. |
| 11443 | * |
| 11444 | * @hide |
| 11445 | */ |
| 11446 | public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; |
| 11447 | |
| 11448 | /** |
John Spurlock | 056c519 | 2014-04-20 21:52:01 -0400 | [diff] [blame] | 11449 | * Opaque value, changes when persisted zen mode configuration changes. |
| 11450 | * |
| 11451 | * @hide |
| 11452 | */ |
| 11453 | public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; |
| 11454 | |
| 11455 | /** |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11456 | * If 0, turning on dnd manually will last indefinitely. |
| 11457 | * Else if non-negative, turning on dnd manually will last for this many minutes. |
| 11458 | * Else (if negative), turning on dnd manually will surface a dialog that prompts |
| 11459 | * user to specify a duration. |
| 11460 | * @hide |
| 11461 | */ |
| 11462 | public static final String ZEN_DURATION = "zen_duration"; |
| 11463 | |
| 11464 | private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR; |
| 11465 | |
| 11466 | /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; |
| 11467 | /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; |
| 11468 | |
| 11469 | /** |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 11470 | * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. |
| 11471 | * |
| 11472 | * @hide |
| 11473 | */ |
Chris Wren | 10d82df | 2014-03-01 10:34:51 -0500 | [diff] [blame] | 11474 | public static final String HEADS_UP_NOTIFICATIONS_ENABLED = |
| 11475 | "heads_up_notifications_enabled"; |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 11476 | |
| 11477 | /** @hide */ public static final int HEADS_UP_OFF = 0; |
| 11478 | /** @hide */ public static final int HEADS_UP_ON = 1; |
| 11479 | |
| 11480 | /** |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 11481 | * The name of the device |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 11482 | */ |
| 11483 | public static final String DEVICE_NAME = "device_name"; |
| 11484 | |
| 11485 | /** |
Jeff Davidson | 56f9f73 | 2014-08-14 16:47:23 -0700 | [diff] [blame] | 11486 | * Whether the NetworkScoringService has been first initialized. |
| 11487 | * <p> |
| 11488 | * Type: int (0 for false, 1 for true) |
| 11489 | * @hide |
| 11490 | */ |
| 11491 | public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; |
| 11492 | |
| 11493 | /** |
Jim Miller | 6848dc8 | 2014-10-13 18:51:53 -0700 | [diff] [blame] | 11494 | * Whether the user wants to be prompted for password to decrypt the device on boot. |
| 11495 | * This only matters if the storage is encrypted. |
| 11496 | * <p> |
| 11497 | * Type: int (0 for false, 1 for true) |
| 11498 | * @hide |
| 11499 | */ |
| 11500 | public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; |
| 11501 | |
| 11502 | /** |
manabu, shimoda | 14723e3 | 2017-10-06 14:39:01 +0900 | [diff] [blame] | 11503 | * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config |
| 11504 | * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}. |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11505 | * <p> |
| 11506 | * Type: int (0 for false, 1 for true) |
| 11507 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11508 | * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED} |
| 11509 | * instead. |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11510 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11511 | @Deprecated |
| 11512 | public static final String ENHANCED_4G_MODE_ENABLED = |
| 11513 | SubscriptionManager.ENHANCED_4G_MODE_ENABLED; |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11514 | |
| 11515 | /** |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11516 | * Whether VT (Video Telephony over IMS) is enabled |
| 11517 | * <p> |
| 11518 | * Type: int (0 for false, 1 for true) |
| 11519 | * |
| 11520 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11521 | * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead. |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11522 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11523 | @Deprecated |
| 11524 | public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED; |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11525 | |
| 11526 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11527 | * Whether WFC is enabled |
| 11528 | * <p> |
| 11529 | * Type: int (0 for false, 1 for true) |
| 11530 | * |
| 11531 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11532 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11533 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11534 | @Deprecated |
| 11535 | public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11536 | |
| 11537 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11538 | * WFC mode on home/non-roaming network. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11539 | * <p> |
| 11540 | * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only |
| 11541 | * |
| 11542 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11543 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11544 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11545 | @Deprecated |
| 11546 | public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11547 | |
| 11548 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11549 | * WFC mode on roaming network. |
| 11550 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 11551 | * Type: int - see {@link #WFC_IMS_MODE} for values |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11552 | * |
| 11553 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11554 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE} |
| 11555 | * instead. |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11556 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11557 | @Deprecated |
| 11558 | public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE; |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11559 | |
| 11560 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11561 | * Whether WFC roaming is enabled |
| 11562 | * <p> |
| 11563 | * Type: int (0 for false, 1 for true) |
| 11564 | * |
| 11565 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11566 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED} |
| 11567 | * instead |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11568 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11569 | @Deprecated |
| 11570 | public static final String WFC_IMS_ROAMING_ENABLED = |
| 11571 | SubscriptionManager.WFC_IMS_ROAMING_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11572 | |
| 11573 | /** |
Amit Mahajan | 4fea092 | 2014-11-18 12:56:28 -0800 | [diff] [blame] | 11574 | * Whether user can enable/disable LTE as a preferred network. A carrier might control |
| 11575 | * this via gservices, OMA-DM, carrier app, etc. |
| 11576 | * <p> |
| 11577 | * Type: int (0 for false, 1 for true) |
| 11578 | * @hide |
| 11579 | */ |
| 11580 | public static final String LTE_SERVICE_FORCED = "lte_service_forced"; |
| 11581 | |
| 11582 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11583 | * Ephemeral app cookie max size in bytes. |
| 11584 | * <p> |
| 11585 | * Type: int |
| 11586 | * @hide |
| 11587 | */ |
| 11588 | public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = |
| 11589 | "ephemeral_cookie_max_size_bytes"; |
| 11590 | |
| 11591 | /** |
Todd Kennedy | d15bb75 | 2016-09-13 16:38:31 -0700 | [diff] [blame] | 11592 | * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is |
| 11593 | * enabled. Set to zero to disable. |
| 11594 | * <p> |
| 11595 | * Type: int (0 for false, 1 for true) |
| 11596 | * |
| 11597 | * @hide |
| 11598 | */ |
| 11599 | public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; |
| 11600 | |
| 11601 | /** |
Todd Kennedy | 133c5da | 2017-06-15 09:44:34 -0700 | [diff] [blame] | 11602 | * Toggle to enable/disable dexopt for instant applications. The default is for dexopt |
| 11603 | * to be disabled. |
| 11604 | * <p> |
| 11605 | * Type: int (0 to disable, 1 to enable) |
| 11606 | * |
| 11607 | * @hide |
| 11608 | */ |
| 11609 | public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; |
| 11610 | |
| 11611 | /** |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11612 | * The min period for caching installed instant apps in milliseconds. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11613 | * <p> |
| 11614 | * Type: long |
| 11615 | * @hide |
| 11616 | */ |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11617 | public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11618 | "installed_instant_app_min_cache_period"; |
| 11619 | |
| 11620 | /** |
| 11621 | * The max period for caching installed instant apps in milliseconds. |
| 11622 | * <p> |
| 11623 | * Type: long |
| 11624 | * @hide |
| 11625 | */ |
| 11626 | public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11627 | "installed_instant_app_max_cache_period"; |
| 11628 | |
| 11629 | /** |
| 11630 | * The min period for caching uninstalled instant apps in milliseconds. |
| 11631 | * <p> |
| 11632 | * Type: long |
| 11633 | * @hide |
| 11634 | */ |
| 11635 | public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11636 | "uninstalled_instant_app_min_cache_period"; |
| 11637 | |
| 11638 | /** |
| 11639 | * The max period for caching uninstalled instant apps in milliseconds. |
| 11640 | * <p> |
| 11641 | * Type: long |
| 11642 | * @hide |
| 11643 | */ |
| 11644 | public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11645 | "uninstalled_instant_app_max_cache_period"; |
| 11646 | |
| 11647 | /** |
| 11648 | * The min period for caching unused static shared libs in milliseconds. |
| 11649 | * <p> |
| 11650 | * Type: long |
| 11651 | * @hide |
| 11652 | */ |
| 11653 | public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = |
| 11654 | "unused_static_shared_lib_min_cache_period"; |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11655 | |
| 11656 | /** |
Fyodor Kupolov | 07140f7 | 2016-02-17 10:46:11 -0800 | [diff] [blame] | 11657 | * Allows switching users when system user is locked. |
| 11658 | * <p> |
| 11659 | * Type: int |
| 11660 | * @hide |
| 11661 | */ |
| 11662 | public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = |
| 11663 | "allow_user_switching_when_system_user_locked"; |
| 11664 | |
| 11665 | /** |
Kenny Guy | c4db5ca | 2017-09-21 11:40:44 +0100 | [diff] [blame] | 11666 | * Boot count since the device starts running API level 24. |
Daichi Hirono | 82ab980 | 2016-03-02 13:23:29 +0900 | [diff] [blame] | 11667 | * <p> |
| 11668 | * Type: int |
| 11669 | */ |
| 11670 | public static final String BOOT_COUNT = "boot_count"; |
| 11671 | |
| 11672 | /** |
Lenka Trochtova | 6474f0e | 2016-03-24 16:43:10 +0100 | [diff] [blame] | 11673 | * Whether the safe boot is disallowed. |
| 11674 | * |
| 11675 | * <p>This setting should have the identical value as the corresponding user restriction. |
| 11676 | * The purpose of the setting is to make the restriction available in early boot stages |
| 11677 | * before the user restrictions are loaded. |
| 11678 | * @hide |
| 11679 | */ |
| 11680 | public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; |
| 11681 | |
| 11682 | /** |
Amith Yamasani | eb437d4 | 2016-04-29 09:31:25 -0700 | [diff] [blame] | 11683 | * Whether this device is currently in retail demo mode. If true, device |
| 11684 | * usage is severely limited. |
| 11685 | * <p> |
| 11686 | * Type: int (0 for false, 1 for true) |
| 11687 | * @hide |
| 11688 | */ |
| 11689 | public static final String DEVICE_DEMO_MODE = "device_demo_mode"; |
| 11690 | |
| 11691 | /** |
Sudheer Shanka | 5918c67 | 2017-03-21 19:31:37 -0700 | [diff] [blame] | 11692 | * Indicates the maximum time that an app is blocked for the network rules to get updated. |
| 11693 | * |
| 11694 | * Type: long |
| 11695 | * |
| 11696 | * @hide |
| 11697 | */ |
| 11698 | public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; |
| 11699 | |
| 11700 | /** |
Svetoslav Ganov | 264c7a9 | 2016-08-24 17:31:14 -0700 | [diff] [blame] | 11701 | * The reason for the settings database being downgraded. This is only for |
| 11702 | * troubleshooting purposes and its value should not be interpreted in any way. |
| 11703 | * |
| 11704 | * Type: string |
| 11705 | * |
| 11706 | * @hide |
| 11707 | */ |
| 11708 | public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; |
| 11709 | |
| 11710 | /** |
Amith Yamasani | 3945202 | 2017-03-21 15:23:47 -0700 | [diff] [blame] | 11711 | * The build id of when the settings database was first created (or re-created due it |
| 11712 | * being missing). |
| 11713 | * |
| 11714 | * Type: string |
| 11715 | * |
| 11716 | * @hide |
| 11717 | */ |
| 11718 | public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; |
| 11719 | |
| 11720 | /** |
Suprabh Shukla | 502fd88 | 2016-09-30 15:06:00 -0700 | [diff] [blame] | 11721 | * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by |
| 11722 | * default. Set to 0 to disable. |
| 11723 | * |
| 11724 | * @hide |
| 11725 | */ |
| 11726 | public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; |
| 11727 | |
| 11728 | /** |
songchenxi | 825f69a | 2017-01-19 14:18:41 -0800 | [diff] [blame] | 11729 | * Flag to enable the link to location permissions in location setting. Set to 0 to disable. |
| 11730 | * |
| 11731 | * @hide |
| 11732 | */ |
| 11733 | public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = |
| 11734 | "location_settings_link_to_permissions_enabled"; |
| 11735 | |
| 11736 | /** |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11737 | * Flag to set the waiting time for euicc factory reset inside System > Settings |
| 11738 | * Type: long |
| 11739 | * |
| 11740 | * @hide |
| 11741 | */ |
qingxi | 2f23151 | 2017-06-23 15:32:53 -0700 | [diff] [blame] | 11742 | public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = |
| 11743 | "euicc_factory_reset_timeout_millis"; |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11744 | |
| 11745 | /** |
Daniel Nishi | 5782b5c | 2017-08-24 10:28:52 -0700 | [diff] [blame] | 11746 | * Flag to set the timeout for when to refresh the storage settings cached data. |
| 11747 | * Type: long |
| 11748 | * |
| 11749 | * @hide |
| 11750 | */ |
| 11751 | public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = |
| 11752 | "storage_settings_clobber_threshold"; |
| 11753 | |
| 11754 | /** |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11755 | * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} |
| 11756 | * temporarily for all users. |
| 11757 | * |
| 11758 | * @hide |
| 11759 | */ |
Makoto Onuki | 8e49825 | 2018-01-22 17:00:00 -0800 | [diff] [blame] | 11760 | @TestApi |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11761 | public static final String LOCATION_GLOBAL_KILL_SWITCH = |
| 11762 | "location_global_kill_switch"; |
| 11763 | |
| 11764 | /** |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11765 | * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored |
| 11766 | * and restoring to lower version of platform API will be skipped. |
| 11767 | * |
| 11768 | * @hide |
| 11769 | */ |
| 11770 | public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = |
| 11771 | "override_settings_provider_restore_any_version"; |
Narayan Kamath | 8d82825 | 2018-01-11 15:22:37 +0000 | [diff] [blame] | 11772 | /** |
| 11773 | * Flag to toggle whether system services report attribution chains when they attribute |
| 11774 | * battery use via a {@code WorkSource}. |
| 11775 | * |
| 11776 | * Type: int (0 to disable, 1 to enable) |
| 11777 | * |
| 11778 | * @hide |
| 11779 | */ |
| 11780 | public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = |
| 11781 | "chained_battery_attribution_enabled"; |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11782 | |
| 11783 | /** |
Svetoslav Ganov | a6ebff0f0 | 2018-02-14 14:07:02 -0800 | [diff] [blame] | 11784 | * The packages whitelisted to be run in autofill compatibility mode. The list |
Felipe Leme | 1c7eb0c | 2018-03-09 14:13:18 -0800 | [diff] [blame] | 11785 | * of packages is {@code ":"} colon delimited, and each entry has the name of the |
| 11786 | * package and an optional list of url bar resource ids (the list is delimited by |
| 11787 | * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). |
| 11788 | * |
| 11789 | * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where |
| 11790 | * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } |
| 11791 | * have 2 ids {@code url_foo} and {@code url_bas}) would be |
| 11792 | * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} |
Svetoslav Ganov | 24c9045 | 2017-12-27 15:17:14 -0800 | [diff] [blame] | 11793 | * |
| 11794 | * @hide |
| 11795 | */ |
| 11796 | @SystemApi |
Svet Ganov | 47b37aa | 2018-02-16 00:11:39 -0800 | [diff] [blame] | 11797 | @TestApi |
Felipe Leme | fd4003b | 2018-03-20 17:12:17 -0700 | [diff] [blame] | 11798 | public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = |
| 11799 | "autofill_compat_mode_allowed_packages"; |
Svetoslav Ganov | 24c9045 | 2017-12-27 15:17:14 -0800 | [diff] [blame] | 11800 | |
| 11801 | /** |
Mathew Inwood | 169cb3b | 2018-02-08 12:23:59 +0000 | [diff] [blame] | 11802 | * Exemptions to the hidden API blacklist. |
| 11803 | * |
| 11804 | * @hide |
| 11805 | */ |
Mathew Inwood | 5518c75 | 2018-02-27 16:36:11 +0000 | [diff] [blame] | 11806 | @TestApi |
Mathew Inwood | 169cb3b | 2018-02-08 12:23:59 +0000 | [diff] [blame] | 11807 | public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = |
| 11808 | "hidden_api_blacklist_exemptions"; |
| 11809 | |
| 11810 | /** |
Mathew Inwood | 04194fe | 2018-04-04 14:48:03 +0100 | [diff] [blame] | 11811 | * Sampling rate for hidden API access event logs, as an integer in the range 0 to 0x10000 |
| 11812 | * inclusive. |
| 11813 | * |
| 11814 | * @hide |
| 11815 | */ |
| 11816 | public static final String HIDDEN_API_ACCESS_LOG_SAMPLING_RATE = |
| 11817 | "hidden_api_access_log_sampling_rate"; |
| 11818 | |
| 11819 | /** |
Mathew Inwood | 1ab3025 | 2018-04-03 14:47:26 +0100 | [diff] [blame] | 11820 | * Hidden API enforcement policy for apps targeting SDK versions prior to the latest |
| 11821 | * version. |
| 11822 | * |
| 11823 | * Values correspond to @{@link |
| 11824 | * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} |
| 11825 | * |
| 11826 | * @hide |
| 11827 | */ |
| 11828 | public static final String HIDDEN_API_POLICY_PRE_P_APPS = |
| 11829 | "hidden_api_policy_pre_p_apps"; |
| 11830 | |
| 11831 | /** |
| 11832 | * Hidden API enforcement policy for apps targeting the current SDK version. |
| 11833 | * |
| 11834 | * Values correspond to @{@link |
| 11835 | * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} |
| 11836 | * |
| 11837 | * @hide |
| 11838 | */ |
| 11839 | public static final String HIDDEN_API_POLICY_P_APPS = |
| 11840 | "hidden_api_policy_p_apps"; |
| 11841 | |
| 11842 | /** |
Philip P. Moltmann | 18e3eb8 | 2018-03-09 16:55:55 -0800 | [diff] [blame] | 11843 | * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} |
| 11844 | * operation (in ms). |
| 11845 | * |
| 11846 | * @hide |
| 11847 | */ |
| 11848 | public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = |
| 11849 | "sound_trigger_detection_service_op_timeout"; |
| 11850 | |
| 11851 | /** |
| 11852 | * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} |
| 11853 | * operations per day. |
| 11854 | * |
| 11855 | * @hide |
| 11856 | */ |
| 11857 | public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = |
| 11858 | "max_sound_trigger_detection_service_ops_per_day"; |
| 11859 | |
| 11860 | /** |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11861 | * Settings to backup. This is here so that it's in the same place as the settings |
| 11862 | * keys and easy to update. |
| 11863 | * |
| 11864 | * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System |
| 11865 | * and Secure as well. This is because those tables drive both backup and |
| 11866 | * restore, and restore needs to properly whitelist keys that used to live |
| 11867 | * in those namespaces. The keys will only actually be backed up / restored |
| 11868 | * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). |
| 11869 | * |
| 11870 | * NOTE: Settings are backed up and restored in the order they appear |
| 11871 | * in this array. If you have one setting depending on another, |
| 11872 | * make sure that they are ordered appropriately. |
| 11873 | * |
| 11874 | * @hide |
| 11875 | */ |
| 11876 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 11877 | BUGREPORT_IN_POWER_MENU, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11878 | STAY_ON_WHILE_PLUGGED_IN, |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 11879 | APP_AUTO_RESTRICTION_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11880 | AUTO_TIME, |
| 11881 | AUTO_TIME_ZONE, |
| 11882 | POWER_SOUNDS_ENABLED, |
| 11883 | DOCK_SOUNDS_ENABLED, |
Ritesh Reddy | f8f1213 | 2015-11-20 16:43:28 +0000 | [diff] [blame] | 11884 | CHARGING_SOUNDS_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11885 | USB_MASS_STORAGE_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11886 | NETWORK_RECOMMENDATIONS_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11887 | WIFI_WAKEUP_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11888 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11889 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 11890 | USE_OPEN_WIFI_PACKAGE, |
Christopher Tate | 16eb7cd | 2012-10-09 15:26:30 -0700 | [diff] [blame] | 11891 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11892 | EMERGENCY_TONE, |
| 11893 | CALL_AUTO_RETRY, |
Amith Yamasani | 9400524 | 2014-10-31 11:35:13 -0700 | [diff] [blame] | 11894 | DOCK_AUDIO_MEDIA_ENABLED, |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11895 | ENCODED_SURROUND_OUTPUT, |
Stanley Tng | 767f05f | 2017-05-01 21:27:31 -0700 | [diff] [blame] | 11896 | LOW_POWER_MODE_TRIGGER_LEVEL, |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 11897 | BLUETOOTH_ON, |
| 11898 | PRIVATE_DNS_MODE, |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 11899 | PRIVATE_DNS_SPECIFIER, |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11900 | SOFT_AP_TIMEOUT_ENABLED, |
| 11901 | ZEN_DURATION, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11902 | }; |
| 11903 | |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11904 | /** |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11905 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 11906 | * otherwise they won't be restored. |
| 11907 | * |
| 11908 | * @hide |
| 11909 | */ |
| 11910 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 11911 | static { |
| 11912 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 11913 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 11914 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 11915 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
| 11916 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 11917 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
| 11918 | VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR); |
| 11919 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 11920 | VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, |
| 11921 | NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR); |
| 11922 | VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR); |
| 11923 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11924 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 11925 | VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR); |
| 11926 | VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
| 11927 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR); |
| 11928 | VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); |
| 11929 | VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); |
| 11930 | VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); |
| 11931 | VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); |
| 11932 | VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); |
Makoto Onuki | 524b4dfe | 2018-03-06 17:34:15 -0800 | [diff] [blame] | 11933 | VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX, |
| 11934 | LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11935 | VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR); |
| 11936 | VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR); |
| 11937 | VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR); |
| 11938 | VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR); |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11939 | VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11940 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 11941 | VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR); |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11942 | VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11943 | } |
| 11944 | |
| 11945 | /** |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11946 | * Global settings that shouldn't be persisted. |
| 11947 | * |
| 11948 | * @hide |
| 11949 | */ |
| 11950 | public static final String[] TRANSIENT_SETTINGS = { |
| 11951 | LOCATION_GLOBAL_KILL_SWITCH, |
| 11952 | }; |
| 11953 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 11954 | /** |
| 11955 | * Keys we no longer back up under the current schema, but want to continue to |
| 11956 | * process when restoring historical backup datasets. |
| 11957 | * |
| 11958 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 11959 | * otherwise they won't be restored. |
| 11960 | * |
| 11961 | * @hide |
| 11962 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 11963 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 11964 | }; |
| 11965 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11966 | private static final ContentProviderHolder sProviderHolder = |
| 11967 | new ContentProviderHolder(CONTENT_URI); |
| 11968 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11969 | // Populated lazily, guarded by class object: |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11970 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11971 | CONTENT_URI, |
| 11972 | CALL_METHOD_GET_GLOBAL, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11973 | CALL_METHOD_PUT_GLOBAL, |
| 11974 | sProviderHolder); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11975 | |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11976 | // Certain settings have been moved from global to the per-user secure namespace |
| 11977 | private static final HashSet<String> MOVED_TO_SECURE; |
| 11978 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 11979 | MOVED_TO_SECURE = new HashSet<>(1); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11980 | MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); |
| 11981 | } |
| 11982 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 11983 | /** @hide */ |
| 11984 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 11985 | outKeySet.addAll(MOVED_TO_SECURE); |
| 11986 | } |
| 11987 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 11988 | /** @hide */ |
| 11989 | public static void clearProviderForTest() { |
| 11990 | sProviderHolder.clearProviderForTest(); |
| 11991 | sNameValueCache.clearGenerationTrackerForTest(); |
| 11992 | } |
| 11993 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11994 | /** |
| 11995 | * Look up a name in the database. |
| 11996 | * @param resolver to access the database with |
| 11997 | * @param name to look up in the table |
| 11998 | * @return the corresponding value, or null if not present |
| 11999 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 12000 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 12001 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12002 | } |
| 12003 | |
| 12004 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 12005 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12006 | int userHandle) { |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 12007 | if (MOVED_TO_SECURE.contains(name)) { |
| 12008 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 12009 | + " to android.provider.Settings.Secure, returning read-only value."); |
| 12010 | return Secure.getStringForUser(resolver, name, userHandle); |
| 12011 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12012 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
| 12013 | } |
| 12014 | |
| 12015 | /** |
| 12016 | * Store a name/value pair into the database. |
| 12017 | * @param resolver to access the database with |
| 12018 | * @param name to store |
| 12019 | * @param value to associate with the name |
| 12020 | * @return true if the value was set, false on database errors |
| 12021 | */ |
| 12022 | public static boolean putString(ContentResolver resolver, |
| 12023 | String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 12024 | return putStringForUser(resolver, name, value, null, false, resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12025 | } |
| 12026 | |
| 12027 | /** |
| 12028 | * Store a name/value pair into the database. |
| 12029 | * <p> |
| 12030 | * The method takes an optional tag to associate with the setting |
| 12031 | * which can be used to clear only settings made by your package and |
| 12032 | * associated with this tag by passing the tag to {@link |
| 12033 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 12034 | * the current tag. Also if another package changes the setting |
| 12035 | * then the tag will be set to the one specified in the set call |
| 12036 | * which can be null. Also any of the settings setters that do not |
| 12037 | * take a tag as an argument effectively clears the tag. |
| 12038 | * </p><p> |
| 12039 | * For example, if you set settings A and B with tags T1 and T2 and |
| 12040 | * another app changes setting A (potentially to the same value), it |
| 12041 | * can assign to it a tag T3 (note that now the package that changed |
| 12042 | * the setting is not yours). Now if you reset your changes for T1 and |
| 12043 | * T2 only setting B will be reset and A not (as it was changed by |
| 12044 | * another package) but since A did not change you are in the desired |
| 12045 | * initial state. Now if the other app changes the value of A (assuming |
| 12046 | * you registered an observer in the beginning) you would detect that |
| 12047 | * the setting was changed by another app and handle this appropriately |
| 12048 | * (ignore, set back to some value, etc). |
| 12049 | * </p><p> |
| 12050 | * Also the method takes an argument whether to make the value the |
| 12051 | * default for this setting. If the system already specified a default |
| 12052 | * value, then the one passed in here will <strong>not</strong> |
| 12053 | * be set as the default. |
| 12054 | * </p> |
| 12055 | * |
| 12056 | * @param resolver to access the database with. |
| 12057 | * @param name to store. |
| 12058 | * @param value to associate with the name. |
| 12059 | * @param tag to associated with the setting. |
| 12060 | * @param makeDefault whether to make the value the default one. |
| 12061 | * @return true if the value was set, false on database errors. |
| 12062 | * |
| 12063 | * @see #resetToDefaults(ContentResolver, String) |
| 12064 | * |
| 12065 | * @hide |
| 12066 | */ |
| 12067 | @SystemApi |
| 12068 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 12069 | public static boolean putString(@NonNull ContentResolver resolver, |
| 12070 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 12071 | boolean makeDefault) { |
| 12072 | return putStringForUser(resolver, name, value, tag, makeDefault, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 12073 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12074 | } |
| 12075 | |
| 12076 | /** |
| 12077 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 12078 | * settings set by the caller's package. Think of it of a way to undo your own |
| 12079 | * changes to the secure settings. Passing in the optional tag will reset only |
| 12080 | * settings changed by your package and associated with this tag. |
| 12081 | * |
| 12082 | * @param resolver Handle to the content resolver. |
| 12083 | * @param tag Optional tag which should be associated with the settings to reset. |
| 12084 | * |
| 12085 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 12086 | * |
| 12087 | * @hide |
| 12088 | */ |
| 12089 | @SystemApi |
| 12090 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 12091 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 12092 | @Nullable String tag) { |
| 12093 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 12094 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12095 | } |
| 12096 | |
| 12097 | /** |
| 12098 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 12099 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 12100 | * allowing resetting the settings made by a package and associated with the tag. |
| 12101 | * |
| 12102 | * @param resolver Handle to the content resolver. |
| 12103 | * @param tag Optional tag which should be associated with the settings to reset. |
| 12104 | * @param mode The reset mode. |
| 12105 | * @param userHandle The user for which to reset to defaults. |
| 12106 | * |
| 12107 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 12108 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 12109 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 12110 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 12111 | * |
| 12112 | * @hide |
| 12113 | */ |
| 12114 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 12115 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 12116 | try { |
| 12117 | Bundle arg = new Bundle(); |
| 12118 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 12119 | if (tag != null) { |
| 12120 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 12121 | } |
| 12122 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 12123 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 12124 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); |
| 12125 | } catch (RemoteException e) { |
| 12126 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 12127 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12128 | } |
| 12129 | |
| 12130 | /** @hide */ |
| 12131 | public static boolean putStringForUser(ContentResolver resolver, |
| 12132 | String name, String value, int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12133 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 12134 | } |
| 12135 | |
| 12136 | /** @hide */ |
| 12137 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 12138 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 12139 | boolean makeDefault, @UserIdInt int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12140 | if (LOCAL_LOGV) { |
| 12141 | Log.v(TAG, "Global.putString(name=" + name + ", value=" + value |
| 12142 | + " for " + userHandle); |
| 12143 | } |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 12144 | // Global and Secure have the same access policy so we can forward writes |
| 12145 | if (MOVED_TO_SECURE.contains(name)) { |
| 12146 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 12147 | + " to android.provider.Settings.Secure, value is unchanged."); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12148 | return Secure.putStringForUser(resolver, name, value, tag, |
| 12149 | makeDefault, userHandle); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 12150 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12151 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 12152 | makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12153 | } |
| 12154 | |
| 12155 | /** |
| 12156 | * Construct the content URI for a particular name/value pair, |
| 12157 | * useful for monitoring changes with a ContentObserver. |
| 12158 | * @param name to look up in the table |
| 12159 | * @return the corresponding content URI, or null if not present |
| 12160 | */ |
| 12161 | public static Uri getUriFor(String name) { |
| 12162 | return getUriFor(CONTENT_URI, name); |
| 12163 | } |
| 12164 | |
| 12165 | /** |
| 12166 | * Convenience function for retrieving a single secure settings value |
| 12167 | * as an integer. Note that internally setting values are always |
| 12168 | * stored as strings; this function converts the string to an integer |
| 12169 | * for you. The default value will be returned if the setting is |
| 12170 | * not defined or not an integer. |
| 12171 | * |
| 12172 | * @param cr The ContentResolver to access. |
| 12173 | * @param name The name of the setting to retrieve. |
| 12174 | * @param def Value to return if the setting is not defined. |
| 12175 | * |
| 12176 | * @return The setting's current value, or 'def' if it is not defined |
| 12177 | * or not a valid integer. |
| 12178 | */ |
| 12179 | public static int getInt(ContentResolver cr, String name, int def) { |
| 12180 | String v = getString(cr, name); |
| 12181 | try { |
| 12182 | return v != null ? Integer.parseInt(v) : def; |
| 12183 | } catch (NumberFormatException e) { |
| 12184 | return def; |
| 12185 | } |
| 12186 | } |
| 12187 | |
| 12188 | /** |
| 12189 | * Convenience function for retrieving a single secure settings value |
| 12190 | * as an integer. Note that internally setting values are always |
| 12191 | * stored as strings; this function converts the string to an integer |
| 12192 | * for you. |
| 12193 | * <p> |
| 12194 | * This version does not take a default value. If the setting has not |
| 12195 | * been set, or the string value is not a number, |
| 12196 | * it throws {@link SettingNotFoundException}. |
| 12197 | * |
| 12198 | * @param cr The ContentResolver to access. |
| 12199 | * @param name The name of the setting to retrieve. |
| 12200 | * |
| 12201 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 12202 | * name can't be found or the setting value is not an integer. |
| 12203 | * |
| 12204 | * @return The setting's current value. |
| 12205 | */ |
| 12206 | public static int getInt(ContentResolver cr, String name) |
| 12207 | throws SettingNotFoundException { |
| 12208 | String v = getString(cr, name); |
| 12209 | try { |
| 12210 | return Integer.parseInt(v); |
| 12211 | } catch (NumberFormatException e) { |
| 12212 | throw new SettingNotFoundException(name); |
| 12213 | } |
| 12214 | } |
| 12215 | |
| 12216 | /** |
| 12217 | * Convenience function for updating a single settings value as an |
| 12218 | * integer. This will either create a new entry in the table if the |
| 12219 | * given name does not exist, or modify the value of the existing row |
| 12220 | * with that name. Note that internally setting values are always |
| 12221 | * stored as strings, so this function converts the given value to a |
| 12222 | * string before storing it. |
| 12223 | * |
| 12224 | * @param cr The ContentResolver to access. |
| 12225 | * @param name The name of the setting to modify. |
| 12226 | * @param value The new value for the setting. |
| 12227 | * @return true if the value was set, false on database errors |
| 12228 | */ |
| 12229 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 12230 | return putString(cr, name, Integer.toString(value)); |
| 12231 | } |
| 12232 | |
| 12233 | /** |
| 12234 | * Convenience function for retrieving a single secure settings value |
| 12235 | * as a {@code long}. Note that internally setting values are always |
| 12236 | * stored as strings; this function converts the string to a {@code long} |
| 12237 | * for you. The default value will be returned if the setting is |
| 12238 | * not defined or not a {@code long}. |
| 12239 | * |
| 12240 | * @param cr The ContentResolver to access. |
| 12241 | * @param name The name of the setting to retrieve. |
| 12242 | * @param def Value to return if the setting is not defined. |
| 12243 | * |
| 12244 | * @return The setting's current value, or 'def' if it is not defined |
| 12245 | * or not a valid {@code long}. |
| 12246 | */ |
| 12247 | public static long getLong(ContentResolver cr, String name, long def) { |
| 12248 | String valString = getString(cr, name); |
| 12249 | long value; |
| 12250 | try { |
| 12251 | value = valString != null ? Long.parseLong(valString) : def; |
| 12252 | } catch (NumberFormatException e) { |
| 12253 | value = def; |
| 12254 | } |
| 12255 | return value; |
| 12256 | } |
| 12257 | |
| 12258 | /** |
| 12259 | * Convenience function for retrieving a single secure settings value |
| 12260 | * as a {@code long}. Note that internally setting values are always |
| 12261 | * stored as strings; this function converts the string to a {@code long} |
| 12262 | * for you. |
| 12263 | * <p> |
| 12264 | * This version does not take a default value. If the setting has not |
| 12265 | * been set, or the string value is not a number, |
| 12266 | * it throws {@link SettingNotFoundException}. |
| 12267 | * |
| 12268 | * @param cr The ContentResolver to access. |
| 12269 | * @param name The name of the setting to retrieve. |
| 12270 | * |
| 12271 | * @return The setting's current value. |
| 12272 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 12273 | * name can't be found or the setting value is not an integer. |
| 12274 | */ |
| 12275 | public static long getLong(ContentResolver cr, String name) |
| 12276 | throws SettingNotFoundException { |
| 12277 | String valString = getString(cr, name); |
| 12278 | try { |
| 12279 | return Long.parseLong(valString); |
| 12280 | } catch (NumberFormatException e) { |
| 12281 | throw new SettingNotFoundException(name); |
| 12282 | } |
| 12283 | } |
| 12284 | |
| 12285 | /** |
| 12286 | * Convenience function for updating a secure settings value as a long |
| 12287 | * integer. This will either create a new entry in the table if the |
| 12288 | * given name does not exist, or modify the value of the existing row |
| 12289 | * with that name. Note that internally setting values are always |
| 12290 | * stored as strings, so this function converts the given value to a |
| 12291 | * string before storing it. |
| 12292 | * |
| 12293 | * @param cr The ContentResolver to access. |
| 12294 | * @param name The name of the setting to modify. |
| 12295 | * @param value The new value for the setting. |
| 12296 | * @return true if the value was set, false on database errors |
| 12297 | */ |
| 12298 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 12299 | return putString(cr, name, Long.toString(value)); |
| 12300 | } |
| 12301 | |
| 12302 | /** |
| 12303 | * Convenience function for retrieving a single secure settings value |
| 12304 | * as a floating point number. Note that internally setting values are |
| 12305 | * always stored as strings; this function converts the string to an |
| 12306 | * float for you. The default value will be returned if the setting |
| 12307 | * is not defined or not a valid float. |
| 12308 | * |
| 12309 | * @param cr The ContentResolver to access. |
| 12310 | * @param name The name of the setting to retrieve. |
| 12311 | * @param def Value to return if the setting is not defined. |
| 12312 | * |
| 12313 | * @return The setting's current value, or 'def' if it is not defined |
| 12314 | * or not a valid float. |
| 12315 | */ |
| 12316 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 12317 | String v = getString(cr, name); |
| 12318 | try { |
| 12319 | return v != null ? Float.parseFloat(v) : def; |
| 12320 | } catch (NumberFormatException e) { |
| 12321 | return def; |
| 12322 | } |
| 12323 | } |
| 12324 | |
| 12325 | /** |
| 12326 | * Convenience function for retrieving a single secure settings value |
| 12327 | * as a float. Note that internally setting values are always |
| 12328 | * stored as strings; this function converts the string to a float |
| 12329 | * for you. |
| 12330 | * <p> |
| 12331 | * This version does not take a default value. If the setting has not |
| 12332 | * been set, or the string value is not a number, |
| 12333 | * it throws {@link SettingNotFoundException}. |
| 12334 | * |
| 12335 | * @param cr The ContentResolver to access. |
| 12336 | * @param name The name of the setting to retrieve. |
| 12337 | * |
| 12338 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 12339 | * name can't be found or the setting value is not a float. |
| 12340 | * |
| 12341 | * @return The setting's current value. |
| 12342 | */ |
| 12343 | public static float getFloat(ContentResolver cr, String name) |
| 12344 | throws SettingNotFoundException { |
| 12345 | String v = getString(cr, name); |
| 12346 | if (v == null) { |
| 12347 | throw new SettingNotFoundException(name); |
| 12348 | } |
| 12349 | try { |
| 12350 | return Float.parseFloat(v); |
| 12351 | } catch (NumberFormatException e) { |
| 12352 | throw new SettingNotFoundException(name); |
| 12353 | } |
| 12354 | } |
| 12355 | |
| 12356 | /** |
| 12357 | * Convenience function for updating a single settings value as a |
| 12358 | * floating point number. This will either create a new entry in the |
| 12359 | * table if the given name does not exist, or modify the value of the |
| 12360 | * existing row with that name. Note that internally setting values |
| 12361 | * are always stored as strings, so this function converts the given |
| 12362 | * value to a string before storing it. |
| 12363 | * |
| 12364 | * @param cr The ContentResolver to access. |
| 12365 | * @param name The name of the setting to modify. |
| 12366 | * @param value The new value for the setting. |
| 12367 | * @return true if the value was set, false on database errors |
| 12368 | */ |
| 12369 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 12370 | return putString(cr, name, Float.toString(value)); |
| 12371 | } |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12372 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12373 | /** |
| 12374 | * Subscription to be used for voice call on a multi sim device. The supported values |
| 12375 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12376 | * @hide |
| 12377 | */ |
| 12378 | public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; |
| 12379 | |
| 12380 | /** |
| 12381 | * Used to provide option to user to select subscription during dial. |
| 12382 | * The supported values are 0 = disable or 1 = enable prompt. |
| 12383 | * @hide |
| 12384 | */ |
| 12385 | public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; |
| 12386 | |
| 12387 | /** |
| 12388 | * Subscription to be used for data call on a multi sim device. The supported values |
| 12389 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12390 | * @hide |
| 12391 | */ |
| 12392 | public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; |
| 12393 | |
| 12394 | /** |
| 12395 | * Subscription to be used for SMS on a multi sim device. The supported values |
| 12396 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12397 | * @hide |
| 12398 | */ |
| 12399 | public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; |
| 12400 | |
| 12401 | /** |
| 12402 | * Used to provide option to user to select subscription during send SMS. |
| 12403 | * The value 1 - enable, 0 - disable |
| 12404 | * @hide |
| 12405 | */ |
| 12406 | public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; |
| 12407 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12408 | /** User preferred subscriptions setting. |
| 12409 | * This holds the details of the user selected subscription from the card and |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 12410 | * the activation status. Each settings string have the comma separated values |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12411 | * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index |
| 12412 | * @hide |
| 12413 | */ |
| 12414 | public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", |
| 12415 | "user_preferred_sub2","user_preferred_sub3"}; |
Zheng Fu | b218ff4 | 2015-04-13 16:31:16 -0700 | [diff] [blame] | 12416 | |
| 12417 | /** |
| 12418 | * Whether to enable new contacts aggregator or not. |
| 12419 | * The value 1 - enable, 0 - disable |
| 12420 | * @hide |
| 12421 | */ |
| 12422 | public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12423 | |
| 12424 | /** |
| 12425 | * Whether to enable contacts metadata syncing or not |
| 12426 | * The value 1 - enable, 0 - disable |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12427 | * |
| 12428 | * @removed |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12429 | */ |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12430 | @Deprecated |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12431 | public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 12432 | |
| 12433 | /** |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12434 | * Whether to enable contacts metadata syncing or not |
| 12435 | * The value 1 - enable, 0 - disable |
| 12436 | */ |
| 12437 | public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; |
| 12438 | |
| 12439 | /** |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 12440 | * Whether to enable cellular on boot. |
| 12441 | * The value 1 - enable, 0 - disable |
| 12442 | * @hide |
| 12443 | */ |
| 12444 | public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; |
Steven Ng | dc20ba6 | 2016-04-26 18:19:04 +0100 | [diff] [blame] | 12445 | |
| 12446 | /** |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 12447 | * The maximum allowed notification enqueue rate in Hertz. |
| 12448 | * |
Julia Reynolds | 76c096d | 2017-06-19 08:16:04 -0400 | [diff] [blame] | 12449 | * Should be a float, and includes updates only. |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 12450 | * @hide |
| 12451 | */ |
| 12452 | public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; |
Doris Ling | 628cea4 | 2016-06-09 10:35:02 -0700 | [diff] [blame] | 12453 | |
| 12454 | /** |
Geoffrey Pitsch | 4c6eef2 | 2017-04-19 10:26:45 -0400 | [diff] [blame] | 12455 | * Displays toasts when an app posts a notification that does not specify a valid channel. |
| 12456 | * |
| 12457 | * The value 1 - enable, 0 - disable |
| 12458 | * @hide |
| 12459 | */ |
| 12460 | public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = |
| 12461 | "show_notification_channel_warnings"; |
| 12462 | |
| 12463 | /** |
Chris Manton | 95a6c89 | 2016-03-15 13:26:11 -0700 | [diff] [blame] | 12464 | * Whether cell is enabled/disabled |
| 12465 | * @hide |
| 12466 | */ |
| 12467 | public static final String CELL_ON = "cell_on"; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12468 | |
| 12469 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12470 | * Global settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12471 | * @hide |
| 12472 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12473 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12474 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12475 | INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); |
| 12476 | INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); |
| 12477 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); |
| 12478 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); |
| 12479 | INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); |
Chad Brubaker | 1f6a266 | 2017-03-20 11:11:30 -0700 | [diff] [blame] | 12480 | INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); |
Chad Brubaker | 91d2e28 | 2017-04-03 14:34:50 -0700 | [diff] [blame] | 12481 | INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); |
| 12482 | INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); |
| 12483 | INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); |
| 12484 | INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 12485 | INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); |
Chad Brubaker | a6170b8 | 2017-09-01 14:48:46 -0700 | [diff] [blame] | 12486 | INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); |
Svet Ganov | 8f90bcc | 2017-12-22 23:29:24 -0800 | [diff] [blame] | 12487 | INSTANT_APP_SETTINGS.add(ZEN_MODE); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12488 | } |
| 12489 | |
Andrew Sapperstein | e335256 | 2017-01-20 15:41:03 -0800 | [diff] [blame] | 12490 | /** |
| 12491 | * Whether to show the high temperature warning notification. |
| 12492 | * @hide |
| 12493 | */ |
| 12494 | public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; |
| 12495 | |
| 12496 | /** |
| 12497 | * Temperature at which the high temperature warning notification should be shown. |
| 12498 | * @hide |
| 12499 | */ |
| 12500 | public static final String WARNING_TEMPERATURE = "warning_temperature"; |
Daniel Nishi | 88e45dc | 2017-01-25 11:43:55 -0800 | [diff] [blame] | 12501 | |
| 12502 | /** |
| 12503 | * Whether the diskstats logging task is enabled/disabled. |
| 12504 | * @hide |
| 12505 | */ |
| 12506 | public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; |
Daniel Nishi | 0f703e6 | 2017-02-21 15:19:27 -0800 | [diff] [blame] | 12507 | |
| 12508 | /** |
| 12509 | * Whether the cache quota calculation task is enabled/disabled. |
| 12510 | * @hide |
| 12511 | */ |
| 12512 | public static final String ENABLE_CACHE_QUOTA_CALCULATION = |
| 12513 | "enable_cache_quota_calculation"; |
Daniel Nishi | 4f5320e | 2017-06-13 17:51:21 -0700 | [diff] [blame] | 12514 | |
| 12515 | /** |
| 12516 | * Whether the Deletion Helper no threshold toggle is available. |
| 12517 | * @hide |
| 12518 | */ |
| 12519 | public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = |
| 12520 | "enable_deletion_helper_no_threshold_toggle"; |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 12521 | |
| 12522 | /** |
| 12523 | * The list of snooze options for notifications |
| 12524 | * This is encoded as a key=value list, separated by commas. Ex: |
| 12525 | * |
| 12526 | * "default=60,options_array=15:30:60:120" |
| 12527 | * |
| 12528 | * The following keys are supported: |
| 12529 | * |
| 12530 | * <pre> |
| 12531 | * default (int) |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 12532 | * options_array (int[]) |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 12533 | * </pre> |
| 12534 | * |
| 12535 | * All delays in integer minutes. Array order is respected. |
| 12536 | * Options will be used in order up to the maximum allowed by the UI. |
| 12537 | * @hide |
| 12538 | */ |
| 12539 | public static final String NOTIFICATION_SNOOZE_OPTIONS = |
| 12540 | "notification_snooze_options"; |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 12541 | |
| 12542 | /** |
Fyodor Kupolov | ee90c03 | 2017-12-12 11:52:57 -0800 | [diff] [blame] | 12543 | * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated |
| 12544 | * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF |
| 12545 | * |
| 12546 | * Supported keys: |
| 12547 | * compatibility_wal_supported (boolean) |
| 12548 | * wal_syncmode (String) |
| 12549 | * |
| 12550 | * @hide |
| 12551 | */ |
| 12552 | public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = |
| 12553 | "sqlite_compatibility_wal_flags"; |
| 12554 | |
| 12555 | /** |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 12556 | * Enable GNSS Raw Measurements Full Tracking? |
| 12557 | * 0 = no |
| 12558 | * 1 = yes |
| 12559 | * @hide |
| 12560 | */ |
| 12561 | public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = |
| 12562 | "enable_gnss_raw_meas_full_tracking"; |
Daniel Colascione | 766b632 | 2018-01-08 19:10:36 -0800 | [diff] [blame] | 12563 | |
| 12564 | /** |
goneil | 4291960 | 2018-01-23 17:37:26 -0800 | [diff] [blame] | 12565 | * Whether the notification should be ongoing (persistent) when a carrier app install is |
| 12566 | * required. |
| 12567 | * |
| 12568 | * The value is a boolean (1 or 0). |
| 12569 | * @hide |
| 12570 | */ |
| 12571 | @SystemApi |
| 12572 | public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = |
| 12573 | "install_carrier_app_notification_persistent"; |
| 12574 | |
| 12575 | /** |
| 12576 | * The amount of time (ms) to hide the install carrier app notification after the user has |
| 12577 | * ignored it. After this time passes, the notification will be shown again |
| 12578 | * |
| 12579 | * The value is a long |
| 12580 | * @hide |
| 12581 | */ |
| 12582 | @SystemApi |
| 12583 | public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = |
| 12584 | "install_carrier_app_notification_sleep_millis"; |
| 12585 | |
| 12586 | /** |
Daniel Colascione | 766b632 | 2018-01-08 19:10:36 -0800 | [diff] [blame] | 12587 | * Whether we've enabled zram on this device. Takes effect on |
| 12588 | * reboot. The value "1" enables zram; "0" disables it, and |
| 12589 | * everything else is unspecified. |
| 12590 | * @hide |
| 12591 | */ |
| 12592 | public static final String ZRAM_ENABLED = |
| 12593 | "zram_enabled"; |
Petr Cermak | 9669e90 | 2018-01-16 16:37:22 +0000 | [diff] [blame] | 12594 | |
| 12595 | /** |
Alice Sheng | 59a9488 | 2018-03-19 23:46:56 +0000 | [diff] [blame] | 12596 | * Whether we have enable CPU frequency scaling for this device. |
| 12597 | * For Wear, default is disable. |
| 12598 | * |
| 12599 | * The value is "1" for enable, "0" for disable. |
| 12600 | * @hide |
| 12601 | */ |
| 12602 | public static final String CPU_SCALING_ENABLED = |
| 12603 | "cpu_frequency_scaling_enabled"; |
| 12604 | |
| 12605 | /** |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12606 | * Configuration flags for smart replies in notifications. |
| 12607 | * This is encoded as a key=value list, separated by commas. Ex: |
| 12608 | * |
| 12609 | * "enabled=1,max_squeeze_remeasure_count=3" |
| 12610 | * |
| 12611 | * The following keys are supported: |
| 12612 | * |
| 12613 | * <pre> |
| 12614 | * enabled (boolean) |
Richard Ledley | 4069f7a | 2018-02-26 10:36:00 +0000 | [diff] [blame] | 12615 | * requires_targeting_p (boolean) |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12616 | * max_squeeze_remeasure_attempts (int) |
| 12617 | * </pre> |
| 12618 | * @see com.android.systemui.statusbar.policy.SmartReplyConstants |
Petr Cermak | 9669e90 | 2018-01-16 16:37:22 +0000 | [diff] [blame] | 12619 | * @hide |
| 12620 | */ |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12621 | public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = |
| 12622 | "smart_replies_in_notifications_flags"; |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 12623 | |
| 12624 | /** |
| 12625 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 12626 | * Otherwise, the process will be silently killed. |
| 12627 | * @hide |
| 12628 | */ |
| 12629 | public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; |
Andrew Sapperstein | 5b679c4 | 2018-01-16 11:13:40 -0800 | [diff] [blame] | 12630 | |
| 12631 | /** |
| 12632 | * If nonzero, crash dialogs will show an option to restart the app. |
| 12633 | * @hide |
| 12634 | */ |
| 12635 | public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; |
| 12636 | |
| 12637 | /** |
| 12638 | * If nonzero, crash dialogs will show an option to mute all future crash dialogs for |
| 12639 | * this app. |
| 12640 | * @hide |
| 12641 | */ |
| 12642 | public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; |
Beverly | 3bae4e5 | 2018-02-07 12:32:02 -0500 | [diff] [blame] | 12643 | |
| 12644 | /** |
| 12645 | * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. |
| 12646 | * @hide |
| 12647 | */ |
| 12648 | public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; |
Annie Meng | d069a88 | 2018-03-13 15:31:40 +0000 | [diff] [blame] | 12649 | |
| 12650 | /** |
| 12651 | * Backup and restore agent timeout parameters. |
| 12652 | * These parameters are represented by a comma-delimited key-value list. |
| 12653 | * |
| 12654 | * The following strings are supported as keys: |
| 12655 | * <pre> |
| 12656 | * kv_backup_agent_timeout_millis (long) |
| 12657 | * full_backup_agent_timeout_millis (long) |
| 12658 | * shared_backup_agent_timeout_millis (long) |
| 12659 | * restore_agent_timeout_millis (long) |
| 12660 | * restore_agent_finished_timeout_millis (long) |
| 12661 | * </pre> |
| 12662 | * |
| 12663 | * They map to milliseconds represented as longs. |
| 12664 | * |
| 12665 | * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" |
| 12666 | * |
| 12667 | * @hide |
| 12668 | */ |
| 12669 | public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = |
| 12670 | "backup_agent_timeout_parameters"; |
Alice Sheng | b32b1ad | 2018-03-14 12:00:44 -0700 | [diff] [blame] | 12671 | |
| 12672 | /** |
| 12673 | * Whether we have enabled swapping on this device. For Wear, default is |
| 12674 | * enabled. |
| 12675 | * |
| 12676 | * The value is "1" for enable, "0" for disable. |
| 12677 | * @hide |
| 12678 | */ |
| 12679 | public static final String SWAP_ENABLED = "swap_enabled"; |
| 12680 | |
Yu-Han Yang | 66c7ea9 | 2018-03-11 17:17:15 -0700 | [diff] [blame] | 12681 | /** |
| 12682 | * Blacklist of GNSS satellites. |
| 12683 | * |
| 12684 | * This is a list of integers separated by commas to represent pairs of (constellation, |
| 12685 | * svid). Thus, the number of integers should be even. |
| 12686 | * |
| 12687 | * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are |
| 12688 | * blacklisted. Note that svid=0 denotes all svids in the |
| 12689 | * constellation are blacklisted. |
| 12690 | * |
| 12691 | * @hide |
| 12692 | */ |
| 12693 | public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist"; |
Yu-Han Yang | ab3e7bd | 2018-04-06 10:23:28 -0700 | [diff] [blame] | 12694 | |
| 12695 | /** |
| 12696 | * Duration of updates in millisecond for GNSS location request from HAL to framework. |
| 12697 | * |
| 12698 | * If zero, the GNSS location request feature is disabled. |
| 12699 | * |
| 12700 | * The value is a non-negative long. |
| 12701 | * |
| 12702 | * @hide |
| 12703 | */ |
| 12704 | public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS = |
| 12705 | "gnss_hal_location_request_duration_millis"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12706 | } |
| 12707 | |
| 12708 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12709 | * User-defined bookmarks and shortcuts. The target of each bookmark is an |
| 12710 | * Intent URL, allowing it to be either a web page or a particular |
| 12711 | * application activity. |
| 12712 | * |
| 12713 | * @hide |
| 12714 | */ |
| 12715 | public static final class Bookmarks implements BaseColumns |
| 12716 | { |
| 12717 | private static final String TAG = "Bookmarks"; |
| 12718 | |
| 12719 | /** |
| 12720 | * The content:// style URL for this table |
| 12721 | */ |
| 12722 | public static final Uri CONTENT_URI = |
| 12723 | Uri.parse("content://" + AUTHORITY + "/bookmarks"); |
| 12724 | |
| 12725 | /** |
| 12726 | * The row ID. |
| 12727 | * <p>Type: INTEGER</p> |
| 12728 | */ |
| 12729 | public static final String ID = "_id"; |
| 12730 | |
| 12731 | /** |
| 12732 | * Descriptive name of the bookmark that can be displayed to the user. |
| 12733 | * If this is empty, the title should be resolved at display time (use |
| 12734 | * {@link #getTitle(Context, Cursor)} any time you want to display the |
| 12735 | * title of a bookmark.) |
| 12736 | * <P> |
| 12737 | * Type: TEXT |
| 12738 | * </P> |
| 12739 | */ |
| 12740 | public static final String TITLE = "title"; |
| 12741 | |
| 12742 | /** |
| 12743 | * Arbitrary string (displayed to the user) that allows bookmarks to be |
| 12744 | * organized into categories. There are some special names for |
| 12745 | * standard folders, which all start with '@'. The label displayed for |
| 12746 | * the folder changes with the locale (via {@link #getLabelForFolder}) but |
| 12747 | * the folder name does not change so you can consistently query for |
| 12748 | * the folder regardless of the current locale. |
| 12749 | * |
| 12750 | * <P>Type: TEXT</P> |
| 12751 | * |
| 12752 | */ |
| 12753 | public static final String FOLDER = "folder"; |
| 12754 | |
| 12755 | /** |
| 12756 | * The Intent URL of the bookmark, describing what it points to. This |
| 12757 | * value is given to {@link android.content.Intent#getIntent} to create |
| 12758 | * an Intent that can be launched. |
| 12759 | * <P>Type: TEXT</P> |
| 12760 | */ |
| 12761 | public static final String INTENT = "intent"; |
| 12762 | |
| 12763 | /** |
| 12764 | * Optional shortcut character associated with this bookmark. |
| 12765 | * <P>Type: INTEGER</P> |
| 12766 | */ |
| 12767 | public static final String SHORTCUT = "shortcut"; |
| 12768 | |
| 12769 | /** |
| 12770 | * The order in which the bookmark should be displayed |
| 12771 | * <P>Type: INTEGER</P> |
| 12772 | */ |
| 12773 | public static final String ORDERING = "ordering"; |
| 12774 | |
| 12775 | private static final String[] sIntentProjection = { INTENT }; |
| 12776 | private static final String[] sShortcutProjection = { ID, SHORTCUT }; |
| 12777 | private static final String sShortcutSelection = SHORTCUT + "=?"; |
| 12778 | |
| 12779 | /** |
| 12780 | * Convenience function to retrieve the bookmarked Intent for a |
| 12781 | * particular shortcut key. |
| 12782 | * |
| 12783 | * @param cr The ContentResolver to query. |
| 12784 | * @param shortcut The shortcut key. |
| 12785 | * |
| 12786 | * @return Intent The bookmarked URL, or null if there is no bookmark |
| 12787 | * matching the given shortcut. |
| 12788 | */ |
| 12789 | public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) |
| 12790 | { |
| 12791 | Intent intent = null; |
| 12792 | |
| 12793 | Cursor c = cr.query(CONTENT_URI, |
| 12794 | sIntentProjection, sShortcutSelection, |
| 12795 | new String[] { String.valueOf((int) shortcut) }, ORDERING); |
| 12796 | // Keep trying until we find a valid shortcut |
| 12797 | try { |
| 12798 | while (intent == null && c.moveToNext()) { |
| 12799 | try { |
| 12800 | String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12801 | intent = Intent.parseUri(intentURI, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12802 | } catch (java.net.URISyntaxException e) { |
| 12803 | // The stored URL is bad... ignore it. |
| 12804 | } catch (IllegalArgumentException e) { |
| 12805 | // Column not found |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 12806 | Log.w(TAG, "Intent column not found", e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12807 | } |
| 12808 | } |
| 12809 | } finally { |
| 12810 | if (c != null) c.close(); |
| 12811 | } |
| 12812 | |
| 12813 | return intent; |
| 12814 | } |
| 12815 | |
| 12816 | /** |
| 12817 | * Add a new bookmark to the system. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12818 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12819 | * @param cr The ContentResolver to query. |
| 12820 | * @param intent The desired target of the bookmark. |
| 12821 | * @param title Bookmark title that is shown to the user; null if none |
| 12822 | * or it should be resolved to the intent's title. |
| 12823 | * @param folder Folder in which to place the bookmark; null if none. |
| 12824 | * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If |
| 12825 | * this is non-zero and there is an existing bookmark entry |
| 12826 | * with this same shortcut, then that existing shortcut is |
| 12827 | * cleared (the bookmark is not removed). |
| 12828 | * @return The unique content URL for the new bookmark entry. |
| 12829 | */ |
| 12830 | public static Uri add(ContentResolver cr, |
| 12831 | Intent intent, |
| 12832 | String title, |
| 12833 | String folder, |
| 12834 | char shortcut, |
| 12835 | int ordering) |
| 12836 | { |
| 12837 | // If a shortcut is supplied, and it is already defined for |
| 12838 | // another bookmark, then remove the old definition. |
| 12839 | if (shortcut != 0) { |
Jeff Hamilton | 7cd51ef | 2010-05-12 17:30:27 -0500 | [diff] [blame] | 12840 | cr.delete(CONTENT_URI, sShortcutSelection, |
| 12841 | new String[] { String.valueOf((int) shortcut) }); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12842 | } |
| 12843 | |
| 12844 | ContentValues values = new ContentValues(); |
| 12845 | if (title != null) values.put(TITLE, title); |
| 12846 | if (folder != null) values.put(FOLDER, folder); |
Jean-Baptiste Queru | 3b9f0a3 | 2010-06-21 13:46:59 -0700 | [diff] [blame] | 12847 | values.put(INTENT, intent.toUri(0)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12848 | if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); |
| 12849 | values.put(ORDERING, ordering); |
| 12850 | return cr.insert(CONTENT_URI, values); |
| 12851 | } |
| 12852 | |
| 12853 | /** |
| 12854 | * Return the folder name as it should be displayed to the user. This |
| 12855 | * takes care of localizing special folders. |
| 12856 | * |
| 12857 | * @param r Resources object for current locale; only need access to |
| 12858 | * system resources. |
| 12859 | * @param folder The value found in the {@link #FOLDER} column. |
| 12860 | * |
| 12861 | * @return CharSequence The label for this folder that should be shown |
| 12862 | * to the user. |
| 12863 | */ |
| 12864 | public static CharSequence getLabelForFolder(Resources r, String folder) { |
| 12865 | return folder; |
| 12866 | } |
| 12867 | |
| 12868 | /** |
| 12869 | * Return the title as it should be displayed to the user. This takes |
| 12870 | * care of localizing bookmarks that point to activities. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12871 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12872 | * @param context A context. |
| 12873 | * @param cursor A cursor pointing to the row whose title should be |
| 12874 | * returned. The cursor must contain at least the {@link #TITLE} |
| 12875 | * and {@link #INTENT} columns. |
| 12876 | * @return A title that is localized and can be displayed to the user, |
| 12877 | * or the empty string if one could not be found. |
| 12878 | */ |
| 12879 | public static CharSequence getTitle(Context context, Cursor cursor) { |
| 12880 | int titleColumn = cursor.getColumnIndex(TITLE); |
| 12881 | int intentColumn = cursor.getColumnIndex(INTENT); |
| 12882 | if (titleColumn == -1 || intentColumn == -1) { |
| 12883 | throw new IllegalArgumentException( |
| 12884 | "The cursor must contain the TITLE and INTENT columns."); |
| 12885 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12886 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12887 | String title = cursor.getString(titleColumn); |
| 12888 | if (!TextUtils.isEmpty(title)) { |
| 12889 | return title; |
| 12890 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12891 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12892 | String intentUri = cursor.getString(intentColumn); |
| 12893 | if (TextUtils.isEmpty(intentUri)) { |
| 12894 | return ""; |
| 12895 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12896 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12897 | Intent intent; |
| 12898 | try { |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12899 | intent = Intent.parseUri(intentUri, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12900 | } catch (URISyntaxException e) { |
| 12901 | return ""; |
| 12902 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12903 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12904 | PackageManager packageManager = context.getPackageManager(); |
| 12905 | ResolveInfo info = packageManager.resolveActivity(intent, 0); |
| 12906 | return info != null ? info.loadLabel(packageManager) : ""; |
| 12907 | } |
| 12908 | } |
| 12909 | |
| 12910 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12911 | * Returns the device ID that we should use when connecting to the mobile gtalk server. |
| 12912 | * This is a string like "android-0x1242", where the hex string is the Android ID obtained |
| 12913 | * from the GoogleLoginService. |
| 12914 | * |
| 12915 | * @param androidId The Android ID for this device. |
| 12916 | * @return The device ID that should be used when connecting to the mobile gtalk server. |
| 12917 | * @hide |
| 12918 | */ |
| 12919 | public static String getGTalkDeviceId(long androidId) { |
| 12920 | return "android-" + Long.toHexString(androidId); |
| 12921 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12922 | |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12923 | private static final String[] PM_WRITE_SETTINGS = { |
| 12924 | android.Manifest.permission.WRITE_SETTINGS |
| 12925 | }; |
| 12926 | private static final String[] PM_CHANGE_NETWORK_STATE = { |
| 12927 | android.Manifest.permission.CHANGE_NETWORK_STATE, |
| 12928 | android.Manifest.permission.WRITE_SETTINGS |
| 12929 | }; |
| 12930 | private static final String[] PM_SYSTEM_ALERT_WINDOW = { |
| 12931 | android.Manifest.permission.SYSTEM_ALERT_WINDOW |
| 12932 | }; |
| 12933 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12934 | /** |
| 12935 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12936 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12937 | * privileged/preinstalled apps. If the provided uid does not match the |
| 12938 | * callingPackage, a negative result will be returned. |
| 12939 | * @hide |
| 12940 | */ |
| 12941 | public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, |
| 12942 | String callingPackage, boolean throwException) { |
| 12943 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12944 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12945 | PM_WRITE_SETTINGS, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12946 | } |
| 12947 | |
| 12948 | /** |
| 12949 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12950 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12951 | * privileged/preinstalled apps. If the provided uid does not match the |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12952 | * callingPackage, a negative result will be returned. The caller is expected to have |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12953 | * the WRITE_SETTINGS permission declared. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12954 | * |
| 12955 | * Note: if the check is successful, the operation of this app will be updated to the |
| 12956 | * current time. |
| 12957 | * @hide |
| 12958 | */ |
| 12959 | public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, |
| 12960 | String callingPackage, boolean throwException) { |
| 12961 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12962 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12963 | PM_WRITE_SETTINGS, true); |
| 12964 | } |
| 12965 | |
| 12966 | /** |
| 12967 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12968 | * change the state of network, as the condition differs for pre-M, M+, and |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12969 | * privileged/preinstalled apps. The caller is expected to have either the |
| 12970 | * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these |
| 12971 | * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and |
| 12972 | * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal |
| 12973 | * permission and cannot be revoked. See http://b/23597341 |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12974 | * |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12975 | * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation |
| 12976 | * of this app will be updated to the current time. |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12977 | * @hide |
| 12978 | */ |
| 12979 | public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, |
| 12980 | String callingPackage, boolean throwException) { |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12981 | if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) |
| 12982 | == PackageManager.PERMISSION_GRANTED) { |
| 12983 | return true; |
| 12984 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12985 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12986 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
| 12987 | PM_CHANGE_NETWORK_STATE, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12988 | } |
| 12989 | |
| 12990 | /** |
| 12991 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12992 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 12993 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 12994 | * a negative result will be returned. |
| 12995 | * @hide |
| 12996 | */ |
| 12997 | public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, |
| 12998 | String callingPackage, boolean throwException) { |
| 12999 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 13000 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13001 | PM_SYSTEM_ALERT_WINDOW, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13002 | } |
| 13003 | |
| 13004 | /** |
| 13005 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 13006 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 13007 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 13008 | * a negative result will be returned. |
| 13009 | * |
| 13010 | * Note: if the check is successful, the operation of this app will be updated to the |
| 13011 | * current time. |
| 13012 | * @hide |
| 13013 | */ |
| 13014 | public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String |
| 13015 | callingPackage, boolean throwException) { |
| 13016 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 13017 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13018 | PM_SYSTEM_ALERT_WINDOW, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13019 | } |
| 13020 | |
| 13021 | /** |
| 13022 | * Helper method to perform a general and comprehensive check of whether an operation that is |
| 13023 | * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and |
| 13024 | * OP_WRITE_SETTINGS |
| 13025 | * @hide |
| 13026 | */ |
| 13027 | public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13028 | int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] |
| 13029 | permissions, boolean makeNote) { |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13030 | if (callingPackage == null) { |
| 13031 | return false; |
| 13032 | } |
| 13033 | |
| 13034 | AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); |
| 13035 | int mode = AppOpsManager.MODE_DEFAULT; |
| 13036 | if (makeNote) { |
| 13037 | mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 13038 | } else { |
| 13039 | mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 13040 | } |
| 13041 | |
| 13042 | switch (mode) { |
| 13043 | case AppOpsManager.MODE_ALLOWED: |
| 13044 | return true; |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13045 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13046 | case AppOpsManager.MODE_DEFAULT: |
| 13047 | // this is the default operating mode after an app's installation |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13048 | // In this case we will check all associated static permission to see |
| 13049 | // if it is granted during install time. |
| 13050 | for (String permission : permissions) { |
| 13051 | if (context.checkCallingOrSelfPermission(permission) == PackageManager |
| 13052 | .PERMISSION_GRANTED) { |
| 13053 | // if either of the permissions are granted, we will allow it |
| 13054 | return true; |
| 13055 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13056 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13057 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13058 | default: |
| 13059 | // this is for all other cases trickled down here... |
| 13060 | if (!throwException) { |
| 13061 | return false; |
| 13062 | } |
| 13063 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 13064 | |
| 13065 | // prepare string to throw SecurityException |
| 13066 | StringBuilder exceptionMessage = new StringBuilder(); |
| 13067 | exceptionMessage.append(callingPackage); |
| 13068 | exceptionMessage.append(" was not granted "); |
| 13069 | if (permissions.length > 1) { |
| 13070 | exceptionMessage.append(" either of these permissions: "); |
| 13071 | } else { |
| 13072 | exceptionMessage.append(" this permission: "); |
| 13073 | } |
| 13074 | for (int i = 0; i < permissions.length; i++) { |
| 13075 | exceptionMessage.append(permissions[i]); |
| 13076 | exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); |
| 13077 | } |
| 13078 | |
| 13079 | throw new SecurityException(exceptionMessage.toString()); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 13080 | } |
| 13081 | |
| 13082 | /** |
| 13083 | * Retrieves a correponding package name for a given uid. It will query all |
| 13084 | * packages that are associated with the given uid, but it will return only |
| 13085 | * the zeroth result. |
| 13086 | * Note: If package could not be found, a null is returned. |
| 13087 | * @hide |
| 13088 | */ |
| 13089 | public static String getPackageNameForUid(Context context, int uid) { |
| 13090 | String[] packages = context.getPackageManager().getPackagesForUid(uid); |
| 13091 | if (packages == null) { |
| 13092 | return null; |
| 13093 | } |
| 13094 | return packages[0]; |
| 13095 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 13096 | } |