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 | /** |
Jason Monk | 76c67aa | 2016-02-19 14:49:42 -0500 | [diff] [blame] | 145 | * Activity Action: Show settings to allow configuration of users. |
| 146 | * <p> |
| 147 | * In some cases, a matching Activity may not exist, so ensure you |
| 148 | * safeguard against this. |
| 149 | * <p> |
| 150 | * Input: Nothing. |
| 151 | * <p> |
| 152 | * Output: Nothing. |
| 153 | * @hide |
| 154 | */ |
| 155 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 156 | public static final String ACTION_USER_SETTINGS = |
| 157 | "android.settings.USER_SETTINGS"; |
| 158 | |
| 159 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 160 | * Activity Action: Show settings to allow configuration of wireless controls |
| 161 | * such as Wi-Fi, Bluetooth and Mobile networks. |
| 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 | */ |
| 170 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 171 | public static final String ACTION_WIRELESS_SETTINGS = |
| 172 | "android.settings.WIRELESS_SETTINGS"; |
| 173 | |
| 174 | /** |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 175 | * Activity Action: Show tether provisioning activity. |
| 176 | * |
| 177 | * <p> |
| 178 | * In some cases, a matching Activity may not exist, so ensure you |
| 179 | * safeguard against this. |
| 180 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 181 | * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type |
| 182 | * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 183 | * contain a {@link ResultReceiver} which will be called back with a tether result code. |
| 184 | * <p> |
| 185 | * Output: The result of the provisioning check. |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 186 | * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, |
| 187 | * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 188 | * |
| 189 | * @hide |
| 190 | */ |
| 191 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 192 | public static final String ACTION_TETHER_PROVISIONING = |
| 193 | "android.settings.TETHER_PROVISIONING_UI"; |
| 194 | |
| 195 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 196 | * Activity Action: Show settings to allow entering/exiting airplane mode. |
| 197 | * <p> |
| 198 | * In some cases, a matching Activity may not exist, so ensure you |
| 199 | * safeguard against this. |
| 200 | * <p> |
| 201 | * Input: Nothing. |
| 202 | * <p> |
| 203 | * Output: Nothing. |
| 204 | */ |
| 205 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 206 | public static final String ACTION_AIRPLANE_MODE_SETTINGS = |
| 207 | "android.settings.AIRPLANE_MODE_SETTINGS"; |
| 208 | |
| 209 | /** |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 210 | * Activity Action: Show mobile data usage list. |
| 211 | * <p> |
| 212 | * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify |
| 213 | * how and what mobile data statistics should be collected. |
| 214 | * <p> |
| 215 | * Output: Nothing |
| 216 | * @hide |
| 217 | */ |
| 218 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 219 | public static final String ACTION_MOBILE_DATA_USAGE = |
| 220 | "android.settings.MOBILE_DATA_USAGE"; |
| 221 | |
| 222 | /** @hide */ |
| 223 | public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 224 | |
| 225 | /** |
| 226 | * An int extra specifying a subscription ID. |
| 227 | * |
| 228 | * @see android.telephony.SubscriptionInfo#getSubscriptionId |
| 229 | */ |
| 230 | public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 231 | |
| 232 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 233 | * Activity Action: Modify Airplane mode settings using a voice command. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 234 | * <p> |
| 235 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 236 | * <p> |
| 237 | * This intent MUST be started using |
| 238 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 239 | * startVoiceActivity}. |
| 240 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 241 | * Note: The activity implementing this intent MUST verify that |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 242 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 243 | * modifying the setting. |
| 244 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 245 | * Input: To tell which state airplane mode should be set to, add the |
| 246 | * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. |
| 247 | * If the extra is not included, no changes will be made. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 248 | * <p> |
| 249 | * Output: Nothing. |
| 250 | */ |
| 251 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 252 | public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = |
| 253 | "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; |
| 254 | |
| 255 | /** |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 256 | * Activity Action: Show settings for accessibility modules. |
| 257 | * <p> |
| 258 | * In some cases, a matching Activity may not exist, so ensure you |
| 259 | * safeguard against this. |
| 260 | * <p> |
| 261 | * Input: Nothing. |
| 262 | * <p> |
| 263 | * Output: Nothing. |
| 264 | */ |
| 265 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 266 | public static final String ACTION_ACCESSIBILITY_SETTINGS = |
| 267 | "android.settings.ACCESSIBILITY_SETTINGS"; |
| 268 | |
| 269 | /** |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 270 | * Activity Action: Show settings to control access to usage information. |
| 271 | * <p> |
| 272 | * In some cases, a matching Activity may not exist, so ensure you |
| 273 | * safeguard against this. |
| 274 | * <p> |
| 275 | * Input: Nothing. |
| 276 | * <p> |
| 277 | * Output: Nothing. |
| 278 | */ |
| 279 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 280 | public static final String ACTION_USAGE_ACCESS_SETTINGS = |
| 281 | "android.settings.USAGE_ACCESS_SETTINGS"; |
| 282 | |
| 283 | /** |
Jason Monk | 6f90978 | 2015-04-17 14:30:25 -0400 | [diff] [blame] | 284 | * Activity Category: Show application settings related to usage access. |
| 285 | * <p> |
| 286 | * An activity that provides a user interface for adjusting usage access related |
| 287 | * preferences for its containing application. Optional but recommended for apps that |
| 288 | * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. |
| 289 | * <p> |
| 290 | * The activity may define meta-data to describe what usage access is |
| 291 | * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which |
| 292 | * will be displayed in Settings. |
| 293 | * <p> |
| 294 | * Input: Nothing. |
| 295 | * <p> |
| 296 | * Output: Nothing. |
| 297 | */ |
| 298 | @SdkConstant(SdkConstantType.INTENT_CATEGORY) |
| 299 | public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = |
| 300 | "android.intent.category.USAGE_ACCESS_CONFIG"; |
| 301 | |
| 302 | /** |
| 303 | * Metadata key: Reason for needing usage access. |
| 304 | * <p> |
| 305 | * A key for metadata attached to an activity that receives action |
| 306 | * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the |
| 307 | * user as description of how the app uses usage access. |
| 308 | * <p> |
| 309 | */ |
| 310 | public static final String METADATA_USAGE_ACCESS_REASON = |
| 311 | "android.settings.metadata.USAGE_ACCESS_REASON"; |
| 312 | |
| 313 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 314 | * Activity Action: Show settings to allow configuration of security and |
| 315 | * location privacy. |
| 316 | * <p> |
| 317 | * In some cases, a matching Activity may not exist, so ensure you |
| 318 | * safeguard against this. |
| 319 | * <p> |
| 320 | * Input: Nothing. |
| 321 | * <p> |
| 322 | * Output: Nothing. |
| 323 | */ |
| 324 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 325 | public static final String ACTION_SECURITY_SETTINGS = |
| 326 | "android.settings.SECURITY_SETTINGS"; |
| 327 | |
| 328 | /** |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 329 | * Activity Action: Show settings to allow configuration of trusted external sources |
Suprabh Shukla | 905df00 | 2017-05-25 14:21:59 -0700 | [diff] [blame] | 330 | * |
Suprabh Shukla | 84d11b4 | 2017-03-07 23:40:25 -0800 | [diff] [blame] | 331 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 332 | * directly invoke the management GUI specific to the package name. For example |
| 333 | * "package:com.my.app". |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 334 | * <p> |
| 335 | * Output: Nothing. |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 336 | */ |
| 337 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Suprabh Shukla | a1300c8 | 2017-04-06 17:52:32 -0700 | [diff] [blame] | 338 | public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = |
Suprabh Shukla | 89aae44 | 2017-04-20 16:04:26 -0700 | [diff] [blame] | 339 | "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 340 | |
| 341 | /** |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 342 | * Activity Action: Show trusted credentials settings, opening to the user tab, |
| 343 | * to allow management of installed credentials. |
| 344 | * <p> |
| 345 | * In some cases, a matching Activity may not exist, so ensure you |
| 346 | * safeguard against this. |
| 347 | * <p> |
| 348 | * Input: Nothing. |
| 349 | * <p> |
| 350 | * Output: Nothing. |
| 351 | * @hide |
| 352 | */ |
| 353 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 354 | public static final String ACTION_TRUSTED_CREDENTIALS_USER = |
| 355 | "com.android.settings.TRUSTED_CREDENTIALS_USER"; |
| 356 | |
| 357 | /** |
| 358 | * Activity Action: Show dialog explaining that an installed CA cert may enable |
| 359 | * monitoring of encrypted network traffic. |
| 360 | * <p> |
| 361 | * In some cases, a matching Activity may not exist, so ensure you |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 362 | * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the |
| 363 | * number of certificates. |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 364 | * <p> |
| 365 | * Input: Nothing. |
| 366 | * <p> |
| 367 | * Output: Nothing. |
| 368 | * @hide |
| 369 | */ |
| 370 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 371 | public static final String ACTION_MONITORING_CERT_INFO = |
| 372 | "com.android.settings.MONITORING_CERT_INFO"; |
| 373 | |
| 374 | /** |
Amith Yamasani | c15255a | 2009-09-23 15:33:19 -0700 | [diff] [blame] | 375 | * Activity Action: Show settings to allow configuration of privacy options. |
| 376 | * <p> |
| 377 | * In some cases, a matching Activity may not exist, so ensure you |
| 378 | * safeguard against this. |
| 379 | * <p> |
| 380 | * Input: Nothing. |
| 381 | * <p> |
| 382 | * Output: Nothing. |
| 383 | */ |
| 384 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 385 | public static final String ACTION_PRIVACY_SETTINGS = |
| 386 | "android.settings.PRIVACY_SETTINGS"; |
| 387 | |
| 388 | /** |
Robin Lee | a249aee | 2016-02-03 13:42:56 +0000 | [diff] [blame] | 389 | * Activity Action: Show settings to allow configuration of VPN. |
| 390 | * <p> |
| 391 | * In some cases, a matching Activity may not exist, so ensure you |
| 392 | * safeguard against this. |
| 393 | * <p> |
| 394 | * Input: Nothing. |
| 395 | * <p> |
| 396 | * Output: Nothing. |
| 397 | */ |
| 398 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 399 | public static final String ACTION_VPN_SETTINGS = |
| 400 | "android.settings.VPN_SETTINGS"; |
| 401 | |
| 402 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 403 | * 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] | 404 | * <p> |
| 405 | * In some cases, a matching Activity may not exist, so ensure you |
| 406 | * safeguard against this. |
| 407 | * <p> |
| 408 | * Input: Nothing. |
| 409 | * <p> |
| 410 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 411 | */ |
| 412 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 413 | public static final String ACTION_WIFI_SETTINGS = |
| 414 | "android.settings.WIFI_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 415 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 416 | /** |
| 417 | * Activity Action: Show settings to allow configuration of a static IP |
| 418 | * address for Wi-Fi. |
| 419 | * <p> |
| 420 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 421 | * against this. |
| 422 | * <p> |
| 423 | * Input: Nothing. |
| 424 | * <p> |
| 425 | * Output: Nothing. |
| 426 | */ |
| 427 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 428 | public static final String ACTION_WIFI_IP_SETTINGS = |
| 429 | "android.settings.WIFI_IP_SETTINGS"; |
| 430 | |
| 431 | /** |
Rohan Shah | 53f3f15 | 2018-02-28 15:13:31 -0800 | [diff] [blame] | 432 | * Activity Action: Show settings to allow configuration of data and view data usage. |
| 433 | * <p> |
| 434 | * In some cases, a matching Activity may not exist, so ensure you |
| 435 | * safeguard against this. |
| 436 | * <p> |
| 437 | * Input: Nothing. |
| 438 | * <p> |
| 439 | * Output: Nothing. |
| 440 | */ |
| 441 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 442 | public static final String ACTION_DATA_USAGE_SETTINGS = |
| 443 | "android.settings.DATA_USAGE_SETTINGS"; |
| 444 | |
| 445 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 446 | * Activity Action: Show settings to allow configuration of Bluetooth. |
| 447 | * <p> |
| 448 | * In some cases, a matching Activity may not exist, so ensure you |
| 449 | * safeguard against this. |
| 450 | * <p> |
| 451 | * Input: Nothing. |
| 452 | * <p> |
| 453 | * Output: Nothing. |
| 454 | */ |
| 455 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 456 | public static final String ACTION_BLUETOOTH_SETTINGS = |
| 457 | "android.settings.BLUETOOTH_SETTINGS"; |
| 458 | |
| 459 | /** |
Kevin Chyn | 268a96c | 2017-06-17 17:32:49 -0700 | [diff] [blame] | 460 | * Activity Action: Show settings to allow configuration of Assist Gesture. |
| 461 | * <p> |
| 462 | * In some cases, a matching Activity may not exist, so ensure you |
| 463 | * safeguard against this. |
| 464 | * <p> |
| 465 | * Input: Nothing. |
| 466 | * <p> |
| 467 | * Output: Nothing. |
| 468 | * @hide |
| 469 | */ |
| 470 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 471 | public static final String ACTION_ASSIST_GESTURE_SETTINGS = |
| 472 | "android.settings.ASSIST_GESTURE_SETTINGS"; |
| 473 | |
| 474 | /** |
Kevin Chyn | 83ff28c | 2017-10-13 16:35:17 -0700 | [diff] [blame] | 475 | * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if |
| 476 | * necessary. |
| 477 | * <p> |
| 478 | * Input: Nothing. |
| 479 | * <p> |
| 480 | * Output: Nothing. |
| 481 | */ |
| 482 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 483 | public static final String ACTION_FINGERPRINT_ENROLL = |
| 484 | "android.settings.FINGERPRINT_ENROLL"; |
| 485 | |
| 486 | /** |
Jeff Brown | c05c1ae | 2015-05-05 13:46:30 -0700 | [diff] [blame] | 487 | * Activity Action: Show settings to allow configuration of cast endpoints. |
Jeff Brown | 1a937b0 | 2014-07-01 22:13:04 -0700 | [diff] [blame] | 488 | * <p> |
| 489 | * In some cases, a matching Activity may not exist, so ensure you |
| 490 | * safeguard against this. |
| 491 | * <p> |
| 492 | * Input: Nothing. |
| 493 | * <p> |
| 494 | * Output: Nothing. |
| 495 | */ |
| 496 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 497 | public static final String ACTION_CAST_SETTINGS = |
| 498 | "android.settings.CAST_SETTINGS"; |
| 499 | |
| 500 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 501 | * Activity Action: Show settings to allow configuration of date and time. |
| 502 | * <p> |
| 503 | * In some cases, a matching Activity may not exist, so ensure you |
| 504 | * safeguard against this. |
| 505 | * <p> |
| 506 | * Input: Nothing. |
| 507 | * <p> |
| 508 | * Output: Nothing. |
| 509 | */ |
| 510 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 511 | public static final String ACTION_DATE_SETTINGS = |
| 512 | "android.settings.DATE_SETTINGS"; |
| 513 | |
| 514 | /** |
| 515 | * Activity Action: Show settings to allow configuration of sound and volume. |
| 516 | * <p> |
| 517 | * In some cases, a matching Activity may not exist, so ensure you |
| 518 | * safeguard against this. |
| 519 | * <p> |
| 520 | * Input: Nothing. |
| 521 | * <p> |
| 522 | * Output: Nothing. |
| 523 | */ |
| 524 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 525 | public static final String ACTION_SOUND_SETTINGS = |
| 526 | "android.settings.SOUND_SETTINGS"; |
| 527 | |
| 528 | /** |
| 529 | * Activity Action: Show settings to allow configuration of display. |
| 530 | * <p> |
| 531 | * In some cases, a matching Activity may not exist, so ensure you |
| 532 | * safeguard against this. |
| 533 | * <p> |
| 534 | * Input: Nothing. |
| 535 | * <p> |
| 536 | * Output: Nothing. |
| 537 | */ |
| 538 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 539 | public static final String ACTION_DISPLAY_SETTINGS = |
| 540 | "android.settings.DISPLAY_SETTINGS"; |
| 541 | |
| 542 | /** |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 543 | * Activity Action: Show settings to allow configuration of Night display. |
| 544 | * <p> |
| 545 | * In some cases, a matching Activity may not exist, so ensure you |
| 546 | * safeguard against this. |
| 547 | * <p> |
| 548 | * Input: Nothing. |
| 549 | * <p> |
| 550 | * Output: Nothing. |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 551 | */ |
| 552 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 553 | public static final String ACTION_NIGHT_DISPLAY_SETTINGS = |
| 554 | "android.settings.NIGHT_DISPLAY_SETTINGS"; |
| 555 | |
| 556 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 557 | * Activity Action: Show settings to allow configuration of locale. |
| 558 | * <p> |
| 559 | * In some cases, a matching Activity may not exist, so ensure you |
| 560 | * safeguard against this. |
| 561 | * <p> |
| 562 | * Input: Nothing. |
| 563 | * <p> |
| 564 | * Output: Nothing. |
| 565 | */ |
| 566 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 567 | public static final String ACTION_LOCALE_SETTINGS = |
| 568 | "android.settings.LOCALE_SETTINGS"; |
| 569 | |
| 570 | /** |
| 571 | * Activity Action: Show settings to configure input methods, in particular |
| 572 | * allowing the user to enable input methods. |
| 573 | * <p> |
| 574 | * In some cases, a matching Activity may not exist, so ensure you |
| 575 | * safeguard against this. |
| 576 | * <p> |
| 577 | * Input: Nothing. |
| 578 | * <p> |
| 579 | * Output: Nothing. |
| 580 | */ |
| 581 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 582 | public static final String ACTION_VOICE_INPUT_SETTINGS = |
| 583 | "android.settings.VOICE_INPUT_SETTINGS"; |
| 584 | |
| 585 | /** |
| 586 | * Activity Action: Show settings to configure input methods, in particular |
| 587 | * allowing the user to enable input methods. |
| 588 | * <p> |
| 589 | * In some cases, a matching Activity may not exist, so ensure you |
| 590 | * safeguard against this. |
| 591 | * <p> |
| 592 | * Input: Nothing. |
| 593 | * <p> |
| 594 | * Output: Nothing. |
| 595 | */ |
| 596 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 597 | public static final String ACTION_INPUT_METHOD_SETTINGS = |
| 598 | "android.settings.INPUT_METHOD_SETTINGS"; |
| 599 | |
| 600 | /** |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 601 | * Activity Action: Show settings to enable/disable input method subtypes. |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 602 | * <p> |
| 603 | * In some cases, a matching Activity may not exist, so ensure you |
| 604 | * safeguard against this. |
| 605 | * <p> |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 606 | * To tell which input method's subtypes are displayed in the settings, add |
| 607 | * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. |
| 608 | * If there is no extra in this Intent, subtypes from all installed input methods |
| 609 | * will be displayed in the settings. |
| 610 | * |
| 611 | * @see android.view.inputmethod.InputMethodInfo#getId |
| 612 | * <p> |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 613 | * Input: Nothing. |
| 614 | * <p> |
| 615 | * Output: Nothing. |
| 616 | */ |
| 617 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 618 | public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = |
| 619 | "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 620 | |
| 621 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 622 | * Activity Action: Show settings to manage the user input dictionary. |
| 623 | * <p> |
Chet Haase | e8222dd | 2013-09-05 07:44:18 -0700 | [diff] [blame] | 624 | * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, |
Satoshi Kataoka | 2aa2bc5 | 2013-07-30 14:25:11 +0900 | [diff] [blame] | 625 | * it is guaranteed there will always be an appropriate implementation for this Intent action. |
| 626 | * 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] | 627 | * <p> |
| 628 | * Input: Nothing. |
| 629 | * <p> |
| 630 | * Output: Nothing. |
| 631 | */ |
| 632 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 633 | public static final String ACTION_USER_DICTIONARY_SETTINGS = |
| 634 | "android.settings.USER_DICTIONARY_SETTINGS"; |
| 635 | |
| 636 | /** |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 637 | * Activity Action: Show settings to configure the hardware keyboard. |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 638 | * <p> |
| 639 | * In some cases, a matching Activity may not exist, so ensure you |
| 640 | * safeguard against this. |
| 641 | * <p> |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 642 | * Input: Nothing. |
| 643 | * <p> |
| 644 | * Output: Nothing. |
| 645 | */ |
| 646 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 647 | public static final String ACTION_HARD_KEYBOARD_SETTINGS = |
| 648 | "android.settings.HARD_KEYBOARD_SETTINGS"; |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 649 | |
| 650 | /** |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 651 | * Activity Action: Adds a word to the user dictionary. |
| 652 | * <p> |
| 653 | * In some cases, a matching Activity may not exist, so ensure you |
| 654 | * safeguard against this. |
| 655 | * <p> |
| 656 | * Input: An extra with key <code>word</code> that contains the word |
| 657 | * that should be added to the dictionary. |
| 658 | * <p> |
| 659 | * Output: Nothing. |
| 660 | * |
| 661 | * @hide |
| 662 | */ |
| 663 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 664 | public static final String ACTION_USER_DICTIONARY_INSERT = |
| 665 | "com.android.settings.USER_DICTIONARY_INSERT"; |
| 666 | |
| 667 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | * Activity Action: Show settings to allow configuration of application-related settings. |
| 669 | * <p> |
| 670 | * In some cases, a matching Activity may not exist, so ensure you |
| 671 | * safeguard against this. |
| 672 | * <p> |
| 673 | * Input: Nothing. |
| 674 | * <p> |
| 675 | * Output: Nothing. |
| 676 | */ |
| 677 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 678 | public static final String ACTION_APPLICATION_SETTINGS = |
| 679 | "android.settings.APPLICATION_SETTINGS"; |
| 680 | |
| 681 | /** |
| 682 | * Activity Action: Show settings to allow configuration of application |
Dianne Hackborn | 8d866e5 | 2012-10-10 18:39:45 -0700 | [diff] [blame] | 683 | * development-related settings. As of |
| 684 | * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is |
| 685 | * a required part of the platform. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | * <p> |
| 687 | * Input: Nothing. |
| 688 | * <p> |
| 689 | * Output: Nothing. |
| 690 | */ |
| 691 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 692 | public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = |
| 693 | "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; |
| 694 | |
| 695 | /** |
| 696 | * Activity Action: Show settings to allow configuration of quick launch shortcuts. |
| 697 | * <p> |
| 698 | * In some cases, a matching Activity may not exist, so ensure you |
| 699 | * safeguard against this. |
| 700 | * <p> |
| 701 | * Input: Nothing. |
| 702 | * <p> |
| 703 | * Output: Nothing. |
| 704 | */ |
| 705 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 706 | public static final String ACTION_QUICK_LAUNCH_SETTINGS = |
| 707 | "android.settings.QUICK_LAUNCH_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 708 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 709 | /** |
| 710 | * Activity Action: Show settings to manage installed applications. |
| 711 | * <p> |
| 712 | * In some cases, a matching Activity may not exist, so ensure you |
| 713 | * safeguard against this. |
| 714 | * <p> |
| 715 | * Input: Nothing. |
| 716 | * <p> |
| 717 | * Output: Nothing. |
| 718 | */ |
| 719 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 720 | public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = |
| 721 | "android.settings.MANAGE_APPLICATIONS_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 722 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 723 | /** |
Winson Chung | 44e8ff9 | 2010-09-27 14:36:52 -0700 | [diff] [blame] | 724 | * Activity Action: Show settings to manage all applications. |
| 725 | * <p> |
| 726 | * In some cases, a matching Activity may not exist, so ensure you |
| 727 | * safeguard against this. |
| 728 | * <p> |
| 729 | * Input: Nothing. |
| 730 | * <p> |
| 731 | * Output: Nothing. |
| 732 | */ |
| 733 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 734 | public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = |
| 735 | "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; |
| 736 | |
| 737 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 738 | * 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] | 739 | * <p> |
| 740 | * In some cases, a matching Activity may not exist, so ensure you |
| 741 | * safeguard against this. |
| 742 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 743 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 744 | * directly invoke the management GUI specific to the package name. For example |
| 745 | * "package:com.my.app". |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 746 | * <p> |
| 747 | * Output: Nothing. |
| 748 | */ |
| 749 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 750 | public static final String ACTION_MANAGE_OVERLAY_PERMISSION = |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 751 | "android.settings.action.MANAGE_OVERLAY_PERMISSION"; |
| 752 | |
| 753 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 754 | * Activity Action: Show screen for controlling which apps are allowed to write/modify |
| 755 | * system settings. |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 756 | * <p> |
| 757 | * In some cases, a matching Activity may not exist, so ensure you |
| 758 | * safeguard against this. |
| 759 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 760 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 761 | * directly invoke the management GUI specific to the package name. For example |
| 762 | * "package:com.my.app". |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 763 | * <p> |
| 764 | * Output: Nothing. |
| 765 | */ |
| 766 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 767 | public static final String ACTION_MANAGE_WRITE_SETTINGS = |
| 768 | "android.settings.action.MANAGE_WRITE_SETTINGS"; |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 769 | |
| 770 | /** |
Dianne Hackborn | b7bb3b3 | 2010-06-06 22:47:50 -0700 | [diff] [blame] | 771 | * Activity Action: Show screen of details about a particular application. |
| 772 | * <p> |
| 773 | * In some cases, a matching Activity may not exist, so ensure you |
| 774 | * safeguard against this. |
| 775 | * <p> |
| 776 | * Input: The Intent's data URI specifies the application package name |
| 777 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 778 | * <p> |
| 779 | * Output: Nothing. |
| 780 | */ |
| 781 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 782 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS = |
| 783 | "android.settings.APPLICATION_DETAILS_SETTINGS"; |
| 784 | |
| 785 | /** |
Ben Lin | 296f80a | 2018-02-27 15:23:38 -0800 | [diff] [blame] | 786 | * Activity Action: Show the "Open by Default" page in a particular application's details page. |
| 787 | * <p> |
| 788 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 789 | * <p> |
| 790 | * Input: The Intent's data URI specifies the application package name |
| 791 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 792 | * <p> |
| 793 | * Output: Nothing. |
| 794 | * @hide |
| 795 | */ |
| 796 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 797 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE = |
| 798 | "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE"; |
| 799 | |
| 800 | /** |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 801 | * Activity Action: Show list of applications that have been running |
| 802 | * foreground services (to the user "running in the background"). |
| 803 | * <p> |
| 804 | * Input: Extras "packages" is a string array of package names. |
| 805 | * <p> |
| 806 | * Output: Nothing. |
| 807 | * @hide |
| 808 | */ |
| 809 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 810 | public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = |
| 811 | "android.settings.FOREGROUND_SERVICES_SETTINGS"; |
| 812 | |
| 813 | /** |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 814 | * Activity Action: Show screen for controlling which apps can ignore battery optimizations. |
| 815 | * <p> |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 816 | * Input: Nothing. |
| 817 | * <p> |
| 818 | * Output: Nothing. |
| 819 | * <p> |
| 820 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 821 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 822 | * already ignoring optimizations. You can use |
| 823 | * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you |
| 824 | * on this list. |
| 825 | */ |
| 826 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 827 | public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = |
| 828 | "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; |
| 829 | |
| 830 | /** |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 831 | * 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] | 832 | * put them on the whitelist of apps shown by |
| 833 | * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also |
| 834 | * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} |
| 835 | * permission. |
| 836 | * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities |
| 837 | * 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] | 838 | * 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] | 839 | * 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] | 840 | * 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] | 841 | * <p> |
| 842 | * Input: The Intent's data URI must specify the application package name |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 843 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 844 | * <p> |
| 845 | * Output: Nothing. |
Dianne Hackborn | 1958e5e | 2015-06-12 18:11:41 -0700 | [diff] [blame] | 846 | * <p> |
| 847 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 848 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 849 | * already ignoring optimizations. |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 850 | */ |
| 851 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 852 | public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = |
| 853 | "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 854 | |
| 855 | /** |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 856 | * Activity Action: Show screen for controlling background data |
| 857 | * restrictions for a particular application. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 858 | * <p> |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 859 | * Input: Intent's data URI set with an application name, using the |
| 860 | * "package" schema (like "package:com.my.app"). |
| 861 | * |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 862 | * <p> |
| 863 | * Output: Nothing. |
| 864 | * <p> |
| 865 | * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 866 | * ConnectivityManager#getRestrictBackgroundStatus()} to determine the |
| 867 | * status of the background data restrictions for them. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 868 | */ |
| 869 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 870 | public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = |
| 871 | "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; |
| 872 | |
| 873 | /** |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 874 | * @hide |
| 875 | * Activity Action: Show the "app ops" settings screen. |
| 876 | * <p> |
| 877 | * Input: Nothing. |
| 878 | * <p> |
| 879 | * Output: Nothing. |
| 880 | */ |
| 881 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 882 | public static final String ACTION_APP_OPS_SETTINGS = |
| 883 | "android.settings.APP_OPS_SETTINGS"; |
| 884 | |
| 885 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 886 | * Activity Action: Show settings for system update functionality. |
| 887 | * <p> |
| 888 | * In some cases, a matching Activity may not exist, so ensure you |
| 889 | * safeguard against this. |
| 890 | * <p> |
| 891 | * Input: Nothing. |
| 892 | * <p> |
| 893 | * Output: Nothing. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 894 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 895 | * @hide |
| 896 | */ |
| 897 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 898 | public static final String ACTION_SYSTEM_UPDATE_SETTINGS = |
| 899 | "android.settings.SYSTEM_UPDATE_SETTINGS"; |
| 900 | |
| 901 | /** |
Ricky Wai | 38bb832 | 2017-02-01 15:23:50 +0000 | [diff] [blame] | 902 | * Activity Action: Show settings for managed profile settings. |
| 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. |
| 910 | * |
| 911 | * @hide |
| 912 | */ |
| 913 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 914 | public static final String ACTION_MANAGED_PROFILE_SETTINGS = |
| 915 | "android.settings.MANAGED_PROFILE_SETTINGS"; |
| 916 | |
| 917 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 918 | * Activity Action: Show settings to allow configuration of sync settings. |
| 919 | * <p> |
| 920 | * In some cases, a matching Activity may not exist, so ensure you |
| 921 | * safeguard against this. |
| 922 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 923 | * The account types available to add via the add account button may be restricted by adding an |
| 924 | * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's |
| 925 | * authorities. Only account types which can sync with that content provider will be offered to |
| 926 | * the user. |
| 927 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 928 | * Input: Nothing. |
| 929 | * <p> |
| 930 | * Output: Nothing. |
| 931 | */ |
| 932 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 933 | public static final String ACTION_SYNC_SETTINGS = |
| 934 | "android.settings.SYNC_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 935 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 936 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 937 | * Activity Action: Show add account screen for creating a new account. |
| 938 | * <p> |
| 939 | * In some cases, a matching Activity may not exist, so ensure you |
| 940 | * safeguard against this. |
| 941 | * <p> |
| 942 | * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} |
| 943 | * extra to the Intent with one or more syncable content provider's authorities. Only account |
| 944 | * types which can sync with that content provider will be offered to the user. |
| 945 | * <p> |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 946 | * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the |
| 947 | * Intent with one or more account types. |
| 948 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 949 | * Input: Nothing. |
| 950 | * <p> |
| 951 | * Output: Nothing. |
| 952 | */ |
| 953 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 954 | public static final String ACTION_ADD_ACCOUNT = |
| 955 | "android.settings.ADD_ACCOUNT_SETTINGS"; |
| 956 | |
| 957 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 958 | * Activity Action: Show settings for selecting the network operator. |
| 959 | * <p> |
| 960 | * In some cases, a matching Activity may not exist, so ensure you |
| 961 | * safeguard against this. |
| 962 | * <p> |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 963 | * The subscription ID of the subscription for which available network operators should be |
| 964 | * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. |
| 965 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 966 | * Input: Nothing. |
| 967 | * <p> |
| 968 | * Output: Nothing. |
| 969 | */ |
| 970 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 971 | public static final String ACTION_NETWORK_OPERATOR_SETTINGS = |
| 972 | "android.settings.NETWORK_OPERATOR_SETTINGS"; |
| 973 | |
| 974 | /** |
| 975 | * Activity Action: Show settings for selection of 2G/3G. |
| 976 | * <p> |
| 977 | * In some cases, a matching Activity may not exist, so ensure you |
| 978 | * safeguard against this. |
| 979 | * <p> |
| 980 | * Input: Nothing. |
| 981 | * <p> |
| 982 | * Output: Nothing. |
| 983 | */ |
| 984 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 985 | public static final String ACTION_DATA_ROAMING_SETTINGS = |
| 986 | "android.settings.DATA_ROAMING_SETTINGS"; |
| 987 | |
| 988 | /** |
| 989 | * Activity Action: Show settings for internal storage. |
| 990 | * <p> |
| 991 | * In some cases, a matching Activity may not exist, so ensure you |
| 992 | * safeguard against this. |
| 993 | * <p> |
| 994 | * Input: Nothing. |
| 995 | * <p> |
| 996 | * Output: Nothing. |
| 997 | */ |
| 998 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 999 | public static final String ACTION_INTERNAL_STORAGE_SETTINGS = |
| 1000 | "android.settings.INTERNAL_STORAGE_SETTINGS"; |
| 1001 | /** |
| 1002 | * Activity Action: Show settings for memory card storage. |
| 1003 | * <p> |
| 1004 | * In some cases, a matching Activity may not exist, so ensure you |
| 1005 | * safeguard against this. |
| 1006 | * <p> |
| 1007 | * Input: Nothing. |
| 1008 | * <p> |
| 1009 | * Output: Nothing. |
| 1010 | */ |
| 1011 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1012 | public static final String ACTION_MEMORY_CARD_SETTINGS = |
| 1013 | "android.settings.MEMORY_CARD_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 1014 | |
Justin Mattson | ef34035 | 2010-01-13 21:05:46 -0800 | [diff] [blame] | 1015 | /** |
| 1016 | * Activity Action: Show settings for global search. |
| 1017 | * <p> |
| 1018 | * In some cases, a matching Activity may not exist, so ensure you |
| 1019 | * safeguard against this. |
| 1020 | * <p> |
| 1021 | * Input: Nothing. |
| 1022 | * <p> |
| 1023 | * Output: Nothing |
| 1024 | */ |
| 1025 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1026 | public static final String ACTION_SEARCH_SETTINGS = |
| 1027 | "android.search.action.SEARCH_SETTINGS"; |
| 1028 | |
Daniel Sandler | 9d8b876 | 2010-01-22 20:50:15 -0500 | [diff] [blame] | 1029 | /** |
| 1030 | * Activity Action: Show general device information settings (serial |
| 1031 | * number, software version, phone number, etc.). |
| 1032 | * <p> |
| 1033 | * In some cases, a matching Activity may not exist, so ensure you |
| 1034 | * safeguard against this. |
| 1035 | * <p> |
| 1036 | * Input: Nothing. |
| 1037 | * <p> |
| 1038 | * Output: Nothing |
| 1039 | */ |
| 1040 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1041 | public static final String ACTION_DEVICE_INFO_SETTINGS = |
| 1042 | "android.settings.DEVICE_INFO_SETTINGS"; |
| 1043 | |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1044 | /** |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1045 | * Activity Action: Show NFC settings. |
| 1046 | * <p> |
| 1047 | * This shows UI that allows NFC to be turned on or off. |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 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 |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1055 | * @see android.nfc.NfcAdapter#isEnabled() |
| 1056 | */ |
| 1057 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1058 | public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; |
| 1059 | |
| 1060 | /** |
| 1061 | * Activity Action: Show NFC Sharing settings. |
| 1062 | * <p> |
| 1063 | * This shows UI that allows NDEF Push (Android Beam) to be turned on or |
| 1064 | * off. |
| 1065 | * <p> |
| 1066 | * In some cases, a matching Activity may not exist, so ensure you |
| 1067 | * safeguard against this. |
| 1068 | * <p> |
| 1069 | * Input: Nothing. |
| 1070 | * <p> |
| 1071 | * Output: Nothing |
| 1072 | * @see android.nfc.NfcAdapter#isNdefPushEnabled() |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1073 | */ |
| 1074 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1075 | public static final String ACTION_NFCSHARING_SETTINGS = |
| 1076 | "android.settings.NFCSHARING_SETTINGS"; |
| 1077 | |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1078 | /** |
Martijn Coenen | 62c196a | 2013-08-09 13:43:34 -0700 | [diff] [blame] | 1079 | * Activity Action: Show NFC Tap & Pay settings |
| 1080 | * <p> |
| 1081 | * This shows UI that allows the user to configure Tap&Pay |
| 1082 | * settings. |
| 1083 | * <p> |
| 1084 | * In some cases, a matching Activity may not exist, so ensure you |
| 1085 | * safeguard against this. |
| 1086 | * <p> |
| 1087 | * Input: Nothing. |
| 1088 | * <p> |
| 1089 | * Output: Nothing |
| 1090 | */ |
| 1091 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1092 | public static final String ACTION_NFC_PAYMENT_SETTINGS = |
| 1093 | "android.settings.NFC_PAYMENT_SETTINGS"; |
| 1094 | |
| 1095 | /** |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1096 | * Activity Action: Show Daydream settings. |
| 1097 | * <p> |
| 1098 | * In some cases, a matching Activity may not exist, so ensure you |
| 1099 | * safeguard against this. |
| 1100 | * <p> |
| 1101 | * Input: Nothing. |
| 1102 | * <p> |
| 1103 | * Output: Nothing. |
| 1104 | * @see android.service.dreams.DreamService |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1105 | */ |
| 1106 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1107 | public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; |
| 1108 | |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1109 | /** |
| 1110 | * Activity Action: Show Notification listener settings. |
| 1111 | * <p> |
| 1112 | * In some cases, a matching Activity may not exist, so ensure you |
| 1113 | * safeguard against this. |
| 1114 | * <p> |
| 1115 | * Input: Nothing. |
| 1116 | * <p> |
| 1117 | * Output: Nothing. |
| 1118 | * @see android.service.notification.NotificationListenerService |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1119 | */ |
| 1120 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1121 | public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS |
Chris Wren | 8326a8a | 2014-10-22 14:13:32 -0400 | [diff] [blame] | 1122 | = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1123 | |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1124 | /** |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1125 | * Activity Action: Show Do Not Disturb access settings. |
| 1126 | * <p> |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1127 | * Users can grant and deny access to Do Not Disturb configuration from here. |
| 1128 | * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more |
| 1129 | * details. |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1130 | * <p> |
| 1131 | * Input: Nothing. |
| 1132 | * <p> |
| 1133 | * Output: Nothing. |
| 1134 | */ |
| 1135 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1136 | public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS |
| 1137 | = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1138 | |
| 1139 | /** |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 1140 | * @hide |
| 1141 | */ |
| 1142 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1143 | public static final String ACTION_CONDITION_PROVIDER_SETTINGS |
| 1144 | = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; |
| 1145 | |
| 1146 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1147 | * Activity Action: Show settings for video captioning. |
| 1148 | * <p> |
| 1149 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1150 | * against this. |
| 1151 | * <p> |
| 1152 | * Input: Nothing. |
| 1153 | * <p> |
| 1154 | * Output: Nothing. |
| 1155 | */ |
| 1156 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1157 | public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; |
| 1158 | |
Svetoslav | 773f54d | 2013-09-03 14:01:43 -0700 | [diff] [blame] | 1159 | /** |
| 1160 | * Activity Action: Show the top level print settings. |
| 1161 | * <p> |
| 1162 | * In some cases, a matching Activity may not exist, so ensure you |
| 1163 | * safeguard against this. |
| 1164 | * <p> |
| 1165 | * Input: Nothing. |
| 1166 | * <p> |
| 1167 | * Output: Nothing. |
| 1168 | */ |
| 1169 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1170 | public static final String ACTION_PRINT_SETTINGS = |
| 1171 | "android.settings.ACTION_PRINT_SETTINGS"; |
| 1172 | |
John Spurlock | de54700 | 2014-02-28 17:50:39 -0500 | [diff] [blame] | 1173 | /** |
| 1174 | * Activity Action: Show Zen Mode configuration settings. |
| 1175 | * |
| 1176 | * @hide |
| 1177 | */ |
| 1178 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1179 | public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; |
| 1180 | |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1181 | /** |
Julia Reynolds | a11d0b1 | 2017-02-16 15:01:36 -0500 | [diff] [blame] | 1182 | * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. |
John Spurlock | fc746f8 | 2015-04-03 13:47:14 -0400 | [diff] [blame] | 1183 | */ |
| 1184 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1185 | public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS |
| 1186 | = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; |
| 1187 | |
| 1188 | /** |
John Spurlock | 7af1018 | 2015-04-03 15:10:31 -0400 | [diff] [blame] | 1189 | * Activity Action: Show Zen Mode automation configuration settings. |
| 1190 | * |
| 1191 | * @hide |
| 1192 | */ |
| 1193 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1194 | public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS |
| 1195 | = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; |
| 1196 | |
| 1197 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1198 | * Activity Action: Modify do not disturb mode settings. |
| 1199 | * <p> |
| 1200 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1201 | * <p> |
| 1202 | * This intent MUST be started using |
| 1203 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1204 | * startVoiceActivity}. |
| 1205 | * <p> |
| 1206 | * Note: The Activity implementing this intent MUST verify that |
| 1207 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. |
| 1208 | * returns true before modifying the setting. |
| 1209 | * <p> |
| 1210 | * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate |
| 1211 | * how long the user wishes to avoid interruptions for. The optional |
| 1212 | * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is |
| 1213 | * enabling or disabling do not disturb mode. If either extra is not included, the |
| 1214 | * user maybe asked to provide the value. |
| 1215 | * <p> |
| 1216 | * Output: Nothing. |
| 1217 | */ |
| 1218 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1219 | public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = |
| 1220 | "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; |
| 1221 | |
| 1222 | /** |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 1223 | * Activity Action: Show Zen Mode schedule rule configuration settings. |
| 1224 | * |
| 1225 | * @hide |
| 1226 | */ |
| 1227 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1228 | public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS |
| 1229 | = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; |
| 1230 | |
| 1231 | /** |
John Spurlock | d60258f | 2015-04-30 09:30:52 -0400 | [diff] [blame] | 1232 | * Activity Action: Show Zen Mode event rule configuration settings. |
| 1233 | * |
| 1234 | * @hide |
| 1235 | */ |
| 1236 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1237 | public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS |
| 1238 | = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; |
| 1239 | |
| 1240 | /** |
John Spurlock | 39581cc | 2015-04-10 11:59:01 -0400 | [diff] [blame] | 1241 | * Activity Action: Show Zen Mode external rule configuration settings. |
| 1242 | * |
| 1243 | * @hide |
| 1244 | */ |
| 1245 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1246 | public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS |
| 1247 | = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; |
| 1248 | |
| 1249 | /** |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1250 | * Activity Action: Show the regulatory information screen for the device. |
| 1251 | * <p> |
| 1252 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1253 | * against this. |
| 1254 | * <p> |
| 1255 | * Input: Nothing. |
| 1256 | * <p> |
| 1257 | * Output: Nothing. |
| 1258 | */ |
Jeff Sharkey | dd77fda | 2014-04-16 17:23:08 -0700 | [diff] [blame] | 1259 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1260 | public static final String |
| 1261 | ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; |
| 1262 | |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1263 | /** |
| 1264 | * Activity Action: Show Device Name Settings. |
| 1265 | * <p> |
| 1266 | * 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] | 1267 | * against this. |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1268 | * |
| 1269 | * @hide |
| 1270 | */ |
| 1271 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1272 | public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; |
| 1273 | |
Tim Kilbourn | 87cd0dc | 2014-04-14 15:37:51 -0700 | [diff] [blame] | 1274 | /** |
| 1275 | * Activity Action: Show pairing settings. |
| 1276 | * <p> |
| 1277 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1278 | * against this. |
| 1279 | * |
| 1280 | * @hide |
| 1281 | */ |
| 1282 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1283 | public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; |
| 1284 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1285 | /** |
| 1286 | * Activity Action: Show battery saver settings. |
John Spurlock | 7346666 | 2014-10-30 13:42:05 -0400 | [diff] [blame] | 1287 | * <p> |
| 1288 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1289 | * against this. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1290 | */ |
| 1291 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1292 | public static final String ACTION_BATTERY_SAVER_SETTINGS |
| 1293 | = "android.settings.BATTERY_SAVER_SETTINGS"; |
| 1294 | |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1295 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1296 | * Activity Action: Modify Battery Saver mode setting using a voice command. |
| 1297 | * <p> |
| 1298 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1299 | * <p> |
| 1300 | * This intent MUST be started using |
| 1301 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1302 | * startVoiceActivity}. |
| 1303 | * <p> |
| 1304 | * Note: The activity implementing this intent MUST verify that |
| 1305 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 1306 | * modifying the setting. |
| 1307 | * <p> |
| 1308 | * Input: To tell which state batter saver mode should be set to, add the |
| 1309 | * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. |
| 1310 | * If the extra is not included, no changes will be made. |
| 1311 | * <p> |
| 1312 | * Output: Nothing. |
| 1313 | */ |
| 1314 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1315 | public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = |
| 1316 | "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; |
| 1317 | |
| 1318 | /** |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1319 | * Activity Action: Show Home selection settings. If there are multiple activities |
| 1320 | * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you |
| 1321 | * to pick your preferred activity. |
| 1322 | */ |
| 1323 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1324 | public static final String ACTION_HOME_SETTINGS |
| 1325 | = "android.settings.HOME_SETTINGS"; |
| 1326 | |
Julia Reynolds | 7eba593 | 2015-12-11 16:40:39 -0500 | [diff] [blame] | 1327 | /** |
| 1328 | * Activity Action: Show Default apps settings. |
| 1329 | * <p> |
| 1330 | * In some cases, a matching Activity may not exist, so ensure you |
| 1331 | * safeguard against this. |
| 1332 | * <p> |
| 1333 | * Input: Nothing. |
| 1334 | * <p> |
| 1335 | * Output: Nothing. |
| 1336 | */ |
| 1337 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1338 | public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS |
| 1339 | = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; |
| 1340 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1341 | /** |
| 1342 | * Activity Action: Show notification settings. |
| 1343 | * |
| 1344 | * @hide |
| 1345 | */ |
| 1346 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1347 | public static final String ACTION_NOTIFICATION_SETTINGS |
| 1348 | = "android.settings.NOTIFICATION_SETTINGS"; |
| 1349 | |
| 1350 | /** |
Julia Reynolds | ed1c9af | 2018-03-21 15:21:09 -0400 | [diff] [blame] | 1351 | * Activity Action: Show app listing settings, filtered by those that send notifications. |
| 1352 | * |
| 1353 | * @hide |
| 1354 | */ |
| 1355 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1356 | public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = |
| 1357 | "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; |
| 1358 | |
| 1359 | /** |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1360 | * Activity Action: Show notification settings for a single app. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1361 | * <p> |
Julia Reynolds | ed1c9af | 2018-03-21 15:21:09 -0400 | [diff] [blame] | 1362 | * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1363 | * <p> |
| 1364 | * Output: Nothing. |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1365 | */ |
| 1366 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1367 | public static final String ACTION_APP_NOTIFICATION_SETTINGS |
| 1368 | = "android.settings.APP_NOTIFICATION_SETTINGS"; |
| 1369 | |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1370 | /** |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1371 | * Activity Action: Show notification settings for a single {@link NotificationChannel}. |
| 1372 | * <p> |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1373 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1374 | * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. |
| 1375 | * <p> |
| 1376 | * Output: Nothing. |
| 1377 | */ |
| 1378 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1379 | public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS |
| 1380 | = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; |
| 1381 | |
| 1382 | /** |
| 1383 | * Activity Extra: The package owner of the notification channel settings to display. |
| 1384 | * <p> |
| 1385 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1386 | */ |
| 1387 | public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; |
| 1388 | |
| 1389 | /** |
| 1390 | * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings |
| 1391 | * to display. |
| 1392 | * <p> |
| 1393 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1394 | */ |
| 1395 | public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; |
| 1396 | |
| 1397 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1398 | * Activity Action: Show notification redaction settings. |
| 1399 | * |
| 1400 | * @hide |
| 1401 | */ |
| 1402 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1403 | public static final String ACTION_APP_NOTIFICATION_REDACTION |
| 1404 | = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; |
| 1405 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1406 | /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1407 | |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1408 | /** |
| 1409 | * Activity Action: Show a dialog with disabled by policy message. |
| 1410 | * <p> If an user action is disabled by policy, this dialog can be triggered to let |
| 1411 | * the user know about this. |
| 1412 | * <p> |
| 1413 | * Input: Nothing. |
| 1414 | * <p> |
| 1415 | * Output: Nothing. |
Sudheer Shanka | aebd5dd | 2016-02-18 12:37:14 +0000 | [diff] [blame] | 1416 | * |
| 1417 | * @hide |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1418 | */ |
| 1419 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1420 | public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS |
| 1421 | = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; |
| 1422 | |
Michal Karpinski | ba24409 | 2016-02-25 17:28:24 +0000 | [diff] [blame] | 1423 | /** |
| 1424 | * Activity Action: Show a dialog for remote bugreport flow. |
| 1425 | * <p> |
| 1426 | * Input: Nothing. |
| 1427 | * <p> |
| 1428 | * Output: Nothing. |
| 1429 | * |
| 1430 | * @hide |
| 1431 | */ |
| 1432 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1433 | public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG |
| 1434 | = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; |
| 1435 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 1436 | /** |
| 1437 | * Activity Action: Show VR listener settings. |
| 1438 | * <p> |
| 1439 | * Input: Nothing. |
| 1440 | * <p> |
| 1441 | * Output: Nothing. |
| 1442 | * |
| 1443 | * @see android.service.vr.VrListenerService |
| 1444 | */ |
| 1445 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1446 | public static final String ACTION_VR_LISTENER_SETTINGS |
| 1447 | = "android.settings.VR_LISTENER_SETTINGS"; |
| 1448 | |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1449 | /** |
Winson Chung | 59fda9e | 2017-01-20 16:14:51 -0800 | [diff] [blame] | 1450 | * Activity Action: Show Picture-in-picture settings. |
| 1451 | * <p> |
| 1452 | * Input: Nothing. |
| 1453 | * <p> |
| 1454 | * Output: Nothing. |
| 1455 | * |
| 1456 | * @hide |
| 1457 | */ |
| 1458 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1459 | public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS |
| 1460 | = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; |
| 1461 | |
| 1462 | /** |
Daniel Nishi | e58d2a7 | 2016-09-20 16:42:19 -0700 | [diff] [blame] | 1463 | * Activity Action: Show Storage Manager settings. |
| 1464 | * <p> |
| 1465 | * Input: Nothing. |
| 1466 | * <p> |
| 1467 | * Output: Nothing. |
| 1468 | * |
| 1469 | * @hide |
| 1470 | */ |
| 1471 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1472 | public static final String ACTION_STORAGE_MANAGER_SETTINGS |
| 1473 | = "android.settings.STORAGE_MANAGER_SETTINGS"; |
| 1474 | |
| 1475 | /** |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1476 | * Activity Action: Allows user to select current webview implementation. |
| 1477 | * <p> |
| 1478 | * Input: Nothing. |
| 1479 | * <p> |
| 1480 | * Output: Nothing. |
| 1481 | */ |
| 1482 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1483 | public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; |
| 1484 | |
Bartosz Fabianowski | 46bea2e | 2016-12-06 01:20:29 +0100 | [diff] [blame] | 1485 | /** |
| 1486 | * Activity Action: Show enterprise privacy section. |
| 1487 | * <p> |
| 1488 | * Input: Nothing. |
| 1489 | * <p> |
| 1490 | * Output: Nothing. |
| 1491 | * @hide |
| 1492 | */ |
| 1493 | @SystemApi |
| 1494 | @TestApi |
| 1495 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1496 | public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS |
| 1497 | = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; |
| 1498 | |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1499 | /** |
| 1500 | * Activity Action: Show screen that let user select its Autofill Service. |
| 1501 | * <p> |
| 1502 | * Input: Intent's data URI set with an application name, using the |
| 1503 | * "package" schema (like "package:com.my.app"). |
| 1504 | * |
| 1505 | * <p> |
| 1506 | * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging |
| 1507 | * to the caller package. |
| 1508 | * |
| 1509 | * <p> |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1510 | * <b>NOTE: </b> Applications should call |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1511 | * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1512 | * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action |
| 1513 | * 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] | 1514 | */ |
| 1515 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1516 | public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = |
| 1517 | "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; |
| 1518 | |
Felipe Leme | d82096e | 2018-01-22 13:44:01 -0800 | [diff] [blame] | 1519 | /** |
| 1520 | * Activity Action: Show screen for controlling which apps have access on volume directories. |
| 1521 | * <p> |
| 1522 | * Input: Nothing. |
| 1523 | * <p> |
| 1524 | * Output: Nothing. |
| 1525 | * <p> |
| 1526 | * Applications typically use this action to ask the user to revert the "Do not ask again" |
| 1527 | * status of directory access requests made by |
| 1528 | * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. |
| 1529 | */ |
| 1530 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1531 | public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = |
| 1532 | "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; |
| 1533 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1534 | // End of Intent actions for Settings |
| 1535 | |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1536 | /** |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1537 | * @hide - Private call() method on SettingsProvider to read from 'system' table. |
| 1538 | */ |
| 1539 | public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; |
| 1540 | |
| 1541 | /** |
| 1542 | * @hide - Private call() method on SettingsProvider to read from 'secure' table. |
| 1543 | */ |
| 1544 | public static final String CALL_METHOD_GET_SECURE = "GET_secure"; |
| 1545 | |
| 1546 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1547 | * @hide - Private call() method on SettingsProvider to read from 'global' table. |
| 1548 | */ |
| 1549 | public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; |
| 1550 | |
| 1551 | /** |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1552 | * @hide - Specifies that the caller of the fast-path call()-based flow tracks |
| 1553 | * the settings generation in order to cache values locally. If this key is |
| 1554 | * mapped to a <code>null</code> string extra in the request bundle, the response |
| 1555 | * bundle will contain the same key mapped to a parcelable extra which would be |
| 1556 | * an {@link android.util.MemoryIntArray}. The response will also contain an |
| 1557 | * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the |
| 1558 | * index in the array clients should use to lookup the generation. For efficiency |
| 1559 | * the caller should request the generation tracking memory array only if it |
| 1560 | * doesn't already have it. |
| 1561 | * |
| 1562 | * @see #CALL_METHOD_GENERATION_INDEX_KEY |
| 1563 | */ |
| 1564 | public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; |
| 1565 | |
| 1566 | /** |
| 1567 | * @hide Key with the location in the {@link android.util.MemoryIntArray} where |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1568 | * 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] | 1569 | * |
| 1570 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1571 | */ |
| 1572 | public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; |
| 1573 | |
| 1574 | /** |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1575 | * @hide Key with the settings table generation. The value is an integer. |
| 1576 | * |
| 1577 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1578 | */ |
| 1579 | public static final String CALL_METHOD_GENERATION_KEY = "_generation"; |
| 1580 | |
| 1581 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1582 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1583 | */ |
| 1584 | public static final String CALL_METHOD_USER_KEY = "_user"; |
| 1585 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1586 | /** |
| 1587 | * @hide - Boolean argument extra to the fast-path call()-based requests |
| 1588 | */ |
| 1589 | public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; |
| 1590 | |
| 1591 | /** |
| 1592 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1593 | */ |
| 1594 | public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; |
| 1595 | |
| 1596 | /** |
| 1597 | * @hide - String argument extra to the fast-path call()-based requests |
| 1598 | */ |
| 1599 | public static final String CALL_METHOD_TAG_KEY = "_tag"; |
| 1600 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1601 | /** @hide - Private call() method to write to 'system' table */ |
| 1602 | public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; |
| 1603 | |
| 1604 | /** @hide - Private call() method to write to 'secure' table */ |
| 1605 | public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; |
| 1606 | |
| 1607 | /** @hide - Private call() method to write to 'global' table */ |
| 1608 | public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; |
| 1609 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1610 | /** @hide - Private call() method to reset to defaults the 'global' table */ |
| 1611 | public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; |
| 1612 | |
| 1613 | /** @hide - Private call() method to reset to defaults the 'secure' table */ |
| 1614 | public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; |
| 1615 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1616 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1617 | * Activity Extra: Limit available options in launched activity based on the given authority. |
| 1618 | * <p> |
| 1619 | * This can be passed as an extra field in an Activity Intent with one or more syncable content |
| 1620 | * provider's authorities as a String[]. This field is used by some intents to alter the |
| 1621 | * behavior of the called activity. |
| 1622 | * <p> |
| 1623 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based |
| 1624 | * on the authority given. |
| 1625 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1626 | public static final String EXTRA_AUTHORITIES = "authorities"; |
| 1627 | |
Alon Albert | d35bf1f | 2013-04-18 14:26:51 -0700 | [diff] [blame] | 1628 | /** |
| 1629 | * Activity Extra: Limit available options in launched activity based on the given account |
| 1630 | * types. |
| 1631 | * <p> |
| 1632 | * This can be passed as an extra field in an Activity Intent with one or more account types |
| 1633 | * as a String[]. This field is used by some intents to alter the behavior of the called |
| 1634 | * activity. |
| 1635 | * <p> |
| 1636 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified |
| 1637 | * list. |
| 1638 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1639 | public static final String EXTRA_ACCOUNT_TYPES = "account_types"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1640 | |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 1641 | public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; |
| 1642 | |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1643 | /** |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1644 | * Activity Extra: The device identifier to act upon. |
| 1645 | * <p> |
| 1646 | * This can be passed as an extra field in an Activity Intent with a single |
| 1647 | * InputDeviceIdentifier. This field is used by some activities to jump straight into the |
| 1648 | * settings for the given device. |
| 1649 | * <p> |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 1650 | * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout |
| 1651 | * dialog for the given device. |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1652 | * @hide |
| 1653 | */ |
| 1654 | public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; |
| 1655 | |
| 1656 | /** |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1657 | * Activity Extra: Enable or disable Airplane Mode. |
| 1658 | * <p> |
| 1659 | * 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] | 1660 | * intent as a boolean to indicate if it should be enabled. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1661 | */ |
| 1662 | public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; |
| 1663 | |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1664 | /** |
| 1665 | * Activity Extra: Enable or disable Battery saver mode. |
| 1666 | * <p> |
| 1667 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} |
| 1668 | * intent as a boolean to indicate if it should be enabled. |
| 1669 | */ |
| 1670 | public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = |
| 1671 | "android.settings.extra.battery_saver_mode_enabled"; |
| 1672 | |
| 1673 | /** |
| 1674 | * Activity Extra: Enable or disable Do Not Disturb mode. |
| 1675 | * <p> |
| 1676 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1677 | * intent as a boolean to indicate if it should be enabled. |
| 1678 | */ |
| 1679 | public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = |
| 1680 | "android.settings.extra.do_not_disturb_mode_enabled"; |
| 1681 | |
| 1682 | /** |
| 1683 | * Activity Extra: How many minutes to enable do not disturb mode for. |
| 1684 | * <p> |
| 1685 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1686 | * intent to indicate how long do not disturb mode should be enabled for. |
| 1687 | */ |
| 1688 | public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = |
| 1689 | "android.settings.extra.do_not_disturb_mode_minutes"; |
| 1690 | |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1691 | /** |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1692 | * Reset mode: reset to defaults only settings changed by the |
| 1693 | * calling package. If there is a default set the setting |
| 1694 | * will be set to it, otherwise the setting will be deleted. |
| 1695 | * This is the only type of reset available to non-system clients. |
| 1696 | * @hide |
| 1697 | */ |
| 1698 | public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; |
| 1699 | |
| 1700 | /** |
| 1701 | * Reset mode: reset all settings set by untrusted packages, which is |
| 1702 | * packages that aren't a part of the system, to the current defaults. |
| 1703 | * If there is a default set the setting will be set to it, otherwise |
| 1704 | * the setting will be deleted. This mode is only available to the system. |
| 1705 | * @hide |
| 1706 | */ |
| 1707 | public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; |
| 1708 | |
| 1709 | /** |
| 1710 | * Reset mode: delete all settings set by untrusted packages, which is |
| 1711 | * packages that aren't a part of the system. If a setting is set by an |
| 1712 | * untrusted package it will be deleted if its default is not provided |
| 1713 | * by the system, otherwise the setting will be set to its default. |
| 1714 | * This mode is only available to the system. |
| 1715 | * @hide |
| 1716 | */ |
| 1717 | public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; |
| 1718 | |
| 1719 | /** |
| 1720 | * Reset mode: reset all settings to defaults specified by trusted |
| 1721 | * packages, which is packages that are a part of the system, and |
| 1722 | * delete all settings set by untrusted packages. If a setting has |
| 1723 | * a default set by a system package it will be set to the default, |
| 1724 | * otherwise the setting will be deleted. This mode is only available |
| 1725 | * to the system. |
| 1726 | * @hide |
| 1727 | */ |
| 1728 | public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; |
| 1729 | |
| 1730 | /** @hide */ |
| 1731 | @Retention(RetentionPolicy.SOURCE) |
Jeff Sharkey | ce8db99 | 2017-12-13 20:05:05 -0700 | [diff] [blame] | 1732 | @IntDef(prefix = { "RESET_MODE_" }, value = { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1733 | RESET_MODE_PACKAGE_DEFAULTS, |
| 1734 | RESET_MODE_UNTRUSTED_DEFAULTS, |
| 1735 | RESET_MODE_UNTRUSTED_CHANGES, |
| 1736 | RESET_MODE_TRUSTED_DEFAULTS |
| 1737 | }) |
| 1738 | public @interface ResetMode{} |
| 1739 | |
Ajay Nadathur | 702fc64 | 2018-03-09 11:56:01 -0800 | [diff] [blame] | 1740 | |
| 1741 | /** |
| 1742 | * User has not started setup personalization. |
| 1743 | * @hide |
| 1744 | */ |
| 1745 | public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; |
| 1746 | |
| 1747 | /** |
| 1748 | * User has not yet completed setup personalization. |
| 1749 | * @hide |
| 1750 | */ |
| 1751 | public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; |
| 1752 | |
| 1753 | /** |
| 1754 | * User has completed setup personalization. |
| 1755 | * @hide |
| 1756 | */ |
| 1757 | public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; |
| 1758 | |
| 1759 | /** @hide */ |
| 1760 | @Retention(RetentionPolicy.SOURCE) |
| 1761 | @IntDef({ |
| 1762 | USER_SETUP_PERSONALIZATION_NOT_STARTED, |
| 1763 | USER_SETUP_PERSONALIZATION_STARTED, |
| 1764 | USER_SETUP_PERSONALIZATION_COMPLETE |
| 1765 | }) |
| 1766 | public @interface UserSetupPersonalization {} |
| 1767 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1768 | /** |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1769 | * Activity Extra: Number of certificates |
| 1770 | * <p> |
| 1771 | * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} |
| 1772 | * intent to indicate the number of certificates |
| 1773 | * @hide |
| 1774 | */ |
| 1775 | public static final String EXTRA_NUMBER_OF_CERTIFICATES = |
| 1776 | "android.settings.extra.number_of_certificates"; |
| 1777 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1778 | private static final String JID_RESOURCE_PREFIX = "android"; |
| 1779 | |
| 1780 | public static final String AUTHORITY = "settings"; |
| 1781 | |
| 1782 | private static final String TAG = "Settings"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1783 | private static final boolean LOCAL_LOGV = false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1784 | |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 1785 | // Lock ensures that when enabling/disabling the master location switch, we don't end up |
| 1786 | // with a partial enable/disable state in multi-threaded situations. |
| 1787 | private static final Object mLocationSettingsLock = new Object(); |
| 1788 | |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1789 | // Used in system server calling uid workaround in call() |
| 1790 | private static boolean sInSystemServer = false; |
| 1791 | private static final Object sInSystemServerLock = new Object(); |
| 1792 | |
| 1793 | /** @hide */ |
| 1794 | public static void setInSystemServer() { |
| 1795 | synchronized (sInSystemServerLock) { |
| 1796 | sInSystemServer = true; |
| 1797 | } |
| 1798 | } |
| 1799 | |
| 1800 | /** @hide */ |
| 1801 | public static boolean isInSystemServer() { |
| 1802 | synchronized (sInSystemServerLock) { |
| 1803 | return sInSystemServer; |
| 1804 | } |
| 1805 | } |
| 1806 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1807 | public static class SettingNotFoundException extends AndroidException { |
| 1808 | public SettingNotFoundException(String msg) { |
| 1809 | super(msg); |
| 1810 | } |
| 1811 | } |
| 1812 | |
| 1813 | /** |
| 1814 | * Common base for tables of name/value settings. |
| 1815 | */ |
| 1816 | public static class NameValueTable implements BaseColumns { |
| 1817 | public static final String NAME = "name"; |
| 1818 | public static final String VALUE = "value"; |
| 1819 | |
| 1820 | protected static boolean putString(ContentResolver resolver, Uri uri, |
| 1821 | String name, String value) { |
| 1822 | // The database will take care of replacing duplicates. |
| 1823 | try { |
| 1824 | ContentValues values = new ContentValues(); |
| 1825 | values.put(NAME, name); |
| 1826 | values.put(VALUE, value); |
| 1827 | resolver.insert(uri, values); |
| 1828 | return true; |
| 1829 | } catch (SQLException e) { |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 1830 | 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] | 1831 | return false; |
| 1832 | } |
| 1833 | } |
| 1834 | |
| 1835 | public static Uri getUriFor(Uri uri, String name) { |
| 1836 | return Uri.withAppendedPath(uri, name); |
| 1837 | } |
| 1838 | } |
| 1839 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1840 | private static final class GenerationTracker { |
| 1841 | private final MemoryIntArray mArray; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1842 | private final Runnable mErrorHandler; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1843 | private final int mIndex; |
| 1844 | private int mCurrentGeneration; |
| 1845 | |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1846 | public GenerationTracker(@NonNull MemoryIntArray array, int index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1847 | int generation, Runnable errorHandler) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1848 | mArray = array; |
| 1849 | mIndex = index; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1850 | mErrorHandler = errorHandler; |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1851 | mCurrentGeneration = generation; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1852 | } |
| 1853 | |
| 1854 | public boolean isGenerationChanged() { |
| 1855 | final int currentGeneration = readCurrentGeneration(); |
| 1856 | if (currentGeneration >= 0) { |
| 1857 | if (currentGeneration == mCurrentGeneration) { |
| 1858 | return false; |
| 1859 | } |
| 1860 | mCurrentGeneration = currentGeneration; |
| 1861 | } |
| 1862 | return true; |
| 1863 | } |
| 1864 | |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1865 | public int getCurrentGeneration() { |
| 1866 | return mCurrentGeneration; |
| 1867 | } |
| 1868 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1869 | private int readCurrentGeneration() { |
| 1870 | try { |
| 1871 | return mArray.get(mIndex); |
| 1872 | } catch (IOException e) { |
| 1873 | Log.e(TAG, "Error getting current generation", e); |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1874 | if (mErrorHandler != null) { |
| 1875 | mErrorHandler.run(); |
| 1876 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1877 | } |
| 1878 | return -1; |
| 1879 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1880 | |
| 1881 | public void destroy() { |
| 1882 | try { |
| 1883 | mArray.close(); |
| 1884 | } catch (IOException e) { |
| 1885 | Log.e(TAG, "Error closing backing array", e); |
| 1886 | if (mErrorHandler != null) { |
| 1887 | mErrorHandler.run(); |
| 1888 | } |
| 1889 | } |
| 1890 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1891 | } |
| 1892 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1893 | private static final class ContentProviderHolder { |
| 1894 | private final Object mLock = new Object(); |
| 1895 | |
| 1896 | @GuardedBy("mLock") |
| 1897 | private final Uri mUri; |
| 1898 | @GuardedBy("mLock") |
| 1899 | private IContentProvider mContentProvider; |
| 1900 | |
| 1901 | public ContentProviderHolder(Uri uri) { |
| 1902 | mUri = uri; |
| 1903 | } |
| 1904 | |
| 1905 | public IContentProvider getProvider(ContentResolver contentResolver) { |
| 1906 | synchronized (mLock) { |
| 1907 | if (mContentProvider == null) { |
| 1908 | mContentProvider = contentResolver |
| 1909 | .acquireProvider(mUri.getAuthority()); |
| 1910 | } |
| 1911 | return mContentProvider; |
| 1912 | } |
| 1913 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 1914 | |
| 1915 | public void clearProviderForTest() { |
| 1916 | synchronized (mLock) { |
| 1917 | mContentProvider = null; |
| 1918 | } |
| 1919 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1920 | } |
| 1921 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1922 | // Thread-safe. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1923 | private static class NameValueCache { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1924 | private static final boolean DEBUG = false; |
| 1925 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1926 | private static final String[] SELECT_VALUE_PROJECTION = new String[] { |
| 1927 | Settings.NameValueTable.VALUE |
| 1928 | }; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1929 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1930 | private static final String NAME_EQ_PLACEHOLDER = "name=?"; |
| 1931 | |
| 1932 | // Must synchronize on 'this' to access mValues and mValuesVersion. |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1933 | private final HashMap<String, String> mValues = new HashMap<>(); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1934 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1935 | private final Uri mUri; |
| 1936 | private final ContentProviderHolder mProviderHolder; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1937 | |
| 1938 | // The method we'll call (or null, to not use) on the provider |
| 1939 | // for the fast path of retrieving settings. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1940 | private final String mCallGetCommand; |
| 1941 | private final String mCallSetCommand; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1942 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1943 | @GuardedBy("this") |
| 1944 | private GenerationTracker mGenerationTracker; |
| 1945 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1946 | public NameValueCache(Uri uri, String getCommand, String setCommand, |
| 1947 | ContentProviderHolder providerHolder) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1948 | mUri = uri; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1949 | mCallGetCommand = getCommand; |
| 1950 | mCallSetCommand = setCommand; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1951 | mProviderHolder = providerHolder; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1952 | } |
| 1953 | |
| 1954 | public boolean putStringForUser(ContentResolver cr, String name, String value, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1955 | String tag, boolean makeDefault, final int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1956 | try { |
| 1957 | Bundle arg = new Bundle(); |
| 1958 | arg.putString(Settings.NameValueTable.VALUE, value); |
Christopher Tate | d5fe147 | 2012-09-10 15:48:38 -0700 | [diff] [blame] | 1959 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1960 | if (tag != null) { |
| 1961 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 1962 | } |
| 1963 | if (makeDefault) { |
| 1964 | arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); |
| 1965 | } |
| 1966 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 1967 | cp.call(cr.getPackageName(), mCallSetCommand, name, arg); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1968 | } catch (RemoteException e) { |
| 1969 | Log.w(TAG, "Can't set key " + name + " in " + mUri, e); |
| 1970 | return false; |
| 1971 | } |
| 1972 | return true; |
| 1973 | } |
| 1974 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1975 | public String getStringForUser(ContentResolver cr, String name, final int userHandle) { |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1976 | final boolean isSelf = (userHandle == UserHandle.myUserId()); |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1977 | int currentGeneration = -1; |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1978 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1979 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1980 | if (mGenerationTracker != null) { |
| 1981 | if (mGenerationTracker.isGenerationChanged()) { |
| 1982 | if (DEBUG) { |
| 1983 | Log.i(TAG, "Generation changed for type:" |
| 1984 | + mUri.getPath() + " in package:" |
| 1985 | + cr.getPackageName() +" and user:" + userHandle); |
| 1986 | } |
| 1987 | mValues.clear(); |
| 1988 | } else if (mValues.containsKey(name)) { |
| 1989 | return mValues.get(name); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1990 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1991 | if (mGenerationTracker != null) { |
| 1992 | currentGeneration = mGenerationTracker.getCurrentGeneration(); |
| 1993 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1994 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1995 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1996 | } else { |
| 1997 | if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle |
| 1998 | + " by user " + UserHandle.myUserId() + " so skipping cache"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1999 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2000 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2001 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2002 | |
| 2003 | // Try the fast path first, not using query(). If this |
| 2004 | // fails (alternate Settings provider that doesn't support |
| 2005 | // this interface?) then we fall back to the query/table |
| 2006 | // interface. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2007 | if (mCallGetCommand != null) { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2008 | try { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2009 | Bundle args = null; |
Christopher Tate | 5e08af0 | 2012-09-21 17:17:22 -0700 | [diff] [blame] | 2010 | if (!isSelf) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2011 | args = new Bundle(); |
| 2012 | args.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 2013 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2014 | boolean needsGenerationTracker = false; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2015 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2016 | if (isSelf && mGenerationTracker == null) { |
| 2017 | needsGenerationTracker = true; |
| 2018 | if (args == null) { |
| 2019 | args = new Bundle(); |
| 2020 | } |
| 2021 | args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); |
| 2022 | if (DEBUG) { |
| 2023 | Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() |
| 2024 | + " in package:" + cr.getPackageName() +" and user:" |
| 2025 | + userHandle); |
| 2026 | } |
| 2027 | } |
| 2028 | } |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2029 | Bundle b; |
| 2030 | // If we're in system server and in a binder transaction we need to clear the |
| 2031 | // calling uid. This works around code in system server that did not call |
| 2032 | // clearCallingIdentity, previously this wasn't needed because reading settings |
| 2033 | // did not do permission checking but thats no longer the case. |
| 2034 | // Long term this should be removed and callers should properly call |
| 2035 | // clearCallingIdentity or use a ContentResolver from the caller as needed. |
| 2036 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2037 | final long token = Binder.clearCallingIdentity(); |
| 2038 | try { |
| 2039 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 2040 | } finally { |
| 2041 | Binder.restoreCallingIdentity(token); |
| 2042 | } |
| 2043 | } else { |
| 2044 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 2045 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2046 | if (b != null) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2047 | String value = b.getString(Settings.NameValueTable.VALUE); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2048 | // Don't update our cache for reads of other users' data |
| 2049 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2050 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2051 | if (needsGenerationTracker) { |
| 2052 | MemoryIntArray array = b.getParcelable( |
| 2053 | CALL_METHOD_TRACK_GENERATION_KEY); |
| 2054 | final int index = b.getInt( |
| 2055 | CALL_METHOD_GENERATION_INDEX_KEY, -1); |
| 2056 | if (array != null && index >= 0) { |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2057 | final int generation = b.getInt( |
| 2058 | CALL_METHOD_GENERATION_KEY, 0); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2059 | if (DEBUG) { |
| 2060 | Log.i(TAG, "Received generation tracker for type:" |
| 2061 | + mUri.getPath() + " in package:" |
| 2062 | + cr.getPackageName() + " and user:" |
| 2063 | + userHandle + " with index:" + index); |
| 2064 | } |
Svet Ganov | 9d723d3 | 2016-08-27 11:05:56 -0700 | [diff] [blame] | 2065 | if (mGenerationTracker != null) { |
| 2066 | mGenerationTracker.destroy(); |
| 2067 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2068 | mGenerationTracker = new GenerationTracker(array, index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2069 | generation, () -> { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2070 | synchronized (NameValueCache.this) { |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2071 | Log.e(TAG, "Error accessing generation" |
| 2072 | + " tracker - removing"); |
| 2073 | if (mGenerationTracker != null) { |
| 2074 | GenerationTracker generationTracker = |
| 2075 | mGenerationTracker; |
| 2076 | mGenerationTracker = null; |
| 2077 | generationTracker.destroy(); |
| 2078 | mValues.clear(); |
| 2079 | } |
| 2080 | } |
| 2081 | }); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2082 | } |
| 2083 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2084 | if (mGenerationTracker != null && currentGeneration == |
| 2085 | mGenerationTracker.getCurrentGeneration()) { |
| 2086 | mValues.put(name, value); |
| 2087 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2088 | } |
| 2089 | } else { |
| 2090 | if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle |
| 2091 | + " by " + UserHandle.myUserId() |
| 2092 | + " so not updating cache"); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2093 | } |
| 2094 | return value; |
| 2095 | } |
| 2096 | // If the response Bundle is null, we fall through |
| 2097 | // to the query interface below. |
| 2098 | } catch (RemoteException e) { |
| 2099 | // Not supported by the remote side? Fall through |
| 2100 | // to query(). |
| 2101 | } |
| 2102 | } |
| 2103 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2104 | Cursor c = null; |
| 2105 | try { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2106 | Bundle queryArgs = ContentResolver.createSqlQueryBundle( |
| 2107 | NAME_EQ_PLACEHOLDER, new String[]{name}, null); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2108 | // Same workaround as above. |
| 2109 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2110 | final long token = Binder.clearCallingIdentity(); |
| 2111 | try { |
| 2112 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2113 | null); |
| 2114 | } finally { |
| 2115 | Binder.restoreCallingIdentity(token); |
| 2116 | } |
| 2117 | } else { |
| 2118 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2119 | null); |
| 2120 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2121 | if (c == null) { |
| 2122 | Log.w(TAG, "Can't get key " + name + " from " + mUri); |
| 2123 | return null; |
| 2124 | } |
| 2125 | |
| 2126 | String value = c.moveToNext() ? c.getString(0) : null; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2127 | synchronized (NameValueCache.this) { |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2128 | if(mGenerationTracker != null && |
| 2129 | currentGeneration == mGenerationTracker.getCurrentGeneration()) { |
| 2130 | mValues.put(name, value); |
| 2131 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2132 | } |
| 2133 | if (LOCAL_LOGV) { |
| 2134 | Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + |
| 2135 | name + " = " + (value == null ? "(null)" : value)); |
| 2136 | } |
| 2137 | return value; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2138 | } catch (RemoteException e) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2139 | Log.w(TAG, "Can't get key " + name + " from " + mUri, e); |
| 2140 | return null; // Return null, but don't cache it. |
| 2141 | } finally { |
| 2142 | if (c != null) c.close(); |
| 2143 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2144 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2145 | |
| 2146 | public void clearGenerationTrackerForTest() { |
| 2147 | synchronized (NameValueCache.this) { |
| 2148 | if (mGenerationTracker != null) { |
| 2149 | mGenerationTracker.destroy(); |
| 2150 | } |
| 2151 | mValues.clear(); |
| 2152 | mGenerationTracker = null; |
| 2153 | } |
| 2154 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2155 | } |
| 2156 | |
| 2157 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2158 | * Checks if the specified context can draw on top of other apps. As of API |
| 2159 | * level 23, an app cannot draw on top of other apps unless it declares the |
| 2160 | * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its |
| 2161 | * manifest, <em>and</em> the user specifically grants the app this |
| 2162 | * capability. To prompt the user to grant this approval, the app must send an |
| 2163 | * intent with the action |
| 2164 | * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which |
| 2165 | * causes the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2166 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2167 | * @param context App context. |
| 2168 | * @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] | 2169 | */ |
| 2170 | public static boolean canDrawOverlays(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 2171 | return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), |
| 2172 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2173 | } |
| 2174 | |
| 2175 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2176 | * System settings, containing miscellaneous system preferences. This |
| 2177 | * table holds simple name/value pairs. There are convenience |
| 2178 | * functions for accessing individual settings entries. |
| 2179 | */ |
| 2180 | public static final class System extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 2181 | // NOTE: If you add new settings here, be sure to add them to |
| 2182 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. |
| 2183 | |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2184 | private static final float DEFAULT_FONT_SCALE = 1.0f; |
| 2185 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2186 | /** |
| 2187 | * The content:// style URL for this table |
| 2188 | */ |
| 2189 | public static final Uri CONTENT_URI = |
| 2190 | Uri.parse("content://" + AUTHORITY + "/system"); |
| 2191 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2192 | private static final ContentProviderHolder sProviderHolder = |
| 2193 | new ContentProviderHolder(CONTENT_URI); |
| 2194 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2195 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2196 | CONTENT_URI, |
| 2197 | CALL_METHOD_GET_SYSTEM, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2198 | CALL_METHOD_PUT_SYSTEM, |
| 2199 | sProviderHolder); |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2200 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2201 | private static final HashSet<String> MOVED_TO_SECURE; |
| 2202 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2203 | MOVED_TO_SECURE = new HashSet<>(30); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2204 | MOVED_TO_SECURE.add(Secure.ANDROID_ID); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2205 | MOVED_TO_SECURE.add(Secure.HTTP_PROXY); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2206 | MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 2207 | MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2208 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); |
| 2209 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); |
| 2210 | 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] | 2211 | MOVED_TO_SECURE.add(Secure.LOGGING_ID); |
| 2212 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); |
| 2213 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); |
| 2214 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); |
| 2215 | MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2216 | MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); |
| 2217 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 2218 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 2219 | MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 2220 | MOVED_TO_SECURE.add(Secure.WIFI_ON); |
| 2221 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); |
| 2222 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); |
| 2223 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); |
| 2224 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); |
| 2225 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); |
| 2226 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); |
| 2227 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); |
| 2228 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); |
| 2229 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); |
| 2230 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); |
| 2231 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 2232 | |
| 2233 | // At one time in System, then Global, but now back in Secure |
| 2234 | MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2235 | } |
| 2236 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2237 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2238 | private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2239 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2240 | MOVED_TO_GLOBAL = new HashSet<>(); |
| 2241 | MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2242 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2243 | // these were originally in system but migrated to secure in the past, |
| 2244 | // so are duplicated in the Secure.* namespace |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2245 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); |
| 2246 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); |
| 2247 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); |
| 2248 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2249 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); |
| 2250 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2251 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2252 | // these are moving directly from system to global |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2253 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); |
| 2254 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); |
| 2255 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); |
| 2256 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); |
| 2257 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); |
| 2258 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); |
| 2259 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); |
| 2260 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); |
| 2261 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); |
| 2262 | MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); |
| 2263 | MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); |
| 2264 | MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); |
| 2265 | MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); |
| 2266 | MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); |
| 2267 | MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); |
| 2268 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2269 | MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2270 | MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); |
| 2271 | MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); |
| 2272 | MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); |
| 2273 | MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); |
| 2274 | MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); |
| 2275 | MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); |
| 2276 | MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); |
| 2277 | MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); |
| 2278 | MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2279 | MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 2280 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); |
| 2281 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); |
| 2282 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); |
| 2283 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); |
| 2284 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); |
| 2285 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); |
| 2286 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); |
| 2287 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2288 | } |
| 2289 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2290 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2291 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2292 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2293 | outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); |
| 2294 | } |
| 2295 | |
| 2296 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2297 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 2298 | outKeySet.addAll(MOVED_TO_SECURE); |
| 2299 | } |
| 2300 | |
| 2301 | /** @hide */ |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2302 | public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { |
| 2303 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2304 | } |
| 2305 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2306 | /** @hide */ |
| 2307 | public static void clearProviderForTest() { |
| 2308 | sProviderHolder.clearProviderForTest(); |
| 2309 | sNameValueCache.clearGenerationTrackerForTest(); |
| 2310 | } |
| 2311 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2312 | /** |
| 2313 | * Look up a name in the database. |
| 2314 | * @param resolver to access the database with |
| 2315 | * @param name to look up in the table |
| 2316 | * @return the corresponding value, or null if not present |
| 2317 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2318 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2319 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2320 | } |
| 2321 | |
| 2322 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2323 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2324 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2325 | if (MOVED_TO_SECURE.contains(name)) { |
| 2326 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2327 | + " to android.provider.Settings.Secure, returning read-only value."); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2328 | return Secure.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2329 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2330 | 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] | 2331 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2332 | + " to android.provider.Settings.Global, returning read-only value."); |
| 2333 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2334 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2335 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2336 | } |
| 2337 | |
| 2338 | /** |
| 2339 | * Store a name/value pair into the database. |
| 2340 | * @param resolver to access the database with |
| 2341 | * @param name to store |
| 2342 | * @param value to associate with the name |
| 2343 | * @return true if the value was set, false on database errors |
| 2344 | */ |
| 2345 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2346 | return putStringForUser(resolver, name, value, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2347 | } |
| 2348 | |
| 2349 | /** @hide */ |
| 2350 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 2351 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2352 | if (MOVED_TO_SECURE.contains(name)) { |
| 2353 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2354 | + " to android.provider.Settings.Secure, value is unchanged."); |
| 2355 | return false; |
| 2356 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2357 | 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] | 2358 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2359 | + " to android.provider.Settings.Global, value is unchanged."); |
| 2360 | return false; |
| 2361 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2362 | return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2363 | } |
| 2364 | |
| 2365 | /** |
| 2366 | * Construct the content URI for a particular name/value pair, |
| 2367 | * useful for monitoring changes with a ContentObserver. |
| 2368 | * @param name to look up in the table |
| 2369 | * @return the corresponding content URI, or null if not present |
| 2370 | */ |
| 2371 | public static Uri getUriFor(String name) { |
| 2372 | if (MOVED_TO_SECURE.contains(name)) { |
| 2373 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2374 | + " to android.provider.Settings.Secure, returning Secure URI."); |
| 2375 | return Secure.getUriFor(Secure.CONTENT_URI, name); |
| 2376 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2377 | 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] | 2378 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2379 | + " to android.provider.Settings.Global, returning read-only global URI."); |
| 2380 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 2381 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2382 | return getUriFor(CONTENT_URI, name); |
| 2383 | } |
| 2384 | |
| 2385 | /** |
| 2386 | * Convenience function for retrieving a single system settings value |
| 2387 | * as an integer. Note that internally setting values are always |
| 2388 | * stored as strings; this function converts the string to an integer |
| 2389 | * for you. The default value will be returned if the setting is |
| 2390 | * not defined or not an integer. |
| 2391 | * |
| 2392 | * @param cr The ContentResolver to access. |
| 2393 | * @param name The name of the setting to retrieve. |
| 2394 | * @param def Value to return if the setting is not defined. |
| 2395 | * |
| 2396 | * @return The setting's current value, or 'def' if it is not defined |
| 2397 | * or not a valid integer. |
| 2398 | */ |
| 2399 | public static int getInt(ContentResolver cr, String name, int def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2400 | return getIntForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2401 | } |
| 2402 | |
| 2403 | /** @hide */ |
| 2404 | public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { |
| 2405 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2406 | try { |
| 2407 | return v != null ? Integer.parseInt(v) : def; |
| 2408 | } catch (NumberFormatException e) { |
| 2409 | return def; |
| 2410 | } |
| 2411 | } |
| 2412 | |
| 2413 | /** |
| 2414 | * Convenience function for retrieving a single system settings value |
| 2415 | * as an integer. Note that internally setting values are always |
| 2416 | * stored as strings; this function converts the string to an integer |
| 2417 | * for you. |
| 2418 | * <p> |
| 2419 | * This version does not take a default value. If the setting has not |
| 2420 | * been set, or the string value is not a number, |
| 2421 | * it throws {@link SettingNotFoundException}. |
| 2422 | * |
| 2423 | * @param cr The ContentResolver to access. |
| 2424 | * @param name The name of the setting to retrieve. |
| 2425 | * |
| 2426 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2427 | * name can't be found or the setting value is not an integer. |
| 2428 | * |
| 2429 | * @return The setting's current value. |
| 2430 | */ |
| 2431 | public static int getInt(ContentResolver cr, String name) |
| 2432 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2433 | return getIntForUser(cr, name, 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 userHandle) |
| 2438 | throws SettingNotFoundException { |
| 2439 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2440 | try { |
| 2441 | return Integer.parseInt(v); |
| 2442 | } catch (NumberFormatException e) { |
| 2443 | throw new SettingNotFoundException(name); |
| 2444 | } |
| 2445 | } |
| 2446 | |
| 2447 | /** |
| 2448 | * Convenience function for updating a single settings value as an |
| 2449 | * integer. This will either create a new entry in the table if the |
| 2450 | * given name does not exist, or modify the value of the existing row |
| 2451 | * with that name. Note that internally setting values are always |
| 2452 | * stored as strings, so this function converts the given value to a |
| 2453 | * string before storing it. |
| 2454 | * |
| 2455 | * @param cr The ContentResolver to access. |
| 2456 | * @param name The name of the setting to modify. |
| 2457 | * @param value The new value for the setting. |
| 2458 | * @return true if the value was set, false on database errors |
| 2459 | */ |
| 2460 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2461 | return putIntForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2462 | } |
| 2463 | |
| 2464 | /** @hide */ |
| 2465 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 2466 | int userHandle) { |
| 2467 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2468 | } |
| 2469 | |
| 2470 | /** |
| 2471 | * Convenience function for retrieving a single system settings value |
| 2472 | * as a {@code long}. Note that internally setting values are always |
| 2473 | * stored as strings; this function converts the string to a {@code long} |
| 2474 | * for you. The default value will be returned if the setting is |
| 2475 | * not defined or not a {@code long}. |
| 2476 | * |
| 2477 | * @param cr The ContentResolver to access. |
| 2478 | * @param name The name of the setting to retrieve. |
| 2479 | * @param def Value to return if the setting is not defined. |
| 2480 | * |
| 2481 | * @return The setting's current value, or 'def' if it is not defined |
| 2482 | * or not a valid {@code long}. |
| 2483 | */ |
| 2484 | public static long getLong(ContentResolver cr, String name, long def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2485 | return getLongForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2486 | } |
| 2487 | |
| 2488 | /** @hide */ |
| 2489 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 2490 | int userHandle) { |
| 2491 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2492 | long value; |
| 2493 | try { |
| 2494 | value = valString != null ? Long.parseLong(valString) : def; |
| 2495 | } catch (NumberFormatException e) { |
| 2496 | value = def; |
| 2497 | } |
| 2498 | return value; |
| 2499 | } |
| 2500 | |
| 2501 | /** |
| 2502 | * Convenience function for retrieving a single system settings value |
| 2503 | * as a {@code long}. Note that internally setting values are always |
| 2504 | * stored as strings; this function converts the string to a {@code long} |
| 2505 | * for you. |
| 2506 | * <p> |
| 2507 | * This version does not take a default value. If the setting has not |
| 2508 | * been set, or the string value is not a number, |
| 2509 | * it throws {@link SettingNotFoundException}. |
| 2510 | * |
| 2511 | * @param cr The ContentResolver to access. |
| 2512 | * @param name The name of the setting to retrieve. |
| 2513 | * |
| 2514 | * @return The setting's current value. |
| 2515 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2516 | * name can't be found or the setting value is not an integer. |
| 2517 | */ |
| 2518 | public static long getLong(ContentResolver cr, String name) |
| 2519 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2520 | return getLongForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2521 | } |
| 2522 | |
| 2523 | /** @hide */ |
| 2524 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 2525 | throws SettingNotFoundException { |
| 2526 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2527 | try { |
| 2528 | return Long.parseLong(valString); |
| 2529 | } catch (NumberFormatException e) { |
| 2530 | throw new SettingNotFoundException(name); |
| 2531 | } |
| 2532 | } |
| 2533 | |
| 2534 | /** |
| 2535 | * Convenience function for updating a single settings value as a long |
| 2536 | * integer. This will either create a new entry in the table if the |
| 2537 | * given name does not exist, or modify the value of the existing row |
| 2538 | * with that name. Note that internally setting values are always |
| 2539 | * stored as strings, so this function converts the given value to a |
| 2540 | * string before storing it. |
| 2541 | * |
| 2542 | * @param cr The ContentResolver to access. |
| 2543 | * @param name The name of the setting to modify. |
| 2544 | * @param value The new value for the setting. |
| 2545 | * @return true if the value was set, false on database errors |
| 2546 | */ |
| 2547 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2548 | return putLongForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2549 | } |
| 2550 | |
| 2551 | /** @hide */ |
| 2552 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 2553 | int userHandle) { |
| 2554 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2555 | } |
| 2556 | |
| 2557 | /** |
| 2558 | * Convenience function for retrieving a single system settings value |
| 2559 | * as a floating point number. Note that internally setting values are |
| 2560 | * always stored as strings; this function converts the string to an |
| 2561 | * float for you. The default value will be returned if the setting |
| 2562 | * is not defined or not a valid float. |
| 2563 | * |
| 2564 | * @param cr The ContentResolver to access. |
| 2565 | * @param name The name of the setting to retrieve. |
| 2566 | * @param def Value to return if the setting is not defined. |
| 2567 | * |
| 2568 | * @return The setting's current value, or 'def' if it is not defined |
| 2569 | * or not a valid float. |
| 2570 | */ |
| 2571 | public static float getFloat(ContentResolver cr, String name, float def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2572 | return getFloatForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2573 | } |
| 2574 | |
| 2575 | /** @hide */ |
| 2576 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 2577 | int userHandle) { |
| 2578 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2579 | try { |
| 2580 | return v != null ? Float.parseFloat(v) : def; |
| 2581 | } catch (NumberFormatException e) { |
| 2582 | return def; |
| 2583 | } |
| 2584 | } |
| 2585 | |
| 2586 | /** |
| 2587 | * Convenience function for retrieving a single system settings value |
| 2588 | * as a float. Note that internally setting values are always |
| 2589 | * stored as strings; this function converts the string to a float |
| 2590 | * for you. |
| 2591 | * <p> |
| 2592 | * This version does not take a default value. If the setting has not |
| 2593 | * been set, or the string value is not a number, |
| 2594 | * it throws {@link SettingNotFoundException}. |
| 2595 | * |
| 2596 | * @param cr The ContentResolver to access. |
| 2597 | * @param name The name of the setting to retrieve. |
| 2598 | * |
| 2599 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2600 | * name can't be found or the setting value is not a float. |
| 2601 | * |
| 2602 | * @return The setting's current value. |
| 2603 | */ |
| 2604 | public static float getFloat(ContentResolver cr, String name) |
| 2605 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2606 | return getFloatForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2607 | } |
| 2608 | |
| 2609 | /** @hide */ |
| 2610 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 2611 | throws SettingNotFoundException { |
| 2612 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 2613 | if (v == null) { |
| 2614 | throw new SettingNotFoundException(name); |
| 2615 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2616 | try { |
| 2617 | return Float.parseFloat(v); |
| 2618 | } catch (NumberFormatException e) { |
| 2619 | throw new SettingNotFoundException(name); |
| 2620 | } |
| 2621 | } |
| 2622 | |
| 2623 | /** |
| 2624 | * Convenience function for updating a single settings value as a |
| 2625 | * floating point number. This will either create a new entry in the |
| 2626 | * table if the given name does not exist, or modify the value of the |
| 2627 | * existing row with that name. Note that internally setting values |
| 2628 | * are always stored as strings, so this function converts the given |
| 2629 | * value to a string before storing it. |
| 2630 | * |
| 2631 | * @param cr The ContentResolver to access. |
| 2632 | * @param name The name of the setting to modify. |
| 2633 | * @param value The new value for the setting. |
| 2634 | * @return true if the value was set, false on database errors |
| 2635 | */ |
| 2636 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2637 | return putFloatForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2638 | } |
| 2639 | |
| 2640 | /** @hide */ |
| 2641 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 2642 | int userHandle) { |
| 2643 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2644 | } |
| 2645 | |
| 2646 | /** |
| 2647 | * Convenience function to read all of the current |
| 2648 | * configuration-related settings into a |
| 2649 | * {@link Configuration} object. |
| 2650 | * |
| 2651 | * @param cr The ContentResolver to access. |
| 2652 | * @param outConfig Where to place the configuration settings. |
| 2653 | */ |
| 2654 | public static void getConfiguration(ContentResolver cr, Configuration outConfig) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2655 | adjustConfigurationForUser(cr, outConfig, cr.getUserId(), |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2656 | false /* updateSettingsIfEmpty */); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2657 | } |
| 2658 | |
| 2659 | /** @hide */ |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2660 | public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, |
| 2661 | int userHandle, boolean updateSettingsIfEmpty) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2662 | outConfig.fontScale = Settings.System.getFloatForUser( |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2663 | cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2664 | if (outConfig.fontScale < 0) { |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2665 | outConfig.fontScale = DEFAULT_FONT_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2666 | } |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2667 | |
| 2668 | final String localeValue = |
| 2669 | Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); |
| 2670 | if (localeValue != null) { |
| 2671 | outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); |
| 2672 | } else { |
| 2673 | // Do not update configuration with emtpy settings since we need to take over the |
| 2674 | // locale list of previous user if the settings value is empty. This happens when a |
| 2675 | // new user is created. |
| 2676 | |
| 2677 | if (updateSettingsIfEmpty) { |
| 2678 | // Make current configuration persistent. This is necessary the first time a |
| 2679 | // user log in. At the first login, the configuration settings are empty, so we |
| 2680 | // need to store the adjusted configuration as the initial settings. |
| 2681 | Settings.System.putStringForUser( |
| 2682 | cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), |
| 2683 | userHandle); |
| 2684 | } |
| 2685 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2686 | } |
| 2687 | |
| 2688 | /** |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2689 | * @hide Erase the fields in the Configuration that should be applied |
| 2690 | * by the settings. |
| 2691 | */ |
| 2692 | public static void clearConfiguration(Configuration inoutConfig) { |
| 2693 | inoutConfig.fontScale = 0; |
Seigo Nonaka | d403151 | 2016-03-17 21:18:53 +0900 | [diff] [blame] | 2694 | if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { |
Seigo Nonaka | bd5cac6 | 2016-05-13 15:11:37 +0900 | [diff] [blame] | 2695 | inoutConfig.clearLocales(); |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2696 | } |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2697 | } |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2698 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2699 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2700 | * Convenience function to write a batch of configuration-related |
| 2701 | * settings from a {@link Configuration} object. |
| 2702 | * |
| 2703 | * @param cr The ContentResolver to access. |
| 2704 | * @param config The settings to write. |
| 2705 | * @return true if the values were set, false on database errors |
| 2706 | */ |
| 2707 | public static boolean putConfiguration(ContentResolver cr, Configuration config) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2708 | return putConfigurationForUser(cr, config, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2709 | } |
| 2710 | |
| 2711 | /** @hide */ |
| 2712 | public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, |
| 2713 | int userHandle) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2714 | return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && |
| 2715 | Settings.System.putStringForUser( |
| 2716 | cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2717 | } |
| 2718 | |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2719 | /** @hide */ |
| 2720 | public static boolean hasInterestingConfigurationChanges(int changes) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2721 | return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || |
| 2722 | (changes & ActivityInfo.CONFIG_LOCALE) != 0; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2723 | } |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2724 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2725 | /** @deprecated - Do not use */ |
| 2726 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2727 | public static boolean getShowGTalkServiceStatus(ContentResolver cr) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2728 | return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2729 | } |
| 2730 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2731 | /** |
| 2732 | * @hide |
| 2733 | * @deprecated - Do not use |
| 2734 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 2735 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2736 | public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, |
| 2737 | int userHandle) { |
| 2738 | return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; |
| 2739 | } |
| 2740 | |
| 2741 | /** @deprecated - Do not use */ |
| 2742 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2743 | public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 2744 | setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2745 | } |
| 2746 | |
| 2747 | /** |
| 2748 | * @hide |
| 2749 | * @deprecated - Do not use |
| 2750 | */ |
| 2751 | @Deprecated |
| 2752 | public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, |
| 2753 | int userHandle) { |
| 2754 | 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] | 2755 | } |
| 2756 | |
| 2757 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2758 | * @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] | 2759 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2760 | @Deprecated |
| 2761 | 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] | 2762 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2763 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 2764 | @Override |
| 2765 | public boolean validate(String value) { |
| 2766 | try { |
| 2767 | int val = Integer.parseInt(value); |
| 2768 | return (val == 0) |
| 2769 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 2770 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 2771 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 2772 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2773 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 2774 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2775 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2776 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 2777 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2778 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2779 | | BatteryManager.BATTERY_PLUGGED_USB |
| 2780 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 2781 | } catch (NumberFormatException e) { |
| 2782 | return false; |
| 2783 | } |
| 2784 | } |
| 2785 | }; |
| 2786 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2787 | /** |
| 2788 | * What happens when the user presses the end call button if they're not |
| 2789 | * on a call.<br/> |
| 2790 | * <b>Values:</b><br/> |
| 2791 | * 0 - The end button does nothing.<br/> |
| 2792 | * 1 - The end button goes to the home screen.<br/> |
| 2793 | * 2 - The end button puts the device to sleep and locks the keyguard.<br/> |
| 2794 | * 3 - The end button goes to the home screen. If the user is already on the |
| 2795 | * home screen, it puts the device to sleep. |
| 2796 | */ |
| 2797 | public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; |
| 2798 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2799 | private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2800 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2801 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2802 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 2803 | * END_BUTTON_BEHAVIOR value for "go home". |
| 2804 | * @hide |
| 2805 | */ |
| 2806 | public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; |
| 2807 | |
| 2808 | /** |
| 2809 | * END_BUTTON_BEHAVIOR value for "go to sleep". |
| 2810 | * @hide |
| 2811 | */ |
| 2812 | public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; |
| 2813 | |
| 2814 | /** |
| 2815 | * END_BUTTON_BEHAVIOR default value. |
| 2816 | * @hide |
| 2817 | */ |
| 2818 | public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; |
| 2819 | |
| 2820 | /** |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2821 | * Is advanced settings mode turned on. 0 == no, 1 == yes |
| 2822 | * @hide |
| 2823 | */ |
| 2824 | public static final String ADVANCED_SETTINGS = "advanced_settings"; |
| 2825 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2826 | private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2827 | |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2828 | /** |
| 2829 | * ADVANCED_SETTINGS default value. |
| 2830 | * @hide |
| 2831 | */ |
| 2832 | public static final int ADVANCED_SETTINGS_DEFAULT = 0; |
| 2833 | |
| 2834 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2835 | * @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] | 2836 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2837 | @Deprecated |
| 2838 | 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] | 2839 | |
| 2840 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2841 | * @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] | 2842 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2843 | @Deprecated |
| 2844 | public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2845 | |
| 2846 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2847 | * @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] | 2848 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2849 | @Deprecated |
| 2850 | public static final String RADIO_WIFI = Global.RADIO_WIFI; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2851 | |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2852 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2853 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2854 | * {@hide} |
| 2855 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2856 | @Deprecated |
| 2857 | public static final String RADIO_WIMAX = Global.RADIO_WIMAX; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2858 | |
| 2859 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2860 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2861 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2862 | @Deprecated |
| 2863 | public static final String RADIO_CELL = Global.RADIO_CELL; |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2864 | |
| 2865 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2866 | * @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] | 2867 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2868 | @Deprecated |
| 2869 | public static final String RADIO_NFC = Global.RADIO_NFC; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2870 | |
| 2871 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2872 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead |
| 2873 | */ |
| 2874 | @Deprecated |
| 2875 | public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; |
| 2876 | |
| 2877 | /** |
| 2878 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2879 | * |
| 2880 | * {@hide} |
| 2881 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2882 | @Deprecated |
| 2883 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = |
| 2884 | Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2885 | |
| 2886 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2887 | * @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] | 2888 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2889 | @Deprecated |
| 2890 | 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] | 2891 | |
| 2892 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2893 | * @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] | 2894 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2895 | @Deprecated |
| 2896 | 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] | 2897 | |
| 2898 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2899 | * @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] | 2900 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2901 | @Deprecated |
| 2902 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = |
| 2903 | Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2904 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2905 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2906 | * @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] | 2907 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2908 | @Deprecated |
| 2909 | 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] | 2910 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2911 | /** |
| 2912 | * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead |
| 2913 | */ |
| 2914 | @Deprecated |
| 2915 | public static final String MODE_RINGER = Global.MODE_RINGER; |
| 2916 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2917 | /** |
| 2918 | * Whether to use static IP and other static network attributes. |
| 2919 | * <p> |
| 2920 | * Set to 1 for true and 0 for false. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2921 | * |
| 2922 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2923 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2924 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2925 | public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; |
| 2926 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2927 | private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2928 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2929 | /** |
| 2930 | * The static IP address. |
| 2931 | * <p> |
| 2932 | * Example: "192.168.1.51" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2933 | * |
| 2934 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2935 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2936 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2937 | public static final String WIFI_STATIC_IP = "wifi_static_ip"; |
| 2938 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2939 | private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2940 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2941 | /** |
| 2942 | * If using static IP, the gateway's IP address. |
| 2943 | * <p> |
| 2944 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2945 | * |
| 2946 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2947 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2948 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2949 | public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; |
| 2950 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2951 | private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2952 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2953 | /** |
| 2954 | * If using static IP, the net mask. |
| 2955 | * <p> |
| 2956 | * Example: "255.255.255.0" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2957 | * |
| 2958 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2959 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2960 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; |
| 2962 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2963 | private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2964 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2965 | /** |
| 2966 | * If using static IP, the primary DNS's IP address. |
| 2967 | * <p> |
| 2968 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2969 | * |
| 2970 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2971 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2972 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2973 | public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; |
| 2974 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2975 | private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2976 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2977 | /** |
| 2978 | * If using static IP, the secondary DNS's IP address. |
| 2979 | * <p> |
| 2980 | * Example: "192.168.1.2" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2981 | * |
| 2982 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2983 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2984 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2985 | public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; |
| 2986 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2987 | 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] | 2988 | |
| 2989 | /** |
| 2990 | * Determines whether remote devices may discover and/or connect to |
| 2991 | * this device. |
| 2992 | * <P>Type: INT</P> |
| 2993 | * 2 -- discoverable and connectable |
| 2994 | * 1 -- connectable but not discoverable |
| 2995 | * 0 -- neither connectable nor discoverable |
| 2996 | */ |
| 2997 | public static final String BLUETOOTH_DISCOVERABILITY = |
| 2998 | "bluetooth_discoverability"; |
| 2999 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3000 | private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3001 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3002 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3003 | /** |
| 3004 | * Bluetooth discoverability timeout. If this value is nonzero, then |
| 3005 | * Bluetooth becomes discoverable for a certain number of seconds, |
| 3006 | * after which is becomes simply connectable. The value is in seconds. |
| 3007 | */ |
| 3008 | public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = |
| 3009 | "bluetooth_discoverability_timeout"; |
| 3010 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3011 | private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3012 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3013 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3014 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3015 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} |
| 3016 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3017 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3018 | @Deprecated |
| 3019 | 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] | 3020 | |
| 3021 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3022 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} |
| 3023 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3024 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3025 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3026 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 3027 | |
| 3028 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 3029 | * @deprecated Use |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3030 | * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} |
| 3031 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3032 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3033 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3034 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 3035 | "lock_pattern_tactile_feedback_enabled"; |
| 3036 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3037 | /** |
| 3038 | * A formatted string of the next alarm that is set, or the empty string |
| 3039 | * if there is no alarm set. |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3040 | * |
| 3041 | * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3042 | */ |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3043 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3044 | public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; |
| 3045 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3046 | private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { |
| 3047 | private static final int MAX_LENGTH = 1000; |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 3048 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3049 | @Override |
| 3050 | public boolean validate(String value) { |
| 3051 | // TODO: No idea what the correct format is. |
Svetoslav | 64d6e9c | 2015-02-12 11:30:36 -0800 | [diff] [blame] | 3052 | return value == null || value.length() < MAX_LENGTH; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3053 | } |
| 3054 | }; |
| 3055 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3056 | /** |
| 3057 | * Scaling factor for fonts, float. |
| 3058 | */ |
| 3059 | public static final String FONT_SCALE = "font_scale"; |
| 3060 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3061 | private static final Validator FONT_SCALE_VALIDATOR = new Validator() { |
| 3062 | @Override |
| 3063 | public boolean validate(String value) { |
| 3064 | try { |
| 3065 | return Float.parseFloat(value) >= 0; |
| 3066 | } catch (NumberFormatException e) { |
| 3067 | return false; |
| 3068 | } |
| 3069 | } |
| 3070 | }; |
| 3071 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3072 | /** |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3073 | * The serialized system locale value. |
| 3074 | * |
| 3075 | * Do not use this value directory. |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 3076 | * To get system locale, use {@link LocaleList#getDefault} instead. |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3077 | * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} |
| 3078 | * instead. |
| 3079 | * @hide |
| 3080 | */ |
| 3081 | public static final String SYSTEM_LOCALES = "system_locales"; |
| 3082 | |
| 3083 | |
| 3084 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3085 | * Name of an application package to be debugged. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3086 | * |
| 3087 | * @deprecated Use {@link Global#DEBUG_APP} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3088 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3089 | @Deprecated |
| 3090 | public static final String DEBUG_APP = Global.DEBUG_APP; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3091 | |
| 3092 | /** |
| 3093 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 3094 | * starting user code. If 0, it will run normally. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3095 | * |
| 3096 | * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3097 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3098 | @Deprecated |
| 3099 | 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] | 3100 | |
| 3101 | /** |
| 3102 | * Whether or not to dim the screen. 0=no 1=yes |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3103 | * @deprecated This setting is no longer used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3104 | */ |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3105 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3106 | public static final String DIM_SCREEN = "dim_screen"; |
| 3107 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3108 | private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3109 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3110 | /** |
Christine Franks | 8ad7149 | 2017-10-24 19:04:22 -0700 | [diff] [blame] | 3111 | * The display color mode. |
| 3112 | * @hide |
| 3113 | */ |
| 3114 | public static final String DISPLAY_COLOR_MODE = "display_color_mode"; |
| 3115 | |
| 3116 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 3117 | * The amount of time in milliseconds before the device goes to sleep or begins |
| 3118 | * to dream after a period of inactivity. This value is also known as the |
| 3119 | * user activity timeout period since the screen isn't necessarily turned off |
| 3120 | * when it expires. |
yuemingw | 0de748d | 2017-11-15 19:22:27 +0000 | [diff] [blame] | 3121 | * |
| 3122 | * <p> |
| 3123 | * This value is bounded by maximum timeout set by |
| 3124 | * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3125 | */ |
| 3126 | public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; |
| 3127 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3128 | private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = |
| 3129 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3130 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3131 | /** |
| 3132 | * The screen backlight brightness between 0 and 255. |
| 3133 | */ |
| 3134 | public static final String SCREEN_BRIGHTNESS = "screen_brightness"; |
| 3135 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3136 | private static final Validator SCREEN_BRIGHTNESS_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3137 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3138 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3139 | /** |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3140 | * The screen backlight brightness between 0 and 255. |
| 3141 | * @hide |
| 3142 | */ |
| 3143 | public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; |
| 3144 | |
| 3145 | private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3146 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3147 | |
| 3148 | /** |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3149 | * Control whether to enable automatic brightness mode. |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3150 | */ |
| 3151 | public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; |
| 3152 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3153 | private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3154 | |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3155 | /** |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3156 | * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) |
| 3157 | * or less (<0.0 >-1.0) bright. |
Dianne Hackborn | 518a3d8 | 2012-05-09 16:30:49 -0700 | [diff] [blame] | 3158 | * @hide |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3159 | */ |
| 3160 | public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; |
| 3161 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3162 | private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3163 | new SettingsValidators.InclusiveFloatRangeValidator(-1, 1); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3164 | |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3165 | /** |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3166 | * SCREEN_BRIGHTNESS_MODE value for manual mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3167 | */ |
| 3168 | public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; |
| 3169 | |
| 3170 | /** |
Scott Main | 52bfc24 | 2012-02-09 10:09:14 -0800 | [diff] [blame] | 3171 | * SCREEN_BRIGHTNESS_MODE value for automatic mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3172 | */ |
| 3173 | public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; |
| 3174 | |
| 3175 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3176 | * Control whether the process CPU usage meter should be shown. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3177 | * |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 3178 | * @deprecated This functionality is no longer available as of |
| 3179 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3181 | @Deprecated |
| 3182 | public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3183 | |
| 3184 | /** |
| 3185 | * If 1, the activity manager will aggressively finish activities and |
| 3186 | * processes as soon as they are no longer needed. If 0, the normal |
| 3187 | * extended lifetime is used. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3188 | * |
| 3189 | * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3190 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3191 | @Deprecated |
| 3192 | 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] | 3193 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3194 | /** |
Beverly | d696476 | 2018-02-16 14:07:03 -0500 | [diff] [blame] | 3195 | * 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] | 3196 | * stream type's bit should be set to 1 if it should be muted when going |
| 3197 | * into an inaudible ringer mode. |
| 3198 | */ |
| 3199 | public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; |
| 3200 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3201 | private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3202 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3203 | |
| 3204 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3205 | * Determines which streams are affected by mute. The |
| 3206 | * stream type's bit should be set to 1 if it should be muted when a mute request |
| 3207 | * is received. |
| 3208 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3209 | public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; |
| 3210 | |
| 3211 | private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3212 | NON_NEGATIVE_INTEGER_VALIDATOR; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3213 | |
| 3214 | /** |
| 3215 | * Whether vibrate is on for different events. This is used internally, |
| 3216 | * changing this value will not change the vibrate. See AudioManager. |
| 3217 | */ |
| 3218 | public static final String VIBRATE_ON = "vibrate_on"; |
| 3219 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3220 | private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3221 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3222 | /** |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3223 | * If 1, redirects the system vibrator to all currently attached input devices |
| 3224 | * that support vibration. If there are no such input devices, then the system |
| 3225 | * vibrator is used instead. |
| 3226 | * If 0, does not register the system vibrator. |
| 3227 | * |
| 3228 | * This setting is mainly intended to provide a compatibility mechanism for |
| 3229 | * applications that only know about the system vibrator and do not use the |
| 3230 | * input device vibrator API. |
| 3231 | * |
| 3232 | * @hide |
| 3233 | */ |
| 3234 | public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; |
| 3235 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3236 | private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3237 | |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3238 | /** |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 3239 | * The intensity of notification vibrations, if configurable. |
| 3240 | * |
| 3241 | * Not all devices are capable of changing their vibration intensity; on these devices |
| 3242 | * there will likely be no difference between the various vibration intensities except for |
| 3243 | * intensity 0 (off) and the rest. |
| 3244 | * |
| 3245 | * <b>Values:</b><br/> |
| 3246 | * 0 - Vibration is disabled<br/> |
| 3247 | * 1 - Weak vibrations<br/> |
| 3248 | * 2 - Medium vibrations<br/> |
| 3249 | * 3 - Strong vibrations |
| 3250 | * @hide |
| 3251 | */ |
| 3252 | public static final String NOTIFICATION_VIBRATION_INTENSITY = |
| 3253 | "notification_vibration_intensity"; |
| 3254 | |
| 3255 | /** |
| 3256 | * The intensity of haptic feedback vibrations, if configurable. |
| 3257 | * |
| 3258 | * Not all devices are capable of changing their feedback intensity; on these devices |
| 3259 | * there will likely be no difference between the various vibration intensities except for |
| 3260 | * intensity 0 (off) and the rest. |
| 3261 | * |
| 3262 | * <b>Values:</b><br/> |
| 3263 | * 0 - Vibration is disabled<br/> |
| 3264 | * 1 - Weak vibrations<br/> |
| 3265 | * 2 - Medium vibrations<br/> |
| 3266 | * 3 - Strong vibrations |
| 3267 | * @hide |
| 3268 | */ |
| 3269 | public static final String HAPTIC_FEEDBACK_INTENSITY = |
| 3270 | "haptic_feedback_intensity"; |
| 3271 | |
| 3272 | private static final Validator VIBRATION_INTENSITY_VALIDATOR = |
| 3273 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
| 3274 | |
| 3275 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3276 | * Ringer volume. This is used internally, changing this value will not |
| 3277 | * change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3278 | * |
| 3279 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3280 | */ |
| 3281 | public static final String VOLUME_RING = "volume_ring"; |
| 3282 | |
| 3283 | /** |
| 3284 | * System/notifications volume. This is used internally, changing this |
| 3285 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3286 | * |
| 3287 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3288 | */ |
| 3289 | public static final String VOLUME_SYSTEM = "volume_system"; |
| 3290 | |
| 3291 | /** |
| 3292 | * Voice call volume. This is used internally, changing this value will |
| 3293 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3294 | * |
| 3295 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3296 | */ |
| 3297 | public static final String VOLUME_VOICE = "volume_voice"; |
| 3298 | |
| 3299 | /** |
| 3300 | * Music/media/gaming volume. This is used internally, changing this |
| 3301 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3302 | * |
| 3303 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3304 | */ |
| 3305 | public static final String VOLUME_MUSIC = "volume_music"; |
| 3306 | |
| 3307 | /** |
| 3308 | * Alarm volume. This is used internally, changing this |
| 3309 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3310 | * |
| 3311 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3312 | */ |
| 3313 | public static final String VOLUME_ALARM = "volume_alarm"; |
| 3314 | |
| 3315 | /** |
| 3316 | * Notification volume. This is used internally, changing this |
| 3317 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3318 | * |
| 3319 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3320 | */ |
| 3321 | public static final String VOLUME_NOTIFICATION = "volume_notification"; |
| 3322 | |
| 3323 | /** |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3324 | * Bluetooth Headset volume. This is used internally, changing this value will |
| 3325 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3326 | * |
| 3327 | * @removed Not used by anything since API 2. |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3328 | */ |
| 3329 | public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; |
| 3330 | |
| 3331 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3332 | * @hide |
| 3333 | * Acessibility volume. This is used internally, changing this |
| 3334 | * value will not change the volume. |
| 3335 | */ |
| 3336 | public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; |
| 3337 | |
| 3338 | /** |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3339 | * Master volume (float in the range 0.0f to 1.0f). |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3340 | * |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3341 | * @hide |
| 3342 | */ |
| 3343 | public static final String VOLUME_MASTER = "volume_master"; |
| 3344 | |
| 3345 | /** |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3346 | * Master mono (int 1 = mono, 0 = normal). |
| 3347 | * |
| 3348 | * @hide |
| 3349 | */ |
| 3350 | public static final String MASTER_MONO = "master_mono"; |
| 3351 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3352 | private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR; |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3353 | |
| 3354 | /** |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3355 | * Whether the notifications should use the ring volume (value of 1) or |
| 3356 | * a separate notification volume (value of 0). In most cases, users |
| 3357 | * will have this enabled so the notification and ringer volumes will be |
| 3358 | * the same. However, power users can disable this and use the separate |
| 3359 | * notification volume control. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3360 | * <p> |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3361 | * Note: This is a one-off setting that will be removed in the future |
| 3362 | * when there is profile support. For this reason, it is kept hidden |
| 3363 | * from the public APIs. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3364 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3365 | * @hide |
Amith Yamasani | 42722bf | 2011-07-22 10:34:27 -0700 | [diff] [blame] | 3366 | * @deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3367 | */ |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 3368 | @Deprecated |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3369 | public static final String NOTIFICATIONS_USE_RING_VOLUME = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3370 | "notifications_use_ring_volume"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3371 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3372 | private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3373 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3374 | /** |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3375 | * Whether silent mode should allow vibration feedback. This is used |
| 3376 | * internally in AudioService and the Sound settings activity to |
| 3377 | * coordinate decoupling of vibrate and silent modes. This setting |
| 3378 | * will likely be removed in a future release with support for |
| 3379 | * audio/vibe feedback profiles. |
| 3380 | * |
Eric Laurent | bffc3d1 | 2012-05-07 17:43:49 -0700 | [diff] [blame] | 3381 | * Not used anymore. On devices with vibrator, the user explicitly selects |
| 3382 | * silent or vibrate mode. |
| 3383 | * Kept for use by legacy database upgrade code in DatabaseHelper. |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3384 | * @hide |
| 3385 | */ |
| 3386 | public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; |
| 3387 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3388 | private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3389 | |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3390 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3391 | * The mapping of stream type (integer) to its setting. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3392 | * |
| 3393 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3394 | */ |
| 3395 | public static final String[] VOLUME_SETTINGS = { |
| 3396 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3397 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3398 | }; |
| 3399 | |
| 3400 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3401 | * @hide |
| 3402 | * The mapping of stream type (integer) to its setting. |
| 3403 | * Unlike the VOLUME_SETTINGS array, this one contains as many entries as |
| 3404 | * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes |
| 3405 | * are never persisted. |
| 3406 | */ |
| 3407 | public static final String[] VOLUME_SETTINGS_INT = { |
| 3408 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
| 3409 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, |
| 3410 | "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, |
| 3411 | "" /*STREAM_DTMF, no setting for this stream*/, |
| 3412 | "" /*STREAM_TTS, no setting for this stream*/, |
| 3413 | VOLUME_ACCESSIBILITY |
| 3414 | }; |
| 3415 | |
| 3416 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3417 | * Appended to various volume related settings to record the previous |
| 3418 | * values before they the settings were affected by a silent/vibrate |
| 3419 | * ringer mode change. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3420 | * |
| 3421 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3422 | */ |
| 3423 | public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; |
| 3424 | |
| 3425 | /** |
| 3426 | * Persistent store for the system-wide default ringtone URI. |
| 3427 | * <p> |
| 3428 | * If you need to play the default ringtone at any given time, it is recommended |
| 3429 | * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve |
| 3430 | * to the set default ringtone at the time of playing. |
| 3431 | * |
| 3432 | * @see #DEFAULT_RINGTONE_URI |
| 3433 | */ |
| 3434 | public static final String RINGTONE = "ringtone"; |
| 3435 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3436 | private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3437 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3438 | /** |
| 3439 | * A {@link Uri} that will point to the current default ringtone at any |
| 3440 | * given time. |
| 3441 | * <p> |
| 3442 | * If the current default ringtone is in the DRM provider and the caller |
| 3443 | * does not have permission, the exception will be a |
| 3444 | * FileNotFoundException. |
| 3445 | */ |
| 3446 | public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); |
| 3447 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3448 | /** {@hide} */ |
| 3449 | public static final String RINGTONE_CACHE = "ringtone_cache"; |
| 3450 | /** {@hide} */ |
| 3451 | public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); |
| 3452 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3453 | /** |
| 3454 | * Persistent store for the system-wide default notification sound. |
| 3455 | * |
| 3456 | * @see #RINGTONE |
| 3457 | * @see #DEFAULT_NOTIFICATION_URI |
| 3458 | */ |
| 3459 | public static final String NOTIFICATION_SOUND = "notification_sound"; |
| 3460 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3461 | private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3462 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3463 | /** |
| 3464 | * A {@link Uri} that will point to the current default notification |
| 3465 | * sound at any given time. |
| 3466 | * |
| 3467 | * @see #DEFAULT_RINGTONE_URI |
| 3468 | */ |
| 3469 | public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); |
| 3470 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3471 | /** {@hide} */ |
| 3472 | public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; |
| 3473 | /** {@hide} */ |
| 3474 | public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); |
| 3475 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3476 | /** |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3477 | * Persistent store for the system-wide default alarm alert. |
| 3478 | * |
| 3479 | * @see #RINGTONE |
| 3480 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3481 | */ |
| 3482 | public static final String ALARM_ALERT = "alarm_alert"; |
| 3483 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3484 | private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3485 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3486 | /** |
| 3487 | * A {@link Uri} that will point to the current default alarm alert at |
| 3488 | * any given time. |
| 3489 | * |
| 3490 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3491 | */ |
| 3492 | public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); |
| 3493 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3494 | /** {@hide} */ |
| 3495 | public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; |
| 3496 | /** {@hide} */ |
| 3497 | public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); |
| 3498 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3499 | /** |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3500 | * Persistent store for the system default media button event receiver. |
| 3501 | * |
| 3502 | * @hide |
| 3503 | */ |
| 3504 | public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; |
| 3505 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3506 | private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3507 | |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3508 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3509 | * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off |
| 3510 | */ |
| 3511 | public static final String TEXT_AUTO_REPLACE = "auto_replace"; |
| 3512 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3513 | private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3514 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3515 | /** |
| 3516 | * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off |
| 3517 | */ |
| 3518 | public static final String TEXT_AUTO_CAPS = "auto_caps"; |
| 3519 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3520 | private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3521 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3522 | /** |
| 3523 | * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This |
| 3524 | * feature converts two spaces to a "." and space. |
| 3525 | */ |
| 3526 | public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3527 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3528 | private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3529 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3530 | /** |
| 3531 | * Setting to showing password characters in text editors. 1 = On, 0 = Off |
| 3532 | */ |
| 3533 | public static final String TEXT_SHOW_PASSWORD = "show_password"; |
| 3534 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3535 | private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3536 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3537 | public static final String SHOW_GTALK_SERVICE_STATUS = |
| 3538 | "SHOW_GTALK_SERVICE_STATUS"; |
| 3539 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3540 | private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3541 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3542 | /** |
| 3543 | * Name of activity to use for wallpaper on the home screen. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3544 | * |
| 3545 | * @deprecated Use {@link WallpaperManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3546 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3547 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3548 | public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; |
| 3549 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3550 | private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { |
| 3551 | private static final int MAX_LENGTH = 1000; |
| 3552 | |
| 3553 | @Override |
| 3554 | public boolean validate(String value) { |
| 3555 | if (value != null && value.length() > MAX_LENGTH) { |
| 3556 | return false; |
| 3557 | } |
| 3558 | return ComponentName.unflattenFromString(value) != null; |
| 3559 | } |
| 3560 | }; |
| 3561 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3562 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3563 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} |
| 3564 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3565 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3566 | @Deprecated |
| 3567 | public static final String AUTO_TIME = Global.AUTO_TIME; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3568 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3569 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3570 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3571 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3572 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} |
| 3573 | * instead |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3574 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3575 | @Deprecated |
| 3576 | public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3577 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3578 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3579 | |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3580 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3581 | * Display times as 12 or 24 hours |
| 3582 | * 12 |
| 3583 | * 24 |
| 3584 | */ |
| 3585 | public static final String TIME_12_24 = "time_12_24"; |
| 3586 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3587 | /** @hide */ |
| 3588 | public static final Validator TIME_12_24_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3589 | new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3590 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3591 | /** |
| 3592 | * Date format string |
| 3593 | * mm/dd/yyyy |
| 3594 | * dd/mm/yyyy |
| 3595 | * yyyy/mm/dd |
| 3596 | */ |
| 3597 | public static final String DATE_FORMAT = "date_format"; |
| 3598 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3599 | /** @hide */ |
| 3600 | public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { |
| 3601 | @Override |
| 3602 | public boolean validate(String value) { |
| 3603 | try { |
| 3604 | new SimpleDateFormat(value); |
| 3605 | return true; |
| 3606 | } catch (IllegalArgumentException e) { |
| 3607 | return false; |
| 3608 | } |
| 3609 | } |
| 3610 | }; |
| 3611 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3612 | /** |
| 3613 | * Whether the setup wizard has been run before (on first boot), or if |
| 3614 | * it still needs to be run. |
| 3615 | * |
| 3616 | * nonzero = it has been run in the past |
| 3617 | * 0 = it has not been run in the past |
| 3618 | */ |
| 3619 | public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; |
| 3620 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3621 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3622 | public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR; |
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 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 3626 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3627 | * |
| 3628 | * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3629 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3630 | @Deprecated |
| 3631 | 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] | 3632 | |
| 3633 | /** |
| 3634 | * Scaling factor for activity transition animations. Setting to 0 will disable window |
| 3635 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3636 | * |
| 3637 | * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3638 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3639 | @Deprecated |
| 3640 | 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] | 3641 | |
| 3642 | /** |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3643 | * Scaling factor for Animator-based animations. This affects both the start delay and |
| 3644 | * duration of all such animations. Setting to 0 will cause animations to end immediately. |
| 3645 | * The default value is 1. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3646 | * |
| 3647 | * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3648 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3649 | @Deprecated |
| 3650 | 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] | 3651 | |
| 3652 | /** |
| 3653 | * Control whether the accelerometer will be used to change screen |
| 3654 | * orientation. If 0, it will not be used unless explicitly requested |
| 3655 | * by the application; if 1, it will be used by default unless explicitly |
| 3656 | * disabled by the application. |
| 3657 | */ |
| 3658 | public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; |
| 3659 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3660 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3661 | public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3662 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3663 | /** |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3664 | * Default screen rotation when no other policy applies. |
| 3665 | * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a |
| 3666 | * preference, this rotation value will be used. Must be one of the |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 3667 | * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3668 | * |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3669 | * @see android.view.Display#getRotation |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3670 | */ |
| 3671 | public static final String USER_ROTATION = "user_rotation"; |
| 3672 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3673 | /** @hide */ |
| 3674 | public static final Validator USER_ROTATION_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3675 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3676 | |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3677 | /** |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3678 | * Control whether the rotation lock toggle in the System UI should be hidden. |
| 3679 | * Typically this is done for accessibility purposes to make it harder for |
| 3680 | * the user to accidentally toggle the rotation lock while the display rotation |
| 3681 | * has been locked for accessibility. |
| 3682 | * |
| 3683 | * If 0, then rotation lock toggle is not hidden for accessibility (although it may be |
| 3684 | * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. |
| 3685 | * |
| 3686 | * @hide |
| 3687 | */ |
| 3688 | public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = |
| 3689 | "hide_rotation_lock_toggle_for_accessibility"; |
| 3690 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3691 | /** @hide */ |
| 3692 | public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3693 | BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3694 | |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3695 | /** |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3696 | * Whether the phone vibrates when it is ringing due to an incoming call. This will |
| 3697 | * be used by Phone and Setting apps; it shouldn't affect other apps. |
| 3698 | * The value is boolean (1 or 0). |
| 3699 | * |
| 3700 | * Note: this is not same as "vibrate on ring", which had been available until ICS. |
| 3701 | * It was about AudioManager's setting and thus affected all the applications which |
| 3702 | * relied on the setting, while this is purely about the vibration setting for incoming |
| 3703 | * calls. |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3704 | */ |
| 3705 | public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; |
| 3706 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3707 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3708 | public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3709 | |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3710 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3711 | * Whether the audible DTMF tones are played by the dialer when dialing. The value is |
| 3712 | * boolean (1 or 0). |
| 3713 | */ |
| 3714 | public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; |
| 3715 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3716 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3717 | public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3718 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3719 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3720 | * CDMA only settings |
| 3721 | * DTMF tone type played by the dialer when dialing. |
| 3722 | * 0 = Normal |
| 3723 | * 1 = Long |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3724 | */ |
| 3725 | public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; |
| 3726 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3727 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3728 | public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3729 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3730 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3731 | * Whether the hearing aid is enabled. The value is |
| 3732 | * boolean (1 or 0). |
| 3733 | * @hide |
| 3734 | */ |
| 3735 | public static final String HEARING_AID = "hearing_aid"; |
| 3736 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3737 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3738 | public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3739 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3740 | /** |
| 3741 | * CDMA only settings |
| 3742 | * TTY Mode |
| 3743 | * 0 = OFF |
| 3744 | * 1 = FULL |
| 3745 | * 2 = VCO |
| 3746 | * 3 = HCO |
| 3747 | * @hide |
| 3748 | */ |
| 3749 | public static final String TTY_MODE = "tty_mode"; |
| 3750 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3751 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3752 | public static final Validator TTY_MODE_VALIDATOR = |
| 3753 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3754 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3755 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3756 | * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is |
| 3757 | * boolean (1 or 0). |
| 3758 | */ |
| 3759 | public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3760 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3761 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3762 | public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3763 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3764 | /** |
Antony Sargent | 4457bb8 | 2018-03-12 16:10:56 -0700 | [diff] [blame] | 3765 | * 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] | 3766 | * boolean (1 or 0). |
| 3767 | */ |
| 3768 | public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 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 HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3772 | |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3773 | /** |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3774 | * @deprecated Each application that shows web suggestions should have its own |
| 3775 | * setting for this. |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3776 | */ |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3777 | @Deprecated |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3778 | public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3779 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3780 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3781 | public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3782 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3783 | /** |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3784 | * Whether the notification LED should repeatedly flash when a notification is |
| 3785 | * pending. The value is boolean (1 or 0). |
| 3786 | * @hide |
| 3787 | */ |
| 3788 | public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; |
| 3789 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3790 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3791 | public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3792 | |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3793 | /** |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3794 | * Show pointer location on screen? |
| 3795 | * 0 = no |
| 3796 | * 1 = yes |
| 3797 | * @hide |
| 3798 | */ |
| 3799 | public static final String POINTER_LOCATION = "pointer_location"; |
| 3800 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3801 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3802 | public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3803 | |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3804 | /** |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3805 | * Show touch positions on screen? |
| 3806 | * 0 = no |
| 3807 | * 1 = yes |
| 3808 | * @hide |
| 3809 | */ |
| 3810 | public static final String SHOW_TOUCHES = "show_touches"; |
| 3811 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3812 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3813 | public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3814 | |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3815 | /** |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3816 | * Log raw orientation data from |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 3817 | * {@link com.android.server.policy.WindowOrientationListener} for use with the |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3818 | * orientationplot.py tool. |
| 3819 | * 0 = no |
| 3820 | * 1 = yes |
| 3821 | * @hide |
| 3822 | */ |
| 3823 | public static final String WINDOW_ORIENTATION_LISTENER_LOG = |
| 3824 | "window_orientation_listener_log"; |
| 3825 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3826 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3827 | public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3828 | |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3829 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3830 | * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} |
| 3831 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3832 | * @hide |
| 3833 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3834 | @Deprecated |
| 3835 | public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3836 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3837 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3838 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3839 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3840 | * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} |
| 3841 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3842 | * @hide |
| 3843 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3844 | @Deprecated |
| 3845 | public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3846 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3847 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3848 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3849 | /** |
| 3850 | * Whether to play sounds when the keyguard is shown and dismissed. |
| 3851 | * @hide |
| 3852 | */ |
| 3853 | public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; |
| 3854 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3855 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3856 | public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3857 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3858 | /** |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3859 | * Whether the lockscreen should be completely disabled. |
| 3860 | * @hide |
| 3861 | */ |
| 3862 | public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; |
| 3863 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3864 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3865 | public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3866 | |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3867 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3868 | * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} |
| 3869 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3870 | * @hide |
| 3871 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3872 | @Deprecated |
| 3873 | public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3874 | |
| 3875 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3876 | * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} |
| 3877 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3878 | * @hide |
| 3879 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3880 | @Deprecated |
| 3881 | public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3882 | |
| 3883 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3884 | * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} |
| 3885 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3886 | * @hide |
| 3887 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3888 | @Deprecated |
| 3889 | public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3890 | |
| 3891 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3892 | * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} |
| 3893 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3894 | * @hide |
| 3895 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3896 | @Deprecated |
| 3897 | public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3898 | |
| 3899 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3900 | * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} |
| 3901 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3902 | * @hide |
| 3903 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3904 | @Deprecated |
| 3905 | public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3906 | |
| 3907 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3908 | * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} |
| 3909 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3910 | * @hide |
| 3911 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3912 | @Deprecated |
| 3913 | public static final String LOCK_SOUND = Global.LOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3914 | |
| 3915 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3916 | * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} |
| 3917 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3918 | * @hide |
| 3919 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3920 | @Deprecated |
| 3921 | public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3922 | |
| 3923 | /** |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3924 | * Receive incoming SIP calls? |
| 3925 | * 0 = no |
| 3926 | * 1 = yes |
| 3927 | * @hide |
| 3928 | */ |
| 3929 | public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; |
| 3930 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3931 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3932 | public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3933 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3934 | /** |
| 3935 | * Call Preference String. |
| 3936 | * "SIP_ALWAYS" : Always use SIP with network access |
| 3937 | * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3938 | * @hide |
| 3939 | */ |
| 3940 | public static final String SIP_CALL_OPTIONS = "sip_call_options"; |
| 3941 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3942 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3943 | public static final Validator SIP_CALL_OPTIONS_VALIDATOR = |
| 3944 | new SettingsValidators.DiscreteValueValidator( |
| 3945 | new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3946 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3947 | /** |
| 3948 | * One of the sip call options: Always use SIP with network access. |
| 3949 | * @hide |
| 3950 | */ |
| 3951 | public static final String SIP_ALWAYS = "SIP_ALWAYS"; |
| 3952 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3953 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3954 | public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3955 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3956 | /** |
| 3957 | * One of the sip call options: Only if destination is a SIP address. |
| 3958 | * @hide |
| 3959 | */ |
| 3960 | public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; |
| 3961 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3962 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3963 | public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3964 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3965 | /** |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3966 | * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that |
| 3967 | * the user should be prompted each time a call is made whether it should be placed using |
| 3968 | * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with |
| 3969 | * SIP_ADDRESS_ONLY. |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3970 | * @hide |
| 3971 | */ |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3972 | @Deprecated |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3973 | public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; |
| 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_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3977 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3978 | /** |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3979 | * Pointer speed setting. |
| 3980 | * This is an integer value in a range between -7 and +7, so there are 15 possible values. |
| 3981 | * -7 = slowest |
| 3982 | * 0 = default speed |
| 3983 | * +7 = fastest |
| 3984 | * @hide |
| 3985 | */ |
| 3986 | public static final String POINTER_SPEED = "pointer_speed"; |
| 3987 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3988 | /** @hide */ |
| 3989 | public static final Validator POINTER_SPEED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3990 | new SettingsValidators.InclusiveFloatRangeValidator(-7, 7); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3991 | |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3992 | /** |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 3993 | * Whether lock-to-app will be triggered by long-press on recents. |
| 3994 | * @hide |
| 3995 | */ |
| 3996 | public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; |
| 3997 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3998 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3999 | public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4000 | |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 4001 | /** |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 4002 | * I am the lolrus. |
| 4003 | * <p> |
| 4004 | * Nonzero values indicate that the user has a bukkit. |
| 4005 | * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. |
| 4006 | * @hide |
| 4007 | */ |
| 4008 | public static final String EGG_MODE = "egg_mode"; |
| 4009 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4010 | /** @hide */ |
Svet Ganov | b1918a0 | 2015-05-15 09:32:55 -0700 | [diff] [blame] | 4011 | public static final Validator EGG_MODE_VALIDATOR = new Validator() { |
| 4012 | @Override |
| 4013 | public boolean validate(String value) { |
| 4014 | try { |
| 4015 | return Long.parseLong(value) >= 0; |
| 4016 | } catch (NumberFormatException e) { |
| 4017 | return false; |
| 4018 | } |
| 4019 | } |
| 4020 | }; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4021 | |
| 4022 | /** |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4023 | * Setting to determine whether or not to show the battery percentage in the status bar. |
| 4024 | * 0 - Don't show percentage |
| 4025 | * 1 - Show percentage |
| 4026 | * @hide |
| 4027 | */ |
| 4028 | public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; |
| 4029 | |
| 4030 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4031 | private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4032 | |
| 4033 | /** |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4034 | * IMPORTANT: If you add a new public settings you also have to add it to |
| 4035 | * PUBLIC_SETTINGS below. If the new setting is hidden you have to add |
| 4036 | * it to PRIVATE_SETTINGS below. Also add a validator that can validate |
| 4037 | * the setting value. See an example above. |
| 4038 | */ |
| 4039 | |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 4040 | /** |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4041 | * Settings to backup. This is here so that it's in the same place as the settings |
| 4042 | * keys and easy to update. |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 4043 | * |
| 4044 | * NOTE: Settings are backed up and restored in the order they appear |
| 4045 | * in this array. If you have one setting depending on another, |
| 4046 | * make sure that they are ordered appropriately. |
| 4047 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4048 | * @hide |
| 4049 | */ |
| 4050 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4051 | STAY_ON_WHILE_PLUGGED_IN, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4052 | WIFI_USE_STATIC_IP, |
| 4053 | WIFI_STATIC_IP, |
| 4054 | WIFI_STATIC_GATEWAY, |
| 4055 | WIFI_STATIC_NETMASK, |
| 4056 | WIFI_STATIC_DNS1, |
| 4057 | WIFI_STATIC_DNS2, |
| 4058 | BLUETOOTH_DISCOVERABILITY, |
| 4059 | BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
Casey Burkhardt | 86b867f | 2015-12-29 18:03:36 -0800 | [diff] [blame] | 4060 | FONT_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4061 | DIM_SCREEN, |
| 4062 | SCREEN_OFF_TIMEOUT, |
| 4063 | SCREEN_BRIGHTNESS, |
Christopher Tate | 362aca6 | 2009-09-25 15:58:03 -0700 | [diff] [blame] | 4064 | SCREEN_BRIGHTNESS_MODE, |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 4065 | SCREEN_AUTO_BRIGHTNESS_ADJ, |
Santos Cordon | bd9dd55 | 2017-02-13 13:37:45 -0800 | [diff] [blame] | 4066 | SCREEN_BRIGHTNESS_FOR_VR, |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 4067 | VIBRATE_INPUT_DEVICES, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 4068 | MODE_RINGER_STREAMS_AFFECTED, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4069 | TEXT_AUTO_REPLACE, |
| 4070 | TEXT_AUTO_CAPS, |
| 4071 | TEXT_AUTO_PUNCTUATE, |
| 4072 | TEXT_SHOW_PASSWORD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4073 | AUTO_TIME, // moved to global |
| 4074 | AUTO_TIME_ZONE, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4075 | TIME_12_24, |
| 4076 | DATE_FORMAT, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4077 | DTMF_TONE_WHEN_DIALING, |
| 4078 | DTMF_TONE_TYPE_WHEN_DIALING, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4079 | HEARING_AID, |
| 4080 | TTY_MODE, |
Christopher Tate | ea2d6e8 | 2016-05-19 16:55:49 -0700 | [diff] [blame] | 4081 | MASTER_MONO, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4082 | SOUND_EFFECTS_ENABLED, |
| 4083 | HAPTIC_FEEDBACK_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4084 | POWER_SOUNDS_ENABLED, // moved to global |
| 4085 | DOCK_SOUNDS_ENABLED, // moved to global |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 4086 | LOCKSCREEN_SOUNDS_ENABLED, |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 4087 | SHOW_WEB_SUGGESTIONS, |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4088 | SIP_CALL_OPTIONS, |
Nick Pelly | 038cabe | 2010-09-23 16:12:11 -0700 | [diff] [blame] | 4089 | SIP_RECEIVE_CALLS, |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 4090 | POINTER_SPEED, |
Amith Yamasani | 622bf222 | 2013-09-06 13:54:28 -0700 | [diff] [blame] | 4091 | VIBRATE_WHEN_RINGING, |
| 4092 | RINGTONE, |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 4093 | LOCK_TO_APP_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 4094 | NOTIFICATION_SOUND, |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4095 | ACCELEROMETER_ROTATION, |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 4096 | SHOW_BATTERY_PERCENT, |
| 4097 | NOTIFICATION_VIBRATION_INTENSITY, |
| 4098 | HAPTIC_FEEDBACK_INTENSITY, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4099 | }; |
| 4100 | |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4101 | /** |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4102 | * Keys we no longer back up under the current schema, but want to continue to |
| 4103 | * process when restoring historical backup datasets. |
| 4104 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4105 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 4106 | * otherwise they won't be restored. |
| 4107 | * |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4108 | * @hide |
| 4109 | */ |
| 4110 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 4111 | }; |
| 4112 | |
| 4113 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4114 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4115 | * |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4116 | * @hide |
| 4117 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4118 | public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); |
| 4119 | static { |
| 4120 | PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4121 | PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4122 | PUBLIC_SETTINGS.add(WIFI_STATIC_IP); |
| 4123 | PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); |
| 4124 | PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); |
| 4125 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); |
| 4126 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); |
| 4127 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); |
| 4128 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); |
| 4129 | PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); |
| 4130 | PUBLIC_SETTINGS.add(FONT_SCALE); |
| 4131 | PUBLIC_SETTINGS.add(DIM_SCREEN); |
| 4132 | PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); |
| 4133 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); |
| 4134 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); |
| 4135 | PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); |
| 4136 | PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); |
| 4137 | PUBLIC_SETTINGS.add(VIBRATE_ON); |
| 4138 | PUBLIC_SETTINGS.add(VOLUME_RING); |
| 4139 | PUBLIC_SETTINGS.add(VOLUME_SYSTEM); |
| 4140 | PUBLIC_SETTINGS.add(VOLUME_VOICE); |
| 4141 | PUBLIC_SETTINGS.add(VOLUME_MUSIC); |
| 4142 | PUBLIC_SETTINGS.add(VOLUME_ALARM); |
| 4143 | PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); |
| 4144 | PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); |
| 4145 | PUBLIC_SETTINGS.add(RINGTONE); |
| 4146 | PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); |
| 4147 | PUBLIC_SETTINGS.add(ALARM_ALERT); |
| 4148 | PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4149 | PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4150 | PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4151 | PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4152 | PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); |
| 4153 | PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); |
| 4154 | PUBLIC_SETTINGS.add(TIME_12_24); |
| 4155 | PUBLIC_SETTINGS.add(DATE_FORMAT); |
| 4156 | PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); |
| 4157 | PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); |
| 4158 | PUBLIC_SETTINGS.add(USER_ROTATION); |
| 4159 | PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); |
| 4160 | PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
| 4161 | PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4162 | PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); |
Svetoslav Ganov | d263163 | 2015-12-09 16:29:22 -0800 | [diff] [blame] | 4163 | PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4164 | } |
| 4165 | |
| 4166 | /** |
| 4167 | * These are all hidden system settings. |
| 4168 | * |
| 4169 | * @hide |
| 4170 | */ |
| 4171 | public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); |
| 4172 | static { |
| 4173 | PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4174 | PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4175 | PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); |
| 4176 | PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); |
| 4177 | PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); |
| 4178 | PRIVATE_SETTINGS.add(VOLUME_MASTER); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4179 | PRIVATE_SETTINGS.add(MASTER_MONO); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4180 | PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); |
| 4181 | PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); |
| 4182 | PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); |
| 4183 | PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4184 | PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); |
| 4185 | PRIVATE_SETTINGS.add(HEARING_AID); |
| 4186 | PRIVATE_SETTINGS.add(TTY_MODE); |
| 4187 | PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); |
| 4188 | PRIVATE_SETTINGS.add(POINTER_LOCATION); |
| 4189 | PRIVATE_SETTINGS.add(SHOW_TOUCHES); |
| 4190 | PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); |
| 4191 | PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); |
| 4192 | PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); |
| 4193 | PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); |
| 4194 | PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); |
| 4195 | PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); |
| 4196 | PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); |
| 4197 | PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); |
| 4198 | PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); |
| 4199 | PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); |
| 4200 | PRIVATE_SETTINGS.add(LOCK_SOUND); |
| 4201 | PRIVATE_SETTINGS.add(UNLOCK_SOUND); |
| 4202 | PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); |
| 4203 | PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); |
| 4204 | PRIVATE_SETTINGS.add(SIP_ALWAYS); |
| 4205 | PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); |
| 4206 | PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); |
| 4207 | PRIVATE_SETTINGS.add(POINTER_SPEED); |
| 4208 | PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); |
| 4209 | PRIVATE_SETTINGS.add(EGG_MODE); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4210 | PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4211 | } |
| 4212 | |
| 4213 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4214 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4215 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4216 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 4217 | * otherwise they won't be restored. |
| 4218 | * |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4219 | * @hide |
| 4220 | */ |
| 4221 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 4222 | static { |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4223 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 4224 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4225 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4226 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); |
| 4227 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
| 4228 | BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); |
| 4229 | VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); |
| 4230 | VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); |
| 4231 | VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); |
| 4232 | VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); |
| 4233 | VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 4234 | VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4235 | VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); |
| 4236 | VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); |
| 4237 | VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); |
| 4238 | VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); |
Michael Wright | 35a0c67 | 2018-01-24 00:32:53 +0000 | [diff] [blame] | 4239 | VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); |
| 4240 | VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4241 | VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); |
| 4242 | VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); |
| 4243 | VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); |
| 4244 | VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); |
| 4245 | VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); |
| 4246 | VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); |
| 4247 | VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4248 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 4249 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4250 | VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); |
| 4251 | VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); |
| 4252 | VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); |
| 4253 | VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); |
| 4254 | VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); |
| 4255 | VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); |
| 4256 | VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); |
| 4257 | VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); |
| 4258 | VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); |
| 4259 | VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4260 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 4261 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4262 | VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); |
| 4263 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4264 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
| 4265 | VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); |
| 4266 | VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); |
| 4267 | VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4268 | VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4269 | VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); |
| 4270 | VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); |
| 4271 | VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); |
| 4272 | VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, |
| 4273 | HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); |
| 4274 | VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); |
| 4275 | VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); |
| 4276 | VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); |
| 4277 | VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); |
| 4278 | VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); |
| 4279 | VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); |
| 4280 | VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); |
| 4281 | VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, |
| 4282 | WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); |
| 4283 | VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); |
| 4284 | VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); |
| 4285 | VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); |
| 4286 | VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); |
| 4287 | VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); |
| 4288 | VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); |
| 4289 | VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); |
| 4290 | VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); |
| 4291 | VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); |
| 4292 | VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); |
| 4293 | VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); |
| 4294 | VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); |
| 4295 | VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); |
| 4296 | VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); |
| 4297 | VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4298 | VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4299 | } |
| 4300 | |
| 4301 | /** |
| 4302 | * These entries are considered common between the personal and the managed profile, |
| 4303 | * since the managed profile doesn't get to change them. |
| 4304 | */ |
| 4305 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
| 4306 | static { |
| 4307 | CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); |
| 4308 | CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); |
| 4309 | CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); |
| 4310 | CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); |
| 4311 | CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); |
| 4312 | } |
| 4313 | |
| 4314 | /** @hide */ |
| 4315 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 4316 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 4317 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4318 | |
| 4319 | /** |
Andre Lago | 3fa139c | 2016-08-04 13:53:44 +0100 | [diff] [blame] | 4320 | * These entries should be cloned from this profile's parent only if the dependency's |
| 4321 | * value is true ("1") |
| 4322 | * |
| 4323 | * Note: the dependencies must be Secure settings |
| 4324 | * |
| 4325 | * @hide |
| 4326 | */ |
| 4327 | public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); |
| 4328 | static { |
| 4329 | CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); |
| 4330 | CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); |
| 4331 | CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); |
| 4332 | } |
| 4333 | |
| 4334 | /** @hide */ |
| 4335 | public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { |
| 4336 | outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); |
| 4337 | } |
| 4338 | |
| 4339 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4340 | * System settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4341 | * @hide |
| 4342 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4343 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4344 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4345 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4346 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4347 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4348 | INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4349 | INSTANT_APP_SETTINGS.add(DATE_FORMAT); |
| 4350 | INSTANT_APP_SETTINGS.add(FONT_SCALE); |
| 4351 | INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4352 | INSTANT_APP_SETTINGS.add(TIME_12_24); |
| 4353 | INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 4354 | INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4355 | } |
| 4356 | |
| 4357 | /** |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4358 | * When to use Wi-Fi calling |
| 4359 | * |
| 4360 | * @see android.telephony.TelephonyManager.WifiCallingChoices |
| 4361 | * @hide |
| 4362 | */ |
| 4363 | public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; |
| 4364 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4365 | // Settings moved to Settings.Secure |
| 4366 | |
| 4367 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4368 | * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4369 | * instead |
| 4370 | */ |
| 4371 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4372 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4373 | |
| 4374 | /** |
| 4375 | * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead |
| 4376 | */ |
| 4377 | @Deprecated |
| 4378 | public static final String ANDROID_ID = Secure.ANDROID_ID; |
| 4379 | |
| 4380 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4381 | * @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] | 4382 | */ |
| 4383 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4384 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4385 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4386 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4387 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4388 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4389 | * @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] | 4390 | */ |
| 4391 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4392 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4393 | |
| 4394 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4395 | * @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] | 4396 | */ |
| 4397 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4398 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4399 | |
| 4400 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4401 | * @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] | 4402 | */ |
| 4403 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4404 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4405 | |
| 4406 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4407 | * @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] | 4408 | */ |
| 4409 | @Deprecated |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4410 | 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] | 4411 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4412 | /** |
| 4413 | * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} |
| 4414 | * instead |
| 4415 | */ |
| 4416 | @Deprecated |
| 4417 | public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; |
| 4418 | |
| 4419 | /** |
| 4420 | * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead |
| 4421 | */ |
| 4422 | @Deprecated |
| 4423 | public static final String LOGGING_ID = Secure.LOGGING_ID; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4424 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4425 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4426 | * @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] | 4427 | */ |
| 4428 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4429 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4430 | |
| 4431 | /** |
| 4432 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} |
| 4433 | * instead |
| 4434 | */ |
| 4435 | @Deprecated |
| 4436 | public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; |
| 4437 | |
| 4438 | /** |
| 4439 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} |
| 4440 | * instead |
| 4441 | */ |
| 4442 | @Deprecated |
| 4443 | public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; |
| 4444 | |
| 4445 | /** |
| 4446 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} |
| 4447 | * instead |
| 4448 | */ |
| 4449 | @Deprecated |
| 4450 | public static final String PARENTAL_CONTROL_REDIRECT_URL = |
| 4451 | Secure.PARENTAL_CONTROL_REDIRECT_URL; |
| 4452 | |
| 4453 | /** |
| 4454 | * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead |
| 4455 | */ |
| 4456 | @Deprecated |
| 4457 | public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; |
| 4458 | |
| 4459 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4460 | * @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] | 4461 | */ |
| 4462 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4463 | 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] | 4464 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4465 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4466 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4467 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4468 | * @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] | 4469 | */ |
| 4470 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4471 | 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] | 4472 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4473 | /** |
| 4474 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4475 | * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4476 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4477 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4478 | 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] | 4479 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4480 | /** |
| 4481 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4482 | * {@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] | 4483 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4484 | @Deprecated |
| 4485 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4486 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4487 | |
| 4488 | /** |
| 4489 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4490 | * {@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] | 4491 | */ |
| 4492 | @Deprecated |
| 4493 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4494 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4495 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4496 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 4497 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4498 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4499 | /** |
| 4500 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4501 | * {@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] | 4502 | */ |
| 4503 | @Deprecated |
| 4504 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4505 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4506 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4507 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 4508 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4509 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4510 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4511 | * @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] | 4512 | * instead |
| 4513 | */ |
| 4514 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4515 | 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] | 4516 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4517 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 4518 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4519 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4520 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4521 | * @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] | 4522 | */ |
| 4523 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4524 | public static final String WIFI_ON = Global.WIFI_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4525 | |
| 4526 | /** |
| 4527 | * @deprecated Use |
| 4528 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} |
| 4529 | * instead |
| 4530 | */ |
| 4531 | @Deprecated |
| 4532 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 4533 | Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; |
| 4534 | |
| 4535 | /** |
| 4536 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead |
| 4537 | */ |
| 4538 | @Deprecated |
| 4539 | public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; |
| 4540 | |
| 4541 | /** |
| 4542 | * @deprecated Use |
| 4543 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead |
| 4544 | */ |
| 4545 | @Deprecated |
| 4546 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 4547 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4548 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4549 | /** |
| 4550 | * @deprecated Use |
| 4551 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead |
| 4552 | */ |
| 4553 | @Deprecated |
| 4554 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 4555 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; |
| 4556 | |
| 4557 | /** |
| 4558 | * @deprecated Use |
| 4559 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} |
| 4560 | * instead |
| 4561 | */ |
| 4562 | @Deprecated |
| 4563 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 4564 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; |
| 4565 | |
| 4566 | /** |
| 4567 | * @deprecated Use |
| 4568 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead |
| 4569 | */ |
| 4570 | @Deprecated |
| 4571 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 4572 | Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; |
| 4573 | |
| 4574 | /** |
| 4575 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} |
| 4576 | * instead |
| 4577 | */ |
| 4578 | @Deprecated |
| 4579 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; |
| 4580 | |
| 4581 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4582 | * @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] | 4583 | */ |
| 4584 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4585 | 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] | 4586 | |
| 4587 | /** |
| 4588 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead |
| 4589 | */ |
| 4590 | @Deprecated |
| 4591 | public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; |
| 4592 | |
| 4593 | /** |
| 4594 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} |
| 4595 | * instead |
| 4596 | */ |
| 4597 | @Deprecated |
| 4598 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; |
| 4599 | |
| 4600 | /** |
| 4601 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} |
| 4602 | * instead |
| 4603 | */ |
| 4604 | @Deprecated |
| 4605 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = |
| 4606 | Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4607 | |
| 4608 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4609 | * Checks if the specified app can modify system settings. As of API |
| 4610 | * level 23, an app cannot modify system settings unless it declares the |
| 4611 | * {@link android.Manifest.permission#WRITE_SETTINGS} |
| 4612 | * permission in its manifest, <em>and</em> the user specifically grants |
| 4613 | * the app this capability. To prompt the user to grant this approval, |
| 4614 | * the app must send an intent with the action {@link |
| 4615 | * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes |
| 4616 | * the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4617 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4618 | * @param context App context. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4619 | * @return true if the calling app can write to system settings, false otherwise |
| 4620 | */ |
| 4621 | public static boolean canWrite(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 4622 | return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), |
| 4623 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4624 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4625 | } |
| 4626 | |
| 4627 | /** |
| 4628 | * Secure system settings, containing system preferences that applications |
| 4629 | * can read but are not allowed to write. These are for preferences that |
| 4630 | * the user must explicitly modify through the system UI or specialized |
| 4631 | * APIs for those values, not modified directly by applications. |
| 4632 | */ |
| 4633 | public static final class Secure extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 4634 | // NOTE: If you add new settings here, be sure to add them to |
| 4635 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. |
| 4636 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4637 | /** |
| 4638 | * The content:// style URL for this table |
| 4639 | */ |
| 4640 | public static final Uri CONTENT_URI = |
| 4641 | Uri.parse("content://" + AUTHORITY + "/secure"); |
| 4642 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4643 | private static final ContentProviderHolder sProviderHolder = |
| 4644 | new ContentProviderHolder(CONTENT_URI); |
| 4645 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 4646 | // Populated lazily, guarded by class object: |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4647 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4648 | CONTENT_URI, |
| 4649 | CALL_METHOD_GET_SECURE, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4650 | CALL_METHOD_PUT_SECURE, |
| 4651 | sProviderHolder); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4652 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4653 | private static ILockSettings sLockSettings = null; |
| 4654 | |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 4655 | private static boolean sIsSystemProcess; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4656 | private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4657 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4658 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4659 | MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4660 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); |
| 4661 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); |
| 4662 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4663 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4664 | MOVED_TO_GLOBAL = new HashSet<>(); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4665 | MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); |
| 4666 | MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); |
| 4667 | MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 4668 | MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4669 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); |
| 4670 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); |
| 4671 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); |
| 4672 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); |
| 4673 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); |
| 4674 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); |
| 4675 | MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); |
| 4676 | MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4677 | MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); |
| 4678 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); |
| 4679 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4680 | MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); |
| 4681 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); |
| 4682 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); |
| 4683 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); |
| 4684 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); |
| 4685 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); |
| 4686 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); |
| 4687 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4688 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); |
| 4689 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); |
| 4690 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); |
| 4691 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); |
| 4692 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); |
| 4693 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); |
| 4694 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); |
| 4695 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); |
| 4696 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); |
| 4697 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); |
| 4698 | MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); |
| 4699 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); |
| 4700 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); |
| 4701 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); |
| 4702 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); |
| 4703 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); |
| 4704 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); |
| 4705 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); |
| 4706 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); |
| 4707 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4708 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); |
| 4709 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); |
| 4710 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); |
| 4711 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); |
| 4712 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); |
| 4713 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4714 | MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); |
| 4715 | MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 4716 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4717 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); |
| 4718 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); |
| 4719 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); |
| 4720 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); |
| 4721 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); |
| 4722 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 4723 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 4724 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 4725 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); |
| 4726 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); |
| 4727 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); |
| 4728 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); |
| 4729 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 4730 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 4731 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); |
| 4732 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4733 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); |
| 4734 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4735 | MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 4736 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); |
| 4737 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); |
| 4738 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); |
| 4739 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); |
| 4740 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); |
| 4741 | MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4742 | MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4743 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); |
| 4744 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); |
| 4745 | MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); |
| 4746 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); |
| 4747 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); |
| 4748 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); |
| 4749 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); |
| 4750 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); |
| 4751 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); |
| 4752 | MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); |
| 4753 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); |
| 4754 | MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); |
| 4755 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); |
| 4756 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); |
| 4757 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); |
| 4758 | MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); |
| 4759 | MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); |
| 4760 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); |
| 4761 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); |
| 4762 | MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); |
| 4763 | MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); |
| 4764 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); |
| 4765 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); |
| 4766 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); |
| 4767 | MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); |
| 4768 | MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); |
| 4769 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); |
| 4770 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); |
| 4771 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); |
| 4772 | MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); |
| 4773 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 4774 | MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 4775 | MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4776 | } |
| 4777 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4778 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4779 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4780 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 4781 | } |
| 4782 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 4783 | /** @hide */ |
| 4784 | public static void clearProviderForTest() { |
| 4785 | sProviderHolder.clearProviderForTest(); |
| 4786 | sNameValueCache.clearGenerationTrackerForTest(); |
| 4787 | } |
| 4788 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4789 | /** |
| 4790 | * Look up a name in the database. |
| 4791 | * @param resolver to access the database with |
| 4792 | * @param name to look up in the table |
| 4793 | * @return the corresponding value, or null if not present |
| 4794 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4795 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4796 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4797 | } |
| 4798 | |
| 4799 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4800 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4801 | int userHandle) { |
| 4802 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4803 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4804 | + " to android.provider.Settings.Global."); |
| 4805 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4806 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4807 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4808 | if (MOVED_TO_LOCK_SETTINGS.contains(name)) { |
| 4809 | synchronized (Secure.class) { |
| 4810 | if (sLockSettings == null) { |
| 4811 | sLockSettings = ILockSettings.Stub.asInterface( |
| 4812 | (IBinder) ServiceManager.getService("lock_settings")); |
| 4813 | sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; |
| 4814 | } |
| 4815 | } |
| 4816 | if (sLockSettings != null && !sIsSystemProcess) { |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 4817 | // No context; use the ActivityThread's context as an approximation for |
| 4818 | // determining the target API level. |
| 4819 | Application application = ActivityThread.currentApplication(); |
| 4820 | |
| 4821 | boolean isPreMnc = application != null |
| 4822 | && application.getApplicationInfo() != null |
| 4823 | && application.getApplicationInfo().targetSdkVersion |
| 4824 | <= VERSION_CODES.LOLLIPOP_MR1; |
| 4825 | if (isPreMnc) { |
| 4826 | try { |
| 4827 | return sLockSettings.getString(name, "0", userHandle); |
| 4828 | } catch (RemoteException re) { |
| 4829 | // Fall through |
| 4830 | } |
| 4831 | } else { |
| 4832 | throw new SecurityException("Settings.Secure." + name |
| 4833 | + " is deprecated and no longer accessible." |
| 4834 | + " See API documentation for potential replacements."); |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4835 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4836 | } |
| 4837 | } |
| 4838 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4839 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4840 | } |
| 4841 | |
| 4842 | /** |
| 4843 | * Store a name/value pair into the database. |
| 4844 | * @param resolver to access the database with |
| 4845 | * @param name to store |
| 4846 | * @param value to associate with the name |
| 4847 | * @return true if the value was set, false on database errors |
| 4848 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4849 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4850 | return putStringForUser(resolver, name, value, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4851 | } |
| 4852 | |
| 4853 | /** @hide */ |
| 4854 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 4855 | int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4856 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 4857 | } |
| 4858 | |
| 4859 | /** @hide */ |
| 4860 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 4861 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4862 | boolean makeDefault, @UserIdInt int userHandle) { |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4863 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4864 | // Map LOCATION_MODE to underlying location provider storage API |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4865 | return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); |
| 4866 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4867 | if (MOVED_TO_GLOBAL.contains(name)) { |
Robin Lee | 7af9a74 | 2017-02-20 14:47:30 +0000 | [diff] [blame] | 4868 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4869 | + " to android.provider.Settings.Global"); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4870 | return Global.putStringForUser(resolver, name, value, |
| 4871 | tag, makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4872 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4873 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 4874 | makeDefault, userHandle); |
| 4875 | } |
| 4876 | |
| 4877 | /** |
| 4878 | * Store a name/value pair into the database. |
| 4879 | * <p> |
| 4880 | * The method takes an optional tag to associate with the setting |
| 4881 | * which can be used to clear only settings made by your package and |
| 4882 | * associated with this tag by passing the tag to {@link |
| 4883 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 4884 | * the current tag. Also if another package changes the setting |
| 4885 | * then the tag will be set to the one specified in the set call |
| 4886 | * which can be null. Also any of the settings setters that do not |
| 4887 | * take a tag as an argument effectively clears the tag. |
| 4888 | * </p><p> |
| 4889 | * For example, if you set settings A and B with tags T1 and T2 and |
| 4890 | * another app changes setting A (potentially to the same value), it |
| 4891 | * can assign to it a tag T3 (note that now the package that changed |
| 4892 | * the setting is not yours). Now if you reset your changes for T1 and |
| 4893 | * T2 only setting B will be reset and A not (as it was changed by |
| 4894 | * another package) but since A did not change you are in the desired |
| 4895 | * initial state. Now if the other app changes the value of A (assuming |
| 4896 | * you registered an observer in the beginning) you would detect that |
| 4897 | * the setting was changed by another app and handle this appropriately |
| 4898 | * (ignore, set back to some value, etc). |
| 4899 | * </p><p> |
| 4900 | * Also the method takes an argument whether to make the value the |
| 4901 | * default for this setting. If the system already specified a default |
| 4902 | * value, then the one passed in here will <strong>not</strong> |
| 4903 | * be set as the default. |
| 4904 | * </p> |
| 4905 | * |
| 4906 | * @param resolver to access the database with. |
| 4907 | * @param name to store. |
| 4908 | * @param value to associate with the name. |
| 4909 | * @param tag to associate with the setting. |
| 4910 | * @param makeDefault whether to make the value the default one. |
| 4911 | * @return true if the value was set, false on database errors. |
| 4912 | * |
| 4913 | * @see #resetToDefaults(ContentResolver, String) |
| 4914 | * |
| 4915 | * @hide |
| 4916 | */ |
| 4917 | @SystemApi |
| 4918 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4919 | public static boolean putString(@NonNull ContentResolver resolver, |
| 4920 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4921 | boolean makeDefault) { |
| 4922 | return putStringForUser(resolver, name, value, tag, makeDefault, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4923 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4924 | } |
| 4925 | |
| 4926 | /** |
| 4927 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 4928 | * settings set by the caller's package. Think of it of a way to undo your own |
| 4929 | * changes to the global settings. Passing in the optional tag will reset only |
| 4930 | * settings changed by your package and associated with this tag. |
| 4931 | * |
| 4932 | * @param resolver Handle to the content resolver. |
| 4933 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4934 | * |
| 4935 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 4936 | * |
| 4937 | * @hide |
| 4938 | */ |
| 4939 | @SystemApi |
| 4940 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4941 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 4942 | @Nullable String tag) { |
| 4943 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 4944 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4945 | } |
| 4946 | |
| 4947 | /** |
| 4948 | * |
| 4949 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 4950 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 4951 | * allowing resetting the settings made by a package and associated with the tag. |
| 4952 | * |
| 4953 | * @param resolver Handle to the content resolver. |
| 4954 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4955 | * @param mode The reset mode. |
| 4956 | * @param userHandle The user for which to reset to defaults. |
| 4957 | * |
| 4958 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 4959 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 4960 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 4961 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 4962 | * |
| 4963 | * @hide |
| 4964 | */ |
| 4965 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 4966 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 4967 | try { |
| 4968 | Bundle arg = new Bundle(); |
| 4969 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 4970 | if (tag != null) { |
| 4971 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 4972 | } |
| 4973 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 4974 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 4975 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); |
| 4976 | } catch (RemoteException e) { |
| 4977 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 4978 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4979 | } |
| 4980 | |
| 4981 | /** |
| 4982 | * Construct the content URI for a particular name/value pair, |
| 4983 | * useful for monitoring changes with a ContentObserver. |
| 4984 | * @param name to look up in the table |
| 4985 | * @return the corresponding content URI, or null if not present |
| 4986 | */ |
| 4987 | public static Uri getUriFor(String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4988 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4989 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4990 | + " to android.provider.Settings.Global, returning global URI."); |
| 4991 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 4992 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4993 | return getUriFor(CONTENT_URI, name); |
| 4994 | } |
| 4995 | |
| 4996 | /** |
| 4997 | * Convenience function for retrieving a single secure settings value |
| 4998 | * as an integer. Note that internally setting values are always |
| 4999 | * stored as strings; this function converts the string to an integer |
| 5000 | * for you. The default value will be returned if the setting is |
| 5001 | * not defined or not an integer. |
| 5002 | * |
| 5003 | * @param cr The ContentResolver to access. |
| 5004 | * @param name The name of the setting to retrieve. |
| 5005 | * @param def Value to return if the setting is not defined. |
| 5006 | * |
| 5007 | * @return The setting's current value, or 'def' if it is not defined |
| 5008 | * or not a valid integer. |
| 5009 | */ |
| 5010 | public static int getInt(ContentResolver cr, String name, int def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5011 | return getIntForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5012 | } |
| 5013 | |
| 5014 | /** @hide */ |
| 5015 | 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] | 5016 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 5017 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5018 | return getLocationModeForUser(cr, userHandle); |
| 5019 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5020 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5021 | try { |
| 5022 | return v != null ? Integer.parseInt(v) : def; |
| 5023 | } catch (NumberFormatException e) { |
| 5024 | return def; |
| 5025 | } |
| 5026 | } |
| 5027 | |
| 5028 | /** |
| 5029 | * Convenience function for retrieving a single secure settings value |
| 5030 | * as an integer. Note that internally setting values are always |
| 5031 | * stored as strings; this function converts the string to an integer |
| 5032 | * for you. |
| 5033 | * <p> |
| 5034 | * This version does not take a default value. If the setting has not |
| 5035 | * been set, or the string value is not a number, |
| 5036 | * it throws {@link SettingNotFoundException}. |
| 5037 | * |
| 5038 | * @param cr The ContentResolver to access. |
| 5039 | * @param name The name of the setting to retrieve. |
| 5040 | * |
| 5041 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5042 | * name can't be found or the setting value is not an integer. |
| 5043 | * |
| 5044 | * @return The setting's current value. |
| 5045 | */ |
| 5046 | public static int getInt(ContentResolver cr, String name) |
| 5047 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5048 | return getIntForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5049 | } |
| 5050 | |
| 5051 | /** @hide */ |
| 5052 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 5053 | throws SettingNotFoundException { |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5054 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 5055 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5056 | return getLocationModeForUser(cr, userHandle); |
| 5057 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5058 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5059 | try { |
| 5060 | return Integer.parseInt(v); |
| 5061 | } catch (NumberFormatException e) { |
| 5062 | throw new SettingNotFoundException(name); |
| 5063 | } |
| 5064 | } |
| 5065 | |
| 5066 | /** |
| 5067 | * Convenience function for updating a single settings value as an |
| 5068 | * integer. This will either create a new entry in the table if the |
| 5069 | * given name does not exist, or modify the value of the existing row |
| 5070 | * with that name. Note that internally setting values are always |
| 5071 | * stored as strings, so this function converts the given value to a |
| 5072 | * string before storing it. |
| 5073 | * |
| 5074 | * @param cr The ContentResolver to access. |
| 5075 | * @param name The name of the setting to modify. |
| 5076 | * @param value The new value for the setting. |
| 5077 | * @return true if the value was set, false on database errors |
| 5078 | */ |
| 5079 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5080 | return putIntForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5081 | } |
| 5082 | |
| 5083 | /** @hide */ |
| 5084 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 5085 | int userHandle) { |
| 5086 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5087 | } |
| 5088 | |
| 5089 | /** |
| 5090 | * Convenience function for retrieving a single secure settings value |
| 5091 | * as a {@code long}. Note that internally setting values are always |
| 5092 | * stored as strings; this function converts the string to a {@code long} |
| 5093 | * for you. The default value will be returned if the setting is |
| 5094 | * not defined or not a {@code long}. |
| 5095 | * |
| 5096 | * @param cr The ContentResolver to access. |
| 5097 | * @param name The name of the setting to retrieve. |
| 5098 | * @param def Value to return if the setting is not defined. |
| 5099 | * |
| 5100 | * @return The setting's current value, or 'def' if it is not defined |
| 5101 | * or not a valid {@code long}. |
| 5102 | */ |
| 5103 | public static long getLong(ContentResolver cr, String name, long def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5104 | return getLongForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5105 | } |
| 5106 | |
| 5107 | /** @hide */ |
| 5108 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 5109 | int userHandle) { |
| 5110 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5111 | long value; |
| 5112 | try { |
| 5113 | value = valString != null ? Long.parseLong(valString) : def; |
| 5114 | } catch (NumberFormatException e) { |
| 5115 | value = def; |
| 5116 | } |
| 5117 | return value; |
| 5118 | } |
| 5119 | |
| 5120 | /** |
| 5121 | * Convenience function for retrieving a single secure settings value |
| 5122 | * as a {@code long}. Note that internally setting values are always |
| 5123 | * stored as strings; this function converts the string to a {@code long} |
| 5124 | * for you. |
| 5125 | * <p> |
| 5126 | * This version does not take a default value. If the setting has not |
| 5127 | * been set, or the string value is not a number, |
| 5128 | * it throws {@link SettingNotFoundException}. |
| 5129 | * |
| 5130 | * @param cr The ContentResolver to access. |
| 5131 | * @param name The name of the setting to retrieve. |
| 5132 | * |
| 5133 | * @return The setting's current value. |
| 5134 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5135 | * name can't be found or the setting value is not an integer. |
| 5136 | */ |
| 5137 | public static long getLong(ContentResolver cr, String name) |
| 5138 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5139 | return getLongForUser(cr, name, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5140 | } |
| 5141 | |
| 5142 | /** @hide */ |
| 5143 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 5144 | throws SettingNotFoundException { |
| 5145 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5146 | try { |
| 5147 | return Long.parseLong(valString); |
| 5148 | } catch (NumberFormatException e) { |
| 5149 | throw new SettingNotFoundException(name); |
| 5150 | } |
| 5151 | } |
| 5152 | |
| 5153 | /** |
| 5154 | * Convenience function for updating a secure settings value as a long |
| 5155 | * integer. This will either create a new entry in the table if the |
| 5156 | * given name does not exist, or modify the value of the existing row |
| 5157 | * with that name. Note that internally setting values are always |
| 5158 | * stored as strings, so this function converts the given value to a |
| 5159 | * string before storing it. |
| 5160 | * |
| 5161 | * @param cr The ContentResolver to access. |
| 5162 | * @param name The name of the setting to modify. |
| 5163 | * @param value The new value for the setting. |
| 5164 | * @return true if the value was set, false on database errors |
| 5165 | */ |
| 5166 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5167 | return putLongForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5168 | } |
| 5169 | |
| 5170 | /** @hide */ |
| 5171 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 5172 | int userHandle) { |
| 5173 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5174 | } |
| 5175 | |
| 5176 | /** |
| 5177 | * Convenience function for retrieving a single secure settings value |
| 5178 | * as a floating point number. Note that internally setting values are |
| 5179 | * always stored as strings; this function converts the string to an |
| 5180 | * float for you. The default value will be returned if the setting |
| 5181 | * is not defined or not a valid float. |
| 5182 | * |
| 5183 | * @param cr The ContentResolver to access. |
| 5184 | * @param name The name of the setting to retrieve. |
| 5185 | * @param def Value to return if the setting is not defined. |
| 5186 | * |
| 5187 | * @return The setting's current value, or 'def' if it is not defined |
| 5188 | * or not a valid float. |
| 5189 | */ |
| 5190 | public static float getFloat(ContentResolver cr, String name, float def) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5191 | return getFloatForUser(cr, name, def, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5192 | } |
| 5193 | |
| 5194 | /** @hide */ |
| 5195 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 5196 | int userHandle) { |
| 5197 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5198 | try { |
| 5199 | return v != null ? Float.parseFloat(v) : def; |
| 5200 | } catch (NumberFormatException e) { |
| 5201 | return def; |
| 5202 | } |
| 5203 | } |
| 5204 | |
| 5205 | /** |
| 5206 | * Convenience function for retrieving a single secure settings value |
| 5207 | * as a float. Note that internally setting values are always |
| 5208 | * stored as strings; this function converts the string to a float |
| 5209 | * for you. |
| 5210 | * <p> |
| 5211 | * This version does not take a default value. If the setting has not |
| 5212 | * been set, or the string value is not a number, |
| 5213 | * it throws {@link SettingNotFoundException}. |
| 5214 | * |
| 5215 | * @param cr The ContentResolver to access. |
| 5216 | * @param name The name of the setting to retrieve. |
| 5217 | * |
| 5218 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5219 | * name can't be found or the setting value is not a float. |
| 5220 | * |
| 5221 | * @return The setting's current value. |
| 5222 | */ |
| 5223 | public static float getFloat(ContentResolver cr, String name) |
| 5224 | throws SettingNotFoundException { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5225 | return getFloatForUser(cr, name, 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, int userHandle) |
| 5230 | throws SettingNotFoundException { |
| 5231 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 5232 | if (v == null) { |
| 5233 | throw new SettingNotFoundException(name); |
| 5234 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5235 | try { |
| 5236 | return Float.parseFloat(v); |
| 5237 | } catch (NumberFormatException e) { |
| 5238 | throw new SettingNotFoundException(name); |
| 5239 | } |
| 5240 | } |
| 5241 | |
| 5242 | /** |
| 5243 | * Convenience function for updating a single settings value as a |
| 5244 | * floating point number. This will either create a new entry in the |
| 5245 | * table if the given name does not exist, or modify the value of the |
| 5246 | * existing row with that name. Note that internally setting values |
| 5247 | * are always stored as strings, so this function converts the given |
| 5248 | * value to a string before storing it. |
| 5249 | * |
| 5250 | * @param cr The ContentResolver to access. |
| 5251 | * @param name The name of the setting to modify. |
| 5252 | * @param value The new value for the setting. |
| 5253 | * @return true if the value was set, false on database errors |
| 5254 | */ |
| 5255 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 5256 | return putFloatForUser(cr, name, value, cr.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5257 | } |
| 5258 | |
| 5259 | /** @hide */ |
| 5260 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 5261 | int userHandle) { |
| 5262 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5263 | } |
| 5264 | |
| 5265 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5266 | * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} |
| 5267 | * instead |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5268 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5269 | @Deprecated |
| 5270 | public static final String DEVELOPMENT_SETTINGS_ENABLED = |
| 5271 | Global.DEVELOPMENT_SETTINGS_ENABLED; |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5272 | |
| 5273 | /** |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5274 | * When the user has enable the option to have a "bug report" command |
| 5275 | * in the power menu. |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5276 | * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5277 | * @hide |
| 5278 | */ |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5279 | @Deprecated |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5280 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 5281 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5282 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5283 | |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5284 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5285 | * @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] | 5286 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5287 | @Deprecated |
| 5288 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5289 | |
| 5290 | /** |
| 5291 | * Setting to allow mock locations and location provider status to be injected into the |
| 5292 | * LocationManager service for testing purposes during application development. These |
| 5293 | * locations and status values override actual location and status information generated |
| 5294 | * by network, gps, or other location providers. |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5295 | * |
| 5296 | * @deprecated This settings is not used anymore. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5297 | */ |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5298 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5299 | public static final String ALLOW_MOCK_LOCATION = "mock_location"; |
| 5300 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5301 | private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5302 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5303 | /** |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5304 | * On Android 8.0 (API level 26) and higher versions of the platform, |
| 5305 | * a 64-bit number (expressed as a hexadecimal string), unique to |
| 5306 | * each combination of app-signing key, user, and device. |
| 5307 | * Values of {@code ANDROID_ID} are scoped by signing key and user. |
| 5308 | * The value may change if a factory reset is performed on the |
| 5309 | * device or if an APK signing key changes. |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5310 | * |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5311 | * For more information about how the platform handles {@code ANDROID_ID} |
| 5312 | * in Android 8.0 (API level 26) and higher, see <a |
| 5313 | * href="{@docRoot}preview/behavior-changes.html#privacy-all"> |
| 5314 | * Android 8.0 Behavior Changes</a>. |
| 5315 | * |
| 5316 | * <p class="note"><strong>Note:</strong> For apps that were installed |
| 5317 | * prior to updating the device to a version of Android 8.0 |
| 5318 | * (API level 26) or higher, the value of {@code ANDROID_ID} changes |
| 5319 | * if the app is uninstalled and then reinstalled after the OTA. |
| 5320 | * To preserve values across uninstalls after an OTA to Android 8.0 |
| 5321 | * or higher, developers can use |
| 5322 | * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> |
| 5323 | * Key/Value Backup</a>.</p> |
| 5324 | * |
| 5325 | * <p>In versions of the platform lower than Android 8.0 (API level 26), |
| 5326 | * a 64-bit number (expressed as a hexadecimal string) that is randomly |
| 5327 | * generated when the user first sets up the device and should remain |
| 5328 | * constant for the lifetime of the user's device. |
| 5329 | * |
| 5330 | * On devices that have |
| 5331 | * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> |
| 5332 | * multiple users</a>, each user appears as a |
| 5333 | * completely separate device, so the {@code ANDROID_ID} value is |
| 5334 | * unique to each user.</p> |
| 5335 | * |
| 5336 | * <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] | 5337 | * to the Instant App, it is generated when the Instant App is first installed and reset if |
| 5338 | * the user clears the Instant App. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5339 | */ |
| 5340 | public static final String ANDROID_ID = "android_id"; |
| 5341 | |
| 5342 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5343 | * @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] | 5344 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5345 | @Deprecated |
| 5346 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5347 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5348 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5349 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5350 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5351 | * @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] | 5352 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 5353 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5354 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5355 | |
| 5356 | /** |
| 5357 | * Setting to record the input method used by default, holding the ID |
| 5358 | * of the desired method. |
| 5359 | */ |
| 5360 | public static final String DEFAULT_INPUT_METHOD = "default_input_method"; |
| 5361 | |
| 5362 | /** |
satok | ab751aa | 2010-09-14 19:17:36 +0900 | [diff] [blame] | 5363 | * Setting to record the input method subtype used by default, holding the ID |
| 5364 | * of the desired method. |
| 5365 | */ |
| 5366 | public static final String SELECTED_INPUT_METHOD_SUBTYPE = |
| 5367 | "selected_input_method_subtype"; |
| 5368 | |
| 5369 | /** |
satok | 723a27e | 2010-11-11 14:58:11 +0900 | [diff] [blame] | 5370 | * Setting to record the history of input method subtype, holding the pair of ID of IME |
| 5371 | * and its last used subtype. |
| 5372 | * @hide |
| 5373 | */ |
| 5374 | public static final String INPUT_METHODS_SUBTYPE_HISTORY = |
| 5375 | "input_methods_subtype_history"; |
| 5376 | |
| 5377 | /** |
satok | 5c58dfc | 2010-12-14 21:54:47 +0900 | [diff] [blame] | 5378 | * Setting to record the visibility of input method selector |
| 5379 | */ |
| 5380 | public static final String INPUT_METHOD_SELECTOR_VISIBILITY = |
| 5381 | "input_method_selector_visibility"; |
| 5382 | |
| 5383 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5384 | * The currently selected voice interaction service flattened ComponentName. |
| 5385 | * @hide |
| 5386 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 5387 | @TestApi |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5388 | public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; |
| 5389 | |
| 5390 | /** |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5391 | * The currently selected autofill service flattened ComponentName. |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5392 | * @hide |
| 5393 | */ |
| 5394 | @TestApi |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5395 | public static final String AUTOFILL_SERVICE = "autofill_service"; |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5396 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5397 | private static final Validator AUTOFILL_SERVICE_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 5398 | |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5399 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5400 | * Boolean indicating if Autofill supports field classification. |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5401 | * |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5402 | * @see android.service.autofill.AutofillService |
| 5403 | * |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5404 | * @hide |
| 5405 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5406 | @SystemApi |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5407 | @TestApi |
Felipe Leme | 329d040 | 2017-12-06 09:22:43 -0800 | [diff] [blame] | 5408 | public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = |
| 5409 | "autofill_field_classification"; |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5410 | |
| 5411 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5412 | * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5413 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5414 | * @hide |
| 5415 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5416 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5417 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5418 | public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = |
| 5419 | "autofill_user_data_max_user_data_size"; |
| 5420 | |
| 5421 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5422 | * Defines value returned by |
| 5423 | * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5424 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5425 | * @hide |
| 5426 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5427 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5428 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5429 | public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = |
| 5430 | "autofill_user_data_max_field_classification_size"; |
| 5431 | |
| 5432 | /** |
Felipe Leme | febb733 | 2018-02-12 18:12:55 -0800 | [diff] [blame] | 5433 | * Defines value returned by |
| 5434 | * {@link android.service.autofill.UserData#getMaxCategoryCount()}. |
| 5435 | * |
| 5436 | * @hide |
| 5437 | */ |
| 5438 | @SystemApi |
| 5439 | @TestApi |
| 5440 | public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = |
| 5441 | "autofill_user_data_max_category_count"; |
| 5442 | |
| 5443 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5444 | * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5445 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5446 | * @hide |
| 5447 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5448 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5449 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5450 | public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = |
| 5451 | "autofill_user_data_max_value_length"; |
| 5452 | |
| 5453 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5454 | * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5455 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5456 | * @hide |
| 5457 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5458 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5459 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5460 | public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = |
| 5461 | "autofill_user_data_min_value_length"; |
| 5462 | |
| 5463 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5464 | * @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] | 5465 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5466 | @Deprecated |
| 5467 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5468 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5469 | /** |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5470 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5471 | * @hide |
| 5472 | */ |
Felipe Leme | 9923012 | 2017-06-12 14:33:02 -0700 | [diff] [blame] | 5473 | @TestApi |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5474 | public static final String USER_SETUP_COMPLETE = "user_setup_complete"; |
| 5475 | |
| 5476 | /** |
Ajay Nadathur | 702fc64 | 2018-03-09 11:56:01 -0800 | [diff] [blame] | 5477 | * The current state of device personalization. |
| 5478 | * |
| 5479 | * @hide |
| 5480 | * @see UserSetupPersonalization |
| 5481 | */ |
| 5482 | public static final String USER_SETUP_PERSONALIZATION_STATE = |
| 5483 | "user_setup_personalization_state"; |
| 5484 | |
| 5485 | /** |
Sujith Ramakrishnan | 314df16 | 2017-06-16 18:03:18 -0700 | [diff] [blame] | 5486 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5487 | * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 |
| 5488 | * in case SetupWizard has been re-enabled on TV devices. |
| 5489 | * |
| 5490 | * @hide |
| 5491 | */ |
| 5492 | public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; |
| 5493 | |
| 5494 | /** |
Ido Ofir | d193c67 | 2016-03-01 13:27:54 -0800 | [diff] [blame] | 5495 | * Prefix for category name that marks whether a suggested action from that category was |
| 5496 | * completed. |
| 5497 | * @hide |
| 5498 | */ |
| 5499 | public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; |
| 5500 | |
| 5501 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5502 | * List of input methods that are currently enabled. This is a string |
| 5503 | * containing the IDs of all enabled input methods, each ID separated |
| 5504 | * by ':'. |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5505 | * |
| 5506 | * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" |
| 5507 | * where imeId is ComponentName and subtype is int32. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5508 | */ |
| 5509 | public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5510 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5511 | /** |
Amith Yamasani | e861ec1 | 2010-03-24 21:39:27 -0700 | [diff] [blame] | 5512 | * List of system input methods that are currently disabled. This is a string |
| 5513 | * containing the IDs of all disabled input methods, each ID separated |
| 5514 | * by ':'. |
| 5515 | * @hide |
| 5516 | */ |
| 5517 | public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; |
| 5518 | |
| 5519 | /** |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5520 | * Whether to show the IME when a hard keyboard is connected. This is a boolean that |
| 5521 | * determines if the IME should be shown when a hard keyboard is attached. |
| 5522 | * @hide |
| 5523 | */ |
| 5524 | public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; |
| 5525 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5526 | private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5527 | |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5528 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5529 | * Host name and port for global http proxy. Uses ':' seperator for |
| 5530 | * between host and port. |
| 5531 | * |
| 5532 | * @deprecated Use {@link Global#HTTP_PROXY} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5533 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5534 | @Deprecated |
| 5535 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
Robert Greenwalt | e90aa5e | 2010-09-01 11:34:05 -0700 | [diff] [blame] | 5536 | |
| 5537 | /** |
Robin Lee | 244ce8e | 2016-01-05 18:03:46 +0000 | [diff] [blame] | 5538 | * Package designated as always-on VPN provider. |
| 5539 | * |
| 5540 | * @hide |
| 5541 | */ |
| 5542 | public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; |
| 5543 | |
| 5544 | /** |
Robin Lee | 17e6183 | 2016-05-09 13:46:28 +0100 | [diff] [blame] | 5545 | * Whether to block networking outside of VPN connections while always-on is set. |
| 5546 | * @see #ALWAYS_ON_VPN_APP |
| 5547 | * |
| 5548 | * @hide |
| 5549 | */ |
| 5550 | public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; |
| 5551 | |
| 5552 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5553 | * Whether applications can be installed for this user via the system's |
| 5554 | * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. |
| 5555 | * |
| 5556 | * <p>1 = permit app installation via the system package installer intent |
| 5557 | * <p>0 = do not allow use of the package installer |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5558 | * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use |
| 5559 | * {@link PackageManager#canRequestPackageInstalls()} |
| 5560 | * @see PackageManager#canRequestPackageInstalls() |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5561 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5562 | public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5563 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5564 | /** |
Suprabh Shukla | 0b1356f | 2017-02-21 14:33:50 -0800 | [diff] [blame] | 5565 | * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that |
| 5566 | * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it |
| 5567 | * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} |
| 5568 | * on behalf of the profile owner if needed to make the change transparent for profile |
| 5569 | * owners. |
| 5570 | * |
| 5571 | * @hide |
| 5572 | */ |
| 5573 | public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = |
| 5574 | "unknown_sources_default_reversed"; |
| 5575 | |
| 5576 | /** |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5577 | * Comma-separated list of location providers that activities may access. Do not rely on |
| 5578 | * this value being present in settings.db or on ContentObserver notifications on the |
| 5579 | * corresponding Uri. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5580 | * |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5581 | * @deprecated use {@link #LOCATION_MODE} and |
| 5582 | * {@link LocationManager#MODE_CHANGED_ACTION} (or |
| 5583 | * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5584 | */ |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5585 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5586 | public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5587 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5588 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5589 | * The degree of location access enabled by the user. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5590 | * <p> |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5591 | * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link |
| 5592 | * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link |
| 5593 | * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link |
| 5594 | * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location |
| 5595 | * modes that might be added in the future. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5596 | * <p> |
| 5597 | * Note: do not rely on this value being present in settings.db or on ContentObserver |
| 5598 | * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} |
| 5599 | * to receive changes in this value. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5600 | * |
| 5601 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5602 | * get the status of a location provider, use |
| 5603 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5604 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5605 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5606 | public static final String LOCATION_MODE = "location_mode"; |
| 5607 | |
| 5608 | /** |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 5609 | * The App or module that changes the location mode. |
| 5610 | * @hide |
| 5611 | */ |
| 5612 | public static final String LOCATION_CHANGER = "location_changer"; |
| 5613 | /** |
| 5614 | * The location changer is unknown or unable to detect. |
| 5615 | * @hide |
| 5616 | */ |
| 5617 | public static final int LOCATION_CHANGER_UNKNOWN = 0; |
| 5618 | /** |
| 5619 | * Location settings in system settings. |
| 5620 | * @hide |
| 5621 | */ |
| 5622 | public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; |
| 5623 | /** |
| 5624 | * The location icon in drop down notification drawer. |
| 5625 | * @hide |
| 5626 | */ |
| 5627 | public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; |
| 5628 | |
| 5629 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5630 | * Location access disabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5631 | * |
| 5632 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5633 | * get the status of a location provider, use |
| 5634 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5635 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5636 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5637 | public static final int LOCATION_MODE_OFF = 0; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5638 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5639 | /** |
| 5640 | * Network Location Provider disabled, but GPS and other sensors enabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5641 | * |
| 5642 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5643 | * get the status of a location provider, use |
| 5644 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5645 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5646 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5647 | public static final int LOCATION_MODE_SENSORS_ONLY = 1; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5648 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5649 | /** |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 5650 | * Reduced power usage, such as limiting the number of GPS updates per hour. Requests |
| 5651 | * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to |
| 5652 | * {@link android.location.Criteria#POWER_MEDIUM}. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5653 | * |
| 5654 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5655 | * get the status of a location provider, use |
| 5656 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5657 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5658 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5659 | public static final int LOCATION_MODE_BATTERY_SAVING = 2; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5660 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5661 | /** |
| 5662 | * Best-effort location computation allowed. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5663 | * |
| 5664 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5665 | * get the status of a location provider, use |
| 5666 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5667 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5668 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5669 | public static final int LOCATION_MODE_HIGH_ACCURACY = 3; |
| 5670 | |
| 5671 | /** |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5672 | * A flag containing settings used for biometric weak |
| 5673 | * @hide |
| 5674 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5675 | @Deprecated |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5676 | public static final String LOCK_BIOMETRIC_WEAK_FLAGS = |
| 5677 | "lock_biometric_weak_flags"; |
| 5678 | |
| 5679 | /** |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 5680 | * Whether lock-to-app will lock the keyguard when exiting. |
| 5681 | * @hide |
| 5682 | */ |
| 5683 | public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; |
| 5684 | |
| 5685 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5686 | * Whether autolock is enabled (0 = false, 1 = true) |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5687 | * |
| 5688 | * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5689 | * 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] | 5690 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5691 | */ |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5692 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5693 | public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; |
| 5694 | |
| 5695 | /** |
| 5696 | * Whether lock pattern is visible as user enters (0 = false, 1 = true) |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5697 | * |
| 5698 | * @deprecated Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5699 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5700 | */ |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5701 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5702 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 5703 | |
| 5704 | /** |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5705 | * Whether lock pattern will vibrate as user enters (0 = false, 1 = |
| 5706 | * true) |
| 5707 | * |
| 5708 | * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the |
| 5709 | * lockscreen uses |
| 5710 | * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5711 | * Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5712 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5713 | */ |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5714 | @Deprecated |
| 5715 | public static final String |
| 5716 | LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5717 | |
| 5718 | /** |
Jim Miller | bc4603b | 2010-08-30 21:21:34 -0700 | [diff] [blame] | 5719 | * This preference allows the device to be locked given time after screen goes off, |
| 5720 | * subject to current DeviceAdmin policy limits. |
| 5721 | * @hide |
| 5722 | */ |
| 5723 | public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; |
| 5724 | |
| 5725 | |
| 5726 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5727 | * This preference contains the string that shows for owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5728 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5729 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5730 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5731 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5732 | public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; |
| 5733 | |
| 5734 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5735 | * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5736 | * @hide |
| 5737 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5738 | @Deprecated |
Michael Jurka | aa2859a | 2012-10-24 12:46:49 -0700 | [diff] [blame] | 5739 | public static final String LOCK_SCREEN_APPWIDGET_IDS = |
| 5740 | "lock_screen_appwidget_ids"; |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5741 | |
| 5742 | /** |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5743 | * Id of the appwidget shown on the lock screen when appwidgets are disabled. |
| 5744 | * @hide |
| 5745 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5746 | @Deprecated |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5747 | public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = |
| 5748 | "lock_screen_fallback_appwidget_id"; |
| 5749 | |
| 5750 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5751 | * Index of the lockscreen appwidget to restore, -1 if none. |
| 5752 | * @hide |
| 5753 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5754 | @Deprecated |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5755 | public static final String LOCK_SCREEN_STICKY_APPWIDGET = |
| 5756 | "lock_screen_sticky_appwidget"; |
| 5757 | |
| 5758 | /** |
| 5759 | * This preference enables showing the owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5760 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5761 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5762 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5763 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5764 | public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = |
| 5765 | "lock_screen_owner_info_enabled"; |
| 5766 | |
| 5767 | /** |
Dan Sandler | 5d7c3cc | 2014-02-18 17:35:15 -0500 | [diff] [blame] | 5768 | * When set by a user, allows notifications to be shown atop a securely locked screen |
| 5769 | * in their full "private" form (same as when the device is unlocked). |
Dan Sandler | fd16d56 | 2014-02-13 18:43:31 -0800 | [diff] [blame] | 5770 | * @hide |
| 5771 | */ |
| 5772 | public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = |
| 5773 | "lock_screen_allow_private_notifications"; |
| 5774 | |
| 5775 | /** |
Adrian Roos | 3aec638 | 2016-02-05 14:19:01 -0800 | [diff] [blame] | 5776 | * When set by a user, allows notification remote input atop a securely locked screen |
| 5777 | * without having to unlock |
| 5778 | * @hide |
| 5779 | */ |
| 5780 | public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = |
| 5781 | "lock_screen_allow_remote_input"; |
| 5782 | |
| 5783 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 5784 | * Set by the system to track if the user needs to see the call to action for |
| 5785 | * the lockscreen notification policy. |
| 5786 | * @hide |
| 5787 | */ |
| 5788 | public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = |
| 5789 | "show_note_about_notification_hiding"; |
| 5790 | |
| 5791 | /** |
Adrian Roos | 3870d45 | 2014-09-05 18:22:28 +0200 | [diff] [blame] | 5792 | * Set to 1 by the system after trust agents have been initialized. |
| 5793 | * @hide |
| 5794 | */ |
| 5795 | public static final String TRUST_AGENTS_INITIALIZED = |
| 5796 | "trust_agents_initialized"; |
| 5797 | |
| 5798 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5799 | * The Logging ID (a unique 64-bit value) as a hex string. |
| 5800 | * Used as a pseudonymous identifier for logging. |
| 5801 | * @deprecated This identifier is poorly initialized and has |
| 5802 | * many collisions. It should not be used. |
| 5803 | */ |
| 5804 | @Deprecated |
| 5805 | public static final String LOGGING_ID = "logging_id"; |
| 5806 | |
| 5807 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5808 | * @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] | 5809 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5810 | @Deprecated |
| 5811 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5812 | |
| 5813 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5814 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5815 | */ |
| 5816 | public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5817 | |
| 5818 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5819 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5820 | */ |
| 5821 | public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5822 | |
| 5823 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5824 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5825 | */ |
| 5826 | public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5827 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5828 | /** |
| 5829 | * Settings classname to launch when Settings is clicked from All |
| 5830 | * Applications. Needed because of user testing between the old |
| 5831 | * and new Settings apps. |
| 5832 | */ |
| 5833 | // TODO: 881807 |
| 5834 | public static final String SETTINGS_CLASSNAME = "settings_classname"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5835 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5836 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5837 | * @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] | 5838 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5839 | @Deprecated |
| 5840 | 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] | 5841 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5842 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5843 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5844 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5845 | * @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] | 5846 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5847 | @Deprecated |
| 5848 | public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5849 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5850 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5851 | * If accessibility is enabled. |
| 5852 | */ |
| 5853 | public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; |
| 5854 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5855 | private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5856 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5857 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5858 | * Setting specifying if the accessibility shortcut is enabled. |
| 5859 | * @hide |
| 5860 | */ |
| 5861 | public static final String ACCESSIBILITY_SHORTCUT_ENABLED = |
| 5862 | "accessibility_shortcut_enabled"; |
| 5863 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5864 | private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5865 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5866 | /** |
| 5867 | * Setting specifying if the accessibility shortcut is enabled. |
| 5868 | * @hide |
| 5869 | */ |
| 5870 | public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = |
| 5871 | "accessibility_shortcut_on_lock_screen"; |
| 5872 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5873 | private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR = |
| 5874 | BOOLEAN_VALIDATOR; |
| 5875 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5876 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5877 | * Setting specifying if the accessibility shortcut dialog has been shown to this user. |
| 5878 | * @hide |
| 5879 | */ |
| 5880 | public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = |
| 5881 | "accessibility_shortcut_dialog_shown"; |
| 5882 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5883 | private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR = |
| 5884 | BOOLEAN_VALIDATOR; |
| 5885 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5886 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5887 | * Setting specifying the accessibility service to be toggled via the accessibility |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5888 | * shortcut. Must be its flattened {@link ComponentName}. |
| 5889 | * @hide |
| 5890 | */ |
| 5891 | public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = |
| 5892 | "accessibility_shortcut_target_service"; |
| 5893 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5894 | private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR = |
| 5895 | COMPONENT_NAME_VALIDATOR; |
| 5896 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5897 | /** |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5898 | * Setting specifying the accessibility service or feature to be toggled via the |
| 5899 | * accessibility button in the navigation bar. This is either a flattened |
| 5900 | * {@link ComponentName} or the class name of a system class implementing a supported |
| 5901 | * accessibility feature. |
| 5902 | * @hide |
| 5903 | */ |
| 5904 | public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = |
| 5905 | "accessibility_button_target_component"; |
| 5906 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5907 | private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR = |
| 5908 | new Validator() { |
| 5909 | @Override |
| 5910 | public boolean validate(String value) { |
| 5911 | // technically either ComponentName or class name, but there's proper value |
| 5912 | // validation at callsites, so allow any non-null string |
| 5913 | return value != null; |
| 5914 | } |
| 5915 | }; |
| 5916 | |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5917 | /** |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5918 | * If touch exploration is enabled. |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5919 | */ |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5920 | public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5921 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5922 | private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5923 | |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5924 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5925 | * List of the enabled accessibility providers. |
| 5926 | */ |
| 5927 | public static final String ENABLED_ACCESSIBILITY_SERVICES = |
| 5928 | "enabled_accessibility_services"; |
| 5929 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5930 | private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5931 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5932 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5933 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 5934 | * List of the accessibility services to which the user has granted |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5935 | * permission to put the device into touch exploration mode. |
| 5936 | * |
| 5937 | * @hide |
| 5938 | */ |
| 5939 | public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = |
| 5940 | "touch_exploration_granted_accessibility_services"; |
| 5941 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5942 | private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5943 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5944 | |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5945 | /** |
Lucas Dupin | 6bd8601 | 2017-12-05 17:58:57 -0800 | [diff] [blame] | 5946 | * Uri of the slice that's presented on the keyguard. |
| 5947 | * Defaults to a slice with the date and next alarm. |
| 5948 | * |
| 5949 | * @hide |
| 5950 | */ |
| 5951 | public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; |
| 5952 | |
| 5953 | /** |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5954 | * Whether to speak passwords while in accessibility mode. |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5955 | * |
| 5956 | * @deprecated The speaking of passwords is controlled by individual accessibility services. |
| 5957 | * Apps should ignore this setting and provide complete information to accessibility |
| 5958 | * 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] | 5959 | */ |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5960 | @Deprecated |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5961 | public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; |
| 5962 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5963 | private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5964 | |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5965 | /** |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 5966 | * Whether to draw text with high contrast while in accessibility mode. |
| 5967 | * |
| 5968 | * @hide |
| 5969 | */ |
| 5970 | public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = |
| 5971 | "high_text_contrast_enabled"; |
| 5972 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5973 | private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR = |
| 5974 | BOOLEAN_VALIDATOR; |
| 5975 | |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 5976 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5977 | * Setting that specifies whether the display magnification is enabled via a system-wide |
| 5978 | * triple tap gesture. Display magnifications allows the user to zoom in the display content |
| 5979 | * and is targeted to low vision users. The current magnification scale is controlled by |
| 5980 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5981 | * |
| 5982 | * @hide |
| 5983 | */ |
Eugene Susla | a55f74e | 2017-09-21 13:48:50 -0700 | [diff] [blame] | 5984 | @TestApi |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5985 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = |
| 5986 | "accessibility_display_magnification_enabled"; |
| 5987 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5988 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR = |
| 5989 | BOOLEAN_VALIDATOR; |
| 5990 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5991 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5992 | * Setting that specifies whether the display magnification is enabled via a shortcut |
| 5993 | * affordance within the system's navigation area. Display magnifications allows the user to |
| 5994 | * zoom in the display content and is targeted to low vision users. The current |
| 5995 | * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
| 5996 | * |
| 5997 | * @hide |
| 5998 | */ |
| 5999 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = |
| 6000 | "accessibility_display_magnification_navbar_enabled"; |
| 6001 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6002 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR |
| 6003 | = BOOLEAN_VALIDATOR; |
| 6004 | |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6005 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6006 | * Setting that specifies what the display magnification scale is. |
| 6007 | * Display magnifications allows the user to zoom in the display |
| 6008 | * content and is targeted to low vision users. Whether a display |
| 6009 | * magnification is performed is controlled by |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 6010 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and |
| 6011 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6012 | * |
| 6013 | * @hide |
| 6014 | */ |
| 6015 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = |
| 6016 | "accessibility_display_magnification_scale"; |
| 6017 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6018 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR = |
| 6019 | new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE); |
| 6020 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6021 | /** |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 6022 | * Unused mangnification setting |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6023 | * |
| 6024 | * @hide |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 6025 | * @deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6026 | */ |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 6027 | @Deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 6028 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = |
| 6029 | "accessibility_display_magnification_auto_update"; |
| 6030 | |
| 6031 | /** |
Anna Galusza | 9b27811 | 2016-01-04 11:37:37 -0800 | [diff] [blame] | 6032 | * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be |
| 6033 | * modified from an AccessibilityService using the SoftKeyboardController. |
| 6034 | * |
| 6035 | * @hide |
| 6036 | */ |
| 6037 | public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = |
| 6038 | "accessibility_soft_keyboard_mode"; |
| 6039 | |
| 6040 | /** |
| 6041 | * Default soft keyboard behavior. |
| 6042 | * |
| 6043 | * @hide |
| 6044 | */ |
| 6045 | public static final int SHOW_MODE_AUTO = 0; |
| 6046 | |
| 6047 | /** |
| 6048 | * Soft keyboard is never shown. |
| 6049 | * |
| 6050 | * @hide |
| 6051 | */ |
| 6052 | public static final int SHOW_MODE_HIDDEN = 1; |
| 6053 | |
| 6054 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6055 | * Setting that specifies whether timed text (captions) should be |
| 6056 | * displayed in video content. Text display properties are controlled by |
| 6057 | * the following settings: |
| 6058 | * <ul> |
| 6059 | * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} |
| 6060 | * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} |
| 6061 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} |
| 6062 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} |
| 6063 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} |
| 6064 | * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6065 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6066 | * </ul> |
| 6067 | * |
| 6068 | * @hide |
| 6069 | */ |
| 6070 | public static final String ACCESSIBILITY_CAPTIONING_ENABLED = |
| 6071 | "accessibility_captioning_enabled"; |
| 6072 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6073 | private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR = |
| 6074 | BOOLEAN_VALIDATOR; |
| 6075 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6076 | /** |
| 6077 | * Setting that specifies the language for captions as a locale string, |
| 6078 | * e.g. en_US. |
| 6079 | * |
| 6080 | * @see java.util.Locale#toString |
| 6081 | * @hide |
| 6082 | */ |
| 6083 | public static final String ACCESSIBILITY_CAPTIONING_LOCALE = |
| 6084 | "accessibility_captioning_locale"; |
| 6085 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6086 | private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR; |
| 6087 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6088 | /** |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6089 | * Integer property that specifies the preset style for captions, one |
| 6090 | * of: |
| 6091 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6092 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} |
| 6093 | * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6094 | * </ul> |
| 6095 | * |
| 6096 | * @see java.util.Locale#toString |
| 6097 | * @hide |
| 6098 | */ |
| 6099 | public static final String ACCESSIBILITY_CAPTIONING_PRESET = |
| 6100 | "accessibility_captioning_preset"; |
| 6101 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6102 | private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR = |
| 6103 | new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2", |
| 6104 | "3", "4"}); |
| 6105 | |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6106 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6107 | * Integer property that specifes the background color for captions as a |
| 6108 | * packed 32-bit color. |
| 6109 | * |
| 6110 | * @see android.graphics.Color#argb |
| 6111 | * @hide |
| 6112 | */ |
| 6113 | public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = |
| 6114 | "accessibility_captioning_background_color"; |
| 6115 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6116 | private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR = |
| 6117 | ANY_INTEGER_VALIDATOR; |
| 6118 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6119 | /** |
| 6120 | * Integer property that specifes the foreground color for captions as a |
| 6121 | * packed 32-bit color. |
| 6122 | * |
| 6123 | * @see android.graphics.Color#argb |
| 6124 | * @hide |
| 6125 | */ |
| 6126 | public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = |
| 6127 | "accessibility_captioning_foreground_color"; |
| 6128 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6129 | private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR = |
| 6130 | ANY_INTEGER_VALIDATOR; |
| 6131 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6132 | /** |
| 6133 | * Integer property that specifes the edge type for captions, one of: |
| 6134 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6135 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} |
| 6136 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} |
| 6137 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6138 | * </ul> |
| 6139 | * |
| 6140 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR |
| 6141 | * @hide |
| 6142 | */ |
| 6143 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = |
| 6144 | "accessibility_captioning_edge_type"; |
| 6145 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6146 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR = |
| 6147 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"}); |
| 6148 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6149 | /** |
| 6150 | * Integer property that specifes the edge color for captions as a |
| 6151 | * packed 32-bit color. |
| 6152 | * |
| 6153 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE |
| 6154 | * @see android.graphics.Color#argb |
| 6155 | * @hide |
| 6156 | */ |
| 6157 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = |
| 6158 | "accessibility_captioning_edge_color"; |
| 6159 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6160 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR = |
| 6161 | ANY_INTEGER_VALIDATOR; |
| 6162 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6163 | /** |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6164 | * Integer property that specifes the window color for captions as a |
| 6165 | * packed 32-bit color. |
| 6166 | * |
| 6167 | * @see android.graphics.Color#argb |
| 6168 | * @hide |
| 6169 | */ |
| 6170 | public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = |
| 6171 | "accessibility_captioning_window_color"; |
| 6172 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6173 | private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR = |
| 6174 | ANY_INTEGER_VALIDATOR; |
| 6175 | |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6176 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6177 | * String property that specifies the typeface for captions, one of: |
| 6178 | * <ul> |
| 6179 | * <li>DEFAULT |
| 6180 | * <li>MONOSPACE |
| 6181 | * <li>SANS_SERIF |
| 6182 | * <li>SERIF |
| 6183 | * </ul> |
| 6184 | * |
| 6185 | * @see android.graphics.Typeface |
| 6186 | * @hide |
| 6187 | */ |
| 6188 | public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = |
| 6189 | "accessibility_captioning_typeface"; |
| 6190 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6191 | private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR = |
| 6192 | new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT", |
| 6193 | "MONOSPACE", "SANS_SERIF", "SERIF"}); |
| 6194 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6195 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6196 | * Floating point property that specifies font scaling for captions. |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6197 | * |
| 6198 | * @hide |
| 6199 | */ |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6200 | public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = |
| 6201 | "accessibility_captioning_font_scale"; |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6202 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6203 | private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR = |
| 6204 | new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f); |
| 6205 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6206 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6207 | * Setting that specifies whether display color inversion is enabled. |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6208 | */ |
| 6209 | public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = |
| 6210 | "accessibility_display_inversion_enabled"; |
| 6211 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6212 | private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR = |
| 6213 | BOOLEAN_VALIDATOR; |
| 6214 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6215 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6216 | * Setting that specifies whether display color space adjustment is |
| 6217 | * enabled. |
| 6218 | * |
| 6219 | * @hide |
| 6220 | */ |
| 6221 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = |
| 6222 | "accessibility_display_daltonizer_enabled"; |
| 6223 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6224 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR = |
| 6225 | BOOLEAN_VALIDATOR; |
| 6226 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6227 | /** |
| 6228 | * Integer property that specifies the type of color space adjustment to |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6229 | * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6230 | * - AccessibilityManager.DALTONIZER_DISABLED = -1 |
| 6231 | * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6232 | * - <item>@string/daltonizer_mode_protanomaly</item> = 11 |
| 6233 | * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and |
| 6234 | * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 |
| 6235 | * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6236 | * |
| 6237 | * @hide |
| 6238 | */ |
| 6239 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = |
| 6240 | "accessibility_display_daltonizer"; |
| 6241 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6242 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR = |
Phil Weaver | 7b8c8e2 | 2018-03-09 09:58:09 -0800 | [diff] [blame] | 6243 | new SettingsValidators.DiscreteValueValidator( |
| 6244 | new String[] {"-1", "0", "11", "12", "13"}); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6245 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6246 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6247 | * Setting that specifies whether automatic click when the mouse pointer stops moving is |
| 6248 | * enabled. |
| 6249 | * |
| 6250 | * @hide |
| 6251 | */ |
| 6252 | public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = |
| 6253 | "accessibility_autoclick_enabled"; |
| 6254 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6255 | private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR = |
| 6256 | BOOLEAN_VALIDATOR; |
| 6257 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6258 | /** |
| 6259 | * Integer setting specifying amount of time in ms the mouse pointer has to stay still |
| 6260 | * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. |
| 6261 | * |
| 6262 | * @see #ACCESSIBILITY_AUTOCLICK_ENABLED |
| 6263 | * @hide |
| 6264 | */ |
| 6265 | public static final String ACCESSIBILITY_AUTOCLICK_DELAY = |
| 6266 | "accessibility_autoclick_delay"; |
| 6267 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6268 | private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR = |
| 6269 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6270 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6271 | /** |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6272 | * Whether or not larger size icons are used for the pointer of mouse/trackpad for |
| 6273 | * accessibility. |
| 6274 | * (0 = false, 1 = true) |
| 6275 | * @hide |
| 6276 | */ |
| 6277 | public static final String ACCESSIBILITY_LARGE_POINTER_ICON = |
| 6278 | "accessibility_large_pointer_icon"; |
| 6279 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6280 | private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR = |
| 6281 | BOOLEAN_VALIDATOR; |
| 6282 | |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6283 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6284 | * 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] | 6285 | * @hide |
| 6286 | */ |
| 6287 | public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; |
| 6288 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6289 | private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR = |
| 6290 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6291 | |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 6292 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 6293 | * The duration in milliseconds between the first tap's up event and the second tap's |
| 6294 | * down event for an interaction to be considered part of the same multi-press. |
| 6295 | * @hide |
| 6296 | */ |
| 6297 | public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; |
| 6298 | |
| 6299 | /** |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6300 | * List of the enabled print services. |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6301 | * |
| 6302 | * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade |
| 6303 | * from pre-N. |
| 6304 | * |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 6305 | * @hide |
| 6306 | */ |
| 6307 | public static final String ENABLED_PRINT_SERVICES = |
| 6308 | "enabled_print_services"; |
| 6309 | |
| 6310 | /** |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6311 | * List of the disabled print services. |
| 6312 | * |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6313 | * @hide |
| 6314 | */ |
Svetoslav Ganov | 2dcedc12 | 2017-06-07 18:50:02 -0700 | [diff] [blame] | 6315 | @TestApi |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6316 | public static final String DISABLED_PRINT_SERVICES = |
| 6317 | "disabled_print_services"; |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6318 | |
| 6319 | /** |
Alan Viverette | 5e8d837 | 2016-02-03 15:38:59 -0500 | [diff] [blame] | 6320 | * The saved value for WindowManagerService.setForcedDisplayDensity() |
| 6321 | * formatted as a single integer representing DPI. If unset, then use |
| 6322 | * the real display density. |
| 6323 | * |
| 6324 | * @hide |
| 6325 | */ |
| 6326 | public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; |
| 6327 | |
| 6328 | /** |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6329 | * Setting to always use the default text-to-speech settings regardless |
| 6330 | * of the application settings. |
| 6331 | * 1 = override application settings, |
| 6332 | * 0 = use application settings (if specified). |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6333 | * |
| 6334 | * @deprecated The value of this setting is no longer respected by |
| 6335 | * 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] | 6336 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6337 | @Deprecated |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6338 | public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; |
| 6339 | |
| 6340 | /** |
| 6341 | * Default text-to-speech engine speech rate. 100 = 1x |
| 6342 | */ |
| 6343 | public static final String TTS_DEFAULT_RATE = "tts_default_rate"; |
| 6344 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6345 | private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6346 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6347 | /** |
| 6348 | * Default text-to-speech engine pitch. 100 = 1x |
| 6349 | */ |
| 6350 | public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; |
| 6351 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6352 | private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6353 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6354 | /** |
| 6355 | * Default text-to-speech engine. |
| 6356 | */ |
| 6357 | public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; |
| 6358 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6359 | private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR; |
| 6360 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6361 | /** |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6362 | * Default text-to-speech language. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6363 | * |
| 6364 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6365 | * Sandwich release. Apps should never need to read this setting directly, |
| 6366 | * instead can query the TextToSpeech framework classes for the default |
| 6367 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6368 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6369 | @Deprecated |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6370 | public static final String TTS_DEFAULT_LANG = "tts_default_lang"; |
| 6371 | |
| 6372 | /** |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6373 | * Default text-to-speech country. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6374 | * |
| 6375 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6376 | * Sandwich release. Apps should never need to read this setting directly, |
| 6377 | * instead can query the TextToSpeech framework classes for the default |
| 6378 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6379 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6380 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6381 | public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; |
| 6382 | |
| 6383 | /** |
| 6384 | * Default text-to-speech locale variant. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6385 | * |
| 6386 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6387 | * Sandwich release. Apps should never need to read this setting directly, |
| 6388 | * instead can query the TextToSpeech framework classes for the |
| 6389 | * locale that is in use {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6390 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6391 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6392 | public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; |
| 6393 | |
| 6394 | /** |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6395 | * Stores the default tts locales on a per engine basis. Stored as |
| 6396 | * a comma seperated list of values, each value being of the form |
| 6397 | * {@code engine_name:locale} for example, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6398 | * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This |
| 6399 | * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and |
| 6400 | * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this |
| 6401 | * setting directly, and can query the TextToSpeech framework classes |
| 6402 | * for the locale that is in use. |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6403 | * |
| 6404 | * @hide |
| 6405 | */ |
| 6406 | public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; |
| 6407 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6408 | private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() { |
| 6409 | @Override |
| 6410 | public boolean validate(String value) { |
| 6411 | if (value == null || value.length() == 0) { |
| 6412 | return false; |
| 6413 | } |
| 6414 | String[] ttsLocales = value.split(","); |
| 6415 | boolean valid = true; |
| 6416 | for (String ttsLocale : ttsLocales) { |
| 6417 | String[] parts = ttsLocale.split(":"); |
| 6418 | valid |= ((parts.length == 2) |
| 6419 | && (parts[0].length() > 0) |
| 6420 | && ANY_STRING_VALIDATOR.validate(parts[0]) |
| 6421 | && LOCALE_VALIDATOR.validate(parts[1])); |
| 6422 | } |
| 6423 | return valid; |
| 6424 | } |
| 6425 | }; |
| 6426 | |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6427 | /** |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6428 | * Space delimited list of plugin packages that are enabled. |
| 6429 | */ |
| 6430 | public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; |
| 6431 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6432 | private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR = |
| 6433 | new SettingsValidators.PackageNameListValidator(" "); |
| 6434 | |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6435 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6436 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} |
| 6437 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6438 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6439 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6440 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6441 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6442 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6443 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 6444 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 6445 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6446 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6447 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} |
| 6448 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6449 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6450 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6451 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6452 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6453 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6454 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 6455 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6456 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6457 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6458 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} |
| 6459 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6460 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6461 | @Deprecated |
| 6462 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = |
| 6463 | Global.WIFI_NUM_OPEN_NETWORKS_KEPT; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6464 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6465 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 6466 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6467 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6468 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6469 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} |
| 6470 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6471 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6472 | @Deprecated |
| 6473 | public static final String WIFI_ON = Global.WIFI_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6474 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6475 | /** |
| 6476 | * The acceptable packet loss percentage (range 0 - 100) before trying |
| 6477 | * another AP on the same network. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6478 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6479 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6480 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6481 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 6482 | "wifi_watchdog_acceptable_packet_loss_percentage"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6483 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6484 | /** |
| 6485 | * The number of access points required for a network in order for the |
| 6486 | * watchdog to monitor it. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6487 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6488 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6489 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6490 | public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6491 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6492 | /** |
| 6493 | * The delay between background checks. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6494 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6495 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6496 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6497 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 6498 | "wifi_watchdog_background_check_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6499 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6500 | /** |
| 6501 | * Whether the Wi-Fi watchdog is enabled for background checking even |
| 6502 | * after it thinks the user has connected to a good access point. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6503 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6504 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6505 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6506 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 6507 | "wifi_watchdog_background_check_enabled"; |
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 timeout for a background ping |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6511 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6512 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6513 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6514 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 6515 | "wifi_watchdog_background_check_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6516 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6517 | /** |
| 6518 | * The number of initial pings to perform that *may* be ignored if they |
| 6519 | * fail. Again, if these fail, they will *not* be used in packet loss |
| 6520 | * calculation. For example, one network always seemed to time out for |
| 6521 | * the first couple pings, so this is set to 3 by default. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6522 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6523 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6524 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6525 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 6526 | "wifi_watchdog_initial_ignored_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6527 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6528 | /** |
| 6529 | * The maximum number of access points (per network) to attempt to test. |
| 6530 | * If this number is reached, the watchdog will no longer monitor the |
| 6531 | * initial connection state for the network. This is a safeguard for |
| 6532 | * networks containing multiple APs whose DNS does not respond to pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6533 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6534 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6535 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6536 | 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] | 6537 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6538 | /** |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6539 | * @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] | 6540 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6541 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6542 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 6543 | |
| 6544 | /** |
| 6545 | * 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] | 6546 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6547 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6548 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6549 | public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; |
| 6550 | |
| 6551 | /** |
| 6552 | * 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] | 6553 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6554 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6555 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6556 | public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6557 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6558 | /** |
| 6559 | * The delay between pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6560 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6561 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6562 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6563 | 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] | 6564 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6565 | /** |
| 6566 | * The timeout per ping. |
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_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; |
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 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6573 | * @deprecated Use |
| 6574 | * {@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] | 6575 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6576 | @Deprecated |
| 6577 | 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] | 6578 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6579 | /** |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6580 | * @deprecated Use |
| 6581 | * {@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] | 6582 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6583 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6584 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6585 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6586 | |
| 6587 | /** |
Jeremy Joslin | 7929484 | 2014-12-03 17:15:28 -0800 | [diff] [blame] | 6588 | * The number of milliseconds to hold on to a PendingIntent based request. This delay gives |
| 6589 | * the receivers of the PendingIntent an opportunity to make a new network request before |
| 6590 | * the Network satisfying the request is potentially removed. |
| 6591 | * |
| 6592 | * @hide |
| 6593 | */ |
| 6594 | public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = |
| 6595 | "connectivity_release_pending_intent_delay_ms"; |
| 6596 | |
| 6597 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 6598 | * Whether background data usage is allowed. |
| 6599 | * |
| 6600 | * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, |
| 6601 | * availability of background data depends on several |
| 6602 | * combined factors. When background data is unavailable, |
| 6603 | * {@link ConnectivityManager#getActiveNetworkInfo()} will |
| 6604 | * now appear disconnected. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6605 | */ |
Jeff Sharkey | 3a844fc | 2011-08-16 14:37:57 -0700 | [diff] [blame] | 6606 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6607 | public static final String BACKGROUND_DATA = "background_data"; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6608 | |
| 6609 | /** |
Bjorn Bringert | 98bfa39 | 2010-03-24 10:59:48 +0000 | [diff] [blame] | 6610 | * Origins for which browsers should allow geolocation by default. |
| 6611 | * The value is a space-separated list of origins. |
| 6612 | */ |
| 6613 | public static final String ALLOWED_GEOLOCATION_ORIGINS |
| 6614 | = "allowed_geolocation_origins"; |
| 6615 | |
| 6616 | /** |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 6617 | * The preferred TTY mode 0 = TTy Off, CDMA default |
| 6618 | * 1 = TTY Full |
| 6619 | * 2 = TTY HCO |
| 6620 | * 3 = TTY VCO |
| 6621 | * @hide |
| 6622 | */ |
| 6623 | public static final String PREFERRED_TTY_MODE = |
| 6624 | "preferred_tty_mode"; |
| 6625 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6626 | private static final Validator PREFERRED_TTY_MODE_VALIDATOR = |
| 6627 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"}); |
| 6628 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6629 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6630 | * Whether the enhanced voice privacy mode is enabled. |
| 6631 | * 0 = normal voice privacy |
| 6632 | * 1 = enhanced voice privacy |
| 6633 | * @hide |
| 6634 | */ |
| 6635 | public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; |
| 6636 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6637 | private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6638 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6639 | /** |
| 6640 | * Whether the TTY mode mode is enabled. |
| 6641 | * 0 = disabled |
| 6642 | * 1 = enabled |
| 6643 | * @hide |
| 6644 | */ |
| 6645 | public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6646 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6647 | private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6648 | |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6649 | /** |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 6650 | * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT |
| 6651 | * calls when supported by the device and carrier. Boolean value. |
| 6652 | * 0 = OFF |
| 6653 | * 1 = ON |
| 6654 | */ |
| 6655 | public static final String RTT_CALLING_MODE = "rtt_calling_mode"; |
| 6656 | |
| 6657 | private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6658 | |
| 6659 | /** |
| 6660 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6661 | * Controls whether settings backup is enabled. |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6662 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6663 | * @hide |
| 6664 | */ |
| 6665 | public static final String BACKUP_ENABLED = "backup_enabled"; |
| 6666 | |
| 6667 | /** |
Christopher Tate | cce9da5 | 2010-02-03 15:11:15 -0800 | [diff] [blame] | 6668 | * Controls whether application data is automatically restored from backup |
| 6669 | * at install time. |
| 6670 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6671 | * @hide |
| 6672 | */ |
| 6673 | public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; |
| 6674 | |
| 6675 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6676 | * Indicates whether settings backup has been fully provisioned. |
| 6677 | * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) |
| 6678 | * @hide |
| 6679 | */ |
| 6680 | public static final String BACKUP_PROVISIONED = "backup_provisioned"; |
| 6681 | |
| 6682 | /** |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6683 | * Component of the transport to use for backup/restore. |
| 6684 | * @hide |
| 6685 | */ |
| 6686 | public static final String BACKUP_TRANSPORT = "backup_transport"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 6687 | |
Dianne Hackborn | d7cd29d | 2009-07-01 11:22:45 -0700 | [diff] [blame] | 6688 | /** |
| 6689 | * Version for which the setup wizard was last shown. Bumped for |
| 6690 | * each release when there is new setup information to show. |
| 6691 | * @hide |
| 6692 | */ |
| 6693 | public static final String LAST_SETUP_SHOWN = "last_setup_shown"; |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6694 | |
| 6695 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6696 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 6697 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 6698 | * the mobile data network. |
| 6699 | * @hide |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6700 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} |
| 6701 | * instead. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6702 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6703 | @Deprecated |
| 6704 | public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6705 | |
| 6706 | /** |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 6707 | * The global search provider chosen by the user (if multiple global |
| 6708 | * search providers are installed). This will be the provider returned |
| 6709 | * by {@link SearchManager#getGlobalSearchActivity()} if it's still |
| 6710 | * installed. This setting is stored as a flattened component name as |
| 6711 | * per {@link ComponentName#flattenToString()}. |
| 6712 | * |
| 6713 | * @hide |
| 6714 | */ |
| 6715 | public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = |
| 6716 | "search_global_search_activity"; |
| 6717 | |
| 6718 | /** |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6719 | * The number of promoted sources in GlobalSearch. |
| 6720 | * @hide |
| 6721 | */ |
| 6722 | public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; |
| 6723 | /** |
| 6724 | * The maximum number of suggestions returned by GlobalSearch. |
| 6725 | * @hide |
| 6726 | */ |
| 6727 | public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; |
| 6728 | /** |
| 6729 | * The number of suggestions GlobalSearch will ask each non-web search source for. |
| 6730 | * @hide |
| 6731 | */ |
| 6732 | public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; |
| 6733 | /** |
| 6734 | * The number of suggestions the GlobalSearch will ask the web search source for. |
| 6735 | * @hide |
| 6736 | */ |
| 6737 | public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = |
| 6738 | "search_web_results_override_limit"; |
| 6739 | /** |
| 6740 | * The number of milliseconds that GlobalSearch will wait for suggestions from |
| 6741 | * promoted sources before continuing with all other sources. |
| 6742 | * @hide |
| 6743 | */ |
| 6744 | public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = |
| 6745 | "search_promoted_source_deadline_millis"; |
| 6746 | /** |
| 6747 | * The number of milliseconds before GlobalSearch aborts search suggesiton queries. |
| 6748 | * @hide |
| 6749 | */ |
| 6750 | public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; |
| 6751 | /** |
| 6752 | * The maximum number of milliseconds that GlobalSearch shows the previous results |
| 6753 | * after receiving a new query. |
| 6754 | * @hide |
| 6755 | */ |
| 6756 | public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; |
| 6757 | /** |
| 6758 | * The maximum age of log data used for shortcuts in GlobalSearch. |
| 6759 | * @hide |
| 6760 | */ |
| 6761 | public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; |
| 6762 | /** |
| 6763 | * The maximum age of log data used for source ranking in GlobalSearch. |
| 6764 | * @hide |
| 6765 | */ |
| 6766 | public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = |
| 6767 | "search_max_source_event_age_millis"; |
| 6768 | /** |
| 6769 | * The minimum number of impressions needed to rank a source in GlobalSearch. |
| 6770 | * @hide |
| 6771 | */ |
| 6772 | public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = |
| 6773 | "search_min_impressions_for_source_ranking"; |
| 6774 | /** |
| 6775 | * The minimum number of clicks needed to rank a source in GlobalSearch. |
| 6776 | * @hide |
| 6777 | */ |
| 6778 | public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = |
| 6779 | "search_min_clicks_for_source_ranking"; |
| 6780 | /** |
| 6781 | * The maximum number of shortcuts shown by GlobalSearch. |
| 6782 | * @hide |
| 6783 | */ |
| 6784 | public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; |
| 6785 | /** |
| 6786 | * The size of the core thread pool for suggestion queries in GlobalSearch. |
| 6787 | * @hide |
| 6788 | */ |
| 6789 | public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = |
| 6790 | "search_query_thread_core_pool_size"; |
| 6791 | /** |
| 6792 | * The maximum size of the thread pool for suggestion queries in GlobalSearch. |
| 6793 | * @hide |
| 6794 | */ |
| 6795 | public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = |
| 6796 | "search_query_thread_max_pool_size"; |
| 6797 | /** |
| 6798 | * The size of the core thread pool for shortcut refreshing in GlobalSearch. |
| 6799 | * @hide |
| 6800 | */ |
| 6801 | public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = |
| 6802 | "search_shortcut_refresh_core_pool_size"; |
| 6803 | /** |
| 6804 | * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. |
| 6805 | * @hide |
| 6806 | */ |
| 6807 | public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = |
| 6808 | "search_shortcut_refresh_max_pool_size"; |
| 6809 | /** |
| 6810 | * The maximun time that excess threads in the GlobalSeach thread pools will |
| 6811 | * wait before terminating. |
| 6812 | * @hide |
| 6813 | */ |
| 6814 | public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = |
| 6815 | "search_thread_keepalive_seconds"; |
| 6816 | /** |
| 6817 | * The maximum number of concurrent suggestion queries to each source. |
| 6818 | * @hide |
| 6819 | */ |
| 6820 | public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = |
| 6821 | "search_per_source_concurrent_query_limit"; |
| 6822 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6823 | /** |
Sudheer Shanka | 2250d56 | 2016-11-07 15:41:02 -0800 | [diff] [blame] | 6824 | * Whether or not alert sounds are played on StorageManagerService events. |
| 6825 | * (0 = false, 1 = true) |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6826 | * @hide |
| 6827 | */ |
| 6828 | public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; |
| 6829 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6830 | private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6831 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6832 | /** |
| 6833 | * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) |
| 6834 | * @hide |
| 6835 | */ |
| 6836 | public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; |
| 6837 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6838 | private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6839 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6840 | /** |
| 6841 | * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) |
| 6842 | * @hide |
| 6843 | */ |
| 6844 | public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; |
| 6845 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6846 | private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6847 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6848 | /** |
| 6849 | * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) |
| 6850 | * @hide |
| 6851 | */ |
| 6852 | public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6853 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6854 | private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6855 | |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6856 | /** |
| 6857 | * If nonzero, ANRs in invisible background processes bring up a dialog. |
| 6858 | * Otherwise, the process will be silently killed. |
Adrian Roos | 6a7e089 | 2016-08-23 14:26:39 +0200 | [diff] [blame] | 6859 | * |
| 6860 | * Also prevents ANRs and crash dialogs from being suppressed. |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6861 | * @hide |
| 6862 | */ |
| 6863 | public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6864 | |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6865 | /** |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6866 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 6867 | * Otherwise, the process will be silently killed. |
| 6868 | * @hide |
| 6869 | */ |
| 6870 | public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = |
| 6871 | "show_first_crash_dialog_dev_option"; |
| 6872 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6873 | private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR = |
| 6874 | BOOLEAN_VALIDATOR; |
| 6875 | |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6876 | /** |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6877 | * The {@link ComponentName} string of the service to be used as the voice recognition |
| 6878 | * service. |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6879 | * |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6880 | * @hide |
| 6881 | */ |
| 6882 | public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6883 | |
William Luh | 623a428 | 2013-06-24 12:14:18 -0700 | [diff] [blame] | 6884 | /** |
| 6885 | * Stores whether an user has consented to have apps verified through PAM. |
| 6886 | * The value is boolean (1 or 0). |
| 6887 | * |
| 6888 | * @hide |
| 6889 | */ |
| 6890 | public static final String PACKAGE_VERIFIER_USER_CONSENT = |
| 6891 | "package_verifier_user_consent"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6892 | |
| 6893 | /** |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6894 | * The {@link ComponentName} string of the selected spell checker service which is |
| 6895 | * one of the services managed by the text service manager. |
| 6896 | * |
| 6897 | * @hide |
| 6898 | */ |
| 6899 | public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; |
| 6900 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6901 | private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 6902 | |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6903 | /** |
| 6904 | * The {@link ComponentName} string of the selected subtype of the selected spell checker |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6905 | * service which is one of the services managed by the text service manager. |
| 6906 | * |
| 6907 | * @hide |
| 6908 | */ |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6909 | public static final String SELECTED_SPELL_CHECKER_SUBTYPE = |
| 6910 | "selected_spell_checker_subtype"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6911 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6912 | private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR = |
| 6913 | COMPONENT_NAME_VALIDATOR; |
| 6914 | |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6915 | /** |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6916 | * Whether spell checker is enabled or not. |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6917 | * |
| 6918 | * @hide |
| 6919 | */ |
| 6920 | public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; |
| 6921 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6922 | private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6923 | |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6924 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6925 | * What happens when the user presses the Power button while in-call |
| 6926 | * and the screen is on.<br/> |
| 6927 | * <b>Values:</b><br/> |
| 6928 | * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> |
| 6929 | * 2 - The Power button hangs up the current call.<br/> |
| 6930 | * |
| 6931 | * @hide |
| 6932 | */ |
| 6933 | public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; |
| 6934 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6935 | private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR = |
| 6936 | new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"}); |
| 6937 | |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6938 | /** |
| 6939 | * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". |
| 6940 | * @hide |
| 6941 | */ |
| 6942 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; |
| 6943 | |
| 6944 | /** |
| 6945 | * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". |
| 6946 | * @hide |
| 6947 | */ |
| 6948 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; |
| 6949 | |
| 6950 | /** |
| 6951 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6952 | * @hide |
| 6953 | */ |
| 6954 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = |
| 6955 | INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; |
| 6956 | |
| 6957 | /** |
Bryce Lee | db776ce | 2016-09-03 15:02:00 -0700 | [diff] [blame] | 6958 | * What happens when the user presses the Back button while in-call |
| 6959 | * and the screen is on.<br/> |
| 6960 | * <b>Values:</b><br/> |
| 6961 | * 0 - The Back buttons does nothing different.<br/> |
| 6962 | * 1 - The Back button hangs up the current call.<br/> |
| 6963 | * |
| 6964 | * @hide |
| 6965 | */ |
| 6966 | public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; |
| 6967 | |
| 6968 | /** |
| 6969 | * INCALL_BACK_BUTTON_BEHAVIOR value for no action. |
| 6970 | * @hide |
| 6971 | */ |
| 6972 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; |
| 6973 | |
| 6974 | /** |
| 6975 | * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". |
| 6976 | * @hide |
| 6977 | */ |
| 6978 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; |
| 6979 | |
| 6980 | /** |
| 6981 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6982 | * @hide |
| 6983 | */ |
| 6984 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = |
| 6985 | INCALL_BACK_BUTTON_BEHAVIOR_NONE; |
| 6986 | |
| 6987 | /** |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 6988 | * Whether the device should wake when the wake gesture sensor detects motion. |
| 6989 | * @hide |
| 6990 | */ |
| 6991 | public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; |
| 6992 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6993 | private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6994 | |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 6995 | /** |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 6996 | * Whether the device should doze if configured. |
| 6997 | * @hide |
| 6998 | */ |
| 6999 | public static final String DOZE_ENABLED = "doze_enabled"; |
| 7000 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7001 | private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7002 | |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 7003 | /** |
Adrian Roos | ebea7a7 | 2016-10-26 12:51:26 -0700 | [diff] [blame] | 7004 | * Whether doze should be always on. |
| 7005 | * @hide |
| 7006 | */ |
| 7007 | public static final String DOZE_ALWAYS_ON = "doze_always_on"; |
| 7008 | |
| 7009 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7010 | * Whether the device should pulse on pick up gesture. |
| 7011 | * @hide |
| 7012 | */ |
| 7013 | public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; |
| 7014 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7015 | private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7016 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7017 | /** |
Adrian Roos | d0963a0 | 2017-05-15 14:33:37 -0700 | [diff] [blame] | 7018 | * Whether the device should pulse on long press gesture. |
| 7019 | * @hide |
| 7020 | */ |
| 7021 | public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; |
| 7022 | |
| 7023 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7024 | * Whether the device should pulse on double tap gesture. |
| 7025 | * @hide |
| 7026 | */ |
| 7027 | public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; |
| 7028 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7029 | private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7030 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7031 | /** |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7032 | * The current night mode that has been selected by the user. Owned |
| 7033 | * and controlled by UiModeManagerService. Constants are as per |
| 7034 | * UiModeManager. |
| 7035 | * @hide |
| 7036 | */ |
| 7037 | public static final String UI_NIGHT_MODE = "ui_night_mode"; |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 7038 | |
| 7039 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7040 | * Whether screensavers are enabled. |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7041 | * @hide |
| 7042 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7043 | public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7044 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7045 | private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7046 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7047 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7048 | * The user's chosen screensaver components. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7049 | * |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7050 | * 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] | 7051 | * 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] | 7052 | * @hide |
| 7053 | */ |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7054 | public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7055 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7056 | private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR = |
| 7057 | new SettingsValidators.ComponentNameListValidator(","); |
| 7058 | |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7059 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7060 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 7061 | * when the device is inserted into a (desk) dock. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 7062 | * @hide |
| 7063 | */ |
| 7064 | public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7065 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7066 | private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7067 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7068 | /** |
| 7069 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 7070 | * when the screen times out when not on battery. |
| 7071 | * @hide |
| 7072 | */ |
| 7073 | public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; |
| 7074 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7075 | private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7076 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 7077 | /** |
| 7078 | * If screensavers are enabled, the default screensaver component. |
| 7079 | * @hide |
| 7080 | */ |
| 7081 | public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; |
| 7082 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 7083 | /** |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 7084 | * The default NFC payment component |
| 7085 | * @hide |
| 7086 | */ |
| 7087 | public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; |
| 7088 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7089 | private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR = |
| 7090 | COMPONENT_NAME_VALIDATOR; |
| 7091 | |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 7092 | /** |
Martijn Coenen | 2f6f3a01 | 2014-04-25 17:00:21 -0700 | [diff] [blame] | 7093 | * Whether NFC payment is handled by the foreground application or a default. |
| 7094 | * @hide |
| 7095 | */ |
| 7096 | public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; |
| 7097 | |
| 7098 | /** |
David Braun | f5d8319 | 2013-09-16 13:43:51 -0700 | [diff] [blame] | 7099 | * Specifies the package name currently configured to be the primary sms application |
| 7100 | * @hide |
| 7101 | */ |
| 7102 | public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; |
| 7103 | |
| 7104 | /** |
Yorke Lee | 014de02 | 2015-04-21 17:15:47 -0700 | [diff] [blame] | 7105 | * Specifies the package name currently configured to be the default dialer application |
| 7106 | * @hide |
| 7107 | */ |
| 7108 | public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; |
| 7109 | |
| 7110 | /** |
Adrian Roos | 943eb86 | 2015-03-26 12:31:16 -0700 | [diff] [blame] | 7111 | * Specifies the package name currently configured to be the emergency assistance application |
| 7112 | * |
| 7113 | * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE |
| 7114 | * |
| 7115 | * @hide |
| 7116 | */ |
| 7117 | public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; |
| 7118 | |
| 7119 | /** |
Jorim Jaggi | 9d91083 | 2015-05-18 17:35:26 -0700 | [diff] [blame] | 7120 | * Specifies whether the current app context on scren (assist data) will be sent to the |
| 7121 | * assist application (active voice interaction service). |
| 7122 | * |
| 7123 | * @hide |
| 7124 | */ |
| 7125 | public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; |
| 7126 | |
| 7127 | /** |
Jorim Jaggi | a133f0b | 2015-06-26 16:40:00 -0700 | [diff] [blame] | 7128 | * Specifies whether a screenshot of the screen contents will be sent to the assist |
| 7129 | * application (active voice interaction service). |
| 7130 | * |
| 7131 | * @hide |
| 7132 | */ |
| 7133 | public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; |
| 7134 | |
| 7135 | /** |
Adrian Roos | 2335bd6 | 2016-08-11 15:42:40 -0700 | [diff] [blame] | 7136 | * Specifies whether the screen will show an animation if screen contents are sent to the |
| 7137 | * assist application (active voice interaction service). |
| 7138 | * |
| 7139 | * Note that the disclosure will be forced for third-party assistants or if the device |
| 7140 | * does not support disabling it. |
| 7141 | * |
| 7142 | * @hide |
| 7143 | */ |
| 7144 | public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; |
| 7145 | |
| 7146 | /** |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7147 | * Control if rotation suggestions are sent to System UI when in rotation locked mode. |
| 7148 | * Done to enable screen rotation while the the screen rotation is locked. Enabling will |
| 7149 | * poll the accelerometer in rotation locked mode. |
| 7150 | * |
| 7151 | * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. |
| 7152 | * |
| 7153 | * @hide |
| 7154 | */ |
| 7155 | |
| 7156 | public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; |
| 7157 | |
| 7158 | /** |
| 7159 | * The disabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7160 | * @hide |
| 7161 | */ |
| 7162 | public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; |
| 7163 | |
| 7164 | /** |
| 7165 | * The enabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7166 | * @hide |
| 7167 | */ |
| 7168 | public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; |
| 7169 | |
| 7170 | /** |
| 7171 | * The default state of SHOW_ROTATION_SUGGESTIONS. |
| 7172 | * @hide |
| 7173 | */ |
| 7174 | public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = |
Mike Digman | 02856ba | 2018-01-16 11:21:23 -0800 | [diff] [blame] | 7175 | SHOW_ROTATION_SUGGESTIONS_ENABLED; |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7176 | |
| 7177 | /** |
Mike Digman | 5075264 | 2018-02-15 13:36:09 -0800 | [diff] [blame] | 7178 | * The number of accepted rotation suggestions. Used to determine if the user has been |
| 7179 | * introduced to rotation suggestions. |
| 7180 | * @hide |
| 7181 | */ |
| 7182 | public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = |
| 7183 | "num_rotation_suggestions_accepted"; |
| 7184 | |
| 7185 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7186 | * 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] | 7187 | * see and assist with all of the user's notifications. |
| 7188 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7189 | * @deprecated Use |
| 7190 | * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7191 | * @hide |
| 7192 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7193 | @Deprecated |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7194 | public static final String ENABLED_NOTIFICATION_ASSISTANT = |
| 7195 | "enabled_notification_assistant"; |
| 7196 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7197 | private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR = |
| 7198 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7199 | |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7200 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7201 | * 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] | 7202 | * see all of the user's notifications, separated by ':'. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7203 | * |
| 7204 | * @hide |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7205 | * @deprecated Use |
| 7206 | * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7207 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7208 | @Deprecated |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7209 | public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; |
| 7210 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7211 | private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR = |
| 7212 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7213 | |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 7214 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7215 | * Read only list of the packages that the current user has explicitly allowed to |
| 7216 | * manage do not disturb, separated by ':'. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7217 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7218 | * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7219 | * @hide |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7220 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7221 | @Deprecated |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7222 | @TestApi |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7223 | public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = |
| 7224 | "enabled_notification_policy_access_packages"; |
| 7225 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7226 | private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR = |
| 7227 | new SettingsValidators.PackageNameListValidator(":"); |
| 7228 | |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7229 | /** |
| 7230 | * Defines whether managed profile ringtones should be synced from it's parent profile |
| 7231 | * <p> |
| 7232 | * 0 = ringtones are not synced |
| 7233 | * 1 = ringtones are synced from the profile's parent (default) |
| 7234 | * <p> |
| 7235 | * This value is only used for managed profiles. |
| 7236 | * @hide |
| 7237 | */ |
Robin Lee | c74d85f | 2017-03-16 17:19:42 +0000 | [diff] [blame] | 7238 | @TestApi |
| 7239 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7240 | public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; |
| 7241 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7242 | private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7243 | |
John Spurlock | cdb57ae | 2015-02-11 19:04:11 -0500 | [diff] [blame] | 7244 | /** @hide */ |
John Spurlock | f1a3664 | 2013-10-12 17:50:42 -0400 | [diff] [blame] | 7245 | public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; |
John Spurlock | d67ec25 | 2013-09-05 11:31:54 -0400 | [diff] [blame] | 7246 | |
Yorke Lee | 647f8f3 | 2013-05-07 10:49:44 -0700 | [diff] [blame] | 7247 | /** |
Svetoslav | f43e851 | 2013-09-30 17:33:05 -0700 | [diff] [blame] | 7248 | * This is the query URI for finding a print service to install. |
| 7249 | * |
| 7250 | * @hide |
| 7251 | */ |
| 7252 | public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; |
| 7253 | |
| 7254 | /** |
| 7255 | * This is the query URI for finding a NFC payment service to install. |
| 7256 | * |
| 7257 | * @hide |
| 7258 | */ |
| 7259 | public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; |
| 7260 | |
| 7261 | /** |
Philip P. Moltmann | a30d6e0 | 2017-04-27 15:40:02 -0700 | [diff] [blame] | 7262 | * This is the query URI for finding a auto fill service to install. |
| 7263 | * |
| 7264 | * @hide |
| 7265 | */ |
| 7266 | public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; |
| 7267 | |
| 7268 | /** |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7269 | * 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] | 7270 | * 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] | 7271 | * <p> |
| 7272 | * Type : int (0 to show hints, 1 to skip showing hints) |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7273 | */ |
| 7274 | public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; |
| 7275 | |
| 7276 | /** |
John Spurlock | aa5ee4d | 2014-07-25 13:05:12 -0400 | [diff] [blame] | 7277 | * Persisted playback time after a user confirmation of an unsafe volume level. |
| 7278 | * |
| 7279 | * @hide |
| 7280 | */ |
| 7281 | public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; |
| 7282 | |
| 7283 | /** |
Dan Sandler | 52e5701e | 2014-07-22 23:14:54 -0400 | [diff] [blame] | 7284 | * This preference enables notification display on the lockscreen. |
| 7285 | * @hide |
| 7286 | */ |
| 7287 | public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = |
| 7288 | "lock_screen_show_notifications"; |
| 7289 | |
| 7290 | /** |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7291 | * List of TV inputs that are currently hidden. This is a string |
Jaewan Kim | f0e530e | 2014-08-22 00:43:31 +0900 | [diff] [blame] | 7292 | * containing the IDs of all hidden TV inputs. Each ID is encoded by |
| 7293 | * {@link android.net.Uri#encode(String)} and separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7294 | * @hide |
| 7295 | */ |
| 7296 | public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; |
| 7297 | |
| 7298 | /** |
| 7299 | * 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] | 7300 | * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} |
| 7301 | * and separated by ','. Each pair is separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7302 | * @hide |
| 7303 | */ |
| 7304 | public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; |
| 7305 | |
| 7306 | /** |
Glenn Kasten | 34cc4db | 2014-08-13 10:56:38 -0700 | [diff] [blame] | 7307 | * Whether automatic routing of system audio to USB audio peripheral is disabled. |
| 7308 | * The value is boolean (1 or 0), where 1 means automatic routing is disabled, |
| 7309 | * and 0 means automatic routing is enabled. |
| 7310 | * |
| 7311 | * @hide |
| 7312 | */ |
| 7313 | public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = |
| 7314 | "usb_audio_automatic_routing_disabled"; |
| 7315 | |
| 7316 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7317 | * The timeout in milliseconds before the device fully goes to sleep after |
| 7318 | * a period of inactivity. This value sets an upper bound on how long the device |
| 7319 | * will stay awake or dreaming without user activity. It should generally |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 7320 | * 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] | 7321 | * will sleep before it ever has a chance to dream. |
| 7322 | * <p> |
| 7323 | * Use -1 to disable this timeout. |
| 7324 | * </p> |
| 7325 | * |
| 7326 | * @hide |
| 7327 | */ |
| 7328 | public static final String SLEEP_TIMEOUT = "sleep_timeout"; |
| 7329 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7330 | private static final Validator SLEEP_TIMEOUT_VALIDATOR = |
| 7331 | new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE); |
| 7332 | |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7333 | /** |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7334 | * Controls whether double tap to wake is enabled. |
| 7335 | * @hide |
| 7336 | */ |
| 7337 | public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; |
| 7338 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7339 | private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7340 | |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7341 | /** |
Xiyuan Xia | e6de8b9 | 2015-06-06 22:18:05 -0700 | [diff] [blame] | 7342 | * The current assistant component. It could be a voice interaction service, |
| 7343 | * or an activity that handles ACTION_ASSIST, or empty which means using the default |
| 7344 | * handling. |
| 7345 | * |
| 7346 | * @hide |
| 7347 | */ |
| 7348 | public static final String ASSISTANT = "assistant"; |
| 7349 | |
| 7350 | /** |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7351 | * Whether the camera launch gesture should be disabled. |
| 7352 | * |
| 7353 | * @hide |
| 7354 | */ |
| 7355 | public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; |
| 7356 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7357 | private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7358 | |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7359 | /** |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7360 | * Whether the camera launch gesture to double tap the power button when the screen is off |
| 7361 | * should be disabled. |
| 7362 | * |
| 7363 | * @hide |
| 7364 | */ |
| 7365 | public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = |
| 7366 | "camera_double_tap_power_gesture_disabled"; |
| 7367 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7368 | private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR = |
| 7369 | BOOLEAN_VALIDATOR; |
| 7370 | |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7371 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7372 | * Whether the camera double twist gesture to flip between front and back mode should be |
| 7373 | * enabled. |
| 7374 | * |
| 7375 | * @hide |
| 7376 | */ |
| 7377 | public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = |
| 7378 | "camera_double_twist_to_flip_enabled"; |
| 7379 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7380 | private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR = |
| 7381 | BOOLEAN_VALIDATOR; |
| 7382 | |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7383 | /** |
Daniel Sheng | 45e0d34 | 2017-04-17 17:27:22 -0700 | [diff] [blame] | 7384 | * Whether or not the smart camera lift trigger that launches the camera when the user moves |
| 7385 | * the phone into a position for taking photos should be enabled. |
| 7386 | * |
| 7387 | * @hide |
| 7388 | */ |
| 7389 | public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; |
| 7390 | |
| 7391 | /** |
Daniel Sheng | 834e572 | 2017-05-30 09:28:52 -0700 | [diff] [blame] | 7392 | * The default enable state of the camera lift trigger. |
| 7393 | * |
| 7394 | * @hide |
| 7395 | */ |
| 7396 | public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; |
| 7397 | |
| 7398 | /** |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7399 | * Whether the assist gesture should be enabled. |
| 7400 | * |
| 7401 | * @hide |
| 7402 | */ |
| 7403 | public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; |
| 7404 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7405 | private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR = |
| 7406 | BOOLEAN_VALIDATOR; |
| 7407 | |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7408 | /** |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7409 | * Sensitivity control for the assist gesture. |
| 7410 | * |
| 7411 | * @hide |
| 7412 | */ |
| 7413 | public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; |
| 7414 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7415 | private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR = |
| 7416 | new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f); |
| 7417 | |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7418 | /** |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7419 | * Whether the assist gesture should silence alerts. |
| 7420 | * |
| 7421 | * @hide |
| 7422 | */ |
| 7423 | public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = |
| 7424 | "assist_gesture_silence_alerts_enabled"; |
| 7425 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7426 | private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR = |
| 7427 | BOOLEAN_VALIDATOR; |
| 7428 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7429 | /** |
| 7430 | * Whether the assist gesture should wake the phone. |
| 7431 | * |
| 7432 | * @hide |
| 7433 | */ |
| 7434 | public static final String ASSIST_GESTURE_WAKE_ENABLED = |
| 7435 | "assist_gesture_wake_enabled"; |
| 7436 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7437 | private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR = |
| 7438 | BOOLEAN_VALIDATOR; |
| 7439 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7440 | /** |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7441 | * Whether Assist Gesture Deferred Setup has been completed |
| 7442 | * |
| 7443 | * @hide |
| 7444 | */ |
| 7445 | public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; |
| 7446 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7447 | private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7448 | |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7449 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7450 | * Control whether Night display is currently activated. |
| 7451 | * @hide |
| 7452 | */ |
| 7453 | public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; |
| 7454 | |
| 7455 | /** |
| 7456 | * Control whether Night display will automatically activate/deactivate. |
| 7457 | * @hide |
| 7458 | */ |
| 7459 | public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; |
| 7460 | |
Christine Franks | eafb541 | 2018-02-06 11:09:39 -0800 | [diff] [blame] | 7461 | private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR = |
| 7462 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7463 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7464 | /** |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7465 | * Control the color temperature of Night Display, represented in Kelvin. |
| 7466 | * @hide |
| 7467 | */ |
| 7468 | public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = |
| 7469 | "night_display_color_temperature"; |
| 7470 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7471 | private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR = |
| 7472 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7473 | |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7474 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7475 | * Custom time when Night display is scheduled to activate. |
| 7476 | * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). |
| 7477 | * @hide |
| 7478 | */ |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7479 | public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = |
| 7480 | "night_display_custom_start_time"; |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7481 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7482 | private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR = |
| 7483 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7484 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7485 | /** |
| 7486 | * Custom time when Night display is scheduled to deactivate. |
| 7487 | * Represented as milliseconds from midnight (e.g. 21600000 == 6am). |
| 7488 | * @hide |
| 7489 | */ |
| 7490 | 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] | 7491 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7492 | private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR = |
| 7493 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7494 | |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 7495 | /** |
Christine Franks | 0321346 | 2017-08-25 13:57:26 -0700 | [diff] [blame] | 7496 | * A String representing the LocalDateTime when Night display was last activated. Use to |
| 7497 | * decide whether to apply the current activated state after a reboot or user change. In |
| 7498 | * legacy cases, this is represented by the time in milliseconds (since epoch). |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7499 | * @hide |
| 7500 | */ |
| 7501 | public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = |
| 7502 | "night_display_last_activated_time"; |
| 7503 | |
| 7504 | /** |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7505 | * Names of the service components that the current user has explicitly allowed to |
| 7506 | * be a VR mode listener, separated by ':'. |
| 7507 | * |
| 7508 | * @hide |
| 7509 | */ |
| 7510 | public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; |
| 7511 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7512 | private static final Validator ENABLED_VR_LISTENERS_VALIDATOR = |
| 7513 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7514 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7515 | /** |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7516 | * Behavior of the display while in VR mode. |
| 7517 | * |
| 7518 | * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. |
| 7519 | * |
| 7520 | * @hide |
| 7521 | */ |
| 7522 | public static final String VR_DISPLAY_MODE = "vr_display_mode"; |
| 7523 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7524 | private static final Validator VR_DISPLAY_MODE_VALIDATOR = |
| 7525 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"}); |
| 7526 | |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7527 | /** |
| 7528 | * Lower the display persistence while the system is in VR mode. |
| 7529 | * |
| 7530 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7531 | * |
| 7532 | * @hide. |
| 7533 | */ |
| 7534 | public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; |
| 7535 | |
| 7536 | /** |
| 7537 | * Do not alter the display persistence while the system is in VR mode. |
| 7538 | * |
| 7539 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7540 | * |
| 7541 | * @hide. |
| 7542 | */ |
| 7543 | public static final int VR_DISPLAY_MODE_OFF = 1; |
| 7544 | |
| 7545 | /** |
Jeff Davidson | 24b9d96 | 2016-07-21 12:35:10 -0700 | [diff] [blame] | 7546 | * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least |
| 7547 | * once. |
| 7548 | * |
| 7549 | * <p>This is used to ensure that we only take one pass which will disable apps that are not |
| 7550 | * privileged (if any). From then on, we only want to enable apps (when a matching SIM is |
| 7551 | * inserted), to avoid disabling an app that the user might actively be using. |
| 7552 | * |
| 7553 | * <p>Will be set to 1 once executed. |
| 7554 | * |
| 7555 | * @hide |
| 7556 | */ |
| 7557 | public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; |
| 7558 | |
| 7559 | /** |
Tony Mak | c820cc5 | 2016-05-03 18:58:28 +0100 | [diff] [blame] | 7560 | * Whether parent user can access remote contact in managed profile. |
| 7561 | * |
| 7562 | * @hide |
| 7563 | */ |
| 7564 | public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = |
| 7565 | "managed_profile_contact_remote_search"; |
| 7566 | |
| 7567 | /** |
Daniel Nishi | 395d387 | 2016-05-23 13:25:21 -0700 | [diff] [blame] | 7568 | * Whether or not the automatic storage manager is enabled and should run on the device. |
| 7569 | * |
| 7570 | * @hide |
| 7571 | */ |
| 7572 | public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = |
| 7573 | "automatic_storage_manager_enabled"; |
| 7574 | |
| 7575 | /** |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7576 | * How many days of information for the automatic storage manager to retain on the device. |
| 7577 | * |
| 7578 | * @hide |
| 7579 | */ |
| 7580 | public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = |
| 7581 | "automatic_storage_manager_days_to_retain"; |
| 7582 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7583 | private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR = |
| 7584 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7585 | |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7586 | /** |
| 7587 | * Default number of days of information for the automatic storage manager to retain. |
| 7588 | * |
| 7589 | * @hide |
| 7590 | */ |
| 7591 | public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; |
| 7592 | |
| 7593 | /** |
Daniel Nishi | f678cc9 | 2016-06-24 15:49:25 -0700 | [diff] [blame] | 7594 | * How many bytes the automatic storage manager has cleared out. |
| 7595 | * |
| 7596 | * @hide |
| 7597 | */ |
| 7598 | public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = |
| 7599 | "automatic_storage_manager_bytes_cleared"; |
| 7600 | |
| 7601 | |
| 7602 | /** |
| 7603 | * Last run time for the automatic storage manager. |
| 7604 | * |
| 7605 | * @hide |
| 7606 | */ |
| 7607 | public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = |
| 7608 | "automatic_storage_manager_last_run"; |
| 7609 | |
Jorge Gil | 6825a77 | 2016-06-30 11:07:18 -0700 | [diff] [blame] | 7610 | /** |
Daniel Nishi | da7332c | 2017-06-12 10:17:33 -0700 | [diff] [blame] | 7611 | * If the automatic storage manager has been disabled by policy. Note that this doesn't |
| 7612 | * mean that the automatic storage manager is prevented from being re-enabled -- this only |
| 7613 | * means that it was turned off by policy at least once. |
| 7614 | * |
| 7615 | * @hide |
| 7616 | */ |
| 7617 | public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = |
| 7618 | "automatic_storage_manager_turned_off_by_policy"; |
| 7619 | |
| 7620 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7621 | * Whether SystemUI navigation keys is enabled. |
| 7622 | * @hide |
| 7623 | */ |
| 7624 | public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = |
| 7625 | "system_navigation_keys_enabled"; |
| 7626 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7627 | private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7628 | |
Allison Babick | f0bc866 | 2016-07-11 15:39:16 -0700 | [diff] [blame] | 7629 | /** |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7630 | * Holds comma separated list of ordering of QS tiles. |
| 7631 | * @hide |
| 7632 | */ |
| 7633 | public static final String QS_TILES = "sysui_qs_tiles"; |
| 7634 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7635 | private static final Validator QS_TILES_VALIDATOR = new Validator() { |
| 7636 | @Override |
| 7637 | public boolean validate(String value) { |
| 7638 | if (value == null) { |
| 7639 | return false; |
| 7640 | } |
| 7641 | String[] tiles = value.split(","); |
| 7642 | boolean valid = true; |
| 7643 | for (String tile : tiles) { |
| 7644 | // tile can be any non-empty string as specified by OEM |
| 7645 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7646 | } |
| 7647 | return valid; |
| 7648 | } |
| 7649 | }; |
| 7650 | |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7651 | /** |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7652 | * Specifies whether the web action API is enabled. |
| 7653 | * |
| 7654 | * @hide |
| 7655 | */ |
Jesse Evans | fc1bfc4 | 2017-04-07 16:11:26 -0700 | [diff] [blame] | 7656 | @SystemApi |
| 7657 | public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7658 | |
| 7659 | /** |
Greg Plesur | 3514404 | 2016-10-10 16:23:49 -0400 | [diff] [blame] | 7660 | * Has this pairable device been paired or upgraded from a previously paired system. |
| 7661 | * @hide |
| 7662 | */ |
| 7663 | public static final String DEVICE_PAIRED = "device_paired"; |
| 7664 | |
| 7665 | /** |
Shahriyar Amini | 9343f57 | 2017-01-12 12:03:24 -0800 | [diff] [blame] | 7666 | * Integer state indicating whether package verifier is enabled. |
| 7667 | * TODO(b/34259924): Remove this setting. |
| 7668 | * |
| 7669 | * @hide |
| 7670 | */ |
| 7671 | public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; |
| 7672 | |
| 7673 | /** |
Jack Yu | 3902857 | 2017-02-23 09:49:25 -0800 | [diff] [blame] | 7674 | * Specifies additional package name for broadcasting the CMAS messages. |
| 7675 | * @hide |
| 7676 | */ |
| 7677 | public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; |
| 7678 | |
| 7679 | /** |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7680 | * Whether the launcher should show any notification badges. |
| 7681 | * The value is boolean (1 or 0). |
| 7682 | * @hide |
| 7683 | */ |
| 7684 | public static final String NOTIFICATION_BADGING = "notification_badging"; |
| 7685 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7686 | private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7687 | |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7688 | /** |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7689 | * Comma separated list of QS tiles that have been auto-added already. |
| 7690 | * @hide |
| 7691 | */ |
| 7692 | public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; |
| 7693 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7694 | private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() { |
| 7695 | @Override |
| 7696 | public boolean validate(String value) { |
| 7697 | if (value == null) { |
| 7698 | return false; |
| 7699 | } |
| 7700 | String[] tiles = value.split(","); |
| 7701 | boolean valid = true; |
| 7702 | for (String tile : tiles) { |
| 7703 | // tile can be any non-empty string as specified by OEM |
| 7704 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7705 | } |
| 7706 | return valid; |
| 7707 | } |
| 7708 | }; |
| 7709 | |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7710 | /** |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7711 | * Whether the Lockdown button should be shown in the power menu. |
| 7712 | * @hide |
| 7713 | */ |
| 7714 | public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7715 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7716 | private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7717 | |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7718 | /** |
| 7719 | * Backup manager behavioral parameters. |
| 7720 | * This is encoded as a key=value list, separated by commas. Ex: |
| 7721 | * |
| 7722 | * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" |
| 7723 | * |
| 7724 | * The following keys are supported: |
| 7725 | * |
| 7726 | * <pre> |
| 7727 | * key_value_backup_interval_milliseconds (long) |
| 7728 | * key_value_backup_fuzz_milliseconds (long) |
| 7729 | * key_value_backup_require_charging (boolean) |
| 7730 | * key_value_backup_required_network_type (int) |
| 7731 | * full_backup_interval_milliseconds (long) |
| 7732 | * full_backup_require_charging (boolean) |
| 7733 | * full_backup_required_network_type (int) |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7734 | * backup_finished_notification_receivers (String[]) |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7735 | * </pre> |
| 7736 | * |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7737 | * backup_finished_notification_receivers uses ":" as delimeter for values. |
| 7738 | * |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7739 | * <p> |
| 7740 | * Type: string |
| 7741 | * @hide |
| 7742 | */ |
| 7743 | public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; |
| 7744 | |
Bernardo Rufino | eaa78b9 | 2018-01-26 11:25:37 +0000 | [diff] [blame] | 7745 | |
| 7746 | /** |
| 7747 | * Local transport parameters so we can configure it for tests. |
| 7748 | * This is encoded as a key=value list, separated by commas. |
| 7749 | * |
| 7750 | * The following keys are supported: |
| 7751 | * |
| 7752 | * <pre> |
| 7753 | * fake_encryption_flag (boolean) |
| 7754 | * </pre> |
| 7755 | * |
| 7756 | * <p> |
| 7757 | * Type: string |
| 7758 | * @hide |
| 7759 | */ |
| 7760 | public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = |
| 7761 | "backup_local_transport_parameters"; |
| 7762 | |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7763 | /** |
Daniel Nishi | 79764127 | 2018-01-02 16:48:33 -0800 | [diff] [blame] | 7764 | * Flag to set if the system should predictively attempt to re-enable Bluetooth while |
| 7765 | * the user is driving. |
| 7766 | * @hide |
| 7767 | */ |
| 7768 | public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; |
| 7769 | |
| 7770 | /** |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 7771 | * What behavior should be invoked when the volume hush gesture is triggered |
| 7772 | * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. |
| 7773 | * |
| 7774 | * @hide |
| 7775 | */ |
| 7776 | public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; |
| 7777 | |
| 7778 | /** @hide */ public static final int VOLUME_HUSH_OFF = 0; |
| 7779 | /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1; |
| 7780 | /** @hide */ public static final int VOLUME_HUSH_MUTE = 2; |
| 7781 | |
| 7782 | private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR = |
| 7783 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7784 | |
| 7785 | /** |
Makoto Onuki | 16a0dd2 | 2018-03-20 10:40:37 -0700 | [diff] [blame] | 7786 | * The number of times (integer) the user has manually enabled battery saver. |
| 7787 | * @hide |
| 7788 | */ |
| 7789 | public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = |
| 7790 | "low_power_manual_activation_count"; |
| 7791 | |
| 7792 | /** |
| 7793 | * Whether the "first time battery saver warning" dialog needs to be shown (0: default) |
| 7794 | * or not (1). |
| 7795 | * |
| 7796 | * @hide |
| 7797 | */ |
| 7798 | public static final String LOW_POWER_WARNING_ACKNOWLEDGED = |
| 7799 | "low_power_warning_acknowledged"; |
| 7800 | |
| 7801 | /** |
Makoto Onuki | 52c6295 | 2018-03-22 10:43:03 -0700 | [diff] [blame] | 7802 | * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been |
| 7803 | * suppressed. |
| 7804 | * @hide |
| 7805 | */ |
| 7806 | public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = |
| 7807 | "suppress_auto_battery_saver_suggestion"; |
| 7808 | |
| 7809 | /** |
Artem Iglikov | 5b53875 | 2018-03-27 15:12:18 +0100 | [diff] [blame] | 7810 | * List of packages, which data need to be unconditionally cleared before full restore. |
| 7811 | * Type: string |
| 7812 | * @hide |
| 7813 | */ |
| 7814 | public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = |
| 7815 | "packages_to_clear_data_before_full_restore"; |
| 7816 | |
| 7817 | /** |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7818 | * This are the settings to be backed up. |
| 7819 | * |
| 7820 | * NOTE: Settings are backed up and restored in the order they appear |
| 7821 | * in this array. If you have one setting depending on another, |
| 7822 | * make sure that they are ordered appropriately. |
| 7823 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7824 | * @hide |
| 7825 | */ |
| 7826 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 7827 | BUGREPORT_IN_POWER_MENU, // moved to global |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 7828 | ALLOW_MOCK_LOCATION, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7829 | USB_MASS_STORAGE_ENABLED, // moved to global |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7830 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7831 | ACCESSIBILITY_DISPLAY_DALTONIZER, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7832 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7833 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 7834 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
Svetoslav Ganov | d8561a2 | 2017-04-25 15:26:03 -0700 | [diff] [blame] | 7835 | AUTOFILL_SERVICE, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7836 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7837 | ENABLED_ACCESSIBILITY_SERVICES, |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7838 | ENABLED_VR_LISTENERS, |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 7839 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
Svetoslav Ganov | a28a16d | 2011-07-28 11:24:21 -0700 | [diff] [blame] | 7840 | TOUCH_EXPLORATION_ENABLED, |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7841 | ACCESSIBILITY_ENABLED, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7842 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 7843 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7844 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 7845 | ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7846 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 7847 | ACCESSIBILITY_SPEAK_PASSWORD, |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 7848 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7849 | ACCESSIBILITY_CAPTIONING_PRESET, |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 7850 | ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7851 | ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7852 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7853 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7854 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7855 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7856 | ACCESSIBILITY_CAPTIONING_TYPEFACE, |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 7857 | ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7858 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7859 | TTS_DEFAULT_RATE, |
| 7860 | TTS_DEFAULT_PITCH, |
| 7861 | TTS_DEFAULT_SYNTH, |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 7862 | TTS_ENABLED_PLUGINS, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 7863 | TTS_DEFAULT_LOCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7864 | SHOW_IME_WITH_HARD_KEYBOARD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7865 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global |
| 7866 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global |
| 7867 | WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global |
Christopher Tate | 06cbadd | 2015-03-16 18:29:42 -0700 | [diff] [blame] | 7868 | SELECTED_SPELL_CHECKER, |
| 7869 | SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7870 | SPELL_CHECKER_ENABLED, |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 7871 | MOUNT_PLAY_NOTIFICATION_SND, |
| 7872 | MOUNT_UMS_AUTOSTART, |
| 7873 | MOUNT_UMS_PROMPT, |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7874 | MOUNT_UMS_NOTIFY_ENABLED, |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7875 | SLEEP_TIMEOUT, |
| 7876 | DOUBLE_TAP_TO_WAKE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7877 | WAKE_GESTURE_ENABLED, |
| 7878 | LONG_PRESS_TIMEOUT, |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7879 | CAMERA_GESTURE_DISABLED, |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 7880 | ACCESSIBILITY_AUTOCLICK_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7881 | ACCESSIBILITY_AUTOCLICK_DELAY, |
| 7882 | ACCESSIBILITY_LARGE_POINTER_ICON, |
| 7883 | PREFERRED_TTY_MODE, |
| 7884 | ENHANCED_VOICE_PRIVACY_ENABLED, |
| 7885 | TTY_MODE_ENABLED, |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 7886 | RTT_CALLING_MODE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7887 | INCALL_POWER_BUTTON_BEHAVIOR, |
| 7888 | NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 7889 | NIGHT_DISPLAY_CUSTOM_END_TIME, |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7890 | NIGHT_DISPLAY_COLOR_TEMPERATURE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7891 | NIGHT_DISPLAY_AUTO_MODE, |
Doris Ling | 5fafa3c | 2016-08-26 15:00:49 -0700 | [diff] [blame] | 7892 | SYNC_PARENT_SOUNDS, |
Doris Ling | 8a33273 | 2016-08-24 15:05:43 -0700 | [diff] [blame] | 7893 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 7894 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7895 | SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 7896 | QS_TILES, |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7897 | DOZE_ENABLED, |
| 7898 | DOZE_PULSE_ON_PICK_UP, |
Ruchi Kandoi | 104e0b4 | 2016-12-29 13:31:43 -0800 | [diff] [blame] | 7899 | DOZE_PULSE_ON_DOUBLE_TAP, |
Daniel Nishi | eb70ad4 | 2017-01-27 10:51:35 -0800 | [diff] [blame] | 7900 | NFC_PAYMENT_DEFAULT_COMPONENT, |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7901 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
Santos Cordon | 5bce494 | 2017-02-27 11:50:18 -0800 | [diff] [blame] | 7902 | ASSIST_GESTURE_ENABLED, |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7903 | ASSIST_GESTURE_SENSITIVITY, |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7904 | ASSIST_GESTURE_SETUP_COMPLETE, |
| 7905 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 7906 | ASSIST_GESTURE_WAKE_ENABLED, |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7907 | VR_DISPLAY_MODE, |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7908 | NOTIFICATION_BADGING, |
| 7909 | QS_AUTO_ADDED_TILES, |
Jason Monk | df31eff | 2017-07-10 11:14:19 -0400 | [diff] [blame] | 7910 | SCREENSAVER_ENABLED, |
| 7911 | SCREENSAVER_COMPONENTS, |
| 7912 | SCREENSAVER_ACTIVATE_ON_DOCK, |
| 7913 | SCREENSAVER_ACTIVATE_ON_SLEEP, |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7914 | LOCKDOWN_IN_POWER_MENU, |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 7915 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 7916 | VOLUME_HUSH_GESTURE |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7917 | }; |
| 7918 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7919 | /** |
| 7920 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 7921 | * otherwise they won't be restored. |
| 7922 | * |
| 7923 | * @hide |
| 7924 | */ |
| 7925 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 7926 | static { |
| 7927 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 7928 | VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR); |
| 7929 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 7930 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7931 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR); |
| 7932 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, |
| 7933 | ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR); |
| 7934 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
| 7935 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR); |
| 7936 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
| 7937 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR); |
| 7938 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
| 7939 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR); |
| 7940 | VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); |
| 7941 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
| 7942 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR); |
| 7943 | VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, |
| 7944 | ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7945 | VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7946 | VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
| 7947 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7948 | VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR); |
| 7949 | VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR); |
| 7950 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
| 7951 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR); |
| 7952 | VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
| 7953 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR); |
| 7954 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
| 7955 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR); |
| 7956 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7957 | ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR); |
| 7958 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
| 7959 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR); |
| 7960 | VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR); |
| 7961 | VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
| 7962 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR); |
| 7963 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, |
| 7964 | ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR); |
| 7965 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7966 | ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR); |
| 7967 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7968 | ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR); |
| 7969 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7970 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR); |
| 7971 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7972 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR); |
| 7973 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7974 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR); |
| 7975 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7976 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR); |
| 7977 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, |
| 7978 | ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR); |
| 7979 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
| 7980 | ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR); |
| 7981 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
| 7982 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR); |
| 7983 | VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR); |
| 7984 | VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR); |
| 7985 | VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR); |
| 7986 | VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR); |
| 7987 | VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR); |
| 7988 | VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR); |
| 7989 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 7990 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 7991 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, |
| 7992 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR); |
| 7993 | VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR); |
| 7994 | VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR); |
| 7995 | VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7996 | SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR); |
| 7997 | VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR); |
| 7998 | VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR); |
| 7999 | VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR); |
| 8000 | VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR); |
| 8001 | VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR); |
| 8002 | VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR); |
| 8003 | VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR); |
| 8004 | VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR); |
| 8005 | VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR); |
| 8006 | VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR); |
| 8007 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, |
| 8008 | ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR); |
| 8009 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR); |
| 8010 | VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, |
| 8011 | ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR); |
| 8012 | VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR); |
| 8013 | VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, |
| 8014 | ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR); |
| 8015 | VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR); |
Hall Liu | 44e4101 | 2018-04-02 15:41:07 -0700 | [diff] [blame] | 8016 | VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 8017 | VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR); |
| 8018 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 8019 | NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR); |
| 8020 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR); |
| 8021 | VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, |
| 8022 | NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR); |
| 8023 | VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR); |
| 8024 | VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR); |
| 8025 | VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 8026 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR); |
| 8027 | VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
| 8028 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR); |
| 8029 | VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 8030 | SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR); |
| 8031 | VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR); |
| 8032 | VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR); |
| 8033 | VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR); |
| 8034 | VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR); |
| 8035 | VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR); |
| 8036 | VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
| 8037 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR); |
| 8038 | VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR); |
| 8039 | VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR); |
| 8040 | VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR); |
| 8041 | VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 8042 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR); |
| 8043 | VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR); |
| 8044 | VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR); |
| 8045 | VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR); |
| 8046 | VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR); |
| 8047 | VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR); |
| 8048 | VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR); |
| 8049 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR); |
| 8050 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR); |
| 8051 | VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR); |
| 8052 | VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
| 8053 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR); |
Mike Digman | 5527286 | 2018-02-20 14:35:17 -0800 | [diff] [blame] | 8054 | VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR); |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 8055 | VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, |
| 8056 | ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting |
| 8057 | VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, |
| 8058 | ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting |
| 8059 | VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, |
| 8060 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting |
| 8061 | } |
| 8062 | |
| 8063 | /** |
| 8064 | * Keys we no longer back up under the current schema, but want to continue to |
| 8065 | * process when restoring historical backup datasets. |
| 8066 | * |
| 8067 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 8068 | * otherwise they won't be restored. |
| 8069 | * |
| 8070 | * @hide |
| 8071 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 8072 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 8073 | ENABLED_NOTIFICATION_LISTENERS, |
| 8074 | ENABLED_NOTIFICATION_ASSISTANT, |
| 8075 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 8076 | }; |
| 8077 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 8078 | /** |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8079 | * These entries are considered common between the personal and the managed profile, |
| 8080 | * since the managed profile doesn't get to change them. |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8081 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8082 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 8083 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8084 | static { |
| 8085 | CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); |
| 8086 | CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); |
| 8087 | CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); |
Felipe Leme | aa00896 | 2017-04-18 14:54:33 -0700 | [diff] [blame] | 8088 | CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8089 | CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); |
| 8090 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 8091 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 8092 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8093 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); |
| 8094 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8095 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); |
Yohei Yukawa | 3f8c568 | 2018-03-01 13:10:23 -0800 | [diff] [blame] | 8096 | if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) { |
| 8097 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER); |
| 8098 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE); |
| 8099 | } |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 8100 | } |
| 8101 | |
| 8102 | /** @hide */ |
| 8103 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 8104 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 8105 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 8106 | |
| 8107 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8108 | * Secure settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8109 | * @hide |
| 8110 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8111 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8112 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8113 | INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 8114 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); |
| 8115 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); |
Chad Brubaker | 9408d51 | 2017-03-28 16:11:38 -0700 | [diff] [blame] | 8116 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); |
| 8117 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); |
| 8118 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); |
| 8119 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); |
| 8120 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); |
| 8121 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); |
| 8122 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); |
| 8123 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); |
| 8124 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); |
Chad Brubaker | d9285b5 | 2017-04-27 15:28:57 -0700 | [diff] [blame] | 8125 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); |
| 8126 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); |
| 8127 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); |
| 8128 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); |
| 8129 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); |
| 8130 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8131 | |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 8132 | INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); |
| 8133 | INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); |
Chad Brubaker | 1bed937 | 2017-03-20 10:52:52 -0700 | [diff] [blame] | 8134 | |
| 8135 | INSTANT_APP_SETTINGS.add(ANDROID_ID); |
Chad Brubaker | 8d7b36f | 2017-04-06 22:57:18 -0700 | [diff] [blame] | 8136 | |
| 8137 | INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 8138 | INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 8139 | } |
| 8140 | |
| 8141 | /** |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8142 | * Helper method for determining if a location provider is enabled. |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 8143 | * |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8144 | * @param cr the content resolver to use |
| 8145 | * @param provider the location provider to query |
| 8146 | * @return true if the provider is enabled |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 8147 | * |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8148 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8149 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8150 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8151 | public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 8152 | return isLocationProviderEnabledForUser(cr, provider, cr.getUserId()); |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8153 | } |
| 8154 | |
| 8155 | /** |
| 8156 | * Helper method for determining if a location provider is enabled. |
| 8157 | * @param cr the content resolver to use |
| 8158 | * @param provider the location provider to query |
| 8159 | * @param userId the userId to query |
| 8160 | * @return true if the provider is enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8161 | * |
| 8162 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8163 | * @hide |
| 8164 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8165 | @Deprecated |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8166 | public static final boolean isLocationProviderEnabledForUser( |
| 8167 | ContentResolver cr, String provider, int userId) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8168 | String allowedProviders = Settings.Secure.getStringForUser(cr, |
| 8169 | LOCATION_PROVIDERS_ALLOWED, userId); |
Brad Fitzpatrick | 11fe181 | 2010-09-10 16:07:52 -0700 | [diff] [blame] | 8170 | return TextUtils.delimitedStringContains(allowedProviders, ',', provider); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8171 | } |
| 8172 | |
| 8173 | /** |
| 8174 | * Thread-safe method for enabling or disabling a single location provider. |
| 8175 | * @param cr the content resolver to use |
| 8176 | * @param provider the location provider to enable or disable |
| 8177 | * @param enabled true if the provider should be enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8178 | * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to |
| 8179 | * change location settings. |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8180 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8181 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8182 | public static final void setLocationProviderEnabled(ContentResolver cr, |
| 8183 | String provider, boolean enabled) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 8184 | setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId()); |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8185 | } |
| 8186 | |
| 8187 | /** |
| 8188 | * Thread-safe method for enabling or disabling a single location provider. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8189 | * |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8190 | * @param cr the content resolver to use |
| 8191 | * @param provider the location provider to enable or disable |
| 8192 | * @param enabled true if the provider should be enabled |
| 8193 | * @param userId the userId for which to enable/disable providers |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8194 | * @return true if the value was set, false on database errors |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8195 | * |
| 8196 | * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8197 | * @hide |
| 8198 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8199 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8200 | public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8201 | String provider, boolean enabled, int userId) { |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8202 | synchronized (mLocationSettingsLock) { |
| 8203 | // to ensure thread safety, we write the provider name with a '+' or '-' |
| 8204 | // and let the SettingsProvider handle it rather than reading and modifying |
| 8205 | // the list of enabled providers. |
| 8206 | if (enabled) { |
| 8207 | provider = "+" + provider; |
| 8208 | } else { |
| 8209 | provider = "-" + provider; |
| 8210 | } |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8211 | return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8212 | userId); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8213 | } |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8214 | } |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8215 | |
| 8216 | /** |
| 8217 | * Thread-safe method for setting the location mode to one of |
| 8218 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
| 8219 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8220 | * Necessary because the mode is a composite of the underlying location provider |
| 8221 | * settings. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8222 | * |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8223 | * @param cr the content resolver to use |
| 8224 | * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} |
| 8225 | * @param userId the userId for which to change mode |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8226 | * @return true if the value was set, false on database errors |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8227 | * |
| 8228 | * @throws IllegalArgumentException if mode is not one of the supported values |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8229 | * |
| 8230 | * @deprecated To enable/disable location, use |
| 8231 | * {@link LocationManager#setLocationEnabledForUser(boolean, int)}. |
| 8232 | * To enable/disable a specific location provider, use |
| 8233 | * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8234 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8235 | @Deprecated |
| 8236 | private static boolean setLocationModeForUser( |
| 8237 | ContentResolver cr, int mode, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8238 | synchronized (mLocationSettingsLock) { |
| 8239 | boolean gps = false; |
| 8240 | boolean network = false; |
| 8241 | switch (mode) { |
| 8242 | case LOCATION_MODE_OFF: |
| 8243 | break; |
| 8244 | case LOCATION_MODE_SENSORS_ONLY: |
| 8245 | gps = true; |
| 8246 | break; |
| 8247 | case LOCATION_MODE_BATTERY_SAVING: |
| 8248 | network = true; |
| 8249 | break; |
| 8250 | case LOCATION_MODE_HIGH_ACCURACY: |
| 8251 | gps = true; |
| 8252 | network = true; |
| 8253 | break; |
| 8254 | default: |
| 8255 | throw new IllegalArgumentException("Invalid location mode: " + mode); |
| 8256 | } |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8257 | |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8258 | boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8259 | cr, LocationManager.NETWORK_PROVIDER, network, userId); |
Tom O'Neill | 7731a99 | 2014-10-09 11:30:49 -0700 | [diff] [blame] | 8260 | boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
| 8261 | cr, LocationManager.GPS_PROVIDER, gps, userId); |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8262 | return gpsSuccess && nlpSuccess; |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8263 | } |
| 8264 | } |
| 8265 | |
| 8266 | /** |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8267 | * Thread-safe method for reading the location mode, returns one of |
| 8268 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8269 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary |
| 8270 | * 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] | 8271 | * |
| 8272 | * @param cr the content resolver to use |
| 8273 | * @param userId the userId for which to read the mode |
| 8274 | * @return the location mode |
| 8275 | */ |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 8276 | private static final int getLocationModeForUser(ContentResolver cr, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8277 | synchronized (mLocationSettingsLock) { |
| 8278 | boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8279 | cr, LocationManager.GPS_PROVIDER, userId); |
| 8280 | boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8281 | cr, LocationManager.NETWORK_PROVIDER, userId); |
| 8282 | if (gpsEnabled && networkEnabled) { |
| 8283 | return LOCATION_MODE_HIGH_ACCURACY; |
| 8284 | } else if (gpsEnabled) { |
| 8285 | return LOCATION_MODE_SENSORS_ONLY; |
| 8286 | } else if (networkEnabled) { |
| 8287 | return LOCATION_MODE_BATTERY_SAVING; |
| 8288 | } else { |
| 8289 | return LOCATION_MODE_OFF; |
| 8290 | } |
| 8291 | } |
| 8292 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8293 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 8294 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8295 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8296 | * Global system settings, containing preferences that always apply identically |
| 8297 | * to all defined users. Applications can read these but are not allowed to write; |
| 8298 | * like the "Secure" settings, these are for preferences that the user must |
| 8299 | * explicitly modify through the system UI or specialized APIs for those values. |
| 8300 | */ |
| 8301 | public static final class Global extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 8302 | // NOTE: If you add new settings here, be sure to add them to |
| 8303 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. |
| 8304 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8305 | /** |
| 8306 | * The content:// style URL for global secure settings items. Not public. |
| 8307 | */ |
| 8308 | public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); |
| 8309 | |
| 8310 | /** |
Amith Yamasani | 23a0f05 | 2014-07-25 12:26:53 -0700 | [diff] [blame] | 8311 | * Whether users are allowed to add more users or guest from lockscreen. |
| 8312 | * <p> |
| 8313 | * Type: int |
| 8314 | * @hide |
| 8315 | */ |
| 8316 | public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; |
| 8317 | |
| 8318 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8319 | * Setting whether the global gesture for enabling accessibility is enabled. |
| 8320 | * If this gesture is enabled the user will be able to perfrom it to enable |
| 8321 | * the accessibility state without visiting the settings app. |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8322 | * |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8323 | * @hide |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8324 | * No longer used. Should be removed once all dependencies have been updated. |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8325 | */ |
| 8326 | public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = |
| 8327 | "enable_accessibility_global_gesture_enabled"; |
| 8328 | |
| 8329 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8330 | * Whether Airplane Mode is on. |
| 8331 | */ |
| 8332 | public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; |
| 8333 | |
| 8334 | /** |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8335 | * Whether Theater Mode is on. |
| 8336 | * {@hide} |
| 8337 | */ |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 8338 | @SystemApi |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8339 | public static final String THEATER_MODE_ON = "theater_mode_on"; |
| 8340 | |
| 8341 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8342 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. |
| 8343 | */ |
| 8344 | public static final String RADIO_BLUETOOTH = "bluetooth"; |
| 8345 | |
| 8346 | /** |
| 8347 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. |
| 8348 | */ |
| 8349 | public static final String RADIO_WIFI = "wifi"; |
| 8350 | |
| 8351 | /** |
| 8352 | * {@hide} |
| 8353 | */ |
| 8354 | public static final String RADIO_WIMAX = "wimax"; |
| 8355 | /** |
| 8356 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
| 8357 | */ |
| 8358 | public static final String RADIO_CELL = "cell"; |
| 8359 | |
| 8360 | /** |
| 8361 | * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. |
| 8362 | */ |
| 8363 | public static final String RADIO_NFC = "nfc"; |
| 8364 | |
| 8365 | /** |
| 8366 | * A comma separated list of radios that need to be disabled when airplane mode |
| 8367 | * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are |
| 8368 | * included in the comma separated list. |
| 8369 | */ |
| 8370 | public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; |
| 8371 | |
| 8372 | /** |
| 8373 | * A comma separated list of radios that should to be disabled when airplane mode |
| 8374 | * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is |
| 8375 | * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi |
| 8376 | * will be turned off when entering airplane mode, but the user will be able to reenable |
| 8377 | * Wifi in the Settings app. |
| 8378 | * |
| 8379 | * {@hide} |
| 8380 | */ |
| 8381 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; |
| 8382 | |
| 8383 | /** |
Pulkit Bhuwalka | 547853d | 2017-09-25 17:55:12 -0700 | [diff] [blame] | 8384 | * An integer representing the Bluetooth Class of Device (CoD). |
| 8385 | * |
| 8386 | * @hide |
| 8387 | */ |
| 8388 | public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; |
| 8389 | |
| 8390 | /** |
Bryce Lee | ec85f34 | 2015-12-16 13:32:28 -0800 | [diff] [blame] | 8391 | * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. |
| 8392 | * See {@link android.bluetooth.BluetoothProfile}. |
| 8393 | * {@hide} |
| 8394 | */ |
| 8395 | public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; |
| 8396 | |
| 8397 | /** |
Andre Eisenbach | 82a94d9 | 2016-01-14 14:20:34 -0800 | [diff] [blame] | 8398 | * A semi-colon separated list of Bluetooth interoperability workarounds. |
| 8399 | * Each entry is a partial Bluetooth device address string and an integer representing |
| 8400 | * the feature to be disabled, separated by a comma. The integer must correspond |
| 8401 | * to a interoperability feature as defined in "interop.h" in /system/bt. |
| 8402 | * <p> |
| 8403 | * Example: <br/> |
| 8404 | * "00:11:22,0;01:02:03:04,2" |
| 8405 | * @hide |
| 8406 | */ |
| 8407 | public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; |
| 8408 | |
| 8409 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8410 | * The policy for deciding when Wi-Fi should go to sleep (which will in |
| 8411 | * turn switch to using the mobile data as an Internet connection). |
| 8412 | * <p> |
| 8413 | * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, |
| 8414 | * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or |
| 8415 | * {@link #WIFI_SLEEP_POLICY_NEVER}. |
| 8416 | */ |
| 8417 | public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; |
| 8418 | |
| 8419 | /** |
| 8420 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep |
| 8421 | * policy, which is to sleep shortly after the turning off |
| 8422 | * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. |
| 8423 | */ |
| 8424 | public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; |
| 8425 | |
| 8426 | /** |
| 8427 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when |
| 8428 | * the device is on battery, and never go to sleep when the device is |
| 8429 | * plugged in. |
| 8430 | */ |
| 8431 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; |
| 8432 | |
| 8433 | /** |
| 8434 | * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. |
| 8435 | */ |
| 8436 | public static final int WIFI_SLEEP_POLICY_NEVER = 2; |
| 8437 | |
| 8438 | /** |
| 8439 | * Value to specify if the user prefers the date, time and time zone |
| 8440 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8441 | */ |
| 8442 | public static final String AUTO_TIME = "auto_time"; |
| 8443 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8444 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8445 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8446 | /** |
| 8447 | * Value to specify if the user prefers the time zone |
| 8448 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8449 | */ |
| 8450 | public static final String AUTO_TIME_ZONE = "auto_time_zone"; |
| 8451 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8452 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8453 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8454 | /** |
| 8455 | * URI for the car dock "in" event sound. |
| 8456 | * @hide |
| 8457 | */ |
| 8458 | public static final String CAR_DOCK_SOUND = "car_dock_sound"; |
| 8459 | |
| 8460 | /** |
| 8461 | * URI for the car dock "out" event sound. |
| 8462 | * @hide |
| 8463 | */ |
| 8464 | public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; |
| 8465 | |
| 8466 | /** |
| 8467 | * URI for the desk dock "in" event sound. |
| 8468 | * @hide |
| 8469 | */ |
| 8470 | public static final String DESK_DOCK_SOUND = "desk_dock_sound"; |
| 8471 | |
| 8472 | /** |
| 8473 | * URI for the desk dock "out" event sound. |
| 8474 | * @hide |
| 8475 | */ |
| 8476 | public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; |
| 8477 | |
| 8478 | /** |
| 8479 | * Whether to play a sound for dock events. |
| 8480 | * @hide |
| 8481 | */ |
| 8482 | public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; |
| 8483 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8484 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8485 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8486 | /** |
Vinod Krishnan | cf11cea | 2016-10-20 22:57:02 -0700 | [diff] [blame] | 8487 | * Whether to play a sound for dock events, only when an accessibility service is on. |
| 8488 | * @hide |
| 8489 | */ |
| 8490 | public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; |
| 8491 | |
| 8492 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8493 | * URI for the "device locked" (keyguard shown) sound. |
| 8494 | * @hide |
| 8495 | */ |
| 8496 | public static final String LOCK_SOUND = "lock_sound"; |
| 8497 | |
| 8498 | /** |
| 8499 | * URI for the "device unlocked" sound. |
| 8500 | * @hide |
| 8501 | */ |
| 8502 | public static final String UNLOCK_SOUND = "unlock_sound"; |
| 8503 | |
| 8504 | /** |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 8505 | * URI for the "device is trusted" sound, which is played when the device enters the trusted |
| 8506 | * state without unlocking. |
| 8507 | * @hide |
| 8508 | */ |
| 8509 | public static final String TRUSTED_SOUND = "trusted_sound"; |
| 8510 | |
| 8511 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8512 | * URI for the low battery sound file. |
| 8513 | * @hide |
| 8514 | */ |
| 8515 | public static final String LOW_BATTERY_SOUND = "low_battery_sound"; |
| 8516 | |
| 8517 | /** |
| 8518 | * Whether to play a sound for low-battery alerts. |
| 8519 | * @hide |
| 8520 | */ |
| 8521 | public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; |
| 8522 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8523 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8524 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8525 | /** |
Beverly | c1313eb | 2018-01-31 18:07:21 -0500 | [diff] [blame] | 8526 | * URI for the "wireless charging started" and "wired charging started" sound. |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 8527 | * @hide |
| 8528 | */ |
Beverly | c1313eb | 2018-01-31 18:07:21 -0500 | [diff] [blame] | 8529 | public static final String CHARGING_STARTED_SOUND = |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 8530 | "wireless_charging_started_sound"; |
| 8531 | |
| 8532 | /** |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8533 | * Whether to play a sound for charging events. |
| 8534 | * @hide |
| 8535 | */ |
| 8536 | public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; |
| 8537 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8538 | private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8539 | |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8540 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8541 | * Whether we keep the device on while the device is plugged in. |
| 8542 | * Supported values are: |
| 8543 | * <ul> |
| 8544 | * <li>{@code 0} to never stay on while plugged in</li> |
| 8545 | * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> |
| 8546 | * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> |
| 8547 | * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> |
| 8548 | * </ul> |
| 8549 | * These values can be OR-ed together. |
| 8550 | */ |
| 8551 | public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; |
| 8552 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8553 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 8554 | @Override |
| 8555 | public boolean validate(String value) { |
| 8556 | try { |
| 8557 | int val = Integer.parseInt(value); |
| 8558 | return (val == 0) |
| 8559 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 8560 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 8561 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 8562 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8563 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 8564 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8565 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8566 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 8567 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8568 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8569 | | BatteryManager.BATTERY_PLUGGED_USB |
| 8570 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 8571 | } catch (NumberFormatException e) { |
| 8572 | return false; |
| 8573 | } |
| 8574 | } |
| 8575 | }; |
| 8576 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8577 | /** |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8578 | * When the user has enable the option to have a "bug report" command |
| 8579 | * in the power menu. |
| 8580 | * @hide |
| 8581 | */ |
| 8582 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 8583 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8584 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8585 | |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8586 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8587 | * Whether ADB is enabled. |
| 8588 | */ |
| 8589 | public static final String ADB_ENABLED = "adb_enabled"; |
| 8590 | |
| 8591 | /** |
Jon Miranda | 836c0a8 | 2014-08-11 12:32:26 -0700 | [diff] [blame] | 8592 | * Whether Views are allowed to save their attribute data. |
| 8593 | * @hide |
| 8594 | */ |
| 8595 | public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; |
| 8596 | |
| 8597 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8598 | * Whether assisted GPS should be enabled or not. |
| 8599 | * @hide |
| 8600 | */ |
| 8601 | public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; |
| 8602 | |
| 8603 | /** |
| 8604 | * Whether bluetooth is enabled/disabled |
| 8605 | * 0=disabled. 1=enabled. |
| 8606 | */ |
| 8607 | public static final String BLUETOOTH_ON = "bluetooth_on"; |
| 8608 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8609 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8610 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8611 | /** |
| 8612 | * CDMA Cell Broadcast SMS |
| 8613 | * 0 = CDMA Cell Broadcast SMS disabled |
| 8614 | * 1 = CDMA Cell Broadcast SMS enabled |
| 8615 | * @hide |
| 8616 | */ |
| 8617 | public static final String CDMA_CELL_BROADCAST_SMS = |
| 8618 | "cdma_cell_broadcast_sms"; |
| 8619 | |
| 8620 | /** |
| 8621 | * The CDMA roaming mode 0 = Home Networks, CDMA default |
| 8622 | * 1 = Roaming on Affiliated networks |
| 8623 | * 2 = Roaming on any networks |
| 8624 | * @hide |
| 8625 | */ |
| 8626 | public static final String CDMA_ROAMING_MODE = "roaming_settings"; |
| 8627 | |
| 8628 | /** |
| 8629 | * The CDMA subscription mode 0 = RUIM/SIM (default) |
| 8630 | * 1 = NV |
| 8631 | * @hide |
| 8632 | */ |
| 8633 | public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; |
| 8634 | |
Narayan Kamath | 94bcdbc | 2017-07-17 15:32:53 +0100 | [diff] [blame] | 8635 | /** |
| 8636 | * The default value for whether background data is enabled or not. |
| 8637 | * |
| 8638 | * Used by {@code NetworkPolicyManagerService}. |
| 8639 | * |
| 8640 | * @hide |
| 8641 | */ |
| 8642 | public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = |
| 8643 | "default_restrict_background_data"; |
| 8644 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8645 | /** Inactivity timeout to track mobile data activity. |
| 8646 | * |
| 8647 | * If set to a positive integer, it indicates the inactivity timeout value in seconds to |
| 8648 | * infer the data activity of mobile network. After a period of no activity on mobile |
| 8649 | * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} |
| 8650 | * intent is fired to indicate a transition of network status from "active" to "idle". Any |
| 8651 | * subsequent activity on mobile networks triggers the firing of {@code |
| 8652 | * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". |
| 8653 | * |
| 8654 | * Network activity refers to transmitting or receiving data on the network interfaces. |
| 8655 | * |
| 8656 | * Tracking is disabled if set to zero or negative value. |
| 8657 | * |
| 8658 | * @hide |
| 8659 | */ |
| 8660 | public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; |
| 8661 | |
| 8662 | /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} |
| 8663 | * but for Wifi network. |
| 8664 | * @hide |
| 8665 | */ |
| 8666 | public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; |
| 8667 | |
| 8668 | /** |
| 8669 | * Whether or not data roaming is enabled. (0 = false, 1 = true) |
| 8670 | */ |
| 8671 | public static final String DATA_ROAMING = "data_roaming"; |
| 8672 | |
| 8673 | /** |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 8674 | * The value passed to a Mobile DataConnection via bringUp which defines the |
| 8675 | * number of retries to preform when setting up the initial connection. The default |
| 8676 | * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. |
| 8677 | * @hide |
| 8678 | */ |
| 8679 | public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; |
| 8680 | |
| 8681 | /** |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8682 | * Whether any package can be on external storage. When this is true, any |
| 8683 | * package, regardless of manifest values, is a candidate for installing |
| 8684 | * or moving onto external storage. (0 = false, 1 = true) |
| 8685 | * @hide |
| 8686 | */ |
| 8687 | public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; |
| 8688 | |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8689 | /** |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8690 | * The default SM-DP+ configured for this device. |
| 8691 | * |
| 8692 | * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to |
| 8693 | * download profiles. If this value is set, the LPA will query this server for any profiles |
| 8694 | * available to this device. If any are available, they may be downloaded during device |
| 8695 | * provisioning or in settings without needing the user to enter an activation code. |
| 8696 | * |
| 8697 | * @see android.service.euicc.EuiccService |
| 8698 | * @hide |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8699 | */ |
Holly Jiuyu Sun | 4f73b9c | 2017-12-12 20:17:09 -0800 | [diff] [blame] | 8700 | @SystemApi |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8701 | public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; |
| 8702 | |
| 8703 | /** |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 8704 | * Whether any profile has ever been downloaded onto a eUICC on the device. |
| 8705 | * |
| 8706 | * <p>Used to hide eUICC UI from users who have never made use of it and would only be |
| 8707 | * confused by seeing references to it in settings. |
| 8708 | * (0 = false, 1 = true) |
| 8709 | * @hide |
| 8710 | */ |
Holly Jiuyu Sun | b85013a | 2018-02-21 20:34:22 -0800 | [diff] [blame] | 8711 | @SystemApi |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 8712 | public static final String EUICC_PROVISIONED = "euicc_provisioned"; |
| 8713 | |
| 8714 | /** |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8715 | * Whether any activity can be resized. When this is true, any |
| 8716 | * activity, regardless of manifest values, can be resized for multi-window. |
| 8717 | * (0 = false, 1 = true) |
| 8718 | * @hide |
| 8719 | */ |
| 8720 | public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES |
| 8721 | = "force_resizable_activities"; |
| 8722 | |
Jorim Jaggi | 6f2efd3 | 2015-12-23 12:04:39 +0100 | [diff] [blame] | 8723 | /** |
| 8724 | * Whether to enable experimental freeform support for windows. |
| 8725 | * @hide |
| 8726 | */ |
| 8727 | public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT |
| 8728 | = "enable_freeform_support"; |
| 8729 | |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8730 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8731 | * Whether user has enabled development settings. |
| 8732 | */ |
| 8733 | public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; |
| 8734 | |
| 8735 | /** |
Amith Yamasani | cb15d66 | 2015-11-10 11:11:15 -0800 | [diff] [blame] | 8736 | * Whether the device has been provisioned (0 = false, 1 = true). |
| 8737 | * <p>On a multiuser device with a separate system user, the screen may be locked |
| 8738 | * as soon as this is set to true and further activities cannot be launched on the |
| 8739 | * system user unless they are marked to show over keyguard. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8740 | */ |
| 8741 | public static final String DEVICE_PROVISIONED = "device_provisioned"; |
| 8742 | |
| 8743 | /** |
Robert Greenwalt | beb482c | 2016-03-28 15:40:56 -0700 | [diff] [blame] | 8744 | * Whether mobile data should be allowed while the device is being provisioned. |
| 8745 | * This allows the provisioning process to turn off mobile data before the user |
| 8746 | * has an opportunity to set things up, preventing other processes from burning |
| 8747 | * precious bytes before wifi is setup. |
| 8748 | * (0 = false, 1 = true) |
| 8749 | * @hide |
| 8750 | */ |
| 8751 | public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = |
| 8752 | "device_provisioning_mobile_data"; |
| 8753 | |
| 8754 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8755 | * The saved value for WindowManagerService.setForcedDisplaySize(). |
| 8756 | * Two integers separated by a comma. If unset, then use the real display size. |
| 8757 | * @hide |
| 8758 | */ |
| 8759 | public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; |
| 8760 | |
| 8761 | /** |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 8762 | * The saved value for WindowManagerService.setForcedDisplayScalingMode(). |
| 8763 | * 0 or unset if scaling is automatic, 1 if scaling is disabled. |
| 8764 | * @hide |
| 8765 | */ |
| 8766 | public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; |
| 8767 | |
| 8768 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8769 | * The maximum size, in bytes, of a download that the download manager will transfer over |
| 8770 | * a non-wifi connection. |
| 8771 | * @hide |
| 8772 | */ |
| 8773 | public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = |
| 8774 | "download_manager_max_bytes_over_mobile"; |
| 8775 | |
| 8776 | /** |
| 8777 | * The recommended maximum size, in bytes, of a download that the download manager should |
| 8778 | * transfer over a non-wifi connection. Over this size, the use will be warned, but will |
| 8779 | * have the option to start the download over the mobile connection anyway. |
| 8780 | * @hide |
| 8781 | */ |
| 8782 | public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = |
| 8783 | "download_manager_recommended_max_bytes_over_mobile"; |
| 8784 | |
| 8785 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8786 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8787 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8788 | @Deprecated |
| 8789 | 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] | 8790 | |
| 8791 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8792 | * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be |
| 8793 | * sent or processed. (0 = false, 1 = true) |
| 8794 | * @hide |
| 8795 | */ |
| 8796 | public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; |
| 8797 | |
| 8798 | /** |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8799 | * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on |
| 8800 | * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will |
| 8801 | * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be |
| 8802 | * activated. |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8803 | * @hide |
| 8804 | */ |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8805 | public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = |
| 8806 | "hdmi_system_audio_control_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8807 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8808 | /** |
| 8809 | * Whether TV will automatically turn on upon reception of the CEC command |
| 8810 | * <Text View On> or <Image View On>. (0 = false, 1 = true) |
| 8811 | * |
| 8812 | * @hide |
| 8813 | */ |
| 8814 | public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = |
| 8815 | "hdmi_control_auto_wakeup_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8816 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8817 | /** |
| 8818 | * Whether TV will also turn off other CEC devices when it goes to standby mode. |
| 8819 | * (0 = false, 1 = true) |
| 8820 | * |
| 8821 | * @hide |
| 8822 | */ |
| 8823 | public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = |
| 8824 | "hdmi_control_auto_device_off_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8825 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8826 | /** |
| 8827 | * If <b>true</b>, enables out-of-the-box execution for priv apps. |
| 8828 | * Default: false |
| 8829 | * Values: 0 = false, 1 = true |
| 8830 | * |
| 8831 | * @hide |
| 8832 | */ |
| 8833 | public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled"; |
| 8834 | |
| 8835 | /** |
| 8836 | * The interval in milliseconds at which location requests will be throttled when they are |
| 8837 | * coming from the background. |
| 8838 | * |
| 8839 | * @hide |
| 8840 | */ |
| 8841 | public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = |
Soonil Nagarkar | 7decfb6 | 2017-01-18 12:18:49 -0800 | [diff] [blame] | 8842 | "location_background_throttle_interval_ms"; |
| 8843 | |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8844 | /** |
Lifu Tang | c94ef4d | 2017-03-23 23:48:00 -0700 | [diff] [blame] | 8845 | * Most frequent location update interval in milliseconds that proximity alert is allowed |
| 8846 | * to request. |
| 8847 | * @hide |
| 8848 | */ |
| 8849 | public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = |
| 8850 | "location_background_throttle_proximity_alert_interval_ms"; |
| 8851 | |
| 8852 | /** |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8853 | * Packages that are whitelisted for background throttling (throttling will not be applied). |
| 8854 | * @hide |
| 8855 | */ |
| 8856 | public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8857 | "location_background_throttle_package_whitelist"; |
| 8858 | |
Wei Wang | cdbffa9 | 2017-04-17 19:49:29 -0700 | [diff] [blame] | 8859 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8860 | * Whether TV will switch to MHL port when a mobile device is plugged in. |
| 8861 | * (0 = false, 1 = true) |
| 8862 | * @hide |
| 8863 | */ |
| 8864 | public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; |
| 8865 | |
| 8866 | /** |
| 8867 | * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) |
| 8868 | * @hide |
| 8869 | */ |
| 8870 | public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; |
| 8871 | |
| 8872 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8873 | * Whether mobile data connections are allowed by the user. See |
| 8874 | * ConnectivityManager for more info. |
| 8875 | * @hide |
| 8876 | */ |
| 8877 | public static final String MOBILE_DATA = "mobile_data"; |
| 8878 | |
Erik Kline | da4bfa8 | 2015-04-30 12:58:40 +0900 | [diff] [blame] | 8879 | /** |
| 8880 | * Whether the mobile data connection should remain active even when higher |
| 8881 | * priority networks like WiFi are active, to help make network switching faster. |
| 8882 | * |
| 8883 | * See ConnectivityService for more info. |
| 8884 | * |
| 8885 | * (0 = disabled, 1 = enabled) |
| 8886 | * @hide |
| 8887 | */ |
| 8888 | public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; |
| 8889 | |
Hugo Benichi | 05686db | 2016-10-19 11:17:28 +0900 | [diff] [blame] | 8890 | /** |
| 8891 | * Size of the event buffer for IP connectivity metrics. |
| 8892 | * @hide |
| 8893 | */ |
| 8894 | public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = |
| 8895 | "connectivity_metrics_buffer_size"; |
| 8896 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8897 | /** {@hide} */ |
| 8898 | public static final String NETSTATS_ENABLED = "netstats_enabled"; |
| 8899 | /** {@hide} */ |
| 8900 | public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; |
| 8901 | /** {@hide} */ |
Jeff Sharkey | 9911a28 | 2018-02-14 22:29:11 -0700 | [diff] [blame] | 8902 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8903 | public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; |
| 8904 | /** {@hide} */ |
| 8905 | public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; |
| 8906 | /** {@hide} */ |
| 8907 | public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; |
Jeff Sharkey | f4de294 | 2017-08-29 15:32:13 -0600 | [diff] [blame] | 8908 | /** {@hide} */ |
| 8909 | public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8910 | |
| 8911 | /** {@hide} */ |
| 8912 | public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; |
| 8913 | /** {@hide} */ |
| 8914 | public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; |
| 8915 | /** {@hide} */ |
| 8916 | public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; |
| 8917 | /** {@hide} */ |
| 8918 | public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; |
| 8919 | |
| 8920 | /** {@hide} */ |
| 8921 | public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; |
| 8922 | /** {@hide} */ |
| 8923 | public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; |
| 8924 | /** {@hide} */ |
| 8925 | public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; |
| 8926 | /** {@hide} */ |
| 8927 | public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; |
| 8928 | |
| 8929 | /** {@hide} */ |
| 8930 | public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; |
| 8931 | /** {@hide} */ |
| 8932 | public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; |
| 8933 | /** {@hide} */ |
| 8934 | public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; |
| 8935 | /** {@hide} */ |
| 8936 | public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; |
| 8937 | |
| 8938 | /** |
| 8939 | * User preference for which network(s) should be used. Only the |
| 8940 | * connectivity service should touch this. |
| 8941 | */ |
| 8942 | public static final String NETWORK_PREFERENCE = "network_preference"; |
| 8943 | |
| 8944 | /** |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 8945 | * Which package name to use for network scoring. If null, or if the package is not a valid |
| 8946 | * scorer app, external network scores will neither be requested nor accepted. |
| 8947 | * @hide |
| 8948 | */ |
| 8949 | public static final String NETWORK_SCORER_APP = "network_scorer_app"; |
| 8950 | |
Christine Franks | 8ad6f6d | 2017-12-13 18:40:43 -0800 | [diff] [blame] | 8951 | /** |
| 8952 | * Whether night display forced auto mode is available. |
| 8953 | * 0 = unavailable, 1 = available. |
| 8954 | * @hide |
| 8955 | */ |
| 8956 | public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = |
| 8957 | "night_display_forced_auto_mode_available"; |
| 8958 | |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 8959 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8960 | * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment |
| 8961 | * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been |
| 8962 | * exceeded. |
| 8963 | * @hide |
| 8964 | */ |
| 8965 | public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; |
| 8966 | |
| 8967 | /** |
| 8968 | * The length of time in milli-seconds that automatic small adjustments to |
| 8969 | * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. |
| 8970 | * @hide |
| 8971 | */ |
| 8972 | public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; |
| 8973 | |
| 8974 | /** Preferred NTP server. {@hide} */ |
| 8975 | public static final String NTP_SERVER = "ntp_server"; |
| 8976 | /** Timeout in milliseconds to wait for NTP server. {@hide} */ |
| 8977 | public static final String NTP_TIMEOUT = "ntp_timeout"; |
| 8978 | |
Jeff Sharkey | e8a4b66 | 2015-06-27 15:43:45 -0700 | [diff] [blame] | 8979 | /** {@hide} */ |
| 8980 | public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; |
| 8981 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8982 | /** |
Pierre Imai | 8e48e67 | 2016-04-21 13:30:43 +0900 | [diff] [blame] | 8983 | * Sample validity in seconds to configure for the system DNS resolver. |
| 8984 | * {@hide} |
| 8985 | */ |
| 8986 | public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = |
| 8987 | "dns_resolver_sample_validity_seconds"; |
| 8988 | |
| 8989 | /** |
| 8990 | * Success threshold in percent for use with the system DNS resolver. |
| 8991 | * {@hide} |
| 8992 | */ |
| 8993 | public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = |
| 8994 | "dns_resolver_success_threshold_percent"; |
| 8995 | |
| 8996 | /** |
| 8997 | * Minimum number of samples needed for statistics to be considered meaningful in the |
| 8998 | * system DNS resolver. |
| 8999 | * {@hide} |
| 9000 | */ |
| 9001 | public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; |
| 9002 | |
| 9003 | /** |
| 9004 | * Maximum number taken into account for statistics purposes in the system DNS resolver. |
| 9005 | * {@hide} |
| 9006 | */ |
| 9007 | public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; |
| 9008 | |
| 9009 | /** |
Tao Bao | fdf7c5d | 2016-02-15 20:59:15 -0800 | [diff] [blame] | 9010 | * Whether to disable the automatic scheduling of system updates. |
| 9011 | * 1 = system updates won't be automatically scheduled (will always |
| 9012 | * present notification instead). |
| 9013 | * 0 = system updates will be automatically scheduled. (default) |
| 9014 | * @hide |
| 9015 | */ |
| 9016 | @SystemApi |
| 9017 | public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; |
| 9018 | |
| 9019 | /** |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9020 | * Whether the package manager should send package verification broadcasts for verifiers to |
| 9021 | * review apps prior to installation. |
| 9022 | * 1 = request apps to be verified prior to installation, if a verifier exists. |
| 9023 | * 0 = do not verify apps before installation |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9024 | * @hide |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9025 | */ |
| 9026 | public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; |
| 9027 | |
| 9028 | /** Timeout for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9029 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9030 | public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; |
| 9031 | |
| 9032 | /** Default response code for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9033 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9034 | public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; |
| 9035 | |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9036 | /** |
| 9037 | * Show package verification setting in the Settings app. |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 9038 | * 1 = show (default) |
| 9039 | * 0 = hide |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9040 | * @hide |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 9041 | */ |
| 9042 | public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; |
| 9043 | |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 9044 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 9045 | * Run package verification on apps installed through ADB/ADT/USB |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 9046 | * 1 = perform package verification on ADB installs (default) |
| 9047 | * 0 = bypass package verification on ADB installs |
| 9048 | * @hide |
| 9049 | */ |
| 9050 | public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; |
| 9051 | |
| 9052 | /** |
Christopher Tate | 7265abe | 2014-11-21 13:54:45 -0800 | [diff] [blame] | 9053 | * Time since last fstrim (milliseconds) after which we force one to happen |
| 9054 | * during device startup. If unset, the default is 3 days. |
| 9055 | * @hide |
| 9056 | */ |
| 9057 | public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; |
| 9058 | |
| 9059 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9060 | * The interval in milliseconds at which to check packet counts on the |
| 9061 | * mobile data interface when screen is on, to detect possible data |
| 9062 | * connection problems. |
| 9063 | * @hide |
| 9064 | */ |
| 9065 | public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = |
| 9066 | "pdp_watchdog_poll_interval_ms"; |
| 9067 | |
| 9068 | /** |
| 9069 | * The interval in milliseconds at which to check packet counts on the |
| 9070 | * mobile data interface when screen is off, to detect possible data |
| 9071 | * connection problems. |
| 9072 | * @hide |
| 9073 | */ |
| 9074 | public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = |
| 9075 | "pdp_watchdog_long_poll_interval_ms"; |
| 9076 | |
| 9077 | /** |
| 9078 | * The interval in milliseconds at which to check packet counts on the |
| 9079 | * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} |
| 9080 | * outgoing packets has been reached without incoming packets. |
| 9081 | * @hide |
| 9082 | */ |
| 9083 | public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = |
| 9084 | "pdp_watchdog_error_poll_interval_ms"; |
| 9085 | |
| 9086 | /** |
| 9087 | * The number of outgoing packets sent without seeing an incoming packet |
| 9088 | * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} |
| 9089 | * device is logged to the event log |
| 9090 | * @hide |
| 9091 | */ |
| 9092 | public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = |
| 9093 | "pdp_watchdog_trigger_packet_count"; |
| 9094 | |
| 9095 | /** |
| 9096 | * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) |
| 9097 | * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before |
| 9098 | * attempting data connection recovery. |
| 9099 | * @hide |
| 9100 | */ |
| 9101 | public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = |
| 9102 | "pdp_watchdog_error_poll_count"; |
| 9103 | |
| 9104 | /** |
| 9105 | * The number of failed PDP reset attempts before moving to something more |
| 9106 | * drastic: re-registering to the network. |
| 9107 | * @hide |
| 9108 | */ |
| 9109 | public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = |
| 9110 | "pdp_watchdog_max_pdp_reset_fail_count"; |
| 9111 | |
| 9112 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9113 | * URL to open browser on to allow user to manage a prepay account |
| 9114 | * @hide |
| 9115 | */ |
| 9116 | public static final String SETUP_PREPAID_DATA_SERVICE_URL = |
| 9117 | "setup_prepaid_data_service_url"; |
| 9118 | |
| 9119 | /** |
| 9120 | * URL to attempt a GET on to see if this is a prepay device |
| 9121 | * @hide |
| 9122 | */ |
| 9123 | public static final String SETUP_PREPAID_DETECTION_TARGET_URL = |
| 9124 | "setup_prepaid_detection_target_url"; |
| 9125 | |
| 9126 | /** |
| 9127 | * Host to check for a redirect to after an attempt to GET |
| 9128 | * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, |
| 9129 | * this is a prepaid device with zero balance.) |
| 9130 | * @hide |
| 9131 | */ |
| 9132 | public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = |
| 9133 | "setup_prepaid_detection_redir_host"; |
| 9134 | |
| 9135 | /** |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 9136 | * The interval in milliseconds at which to check the number of SMS sent out without asking |
| 9137 | * for use permit, to limit the un-authorized SMS usage. |
| 9138 | * |
| 9139 | * @hide |
| 9140 | */ |
| 9141 | public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = |
| 9142 | "sms_outgoing_check_interval_ms"; |
| 9143 | |
| 9144 | /** |
| 9145 | * The number of outgoing SMS sent without asking for user permit (of {@link |
| 9146 | * #SMS_OUTGOING_CHECK_INTERVAL_MS} |
| 9147 | * |
| 9148 | * @hide |
| 9149 | */ |
| 9150 | public static final String SMS_OUTGOING_CHECK_MAX_COUNT = |
| 9151 | "sms_outgoing_check_max_count"; |
| 9152 | |
| 9153 | /** |
| 9154 | * Used to disable SMS short code confirmation - defaults to true. |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 9155 | * 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] | 9156 | * @see com.android.internal.telephony.SmsUsageMonitor |
| 9157 | * @hide |
| 9158 | */ |
| 9159 | public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; |
| 9160 | |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 9161 | /** |
| 9162 | * Used to select which country we use to determine premium sms codes. |
| 9163 | * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, |
| 9164 | * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, |
| 9165 | * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. |
| 9166 | * @hide |
| 9167 | */ |
| 9168 | public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; |
| 9169 | |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 9170 | /** |
JP Abgrall | 32d1ac4d | 2014-02-21 12:05:20 -0800 | [diff] [blame] | 9171 | * Used to select TCP's default initial receiver window size in segments - defaults to a build config value |
| 9172 | * @hide |
| 9173 | */ |
| 9174 | public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; |
| 9175 | |
| 9176 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9177 | * Used to disable Tethering on a device - defaults to true |
| 9178 | * @hide |
| 9179 | */ |
| 9180 | public static final String TETHER_SUPPORTED = "tether_supported"; |
| 9181 | |
| 9182 | /** |
| 9183 | * Used to require DUN APN on the device or not - defaults to a build config value |
| 9184 | * which defaults to false |
| 9185 | * @hide |
| 9186 | */ |
| 9187 | public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; |
| 9188 | |
| 9189 | /** |
| 9190 | * Used to hold a gservices-provisioned apn value for DUN. If set, or the |
| 9191 | * corresponding build config values are set it will override the APN DB |
| 9192 | * values. |
| 9193 | * Consists of a comma seperated list of strings: |
| 9194 | * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" |
| 9195 | * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" |
| 9196 | * @hide |
| 9197 | */ |
| 9198 | public static final String TETHER_DUN_APN = "tether_dun_apn"; |
| 9199 | |
Erik Kline | 92c4db0 | 2017-05-31 10:21:32 +0900 | [diff] [blame] | 9200 | /** |
| 9201 | * Used to disable trying to talk to any available tethering offload HAL. |
| 9202 | * |
| 9203 | * Integer values are interpreted as boolean, and the absence of an explicit setting |
| 9204 | * is interpreted as |false|. |
| 9205 | * @hide |
| 9206 | */ |
| 9207 | public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; |
| 9208 | |
goneil | 6db18a9b | 2018-01-10 16:23:11 -0800 | [diff] [blame] | 9209 | /** |
| 9210 | * List of certificate (hex string representation of the application's certificate - SHA-1 |
| 9211 | * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for |
| 9212 | * install when a sim card with matching UICC carrier privilege rules is inserted. The |
| 9213 | * certificate is used as a key, so the certificate encoding here must be the same as the |
| 9214 | * certificate encoding used on the SIM. |
| 9215 | * |
| 9216 | * The value is "cert1:package1;cert2:package2;..." |
| 9217 | * @hide |
| 9218 | */ |
| 9219 | @SystemApi |
| 9220 | public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 9221 | |
goneil | 15f5a7e | 2018-02-16 17:33:56 -0800 | [diff] [blame] | 9222 | /** |
goneil | 986fae2 | 2018-03-29 17:30:58 -0700 | [diff] [blame] | 9223 | * Map of package name to application names. The application names cannot and will not be |
| 9224 | * localized. App names may not contain colons or semicolons. |
goneil | 15f5a7e | 2018-02-16 17:33:56 -0800 | [diff] [blame] | 9225 | * |
| 9226 | * The value is "packageName1:appName1;packageName2:appName2;..." |
| 9227 | * @hide |
| 9228 | */ |
| 9229 | @SystemApi |
| 9230 | public static final String CARRIER_APP_NAMES = "carrier_app_names"; |
| 9231 | |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 9232 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9233 | * USB Mass Storage Enabled |
| 9234 | */ |
| 9235 | public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; |
| 9236 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9237 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9238 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9239 | /** |
| 9240 | * If this setting is set (to anything), then all references |
| 9241 | * to Gmail on the device must change to Google Mail. |
| 9242 | */ |
| 9243 | public static final String USE_GOOGLE_MAIL = "use_google_mail"; |
| 9244 | |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 9245 | /** |
| 9246 | * Webview Data reduction proxy key. |
| 9247 | * @hide |
| 9248 | */ |
| 9249 | public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = |
| 9250 | "webview_data_reduction_proxy_key"; |
| 9251 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9252 | /** |
| 9253 | * Whether or not the WebView fallback mechanism should be enabled. |
| 9254 | * 0=disabled, 1=enabled. |
| 9255 | * @hide |
| 9256 | */ |
| 9257 | public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = |
| 9258 | "webview_fallback_logic_enabled"; |
Gustav Sennton | c83e3fa | 2016-02-18 12:19:13 +0000 | [diff] [blame] | 9259 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9260 | /** |
| 9261 | * Name of the package used as WebView provider (if unset the provider is instead determined |
| 9262 | * by the system). |
| 9263 | * @hide |
| 9264 | */ |
| 9265 | public static final String WEBVIEW_PROVIDER = "webview_provider"; |
Gustav Sennton | 14c033c | 2016-02-11 12:51:27 +0000 | [diff] [blame] | 9266 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9267 | /** |
| 9268 | * Developer setting to enable WebView multiprocess rendering. |
| 9269 | * @hide |
| 9270 | */ |
| 9271 | @SystemApi |
| 9272 | public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; |
| 9273 | |
| 9274 | /** |
| 9275 | * The maximum number of notifications shown in 24 hours when switching networks. |
| 9276 | * @hide |
| 9277 | */ |
| 9278 | public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = |
| 9279 | "network_switch_notification_daily_limit"; |
| 9280 | |
| 9281 | /** |
| 9282 | * The minimum time in milliseconds between notifications when switching networks. |
| 9283 | * @hide |
| 9284 | */ |
| 9285 | public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = |
| 9286 | "network_switch_notification_rate_limit_millis"; |
Tobias Sargeant | da85710 | 2016-02-11 14:52:28 +0000 | [diff] [blame] | 9287 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9288 | /** |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9289 | * Whether to automatically switch away from wifi networks that lose Internet access. |
Lorenzo Colitti | 165c51c | 2016-09-19 01:00:19 +0900 | [diff] [blame] | 9290 | * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always |
| 9291 | * avoids such networks. Valid values are: |
| 9292 | * |
| 9293 | * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. |
| 9294 | * null: Ask the user whether to switch away from bad wifi. |
| 9295 | * 1: Avoid bad wifi. |
| 9296 | * |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9297 | * @hide |
| 9298 | */ |
| 9299 | public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; |
| 9300 | |
| 9301 | /** |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9302 | * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be |
| 9303 | * overridden by the system based on device or application state. If null, the value |
| 9304 | * specified by config_networkMeteredMultipathPreference is used. |
| 9305 | * |
| 9306 | * @hide |
| 9307 | */ |
| 9308 | public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = |
| 9309 | "network_metered_multipath_preference"; |
| 9310 | |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 9311 | /** |
Remi NGUYEN VAN | e0ec992 | 2018-03-29 16:17:19 +0900 | [diff] [blame] | 9312 | * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() |
| 9313 | * on metered networks. This default quota is only used if quota could not be determined |
| 9314 | * from data plan or data limit/warning set by the user. |
| 9315 | * @hide |
| 9316 | */ |
| 9317 | public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = |
| 9318 | "network_default_daily_multipath_quota_bytes"; |
| 9319 | |
| 9320 | /** |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 9321 | * Network watchlist last report time. |
| 9322 | * @hide |
| 9323 | */ |
| 9324 | public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = |
| 9325 | "network_watchlist_last_report_time"; |
| 9326 | |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9327 | /** |
William Mee | cd62f3a | 2017-01-24 18:01:38 -0800 | [diff] [blame] | 9328 | * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of |
| 9329 | * colon-delimited key-value pairs. The key is the badging enum value defined in |
| 9330 | * android.net.ScoredNetwork and the value is the minimum sustained network throughput in |
| 9331 | * kbps required for the badge. For example: "10:3000,20:5000,30:25000" |
| 9332 | * |
| 9333 | * @hide |
| 9334 | */ |
| 9335 | @SystemApi |
| 9336 | public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; |
| 9337 | |
| 9338 | /** |
Jeff Brown | 89d5546 | 2012-09-19 11:33:42 -0700 | [diff] [blame] | 9339 | * Whether Wifi display is enabled/disabled |
| 9340 | * 0=disabled. 1=enabled. |
| 9341 | * @hide |
| 9342 | */ |
| 9343 | public static final String WIFI_DISPLAY_ON = "wifi_display_on"; |
| 9344 | |
| 9345 | /** |
Chong Zhang | 1f3ecaa | 2013-05-03 15:55:36 -0700 | [diff] [blame] | 9346 | * Whether Wifi display certification mode is enabled/disabled |
| 9347 | * 0=disabled. 1=enabled. |
| 9348 | * @hide |
| 9349 | */ |
| 9350 | public static final String WIFI_DISPLAY_CERTIFICATION_ON = |
| 9351 | "wifi_display_certification_on"; |
| 9352 | |
| 9353 | /** |
Chong Zhang | e38af81 | 2013-08-29 17:25:17 -0700 | [diff] [blame] | 9354 | * WPS Configuration method used by Wifi display, this setting only |
| 9355 | * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). |
| 9356 | * |
| 9357 | * Possible values are: |
| 9358 | * |
| 9359 | * WpsInfo.INVALID: use default WPS method chosen by framework |
| 9360 | * WpsInfo.PBC : use Push button |
| 9361 | * WpsInfo.KEYPAD : use Keypad |
| 9362 | * WpsInfo.DISPLAY: use Display |
| 9363 | * @hide |
| 9364 | */ |
| 9365 | public static final String WIFI_DISPLAY_WPS_CONFIG = |
| 9366 | "wifi_display_wps_config"; |
| 9367 | |
| 9368 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9369 | * Whether to notify the user of open networks. |
| 9370 | * <p> |
| 9371 | * If not connected and the scan results have an open network, we will |
| 9372 | * put this notification up. If we attempt to connect to a network or |
| 9373 | * the open network(s) disappear, we remove the notification. When we |
| 9374 | * show the notification, we will not show it again for |
| 9375 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9376 | * |
| 9377 | * @deprecated This feature is no longer controlled by this setting in |
| 9378 | * {@link android.os.Build.VERSION_CODES#O}. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9379 | */ |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9380 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9381 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9382 | "wifi_networks_available_notification_on"; |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9383 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9384 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9385 | BOOLEAN_VALIDATOR; |
| 9386 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9387 | /** |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 9388 | * Whether to notify the user of carrier networks. |
| 9389 | * <p> |
| 9390 | * If not connected and the scan results have a carrier network, we will |
| 9391 | * put this notification up. If we attempt to connect to a network or |
| 9392 | * the carrier network(s) disappear, we remove the notification. When we |
| 9393 | * show the notification, we will not show it again for |
| 9394 | * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
| 9395 | * @hide |
| 9396 | */ |
| 9397 | public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9398 | "wifi_carrier_networks_available_notification_on"; |
| 9399 | |
| 9400 | private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9401 | BOOLEAN_VALIDATOR; |
| 9402 | |
| 9403 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9404 | * {@hide} |
| 9405 | */ |
| 9406 | public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9407 | "wimax_networks_available_notification_on"; |
| 9408 | |
| 9409 | /** |
| 9410 | * Delay (in seconds) before repeating the Wi-Fi networks available notification. |
| 9411 | * Connecting to a network will reset the timer. |
| 9412 | */ |
| 9413 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 9414 | "wifi_networks_available_repeat_delay"; |
| 9415 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9416 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 9417 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9418 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9419 | /** |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 9420 | * 802.11 country code in ISO 3166 format |
| 9421 | * @hide |
| 9422 | */ |
| 9423 | public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; |
| 9424 | |
| 9425 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9426 | * The interval in milliseconds to issue wake up scans when wifi needs |
| 9427 | * to connect. This is necessary to connect to an access point when |
| 9428 | * device is on the move and the screen is off. |
| 9429 | * @hide |
| 9430 | */ |
| 9431 | public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = |
| 9432 | "wifi_framework_scan_interval_ms"; |
| 9433 | |
| 9434 | /** |
| 9435 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 9436 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 9437 | * the mobile data network. |
| 9438 | * @hide |
| 9439 | */ |
| 9440 | public static final String WIFI_IDLE_MS = "wifi_idle_ms"; |
| 9441 | |
| 9442 | /** |
| 9443 | * When the number of open networks exceeds this number, the |
| 9444 | * least-recently-used excess networks will be removed. |
| 9445 | */ |
| 9446 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; |
| 9447 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9448 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 9449 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9450 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9451 | /** |
| 9452 | * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. |
| 9453 | */ |
| 9454 | public static final String WIFI_ON = "wifi_on"; |
| 9455 | |
| 9456 | /** |
Irfan Sheriff | 11aefad | 2013-03-06 07:57:41 -0800 | [diff] [blame] | 9457 | * Setting to allow scans to be enabled even wifi is turned off for connectivity. |
| 9458 | * @hide |
| 9459 | */ |
| 9460 | public static final String WIFI_SCAN_ALWAYS_AVAILABLE = |
| 9461 | "wifi_scan_always_enabled"; |
| 9462 | |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9463 | /** |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9464 | * 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] | 9465 | * |
| 9466 | * Type: int (0 for false, 1 for true) |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9467 | * @hide |
| 9468 | */ |
| 9469 | public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; |
| 9470 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9471 | private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9472 | |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9473 | /** |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9474 | * Value to specify if Wi-Fi Wakeup feature is enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9475 | * |
| 9476 | * Type: int (0 for false, 1 for true) |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9477 | * @hide |
| 9478 | */ |
| 9479 | @SystemApi |
| 9480 | public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; |
| 9481 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9482 | private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9483 | |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9484 | /** |
Sundeep Ghuman | e869d83 | 2017-01-25 16:23:43 -0800 | [diff] [blame] | 9485 | * Value to specify whether network quality scores and badging should be shown in the UI. |
| 9486 | * |
| 9487 | * Type: int (0 for false, 1 for true) |
| 9488 | * @hide |
| 9489 | */ |
| 9490 | public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; |
| 9491 | |
| 9492 | /** |
Sundeep Ghuman | 9bb85d3 | 2017-08-28 17:04:16 -0700 | [diff] [blame] | 9493 | * Value to specify how long in milliseconds to retain seen score cache curves to be used |
| 9494 | * when generating SSID only bases score curves. |
| 9495 | * |
| 9496 | * Type: long |
| 9497 | * @hide |
| 9498 | */ |
| 9499 | public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = |
| 9500 | "speed_label_cache_eviction_age_millis"; |
| 9501 | |
| 9502 | /** |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9503 | * Value to specify if network recommendations from |
| 9504 | * {@link com.android.server.NetworkScoreService} are enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9505 | * |
Jeremy Joslin | 9925c6a | 2017-03-06 10:39:35 -0800 | [diff] [blame] | 9506 | * Type: int |
| 9507 | * Valid values: |
| 9508 | * -1 = Forced off |
| 9509 | * 0 = Disabled |
| 9510 | * 1 = Enabled |
| 9511 | * |
| 9512 | * Most readers of this setting should simply check if value == 1 to determined the |
| 9513 | * enabled state. |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9514 | * @hide |
| 9515 | */ |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9516 | public static final String NETWORK_RECOMMENDATIONS_ENABLED = |
| 9517 | "network_recommendations_enabled"; |
| 9518 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9519 | private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR = |
| 9520 | new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"}); |
| 9521 | |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9522 | /** |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 9523 | * Which package name to use for network recommendations. If null, network recommendations |
| 9524 | * will neither be requested nor accepted. |
| 9525 | * |
| 9526 | * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and |
| 9527 | * {@link NetworkScoreManager#setActiveScorer(String)} to write it. |
| 9528 | * |
| 9529 | * Type: string - package name |
| 9530 | * @hide |
| 9531 | */ |
| 9532 | public static final String NETWORK_RECOMMENDATIONS_PACKAGE = |
| 9533 | "network_recommendations_package"; |
| 9534 | |
| 9535 | /** |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9536 | * The package name of the application that connect and secures high quality open wifi |
| 9537 | * networks automatically. |
| 9538 | * |
| 9539 | * Type: string package name or null if the feature is either not provided or disabled. |
| 9540 | * @hide |
| 9541 | */ |
Eric Enslen | 1e423b9 | 2017-12-18 11:30:21 -0800 | [diff] [blame] | 9542 | @TestApi |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9543 | public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; |
| 9544 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9545 | private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() { |
| 9546 | @Override |
| 9547 | public boolean validate(String value) { |
| 9548 | return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value); |
| 9549 | } |
| 9550 | }; |
| 9551 | |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9552 | /** |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9553 | * The number of milliseconds the {@link com.android.server.NetworkScoreService} |
| 9554 | * will give a recommendation request to complete before returning a default response. |
| 9555 | * |
| 9556 | * Type: long |
| 9557 | * @hide |
Jeremy Joslin | b1a0139 | 2017-04-14 13:35:48 -0700 | [diff] [blame] | 9558 | * @deprecated to be removed |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9559 | */ |
| 9560 | public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = |
| 9561 | "network_recommendation_request_timeout_ms"; |
| 9562 | |
Amin Shaikh | d3c8193 | 2017-02-06 16:22:42 -0800 | [diff] [blame] | 9563 | /** |
| 9564 | * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in |
| 9565 | * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. |
| 9566 | * |
| 9567 | * Type: long |
| 9568 | * @hide |
| 9569 | */ |
| 9570 | public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = |
| 9571 | "recommended_network_evaluator_cache_expiry_ms"; |
| 9572 | |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9573 | /** |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9574 | * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for |
| 9575 | * connectivity. |
| 9576 | * @hide |
| 9577 | */ |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9578 | public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; |
| 9579 | |
| 9580 | /** |
| 9581 | * The length in milliseconds of a BLE scan window in a low-power scan mode. |
| 9582 | * @hide |
| 9583 | */ |
| 9584 | public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; |
| 9585 | |
| 9586 | /** |
| 9587 | * The length in milliseconds of a BLE scan window in a balanced scan mode. |
| 9588 | * @hide |
| 9589 | */ |
| 9590 | public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; |
| 9591 | |
| 9592 | /** |
| 9593 | * The length in milliseconds of a BLE scan window in a low-latency scan mode. |
| 9594 | * @hide |
| 9595 | */ |
| 9596 | public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = |
| 9597 | "ble_scan_low_latency_window_ms"; |
| 9598 | |
| 9599 | /** |
| 9600 | * The length in milliseconds of a BLE scan interval in a low-power scan mode. |
| 9601 | * @hide |
| 9602 | */ |
| 9603 | public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = |
| 9604 | "ble_scan_low_power_interval_ms"; |
| 9605 | |
| 9606 | /** |
| 9607 | * The length in milliseconds of a BLE scan interval in a balanced scan mode. |
| 9608 | * @hide |
| 9609 | */ |
| 9610 | public static final String BLE_SCAN_BALANCED_INTERVAL_MS = |
| 9611 | "ble_scan_balanced_interval_ms"; |
| 9612 | |
| 9613 | /** |
| 9614 | * The length in milliseconds of a BLE scan interval in a low-latency scan mode. |
| 9615 | * @hide |
| 9616 | */ |
| 9617 | public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = |
| 9618 | "ble_scan_low_latency_interval_ms"; |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9619 | |
Anthony Stange | c97870a | 2018-03-14 01:09:45 +0000 | [diff] [blame] | 9620 | /** |
| 9621 | * The mode that BLE scanning clients will be moved to when in the background. |
| 9622 | * @hide |
| 9623 | */ |
| 9624 | public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; |
| 9625 | |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9626 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9627 | * Used to save the Wifi_ON state prior to tethering. |
| 9628 | * This state will be checked to restore Wifi after |
| 9629 | * the user turns off tethering. |
| 9630 | * |
| 9631 | * @hide |
| 9632 | */ |
| 9633 | public static final String WIFI_SAVED_STATE = "wifi_saved_state"; |
| 9634 | |
| 9635 | /** |
| 9636 | * The interval in milliseconds to scan as used by the wifi supplicant |
| 9637 | * @hide |
| 9638 | */ |
| 9639 | public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = |
| 9640 | "wifi_supplicant_scan_interval_ms"; |
| 9641 | |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 9642 | /** |
| 9643 | * whether frameworks handles wifi auto-join |
| 9644 | * @hide |
| 9645 | */ |
| 9646 | public static final String WIFI_ENHANCED_AUTO_JOIN = |
| 9647 | "wifi_enhanced_auto_join"; |
| 9648 | |
| 9649 | /** |
| 9650 | * whether settings show RSSI |
| 9651 | * @hide |
| 9652 | */ |
| 9653 | public static final String WIFI_NETWORK_SHOW_RSSI = |
| 9654 | "wifi_network_show_rssi"; |
| 9655 | |
| 9656 | /** |
Irfan Sheriff | 3809f50 | 2012-09-17 16:04:57 -0700 | [diff] [blame] | 9657 | * The interval in milliseconds to scan at supplicant when p2p is connected |
| 9658 | * @hide |
| 9659 | */ |
| 9660 | public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = |
| 9661 | "wifi_scan_interval_p2p_connected_ms"; |
| 9662 | |
| 9663 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9664 | * Whether the Wi-Fi watchdog is enabled. |
| 9665 | */ |
| 9666 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 9667 | |
| 9668 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9669 | * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and |
| 9670 | * the setting needs to be set to 0 to disable it. |
| 9671 | * @hide |
| 9672 | */ |
| 9673 | public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = |
| 9674 | "wifi_watchdog_poor_network_test_enabled"; |
| 9675 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9676 | private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR = |
| 9677 | ANY_STRING_VALIDATOR; |
| 9678 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9679 | /** |
| 9680 | * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and |
| 9681 | * needs to be set to 0 to disable it. |
| 9682 | * @hide |
| 9683 | */ |
| 9684 | public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = |
| 9685 | "wifi_suspend_optimizations_enabled"; |
| 9686 | |
| 9687 | /** |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9688 | * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 |
| 9689 | * will enable it. In the future, additional values may be supported. |
| 9690 | * @hide |
| 9691 | */ |
| 9692 | public static final String WIFI_VERBOSE_LOGGING_ENABLED = |
| 9693 | "wifi_verbose_logging_enabled"; |
| 9694 | |
Jong Wook Kim | 0a20eda | 2018-01-05 18:40:25 -0800 | [diff] [blame] | 9695 | /** |
| 9696 | * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and |
| 9697 | * setting to 1 will enable it. In the future, additional values may be supported. |
| 9698 | * @hide |
| 9699 | */ |
| 9700 | public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = |
| 9701 | "wifi_connected_mac_randomization_enabled"; |
| 9702 | |
Michael Plass | f1510fb | 2018-02-28 16:08:47 -0800 | [diff] [blame] | 9703 | /** |
| 9704 | * Parameters to adjust the performance of framework wifi scoring methods. |
| 9705 | * <p> |
| 9706 | * Encoded as a comma-separated key=value list, for example: |
| 9707 | * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" |
| 9708 | * This is intended for experimenting with new parameter values, |
| 9709 | * and is normally unset or empty. The example does not include all |
| 9710 | * parameters that may be honored. |
| 9711 | * Default values are provided by code or device configurations. |
| 9712 | * Errors in the parameters will cause the entire setting to be ignored. |
| 9713 | * @hide |
| 9714 | */ |
| 9715 | public static final String WIFI_SCORE_PARAMS = |
| 9716 | "wifi_score_params"; |
| 9717 | |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9718 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9719 | * The maximum number of times we will retry a connection to an access |
| 9720 | * point for which we have failed in acquiring an IP address from DHCP. |
| 9721 | * A value of N means that we will make N+1 connection attempts in all. |
| 9722 | */ |
| 9723 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; |
| 9724 | |
| 9725 | /** |
| 9726 | * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile |
| 9727 | * data connectivity to be established after a disconnect from Wi-Fi. |
| 9728 | */ |
| 9729 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 9730 | "wifi_mobile_data_transition_wakelock_timeout_ms"; |
| 9731 | |
| 9732 | /** |
Zoltan Szatmary-Ban | 4045d24 | 2015-05-27 12:42:39 +0100 | [diff] [blame] | 9733 | * This setting controls whether WiFi configurations created by a Device Owner app |
| 9734 | * should be locked down (that is, be editable or removable only by the Device Owner App, |
| 9735 | * not even by Settings app). |
| 9736 | * This setting takes integer values. Non-zero values mean DO created configurations |
| 9737 | * are locked down. Value of zero means they are not. Default value in the absence of |
| 9738 | * actual value to this setting is 0. |
| 9739 | */ |
| 9740 | public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = |
| 9741 | "wifi_device_owner_configs_lockdown"; |
| 9742 | |
| 9743 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9744 | * The operational wifi frequency band |
| 9745 | * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, |
| 9746 | * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or |
| 9747 | * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} |
| 9748 | * |
| 9749 | * @hide |
| 9750 | */ |
| 9751 | public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; |
| 9752 | |
| 9753 | /** |
| 9754 | * The Wi-Fi peer-to-peer device name |
| 9755 | * @hide |
| 9756 | */ |
| 9757 | public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; |
| 9758 | |
| 9759 | /** |
Robert Greenwalt | c12783a | 2013-05-16 12:48:20 -0700 | [diff] [blame] | 9760 | * The min time between wifi disable and wifi enable |
| 9761 | * @hide |
| 9762 | */ |
| 9763 | public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; |
| 9764 | |
| 9765 | /** |
Jeff Davidson | a20ca67d | 2014-12-16 11:48:54 -0800 | [diff] [blame] | 9766 | * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect |
| 9767 | * from an ephemeral network if there is no BSSID for that network with a non-null score that |
| 9768 | * has been seen in this time period. |
| 9769 | * |
| 9770 | * If this is less than or equal to zero, we use a more conservative behavior and only check |
| 9771 | * for a non-null score from the currently connected or target BSSID. |
| 9772 | * @hide |
| 9773 | */ |
| 9774 | public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = |
| 9775 | "wifi_ephemeral_out_of_range_timeout_ms"; |
| 9776 | |
| 9777 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9778 | * The number of milliseconds to delay when checking for data stalls during |
| 9779 | * non-aggressive detection. (screen is turned off.) |
| 9780 | * @hide |
| 9781 | */ |
| 9782 | public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = |
| 9783 | "data_stall_alarm_non_aggressive_delay_in_ms"; |
| 9784 | |
| 9785 | /** |
| 9786 | * The number of milliseconds to delay when checking for data stalls during |
| 9787 | * aggressive detection. (screen on or suspected data stall) |
| 9788 | * @hide |
| 9789 | */ |
| 9790 | public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = |
| 9791 | "data_stall_alarm_aggressive_delay_in_ms"; |
| 9792 | |
| 9793 | /** |
Wink Saville | ce1e379 | 2013-09-03 16:41:44 -0700 | [diff] [blame] | 9794 | * The number of milliseconds to allow the provisioning apn to remain active |
| 9795 | * @hide |
| 9796 | */ |
| 9797 | public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = |
| 9798 | "provisioning_apn_alarm_delay_in_ms"; |
| 9799 | |
| 9800 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9801 | * The interval in milliseconds at which to check gprs registration |
| 9802 | * after the first registration mismatch of gprs and voice service, |
| 9803 | * to detect possible data network registration problems. |
| 9804 | * |
| 9805 | * @hide |
| 9806 | */ |
| 9807 | public static final String GPRS_REGISTER_CHECK_PERIOD_MS = |
| 9808 | "gprs_register_check_period_ms"; |
| 9809 | |
| 9810 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9811 | * Nonzero causes Log.wtf() to crash. |
| 9812 | * @hide |
| 9813 | */ |
| 9814 | public static final String WTF_IS_FATAL = "wtf_is_fatal"; |
| 9815 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 9816 | /** |
| 9817 | * Ringer mode. This is used internally, changing this value will not |
| 9818 | * change the ringer mode. See AudioManager. |
| 9819 | */ |
| 9820 | public static final String MODE_RINGER = "mode_ringer"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9821 | |
Jeff Brown | d493596 | 2012-09-25 13:27:20 -0700 | [diff] [blame] | 9822 | /** |
| 9823 | * Overlay display devices setting. |
| 9824 | * The associated value is a specially formatted string that describes the |
| 9825 | * size and density of simulated secondary display devices. |
| 9826 | * <p> |
| 9827 | * Format: {width}x{height}/{dpi};... |
| 9828 | * </p><p> |
| 9829 | * Example: |
| 9830 | * <ul> |
| 9831 | * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> |
| 9832 | * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first |
| 9833 | * at 1080p and the second at 720p.</li> |
| 9834 | * <li>If the value is empty, then no overlay display devices are created.</li> |
| 9835 | * </ul></p> |
| 9836 | * |
| 9837 | * @hide |
| 9838 | */ |
| 9839 | public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9840 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9841 | /** |
| 9842 | * Threshold values for the duration and level of a discharge cycle, |
| 9843 | * under which we log discharge cycle info. |
| 9844 | * |
| 9845 | * @hide |
| 9846 | */ |
| 9847 | public static final String |
| 9848 | BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; |
| 9849 | |
| 9850 | /** @hide */ |
| 9851 | public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; |
| 9852 | |
| 9853 | /** |
| 9854 | * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR |
| 9855 | * intents on application crashes and ANRs. If this is disabled, the |
| 9856 | * crash/ANR dialog will never display the "Report" button. |
| 9857 | * <p> |
| 9858 | * Type: int (0 = disallow, 1 = allow) |
| 9859 | * |
| 9860 | * @hide |
| 9861 | */ |
| 9862 | public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; |
| 9863 | |
| 9864 | /** |
| 9865 | * Maximum age of entries kept by {@link DropBoxManager}. |
| 9866 | * |
| 9867 | * @hide |
| 9868 | */ |
| 9869 | public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; |
| 9870 | |
| 9871 | /** |
| 9872 | * Maximum number of entry files which {@link DropBoxManager} will keep |
| 9873 | * around. |
| 9874 | * |
| 9875 | * @hide |
| 9876 | */ |
| 9877 | public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; |
| 9878 | |
| 9879 | /** |
| 9880 | * Maximum amount of disk space used by {@link DropBoxManager} no matter |
| 9881 | * what. |
| 9882 | * |
| 9883 | * @hide |
| 9884 | */ |
| 9885 | public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; |
| 9886 | |
| 9887 | /** |
| 9888 | * Percent of free disk (excluding reserve) which {@link DropBoxManager} |
| 9889 | * will use. |
| 9890 | * |
| 9891 | * @hide |
| 9892 | */ |
| 9893 | public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; |
| 9894 | |
| 9895 | /** |
| 9896 | * Percent of total disk which {@link DropBoxManager} will never dip |
| 9897 | * into. |
| 9898 | * |
| 9899 | * @hide |
| 9900 | */ |
| 9901 | public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; |
| 9902 | |
| 9903 | /** |
| 9904 | * Prefix for per-tag dropbox disable/enable settings. |
| 9905 | * |
| 9906 | * @hide |
| 9907 | */ |
| 9908 | public static final String DROPBOX_TAG_PREFIX = "dropbox:"; |
| 9909 | |
| 9910 | /** |
| 9911 | * Lines of logcat to include with system crash/ANR/etc. reports, as a |
| 9912 | * prefix of the dropbox tag of the report type. For example, |
| 9913 | * "logcat_for_system_server_anr" controls the lines of logcat captured |
| 9914 | * with system server ANR reports. 0 to disable. |
| 9915 | * |
| 9916 | * @hide |
| 9917 | */ |
| 9918 | public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; |
| 9919 | |
| 9920 | /** |
| 9921 | * The interval in minutes after which the amount of free storage left |
| 9922 | * on the device is logged to the event log |
| 9923 | * |
| 9924 | * @hide |
| 9925 | */ |
| 9926 | public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; |
| 9927 | |
| 9928 | /** |
| 9929 | * Threshold for the amount of change in disk free space required to |
| 9930 | * report the amount of free space. Used to prevent spamming the logs |
| 9931 | * when the disk free space isn't changing frequently. |
| 9932 | * |
| 9933 | * @hide |
| 9934 | */ |
| 9935 | public static final String |
| 9936 | DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; |
| 9937 | |
| 9938 | /** |
| 9939 | * Minimum percentage of free storage on the device that is used to |
| 9940 | * determine if the device is running low on storage. The default is 10. |
| 9941 | * <p> |
| 9942 | * Say this value is set to 10, the device is considered running low on |
| 9943 | * storage if 90% or more of the device storage is filled up. |
| 9944 | * |
| 9945 | * @hide |
| 9946 | */ |
| 9947 | public static final String |
| 9948 | SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; |
| 9949 | |
| 9950 | /** |
| 9951 | * Maximum byte size of the low storage threshold. This is to ensure |
| 9952 | * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an |
| 9953 | * overly large threshold for large storage devices. Currently this must |
| 9954 | * be less than 2GB. This default is 500MB. |
| 9955 | * |
| 9956 | * @hide |
| 9957 | */ |
| 9958 | public static final String |
| 9959 | SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; |
| 9960 | |
| 9961 | /** |
| 9962 | * Minimum bytes of free storage on the device before the data partition |
| 9963 | * is considered full. By default, 1 MB is reserved to avoid system-wide |
| 9964 | * SQLite disk full exceptions. |
| 9965 | * |
| 9966 | * @hide |
| 9967 | */ |
| 9968 | public static final String |
| 9969 | SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; |
| 9970 | |
| 9971 | /** |
Jeff Sharkey | d5d5e92 | 2017-02-21 10:51:23 -0700 | [diff] [blame] | 9972 | * Minimum percentage of storage on the device that is reserved for |
| 9973 | * cached data. |
| 9974 | * |
| 9975 | * @hide |
| 9976 | */ |
| 9977 | public static final String |
| 9978 | SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; |
| 9979 | |
| 9980 | /** |
| 9981 | * Maximum bytes of storage on the device that is reserved for cached |
| 9982 | * data. |
| 9983 | * |
| 9984 | * @hide |
| 9985 | */ |
| 9986 | public static final String |
| 9987 | SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; |
| 9988 | |
| 9989 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9990 | * The maximum reconnect delay for short network outages or when the |
| 9991 | * network is suspended due to phone use. |
| 9992 | * |
| 9993 | * @hide |
| 9994 | */ |
| 9995 | public static final String |
| 9996 | SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; |
| 9997 | |
| 9998 | /** |
| 9999 | * The number of milliseconds to delay before sending out |
Erik Kline | 8f29dcf | 2014-12-08 16:25:20 +0900 | [diff] [blame] | 10000 | * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10001 | * |
| 10002 | * @hide |
| 10003 | */ |
| 10004 | public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; |
| 10005 | |
Vinit Deshapnde | 1f12cb5 | 2013-08-21 13:09:01 -0700 | [diff] [blame] | 10006 | |
| 10007 | /** |
| 10008 | * Network sampling interval, in seconds. We'll generate link information |
| 10009 | * about bytes/packets sent and error rates based on data sampled in this interval |
| 10010 | * |
| 10011 | * @hide |
| 10012 | */ |
| 10013 | |
| 10014 | public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = |
| 10015 | "connectivity_sampling_interval_in_seconds"; |
| 10016 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10017 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 10018 | * The series of successively longer delays used in retrying to download PAC file. |
| 10019 | * Last delay is used between successful PAC downloads. |
| 10020 | * |
| 10021 | * @hide |
| 10022 | */ |
| 10023 | public static final String PAC_CHANGE_DELAY = "pac_change_delay"; |
| 10024 | |
| 10025 | /** |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 10026 | * Don't attempt to detect captive portals. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10027 | * |
| 10028 | * @hide |
| 10029 | */ |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 10030 | public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; |
| 10031 | |
| 10032 | /** |
| 10033 | * When detecting a captive portal, display a notification that |
| 10034 | * prompts the user to sign in. |
| 10035 | * |
| 10036 | * @hide |
| 10037 | */ |
| 10038 | public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; |
| 10039 | |
| 10040 | /** |
| 10041 | * When detecting a captive portal, immediately disconnect from the |
| 10042 | * network and do not reconnect to that network in the future. |
| 10043 | * |
| 10044 | * @hide |
| 10045 | */ |
| 10046 | public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; |
| 10047 | |
| 10048 | /** |
| 10049 | * What to do when connecting a network that presents a captive portal. |
| 10050 | * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. |
| 10051 | * |
| 10052 | * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. |
| 10053 | * @hide |
| 10054 | */ |
| 10055 | public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; |
| 10056 | |
| 10057 | /** |
| 10058 | * Setting to turn off captive portal detection. Feature is enabled by |
| 10059 | * default and the setting needs to be set to 0 to disable it. |
| 10060 | * |
| 10061 | * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection |
| 10062 | * @hide |
| 10063 | */ |
| 10064 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10065 | public static final String |
| 10066 | CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; |
| 10067 | |
| 10068 | /** |
| 10069 | * The server used for captive portal detection upon a new conection. A |
| 10070 | * 204 response code from the server is used for validation. |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10071 | * TODO: remove this deprecated symbol. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10072 | * |
| 10073 | * @hide |
| 10074 | */ |
| 10075 | public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; |
| 10076 | |
| 10077 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10078 | * The URL used for HTTPS captive portal detection upon a new connection. |
| 10079 | * A 204 response code from the server is used for validation. |
| 10080 | * |
| 10081 | * @hide |
| 10082 | */ |
| 10083 | public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; |
| 10084 | |
| 10085 | /** |
| 10086 | * The URL used for HTTP captive portal detection upon a new connection. |
| 10087 | * A 204 response code from the server is used for validation. |
| 10088 | * |
| 10089 | * @hide |
| 10090 | */ |
| 10091 | public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; |
| 10092 | |
| 10093 | /** |
| 10094 | * The URL used for fallback HTTP captive portal detection when previous HTTP |
| 10095 | * and HTTPS captive portal detection attemps did not return a conclusive answer. |
| 10096 | * |
| 10097 | * @hide |
| 10098 | */ |
| 10099 | public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; |
| 10100 | |
| 10101 | /** |
Hugo Benichi | eef918a | 2017-04-10 17:43:08 +0900 | [diff] [blame] | 10102 | * A comma separated list of URLs used for captive portal detection in addition to the |
| 10103 | * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. |
| 10104 | * |
| 10105 | * @hide |
| 10106 | */ |
| 10107 | public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = |
| 10108 | "captive_portal_other_fallback_urls"; |
| 10109 | |
| 10110 | /** |
Lorenzo Colitti | c5be12e | 2016-04-19 21:57:31 +0900 | [diff] [blame] | 10111 | * Whether to use HTTPS for network validation. This is enabled by default and the setting |
| 10112 | * needs to be set to 0 to disable it. This setting is a misnomer because captive portals |
| 10113 | * don't actually use HTTPS, but it's consistent with the other settings. |
| 10114 | * |
| 10115 | * @hide |
| 10116 | */ |
| 10117 | public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; |
| 10118 | |
| 10119 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 10120 | * Which User-Agent string to use in the header of the captive portal detection probes. |
| 10121 | * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). |
| 10122 | * |
| 10123 | * @hide |
| 10124 | */ |
| 10125 | public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; |
| 10126 | |
| 10127 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10128 | * Whether network service discovery is enabled. |
| 10129 | * |
| 10130 | * @hide |
| 10131 | */ |
| 10132 | public static final String NSD_ON = "nsd_on"; |
| 10133 | |
| 10134 | /** |
| 10135 | * Let user pick default install location. |
| 10136 | * |
| 10137 | * @hide |
| 10138 | */ |
| 10139 | public static final String SET_INSTALL_LOCATION = "set_install_location"; |
| 10140 | |
| 10141 | /** |
| 10142 | * Default install location value. |
| 10143 | * 0 = auto, let system decide |
| 10144 | * 1 = internal |
| 10145 | * 2 = sdcard |
| 10146 | * @hide |
| 10147 | */ |
| 10148 | public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; |
| 10149 | |
| 10150 | /** |
| 10151 | * ms during which to consume extra events related to Inet connection |
| 10152 | * condition after a transtion to fully-connected |
| 10153 | * |
| 10154 | * @hide |
| 10155 | */ |
| 10156 | public static final String |
| 10157 | INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; |
| 10158 | |
| 10159 | /** |
| 10160 | * ms during which to consume extra events related to Inet connection |
| 10161 | * condtion after a transtion to partly-connected |
| 10162 | * |
| 10163 | * @hide |
| 10164 | */ |
| 10165 | public static final String |
| 10166 | INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; |
| 10167 | |
| 10168 | /** {@hide} */ |
| 10169 | public static final String |
| 10170 | READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; |
| 10171 | |
| 10172 | /** |
| 10173 | * Host name and port for global http proxy. Uses ':' seperator for |
| 10174 | * between host and port. |
| 10175 | */ |
| 10176 | public static final String HTTP_PROXY = "http_proxy"; |
| 10177 | |
| 10178 | /** |
| 10179 | * Host name for global http proxy. Set via ConnectivityManager. |
| 10180 | * |
| 10181 | * @hide |
| 10182 | */ |
| 10183 | public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; |
| 10184 | |
| 10185 | /** |
| 10186 | * Integer host port for global http proxy. Set via ConnectivityManager. |
| 10187 | * |
| 10188 | * @hide |
| 10189 | */ |
| 10190 | public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; |
| 10191 | |
| 10192 | /** |
| 10193 | * Exclusion list for global proxy. This string contains a list of |
| 10194 | * comma-separated domains where the global proxy does not apply. |
| 10195 | * Domains should be listed in a comma- separated list. Example of |
| 10196 | * acceptable formats: ".domain1.com,my.domain2.com" Use |
| 10197 | * ConnectivityManager to set/get. |
| 10198 | * |
| 10199 | * @hide |
| 10200 | */ |
| 10201 | public static final String |
| 10202 | GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; |
| 10203 | |
| 10204 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 10205 | * The location PAC File for the proxy. |
| 10206 | * @hide |
| 10207 | */ |
| 10208 | public static final String |
| 10209 | GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; |
| 10210 | |
| 10211 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 10212 | * Enables the UI setting to allow the user to specify the global HTTP |
| 10213 | * proxy and associated exclusion list. |
| 10214 | * |
| 10215 | * @hide |
| 10216 | */ |
| 10217 | public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; |
| 10218 | |
| 10219 | /** |
| 10220 | * Setting for default DNS in case nobody suggests one |
| 10221 | * |
| 10222 | * @hide |
| 10223 | */ |
| 10224 | public static final String DEFAULT_DNS_SERVER = "default_dns_server"; |
| 10225 | |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10226 | /** |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10227 | * The requested Private DNS mode (string), and an accompanying specifier (string). |
| 10228 | * |
| 10229 | * Currently, the specifier holds the chosen provider name when the mode requests |
| 10230 | * a specific provider. It may be used to store the provider name even when the |
| 10231 | * mode changes so that temporarily disabling and re-enabling the specific |
| 10232 | * provider mode does not necessitate retyping the provider hostname. |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10233 | * |
| 10234 | * @hide |
| 10235 | */ |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10236 | public static final String PRIVATE_DNS_MODE = "private_dns_mode"; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10237 | |
| 10238 | private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10239 | |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10240 | /** |
| 10241 | * @hide |
| 10242 | */ |
| 10243 | public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10244 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10245 | private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10246 | |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10247 | /** {@hide} */ |
| 10248 | public static final String |
| 10249 | BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; |
| 10250 | /** {@hide} */ |
| 10251 | public static final String |
| 10252 | BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; |
| 10253 | /** {@hide} */ |
| 10254 | public static final String |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10255 | BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; |
| 10256 | /** {@hide} */ |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10257 | public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = |
| 10258 | "bluetooth_a2dp_supports_optional_codecs_"; |
| 10259 | /** {@hide} */ |
| 10260 | public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = |
| 10261 | "bluetooth_a2dp_optional_codecs_enabled_"; |
| 10262 | /** {@hide} */ |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10263 | public static final String |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10264 | BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10265 | /** {@hide} */ |
| 10266 | public static final String |
| 10267 | BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10268 | /** {@hide} */ |
| 10269 | public static final String |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10270 | BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; |
| 10271 | /** {@hide} */ |
| 10272 | public static final String |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 10273 | BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; |
| 10274 | /** {@hide} */ |
| 10275 | public static final String |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10276 | BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10277 | /** {@hide} */ |
| 10278 | public static final String |
| 10279 | BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10280 | /** {@hide} */ |
| 10281 | public static final String |
| 10282 | BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10283 | |
| 10284 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10285 | * Activity manager specific settings. |
| 10286 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10287 | * |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10288 | * "gc_timeout=5000,max_cached_processes=24" |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10289 | * |
| 10290 | * The following keys are supported: |
| 10291 | * |
| 10292 | * <pre> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10293 | * max_cached_processes (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10294 | * background_settle_time (long) |
Dianne Hackborn | cb01563 | 2017-06-14 17:30:15 -0700 | [diff] [blame] | 10295 | * fgservice_min_shown_time (long) |
| 10296 | * fgservice_min_report_time (long) |
| 10297 | * fgservice_screen_on_before_time (long) |
| 10298 | * fgservice_screen_on_after_time (long) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10299 | * content_provider_retain_time (long) |
| 10300 | * gc_timeout (long) |
| 10301 | * gc_min_interval (long) |
| 10302 | * full_pss_min_interval (long) |
| 10303 | * full_pss_lowered_interval (long) |
Dianne Hackborn | ffca58b | 2017-05-24 16:15:45 -0700 | [diff] [blame] | 10304 | * power_check_interval (long) |
| 10305 | * power_check_max_cpu_1 (int) |
| 10306 | * power_check_max_cpu_2 (int) |
| 10307 | * power_check_max_cpu_3 (int) |
| 10308 | * power_check_max_cpu_4 (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10309 | * service_usage_interaction_time (long) |
| 10310 | * usage_stats_interaction_interval (long) |
| 10311 | * service_restart_duration (long) |
| 10312 | * service_reset_run_duration (long) |
| 10313 | * service_restart_duration_factor (int) |
| 10314 | * service_min_restart_time_between (long) |
| 10315 | * service_max_inactivity (long) |
| 10316 | * service_bg_start_timeout (long) |
Sudheer Shanka | f669010 | 2017-10-16 10:20:32 -0700 | [diff] [blame] | 10317 | * process_start_async (boolean) |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10318 | * </pre> |
| 10319 | * |
| 10320 | * <p> |
| 10321 | * Type: string |
| 10322 | * @hide |
| 10323 | * @see com.android.server.am.ActivityManagerConstants |
| 10324 | */ |
| 10325 | public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; |
| 10326 | |
| 10327 | /** |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10328 | * Device Idle (Doze) specific settings. |
| 10329 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10330 | * |
Henrik Baard | eac10ab | 2016-04-19 07:50:24 +0200 | [diff] [blame] | 10331 | * "inactive_to=60000,sensing_to=400000" |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10332 | * |
| 10333 | * The following keys are supported: |
| 10334 | * |
| 10335 | * <pre> |
| 10336 | * inactive_to (long) |
| 10337 | * sensing_to (long) |
| 10338 | * motion_inactive_to (long) |
| 10339 | * idle_after_inactive_to (long) |
| 10340 | * idle_pending_to (long) |
| 10341 | * max_idle_pending_to (long) |
| 10342 | * idle_pending_factor (float) |
| 10343 | * idle_to (long) |
| 10344 | * max_idle_to (long) |
| 10345 | * idle_factor (float) |
| 10346 | * min_time_to_alarm (long) |
| 10347 | * max_temp_app_whitelist_duration (long) |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 10348 | * notification_whitelist_duration (long) |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10349 | * </pre> |
| 10350 | * |
| 10351 | * <p> |
| 10352 | * Type: string |
| 10353 | * @hide |
| 10354 | * @see com.android.server.DeviceIdleController.Constants |
| 10355 | */ |
| 10356 | public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; |
| 10357 | |
| 10358 | /** |
jackqdyulei | 455e90a | 2017-02-09 15:29:16 -0800 | [diff] [blame] | 10359 | * Battery Saver specific settings |
| 10360 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10361 | * |
| 10362 | * "vibration_disabled=true,adjust_brightness_factor=0.5" |
| 10363 | * |
| 10364 | * The following keys are supported: |
| 10365 | * |
| 10366 | * <pre> |
| 10367 | * vibration_disabled (boolean) |
| 10368 | * animation_disabled (boolean) |
| 10369 | * soundtrigger_disabled (boolean) |
| 10370 | * fullbackup_deferred (boolean) |
| 10371 | * keyvaluebackup_deferred (boolean) |
| 10372 | * firewall_disabled (boolean) |
| 10373 | * gps_mode (int) |
| 10374 | * adjust_brightness_disabled (boolean) |
| 10375 | * adjust_brightness_factor (float) |
| 10376 | * </pre> |
| 10377 | * @hide |
| 10378 | * @see com.android.server.power.BatterySaverPolicy |
| 10379 | */ |
| 10380 | public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; |
| 10381 | |
| 10382 | /** |
Makoto Onuki | 66a7812 | 2017-11-14 15:03:21 -0800 | [diff] [blame] | 10383 | * Battery Saver device specific settings |
| 10384 | * This is encoded as a key=value list, separated by commas. |
| 10385 | * See {@link com.android.server.power.BatterySaverPolicy} for the details. |
| 10386 | * |
| 10387 | * @hide |
| 10388 | */ |
| 10389 | public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = |
| 10390 | "battery_saver_device_specific_constants"; |
| 10391 | |
| 10392 | /** |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10393 | * Battery tip specific settings |
| 10394 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10395 | * |
| 10396 | * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10397 | * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," |
| 10398 | * "high_usage_battery_draining=25,high_usage_period_ms=3000" |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10399 | * |
| 10400 | * The following keys are supported: |
| 10401 | * |
| 10402 | * <pre> |
| 10403 | * battery_tip_enabled (boolean) |
| 10404 | * summary_enabled (boolean) |
| 10405 | * battery_saver_tip_enabled (boolean) |
| 10406 | * high_usage_enabled (boolean) |
| 10407 | * high_usage_app_count (int) |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10408 | * high_usage_period_ms (long) |
| 10409 | * high_usage_battery_draining (int) |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10410 | * app_restriction_enabled (boolean) |
| 10411 | * reduced_battery_enabled (boolean) |
| 10412 | * reduced_battery_percent (int) |
| 10413 | * low_battery_enabled (boolean) |
| 10414 | * low_battery_hour (int) |
| 10415 | * </pre> |
| 10416 | * @hide |
| 10417 | */ |
| 10418 | public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; |
| 10419 | |
| 10420 | /** |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10421 | * Battery anomaly detection specific settings |
| 10422 | * This is encoded as a key=value list, separated by commas. |
| 10423 | * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via |
| 10424 | * {@link Uri#encode(String)}, separated by colons. Ex: |
| 10425 | * |
| 10426 | * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," |
| 10427 | * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" |
| 10428 | * |
| 10429 | * The following keys are supported: |
| 10430 | * |
| 10431 | * <pre> |
| 10432 | * anomaly_detection_enabled (boolean) |
| 10433 | * wakelock_enabled (boolean) |
| 10434 | * wakelock_threshold (long) |
| 10435 | * wakeup_alarm_enabled (boolean) |
| 10436 | * wakeup_alarm_threshold (long) |
| 10437 | * wakeup_blacklisted_tags (string) |
| 10438 | * bluetooth_scan_enabled (boolean) |
| 10439 | * bluetooth_scan_threshold (long) |
| 10440 | * </pre> |
| 10441 | * @hide |
| 10442 | */ |
| 10443 | public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; |
| 10444 | |
| 10445 | /** |
jackqdyulei | fa81bee | 2018-02-01 11:16:23 -0800 | [diff] [blame] | 10446 | * An integer to show the version of the anomaly config. Ex: 1, which means |
| 10447 | * current version is 1. |
| 10448 | * @hide |
| 10449 | */ |
| 10450 | public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; |
| 10451 | |
| 10452 | /** |
| 10453 | * A base64-encoded string represents anomaly stats config, used for |
| 10454 | * {@link android.app.StatsManager}. |
| 10455 | * @hide |
| 10456 | */ |
| 10457 | public static final String ANOMALY_CONFIG = "anomaly_config"; |
| 10458 | |
| 10459 | /** |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10460 | * Always on display(AOD) specific settings |
| 10461 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10462 | * |
| 10463 | * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" |
| 10464 | * |
| 10465 | * The following keys are supported: |
| 10466 | * |
| 10467 | * <pre> |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 10468 | * screen_brightness_array (int[]) |
| 10469 | * dimming_scrim_array (int[]) |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10470 | * prox_screen_off_delay (long) |
| 10471 | * prox_cooldown_trigger (long) |
| 10472 | * prox_cooldown_period (long) |
| 10473 | * </pre> |
| 10474 | * @hide |
| 10475 | */ |
| 10476 | public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; |
| 10477 | |
| 10478 | /** |
Shikhar Srivastav | 9a896a6c | 2018-01-09 16:58:36 -0800 | [diff] [blame] | 10479 | * System VDSO global setting. This links to the "sys.vdso" system property. |
| 10480 | * The following values are supported: |
| 10481 | * false -> both 32 and 64 bit vdso disabled |
| 10482 | * 32 -> 32 bit vdso enabled |
| 10483 | * 64 -> 64 bit vdso enabled |
| 10484 | * Any other value defaults to both 32 bit and 64 bit true. |
| 10485 | * @hide |
| 10486 | */ |
| 10487 | public static final String SYS_VDSO = "sys_vdso"; |
| 10488 | |
| 10489 | /** |
Marissa Wall | 04e7a9b | 2018-02-02 09:35:58 -0800 | [diff] [blame] | 10490 | * UidCpuPower global setting. This links the sys.uidcpupower system property. |
| 10491 | * The following values are supported: |
| 10492 | * 0 -> /proc/uid_cpupower/* are disabled |
| 10493 | * 1 -> /proc/uid_cpupower/* are enabled |
| 10494 | * Any other value defaults to enabled. |
| 10495 | * @hide |
| 10496 | */ |
| 10497 | public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; |
| 10498 | |
| 10499 | /** |
Hector Dearman | cf92ca1 | 2018-03-07 11:12:35 +0000 | [diff] [blame] | 10500 | * traced global setting. This controls weather the deamons: traced and |
| 10501 | * traced_probes run. This links the sys.traced system property. |
| 10502 | * The following values are supported: |
| 10503 | * 0 -> traced and traced_probes are disabled |
| 10504 | * 1 -> traced and traced_probes are enabled |
| 10505 | * Any other value defaults to disabled. |
| 10506 | * @hide |
| 10507 | */ |
| 10508 | public static final String SYS_TRACED = "sys_traced"; |
| 10509 | |
| 10510 | /** |
Makoto Onuki | 3c9c998 | 2018-01-17 10:46:48 -0800 | [diff] [blame] | 10511 | * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the |
| 10512 | * device for this setting to take full effect. |
| 10513 | * |
| 10514 | * @hide |
| 10515 | */ |
| 10516 | public static final String FPS_DEVISOR = "fps_divisor"; |
| 10517 | |
| 10518 | /** |
Ajay Dudani | bcfcd6c | 2018-02-05 10:44:27 -0800 | [diff] [blame] | 10519 | * Flag to enable or disable display panel low power mode (lpm) |
| 10520 | * false -> Display panel power saving mode is disabled. |
| 10521 | * true -> Display panel power saving mode is enabled. |
| 10522 | * |
| 10523 | * @hide |
| 10524 | */ |
| 10525 | public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; |
| 10526 | |
| 10527 | /** |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10528 | * App standby (app idle) specific settings. |
| 10529 | * This is encoded as a key=value list, separated by commas. Ex: |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10530 | * <p> |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10531 | * "idle_duration=5000,parole_interval=4500" |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10532 | * <p> |
| 10533 | * All durations are in millis. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10534 | * The following keys are supported: |
| 10535 | * |
| 10536 | * <pre> |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10537 | * idle_duration2 (long) |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10538 | * wallclock_threshold (long) |
| 10539 | * parole_interval (long) |
| 10540 | * parole_duration (long) |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10541 | * |
| 10542 | * idle_duration (long) // This is deprecated and used to circumvent b/26355386. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10543 | * </pre> |
| 10544 | * |
| 10545 | * <p> |
| 10546 | * Type: string |
| 10547 | * @hide |
| 10548 | * @see com.android.server.usage.UsageStatsService.SettingsObserver |
| 10549 | */ |
| 10550 | public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; |
| 10551 | |
| 10552 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10553 | * Power manager specific settings. |
| 10554 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10555 | * |
| 10556 | * "no_cached_wake_locks=1" |
| 10557 | * |
| 10558 | * The following keys are supported: |
| 10559 | * |
| 10560 | * <pre> |
| 10561 | * no_cached_wake_locks (boolean) |
| 10562 | * </pre> |
| 10563 | * |
| 10564 | * <p> |
| 10565 | * Type: string |
| 10566 | * @hide |
| 10567 | * @see com.android.server.power.PowerManagerConstants |
| 10568 | */ |
| 10569 | public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; |
| 10570 | |
| 10571 | /** |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 10572 | * Alarm manager specific settings. |
| 10573 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10574 | * |
| 10575 | * "min_futurity=5000,allow_while_idle_short_time=4500" |
| 10576 | * |
| 10577 | * The following keys are supported: |
| 10578 | * |
| 10579 | * <pre> |
| 10580 | * min_futurity (long) |
| 10581 | * min_interval (long) |
| 10582 | * allow_while_idle_short_time (long) |
| 10583 | * allow_while_idle_long_time (long) |
| 10584 | * allow_while_idle_whitelist_duration (long) |
| 10585 | * </pre> |
| 10586 | * |
| 10587 | * <p> |
| 10588 | * Type: string |
| 10589 | * @hide |
| 10590 | * @see com.android.server.AlarmManagerService.Constants |
| 10591 | */ |
| 10592 | public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; |
| 10593 | |
| 10594 | /** |
Dianne Hackborn | e9a988c | 2016-05-27 17:59:40 -0700 | [diff] [blame] | 10595 | * Job scheduler specific settings. |
| 10596 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10597 | * |
| 10598 | * "min_ready_jobs_count=2,moderate_use_factor=.5" |
| 10599 | * |
| 10600 | * The following keys are supported: |
| 10601 | * |
| 10602 | * <pre> |
| 10603 | * min_idle_count (int) |
| 10604 | * min_charging_count (int) |
| 10605 | * min_connectivity_count (int) |
| 10606 | * min_content_count (int) |
| 10607 | * min_ready_jobs_count (int) |
| 10608 | * heavy_use_factor (float) |
| 10609 | * moderate_use_factor (float) |
| 10610 | * fg_job_count (int) |
| 10611 | * bg_normal_job_count (int) |
| 10612 | * bg_moderate_job_count (int) |
| 10613 | * bg_low_job_count (int) |
| 10614 | * bg_critical_job_count (int) |
| 10615 | * </pre> |
| 10616 | * |
| 10617 | * <p> |
| 10618 | * Type: string |
| 10619 | * @hide |
| 10620 | * @see com.android.server.job.JobSchedulerService.Constants |
| 10621 | */ |
| 10622 | public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; |
| 10623 | |
| 10624 | /** |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10625 | * ShortcutManager specific settings. |
| 10626 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10627 | * |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10628 | * "reset_interval_sec=86400,max_updates_per_interval=1" |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10629 | * |
| 10630 | * The following keys are supported: |
| 10631 | * |
| 10632 | * <pre> |
| 10633 | * reset_interval_sec (long) |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10634 | * max_updates_per_interval (int) |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10635 | * max_icon_dimension_dp (int, DP) |
| 10636 | * max_icon_dimension_dp_lowram (int, DP) |
| 10637 | * max_shortcuts (int) |
| 10638 | * icon_quality (int, 0-100) |
| 10639 | * icon_format (String) |
| 10640 | * </pre> |
| 10641 | * |
| 10642 | * <p> |
| 10643 | * Type: string |
| 10644 | * @hide |
| 10645 | * @see com.android.server.pm.ShortcutService.ConfigConstants |
| 10646 | */ |
| 10647 | public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; |
| 10648 | |
| 10649 | /** |
Makoto Onuki | 09c529a | 2017-05-01 10:05:28 -0700 | [diff] [blame] | 10650 | * DevicePolicyManager specific settings. |
| 10651 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10652 | * |
| 10653 | * <pre> |
| 10654 | * das_died_service_reconnect_backoff_sec (long) |
| 10655 | * das_died_service_reconnect_backoff_increase (float) |
| 10656 | * das_died_service_reconnect_max_backoff_sec (long) |
| 10657 | * </pre> |
| 10658 | * |
| 10659 | * <p> |
| 10660 | * Type: string |
| 10661 | * @hide |
| 10662 | * see also com.android.server.devicepolicy.DevicePolicyConstants |
| 10663 | */ |
| 10664 | public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; |
| 10665 | |
| 10666 | /** |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10667 | * TextClassifier specific settings. |
Jan Althaus | 0aacdb6 | 2018-02-19 11:44:37 +0100 | [diff] [blame] | 10668 | * This is encoded as a key=value list, separated by commas. String[] types like |
| 10669 | * entity_list_default use ":" as delimiter for values. Ex: |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10670 | * |
| 10671 | * <pre> |
Abodunrinwa Toki | c7073a4 | 2018-02-28 23:02:13 +0000 | [diff] [blame] | 10672 | * smart_linkify_enabled (boolean) |
| 10673 | * system_textclassifier_enabled (boolean) |
Abodunrinwa Toki | db8fc31 | 2018-02-26 21:37:51 +0000 | [diff] [blame] | 10674 | * model_dark_launch_enabled (boolean) |
| 10675 | * smart_selection_enabled (boolean) |
| 10676 | * smart_text_share_enabled (boolean) |
| 10677 | * smart_linkify_enabled (boolean) |
| 10678 | * smart_select_animation_enabled (boolean) |
Jan Althaus | 108aad3 | 2018-01-30 15:26:55 +0100 | [diff] [blame] | 10679 | * suggest_selection_max_range_length (int) |
| 10680 | * classify_text_max_range_length (int) |
| 10681 | * generate_links_max_text_length (int) |
Jan Althaus | 31efdc3 | 2018-02-19 22:23:13 +0100 | [diff] [blame] | 10682 | * generate_links_log_sample_rate (int) |
Jan Althaus | 0aacdb6 | 2018-02-19 11:44:37 +0100 | [diff] [blame] | 10683 | * entity_list_default (String[]) |
| 10684 | * entity_list_not_editable (String[]) |
| 10685 | * entity_list_editable (String[]) |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10686 | * </pre> |
| 10687 | * |
| 10688 | * <p> |
| 10689 | * Type: string |
| 10690 | * @hide |
Abodunrinwa Toki | db8fc31 | 2018-02-26 21:37:51 +0000 | [diff] [blame] | 10691 | * see also android.view.textclassifier.TextClassificationConstants |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10692 | */ |
| 10693 | public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; |
| 10694 | |
| 10695 | /** |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10696 | * BatteryStats specific settings. |
| 10697 | * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" |
| 10698 | * |
| 10699 | * The following keys are supported: |
| 10700 | * <pre> |
| 10701 | * track_cpu_times_by_proc_state (boolean) |
Mike Ma | fae87da | 2018-01-19 20:07:20 -0800 | [diff] [blame] | 10702 | * track_cpu_active_cluster_time (boolean) |
| 10703 | * read_binary_cpu_time (boolean) |
Sudheer Shanka | c20379e | 2018-02-15 00:06:21 -0800 | [diff] [blame] | 10704 | * proc_state_cpu_times_read_delay_ms (long) |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10705 | * </pre> |
| 10706 | * |
| 10707 | * <p> |
| 10708 | * Type: string |
| 10709 | * @hide |
| 10710 | * see also com.android.internal.os.BatteryStatsImpl.Constants |
| 10711 | */ |
| 10712 | public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; |
| 10713 | |
| 10714 | /** |
Makoto Onuki | aad2b51 | 2018-02-07 09:31:46 -0800 | [diff] [blame] | 10715 | * SyncManager specific settings. |
| 10716 | * |
| 10717 | * <p> |
| 10718 | * Type: string |
| 10719 | * @hide |
| 10720 | * @see com.android.server.content.SyncManagerConstants |
| 10721 | */ |
| 10722 | public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; |
| 10723 | |
| 10724 | /** |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10725 | * Whether or not App Standby feature is enabled. This controls throttling of apps |
| 10726 | * based on usage patterns and predictions. |
| 10727 | * Type: int (0 for false, 1 for true) |
| 10728 | * Default: 1 |
| 10729 | * @hide |
| 10730 | */ |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10731 | public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10732 | |
| 10733 | /** |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 10734 | * Whether or not app auto restriction is enabled. When it is enabled, settings app will |
| 10735 | * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time). |
| 10736 | * |
| 10737 | * Type: boolean (0 for false, 1 for true) |
| 10738 | * Default: 1 |
| 10739 | * |
| 10740 | * @hide |
| 10741 | */ |
Kweku Adams | 3699c36 | 2018-03-13 13:32:34 -0700 | [diff] [blame] | 10742 | public static final String APP_AUTO_RESTRICTION_ENABLED = |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 10743 | "app_auto_restriction_enabled"; |
| 10744 | |
| 10745 | private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR = |
| 10746 | BOOLEAN_VALIDATOR; |
| 10747 | |
| 10748 | /** |
Suprabh Shukla | 4deb852 | 2018-01-08 16:27:10 -0800 | [diff] [blame] | 10749 | * Feature flag to enable or disable the Forced App Standby feature. |
| 10750 | * Type: int (0 for false, 1 for true) |
| 10751 | * Default: 1 |
| 10752 | * @hide |
| 10753 | */ |
| 10754 | public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; |
| 10755 | |
| 10756 | /** |
Nancy Zheng | 525aaa1 | 2018-01-12 11:45:37 -0800 | [diff] [blame] | 10757 | * Whether or not to enable Forced App Standby on small battery devices. |
| 10758 | * Type: int (0 for false, 1 for true) |
| 10759 | * Default: 0 |
| 10760 | * @hide |
| 10761 | */ |
| 10762 | public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED |
| 10763 | = "forced_app_standby_for_small_battery_enabled"; |
| 10764 | |
| 10765 | /** |
Damien Bargiacchi | 50b6110 | 2018-02-15 16:45:37 -0800 | [diff] [blame] | 10766 | * Whether or not to enable the Off Body, Radios Off feature on small battery devices. |
| 10767 | * Type: int (0 for false, 1 for true) |
| 10768 | * Default: 0 |
| 10769 | * @hide |
| 10770 | */ |
| 10771 | public static final String OFF_BODY_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED |
| 10772 | = "off_body_radios_off_for_small_battery_enabled"; |
| 10773 | |
| 10774 | /** |
| 10775 | * How long after the device goes off body to disable radios, in milliseconds. |
| 10776 | * Type: long |
| 10777 | * Default: 10 minutes |
| 10778 | * @hide |
| 10779 | */ |
| 10780 | public static final String OFF_BODY_RADIOS_OFF_DELAY_MS = "off_body_radios_off_delay_ms"; |
| 10781 | |
| 10782 | /** |
yuanlu | b6b0495 | 2018-02-20 14:28:13 -0800 | [diff] [blame] | 10783 | * Whether or not to turn on Wifi when proxy is disconnected. |
| 10784 | * Type: int (0 for false, 1 for true) |
| 10785 | * Default: 1 |
| 10786 | * @hide |
| 10787 | */ |
| 10788 | public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED |
| 10789 | = "wifi_on_when_proxy_disconnected"; |
| 10790 | |
| 10791 | /** |
Michael Kwan | 5f5a0bf | 2018-03-16 12:25:50 -0700 | [diff] [blame] | 10792 | * Time Only Mode specific settings. |
| 10793 | * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" |
| 10794 | * |
| 10795 | * The following keys are supported: |
| 10796 | * |
| 10797 | * <pre> |
| 10798 | * enabled (boolean) |
| 10799 | * disable_tilt_to_wake (boolean) |
| 10800 | * disable_touch_to_wake (boolean) |
| 10801 | * </pre> |
| 10802 | * Type: string |
Michael Kwan | 47abf8c | 2018-01-23 13:57:18 -0800 | [diff] [blame] | 10803 | * @hide |
| 10804 | */ |
Michael Kwan | 5f5a0bf | 2018-03-16 12:25:50 -0700 | [diff] [blame] | 10805 | public static final String TIME_ONLY_MODE_CONSTANTS |
| 10806 | = "time_only_mode_constants"; |
Michael Kwan | 47abf8c | 2018-01-23 13:57:18 -0800 | [diff] [blame] | 10807 | |
| 10808 | /** |
Ricky Wai | eef5065 | 2017-12-21 16:27:40 +0000 | [diff] [blame] | 10809 | * Whether or not Network Watchlist feature is enabled. |
| 10810 | * Type: int (0 for false, 1 for true) |
| 10811 | * Default: 0 |
| 10812 | * @hide |
| 10813 | */ |
| 10814 | public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; |
| 10815 | |
| 10816 | /** |
Robin Lee | 81ad972 | 2018-01-19 16:34:31 +0100 | [diff] [blame] | 10817 | * Flag to keep background restricted profiles running after exiting. If disabled, |
| 10818 | * the restricted profile can be put into stopped state as soon as the user leaves it. |
| 10819 | * Type: int (0 for false, 1 for true) |
| 10820 | * |
| 10821 | * Overridden by the system based on device information. If null, the value specified |
| 10822 | * by {@code config_keepRestrictedProfilesInBackground} is used. |
| 10823 | * |
| 10824 | * @hide |
| 10825 | */ |
| 10826 | public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; |
| 10827 | |
| 10828 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10829 | * Get the key that retrieves a bluetooth headset's priority. |
| 10830 | * @hide |
| 10831 | */ |
| 10832 | public static final String getBluetoothHeadsetPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10833 | return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10834 | } |
| 10835 | |
| 10836 | /** |
| 10837 | * Get the key that retrieves a bluetooth a2dp sink's priority. |
| 10838 | * @hide |
| 10839 | */ |
| 10840 | public static final String getBluetoothA2dpSinkPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10841 | return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10842 | } |
| 10843 | |
| 10844 | /** |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10845 | * Get the key that retrieves a bluetooth a2dp src's priority. |
| 10846 | * @hide |
| 10847 | */ |
| 10848 | public static final String getBluetoothA2dpSrcPriorityKey(String address) { |
| 10849 | return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10850 | } |
| 10851 | |
| 10852 | /** |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10853 | * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs. |
| 10854 | * @hide |
| 10855 | */ |
| 10856 | public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) { |
| 10857 | return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX + |
| 10858 | address.toUpperCase(Locale.ROOT); |
| 10859 | } |
| 10860 | |
| 10861 | /** |
| 10862 | * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs |
| 10863 | * enabled. |
| 10864 | * @hide |
| 10865 | */ |
| 10866 | public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) { |
| 10867 | return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX + |
| 10868 | address.toUpperCase(Locale.ROOT); |
| 10869 | } |
| 10870 | |
| 10871 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10872 | * Get the key that retrieves a bluetooth Input Device's priority. |
| 10873 | * @hide |
| 10874 | */ |
Hansong Zhang | c26c76c | 2017-10-20 15:55:59 -0700 | [diff] [blame] | 10875 | public static final String getBluetoothHidHostPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10876 | return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10877 | } |
| 10878 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10879 | /** |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10880 | * Get the key that retrieves a bluetooth pan client priority. |
| 10881 | * @hide |
| 10882 | */ |
| 10883 | public static final String getBluetoothPanPriorityKey(String address) { |
| 10884 | return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10885 | } |
| 10886 | |
| 10887 | /** |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10888 | * Get the key that retrieves a bluetooth hearing aid priority. |
| 10889 | * @hide |
| 10890 | */ |
| 10891 | public static final String getBluetoothHearingAidPriorityKey(String address) { |
| 10892 | return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10893 | } |
| 10894 | |
| 10895 | /** |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10896 | * Get the key that retrieves a bluetooth map priority. |
| 10897 | * @hide |
| 10898 | */ |
| 10899 | public static final String getBluetoothMapPriorityKey(String address) { |
| 10900 | return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10901 | } |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10902 | |
| 10903 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10904 | * Get the key that retrieves a bluetooth map client priority. |
| 10905 | * @hide |
| 10906 | */ |
| 10907 | public static final String getBluetoothMapClientPriorityKey(String address) { |
| 10908 | return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10909 | } |
| 10910 | |
| 10911 | /** |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 10912 | * Get the key that retrieves a bluetooth pbap client priority. |
| 10913 | * @hide |
| 10914 | */ |
| 10915 | public static final String getBluetoothPbapClientPriorityKey(String address) { |
| 10916 | return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10917 | } |
| 10918 | |
| 10919 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10920 | * Get the key that retrieves a bluetooth sap priority. |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10921 | * @hide |
| 10922 | */ |
| 10923 | public static final String getBluetoothSapPriorityKey(String address) { |
| 10924 | return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10925 | } |
| 10926 | |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10927 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10928 | * Scaling factor for normal window animations. Setting to 0 will |
| 10929 | * disable window animations. |
| 10930 | */ |
| 10931 | public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; |
| 10932 | |
| 10933 | /** |
| 10934 | * Scaling factor for activity transition animations. Setting to 0 will |
| 10935 | * disable window animations. |
| 10936 | */ |
| 10937 | public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; |
| 10938 | |
| 10939 | /** |
| 10940 | * Scaling factor for Animator-based animations. This affects both the |
| 10941 | * start delay and duration of all such animations. Setting to 0 will |
| 10942 | * cause animations to end immediately. The default value is 1. |
| 10943 | */ |
| 10944 | public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; |
| 10945 | |
| 10946 | /** |
| 10947 | * Scaling factor for normal window animations. Setting to 0 will |
| 10948 | * disable window animations. |
| 10949 | * |
| 10950 | * @hide |
| 10951 | */ |
| 10952 | public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; |
| 10953 | |
| 10954 | /** |
| 10955 | * If 0, the compatibility mode is off for all applications. |
| 10956 | * If 1, older applications run under compatibility mode. |
| 10957 | * TODO: remove this settings before code freeze (bug/1907571) |
| 10958 | * @hide |
| 10959 | */ |
| 10960 | public static final String COMPATIBILITY_MODE = "compatibility_mode"; |
| 10961 | |
| 10962 | /** |
| 10963 | * CDMA only settings |
| 10964 | * Emergency Tone 0 = Off |
| 10965 | * 1 = Alert |
| 10966 | * 2 = Vibrate |
| 10967 | * @hide |
| 10968 | */ |
| 10969 | public static final String EMERGENCY_TONE = "emergency_tone"; |
| 10970 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10971 | private static final Validator EMERGENCY_TONE_VALIDATOR = |
| 10972 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 10973 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10974 | /** |
| 10975 | * CDMA only settings |
| 10976 | * Whether the auto retry is enabled. The value is |
| 10977 | * boolean (1 or 0). |
| 10978 | * @hide |
| 10979 | */ |
| 10980 | public static final String CALL_AUTO_RETRY = "call_auto_retry"; |
| 10981 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10982 | private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR; |
| 10983 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10984 | /** |
Selim Cinek | 705442f | 2016-09-13 16:02:33 -0700 | [diff] [blame] | 10985 | * A setting that can be read whether the emergency affordance is currently needed. |
| 10986 | * The value is a boolean (1 or 0). |
| 10987 | * @hide |
| 10988 | */ |
| 10989 | public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; |
| 10990 | |
| 10991 | /** |
Sungmin Choi | e099ab1 | 2014-06-09 14:45:51 +0900 | [diff] [blame] | 10992 | * See RIL_PreferredNetworkType in ril.h |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10993 | * @hide |
| 10994 | */ |
| 10995 | public static final String PREFERRED_NETWORK_MODE = |
| 10996 | "preferred_network_mode"; |
| 10997 | |
| 10998 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10999 | * Name of an application package to be debugged. |
| 11000 | */ |
| 11001 | public static final String DEBUG_APP = "debug_app"; |
| 11002 | |
| 11003 | /** |
| 11004 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 11005 | * starting user code. If 0, it will run normally. |
| 11006 | */ |
| 11007 | public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; |
| 11008 | |
| 11009 | /** |
Cody Northrop | 86cedcb | 2017-10-20 09:03:13 -0600 | [diff] [blame] | 11010 | * Allow GPU debug layers? |
| 11011 | * 0 = no |
| 11012 | * 1 = yes |
| 11013 | * @hide |
| 11014 | */ |
| 11015 | public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; |
| 11016 | |
| 11017 | /** |
| 11018 | * App allowed to load GPU debug layers |
| 11019 | * @hide |
| 11020 | */ |
| 11021 | public static final String GPU_DEBUG_APP = "gpu_debug_app"; |
| 11022 | |
| 11023 | /** |
| 11024 | * Ordered GPU debug layer list |
| 11025 | * i.e. <layer1>:<layer2>:...:<layerN> |
| 11026 | * @hide |
| 11027 | */ |
| 11028 | public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; |
| 11029 | |
| 11030 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11031 | * Control whether the process CPU usage meter should be shown. |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 11032 | * |
| 11033 | * @deprecated This functionality is no longer available as of |
| 11034 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11035 | */ |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 11036 | @Deprecated |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11037 | public static final String SHOW_PROCESSES = "show_processes"; |
| 11038 | |
| 11039 | /** |
Makoto Onuki | a3cd7b9 | 2018-03-19 14:47:05 -0700 | [diff] [blame] | 11040 | * If 1 low power mode (aka battery saver) is enabled. |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 11041 | * @hide |
| 11042 | */ |
Makoto Onuki | f9046a2 | 2018-01-12 10:32:32 -0800 | [diff] [blame] | 11043 | @TestApi |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 11044 | public static final String LOW_POWER_MODE = "low_power"; |
| 11045 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 11046 | /** |
Makoto Onuki | a3cd7b9 | 2018-03-19 14:47:05 -0700 | [diff] [blame] | 11047 | * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device |
| 11048 | * is unplugged from a charger or rebooted. |
| 11049 | * @hide |
| 11050 | */ |
| 11051 | @TestApi |
| 11052 | public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; |
| 11053 | |
| 11054 | /** |
Makoto Onuki | 45a772e | 2018-02-01 15:27:53 -0800 | [diff] [blame] | 11055 | * Battery level [1-100] at which low power mode automatically turns on. |
Dianne Hackborn | 1427230 | 2014-06-10 23:13:02 -0700 | [diff] [blame] | 11056 | * If 0, it will not automatically turn on. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 11057 | * @hide |
| 11058 | */ |
| 11059 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; |
| 11060 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11061 | private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = |
Makoto Onuki | 45a772e | 2018-02-01 15:27:53 -0800 | [diff] [blame] | 11062 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 100); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11063 | |
Makoto Onuki | 524b4dfe | 2018-03-06 17:34:15 -0800 | [diff] [blame] | 11064 | |
| 11065 | /** |
| 11066 | * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set |
| 11067 | * or the value is 0, the default max will be used. |
| 11068 | * |
| 11069 | * @hide |
| 11070 | */ |
| 11071 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; |
| 11072 | |
Makoto Onuki | bc064d4b | 2018-03-27 14:48:42 -0700 | [diff] [blame] | 11073 | /** |
| 11074 | * See com.android.settingslib.fuelgauge.BatterySaverUtils. |
| 11075 | * @hide |
| 11076 | */ |
| 11077 | public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = |
| 11078 | "low_power_mode_suggestion_params"; |
| 11079 | |
| 11080 | /** |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 11081 | * If not 0, the activity manager will aggressively finish activities and |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11082 | * processes as soon as they are no longer needed. If 0, the normal |
| 11083 | * extended lifetime is used. |
| 11084 | */ |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 11085 | public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 11086 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11087 | /** |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 11088 | * Use Dock audio output for media: |
| 11089 | * 0 = disabled |
| 11090 | * 1 = enabled |
| 11091 | * @hide |
| 11092 | */ |
| 11093 | public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; |
| 11094 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11095 | private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 11096 | |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 11097 | /** |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11098 | * The surround sound formats AC3, DTS or IEC61937 are |
| 11099 | * available for use if they are detected. |
| 11100 | * This is the default mode. |
| 11101 | * |
| 11102 | * Note that AUTO is equivalent to ALWAYS for Android TVs and other |
| 11103 | * devices that have an S/PDIF output. This is because S/PDIF |
| 11104 | * is unidirectional and the TV cannot know if a decoder is |
| 11105 | * connected. So it assumes they are always available. |
| 11106 | * @hide |
| 11107 | */ |
| 11108 | public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; |
| 11109 | |
| 11110 | /** |
| 11111 | * AC3, DTS or IEC61937 are NEVER available, even if they |
| 11112 | * are detected by the hardware. Those formats will not be |
| 11113 | * reported. |
| 11114 | * |
| 11115 | * An example use case would be an AVR reports that it is capable of |
| 11116 | * surround sound decoding but is broken. If NEVER is chosen |
| 11117 | * then apps must use PCM output instead of encoded output. |
| 11118 | * @hide |
| 11119 | */ |
| 11120 | public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; |
| 11121 | |
| 11122 | /** |
| 11123 | * AC3, DTS or IEC61937 are ALWAYS available, even if they |
| 11124 | * are not detected by the hardware. Those formats will be |
| 11125 | * reported as part of the HDMI output capability. Applications |
| 11126 | * are then free to use either PCM or encoded output. |
| 11127 | * |
| 11128 | * An example use case would be a when TV was connected over |
| 11129 | * TOS-link to an AVR. But the TV could not see it because TOS-link |
| 11130 | * is unidirectional. |
| 11131 | * @hide |
| 11132 | */ |
| 11133 | public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; |
| 11134 | |
| 11135 | /** |
| 11136 | * Set to ENCODED_SURROUND_OUTPUT_AUTO, |
| 11137 | * ENCODED_SURROUND_OUTPUT_NEVER or |
| 11138 | * ENCODED_SURROUND_OUTPUT_ALWAYS |
| 11139 | * @hide |
| 11140 | */ |
| 11141 | public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; |
| 11142 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11143 | private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR = |
| 11144 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 11145 | |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11146 | /** |
Eric Laurent | 05274f3 | 2012-11-29 12:48:18 -0800 | [diff] [blame] | 11147 | * Persisted safe headphone volume management state by AudioService |
| 11148 | * @hide |
| 11149 | */ |
| 11150 | public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; |
| 11151 | |
| 11152 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11153 | * URL for tzinfo (time zone) updates |
| 11154 | * @hide |
| 11155 | */ |
| 11156 | public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; |
| 11157 | |
| 11158 | /** |
| 11159 | * URL for tzinfo (time zone) update metadata |
| 11160 | * @hide |
| 11161 | */ |
| 11162 | public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; |
| 11163 | |
| 11164 | /** |
| 11165 | * URL for selinux (mandatory access control) updates |
| 11166 | * @hide |
| 11167 | */ |
| 11168 | public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; |
| 11169 | |
| 11170 | /** |
| 11171 | * URL for selinux (mandatory access control) update metadata |
| 11172 | * @hide |
| 11173 | */ |
| 11174 | public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; |
| 11175 | |
| 11176 | /** |
| 11177 | * URL for sms short code updates |
| 11178 | * @hide |
| 11179 | */ |
| 11180 | public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = |
| 11181 | "sms_short_codes_content_url"; |
| 11182 | |
| 11183 | /** |
| 11184 | * URL for sms short code update metadata |
| 11185 | * @hide |
| 11186 | */ |
| 11187 | public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = |
| 11188 | "sms_short_codes_metadata_url"; |
| 11189 | |
| 11190 | /** |
Amit Mahajan | 9069fab | 2015-05-01 11:05:47 -0700 | [diff] [blame] | 11191 | * URL for apn_db updates |
| 11192 | * @hide |
| 11193 | */ |
| 11194 | public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; |
| 11195 | |
| 11196 | /** |
| 11197 | * URL for apn_db update metadata |
| 11198 | * @hide |
| 11199 | */ |
| 11200 | public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; |
| 11201 | |
| 11202 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11203 | * URL for cert pinlist updates |
| 11204 | * @hide |
| 11205 | */ |
| 11206 | public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; |
| 11207 | |
| 11208 | /** |
| 11209 | * URL for cert pinlist updates |
| 11210 | * @hide |
| 11211 | */ |
| 11212 | public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; |
| 11213 | |
Geremy Condra | 757ee52 | 2013-03-29 16:39:45 -0700 | [diff] [blame] | 11214 | /** |
Ben Gruver | 633dc9b | 2013-04-04 12:05:49 -0700 | [diff] [blame] | 11215 | * URL for intent firewall updates |
| 11216 | * @hide |
| 11217 | */ |
| 11218 | public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = |
| 11219 | "intent_firewall_content_url"; |
| 11220 | |
| 11221 | /** |
| 11222 | * URL for intent firewall update metadata |
| 11223 | * @hide |
| 11224 | */ |
| 11225 | public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = |
| 11226 | "intent_firewall_metadata_url"; |
| 11227 | |
| 11228 | /** |
Abodunrinwa Toki | 51c4203 | 2017-04-02 19:16:01 +0100 | [diff] [blame] | 11229 | * URL for lang id model updates |
| 11230 | * @hide |
| 11231 | */ |
| 11232 | public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; |
| 11233 | |
| 11234 | /** |
| 11235 | * URL for lang id model update metadata |
| 11236 | * @hide |
| 11237 | */ |
| 11238 | public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; |
| 11239 | |
| 11240 | /** |
Abodunrinwa Toki | bb957d1 | 2017-04-12 14:40:46 +0100 | [diff] [blame] | 11241 | * URL for smart selection model updates |
| 11242 | * @hide |
| 11243 | */ |
| 11244 | public static final String SMART_SELECTION_UPDATE_CONTENT_URL = |
| 11245 | "smart_selection_content_url"; |
| 11246 | |
| 11247 | /** |
| 11248 | * URL for smart selection model update metadata |
| 11249 | * @hide |
| 11250 | */ |
| 11251 | public static final String SMART_SELECTION_UPDATE_METADATA_URL = |
| 11252 | "smart_selection_metadata_url"; |
| 11253 | |
| 11254 | /** |
Geremy Condra | 4e7f7e8 | 2013-03-26 21:09:01 -0700 | [diff] [blame] | 11255 | * SELinux enforcement status. If 0, permissive; if 1, enforcing. |
| 11256 | * @hide |
| 11257 | */ |
| 11258 | public static final String SELINUX_STATUS = "selinux_status"; |
| 11259 | |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 11260 | /** |
Amith Yamasani | d8415f4 | 2013-08-07 20:15:10 -0700 | [diff] [blame] | 11261 | * Developer setting to force RTL layout. |
| 11262 | * @hide |
| 11263 | */ |
| 11264 | public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; |
| 11265 | |
| 11266 | /** |
Daniel Sandler | dea6462 | 2013-09-23 16:05:57 -0400 | [diff] [blame] | 11267 | * Milliseconds after screen-off after which low battery sounds will be silenced. |
| 11268 | * |
| 11269 | * If zero, battery sounds will always play. |
| 11270 | * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. |
| 11271 | * |
| 11272 | * @hide |
| 11273 | */ |
| 11274 | public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; |
| 11275 | |
| 11276 | /** |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 11277 | * 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] | 11278 | * 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] | 11279 | * clean up any value that they may have written. |
| 11280 | * |
| 11281 | * @hide |
| 11282 | */ |
| 11283 | public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; |
| 11284 | |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 11285 | /** |
| 11286 | * Defines global runtime overrides to window policy. |
| 11287 | * |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 11288 | * See {@link com.android.server.policy.PolicyControl} for value format. |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 11289 | * |
| 11290 | * @hide |
| 11291 | */ |
| 11292 | public static final String POLICY_CONTROL = "policy_control"; |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 11293 | |
| 11294 | /** |
Adrian Roos | 000cf5e | 2017-11-10 15:55:18 +0100 | [diff] [blame] | 11295 | * {@link android.view.DisplayCutout DisplayCutout} emulation mode. |
| 11296 | * |
| 11297 | * @hide |
| 11298 | */ |
| 11299 | public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; |
| 11300 | |
| 11301 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; |
| 11302 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; |
| 11303 | |
| 11304 | /** |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11305 | * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, |
| 11306 | * or ZEN_MODE_NO_INTERRUPTIONS. |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11307 | * |
| 11308 | * @hide |
| 11309 | */ |
| 11310 | public static final String ZEN_MODE = "zen_mode"; |
| 11311 | |
| 11312 | /** @hide */ public static final int ZEN_MODE_OFF = 0; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11313 | /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; |
| 11314 | /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 11315 | /** @hide */ public static final int ZEN_MODE_ALARMS = 3; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11316 | |
| 11317 | /** @hide */ public static String zenModeToString(int mode) { |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11318 | if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 11319 | if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 11320 | if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; |
| 11321 | return "ZEN_MODE_OFF"; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11322 | } |
| 11323 | |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 11324 | /** @hide */ public static boolean isValidZenMode(int value) { |
| 11325 | switch (value) { |
| 11326 | case Global.ZEN_MODE_OFF: |
| 11327 | case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: |
| 11328 | case Global.ZEN_MODE_ALARMS: |
| 11329 | case Global.ZEN_MODE_NO_INTERRUPTIONS: |
| 11330 | return true; |
| 11331 | default: |
| 11332 | return false; |
| 11333 | } |
| 11334 | } |
| 11335 | |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 11336 | /** |
Julia Reynolds | 9b11fdb | 2015-07-31 09:49:55 -0400 | [diff] [blame] | 11337 | * Value of the ringer before entering zen mode. |
| 11338 | * |
| 11339 | * @hide |
| 11340 | */ |
| 11341 | public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; |
| 11342 | |
| 11343 | /** |
John Spurlock | 056c519 | 2014-04-20 21:52:01 -0400 | [diff] [blame] | 11344 | * Opaque value, changes when persisted zen mode configuration changes. |
| 11345 | * |
| 11346 | * @hide |
| 11347 | */ |
| 11348 | public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; |
| 11349 | |
| 11350 | /** |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11351 | * If 0, turning on dnd manually will last indefinitely. |
| 11352 | * Else if non-negative, turning on dnd manually will last for this many minutes. |
| 11353 | * Else (if negative), turning on dnd manually will surface a dialog that prompts |
| 11354 | * user to specify a duration. |
| 11355 | * @hide |
| 11356 | */ |
| 11357 | public static final String ZEN_DURATION = "zen_duration"; |
| 11358 | |
| 11359 | private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR; |
| 11360 | |
| 11361 | /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; |
| 11362 | /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; |
| 11363 | |
| 11364 | /** |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 11365 | * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. |
| 11366 | * |
| 11367 | * @hide |
| 11368 | */ |
Chris Wren | 10d82df | 2014-03-01 10:34:51 -0500 | [diff] [blame] | 11369 | public static final String HEADS_UP_NOTIFICATIONS_ENABLED = |
| 11370 | "heads_up_notifications_enabled"; |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 11371 | |
| 11372 | /** @hide */ public static final int HEADS_UP_OFF = 0; |
| 11373 | /** @hide */ public static final int HEADS_UP_ON = 1; |
| 11374 | |
| 11375 | /** |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 11376 | * The name of the device |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 11377 | */ |
| 11378 | public static final String DEVICE_NAME = "device_name"; |
| 11379 | |
| 11380 | /** |
Jeff Davidson | 56f9f73 | 2014-08-14 16:47:23 -0700 | [diff] [blame] | 11381 | * Whether the NetworkScoringService has been first initialized. |
| 11382 | * <p> |
| 11383 | * Type: int (0 for false, 1 for true) |
| 11384 | * @hide |
| 11385 | */ |
| 11386 | public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; |
| 11387 | |
| 11388 | /** |
Jim Miller | 6848dc8 | 2014-10-13 18:51:53 -0700 | [diff] [blame] | 11389 | * Whether the user wants to be prompted for password to decrypt the device on boot. |
| 11390 | * This only matters if the storage is encrypted. |
| 11391 | * <p> |
| 11392 | * Type: int (0 for false, 1 for true) |
| 11393 | * @hide |
| 11394 | */ |
| 11395 | public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; |
| 11396 | |
| 11397 | /** |
manabu, shimoda | 14723e3 | 2017-10-06 14:39:01 +0900 | [diff] [blame] | 11398 | * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config |
| 11399 | * 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] | 11400 | * <p> |
| 11401 | * Type: int (0 for false, 1 for true) |
| 11402 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11403 | * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED} |
| 11404 | * instead. |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11405 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11406 | @Deprecated |
| 11407 | public static final String ENHANCED_4G_MODE_ENABLED = |
| 11408 | SubscriptionManager.ENHANCED_4G_MODE_ENABLED; |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11409 | |
| 11410 | /** |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11411 | * Whether VT (Video Telephony over IMS) is enabled |
| 11412 | * <p> |
| 11413 | * Type: int (0 for false, 1 for true) |
| 11414 | * |
| 11415 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11416 | * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead. |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11417 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11418 | @Deprecated |
| 11419 | public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED; |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11420 | |
| 11421 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11422 | * Whether WFC is enabled |
| 11423 | * <p> |
| 11424 | * Type: int (0 for false, 1 for true) |
| 11425 | * |
| 11426 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11427 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11428 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11429 | @Deprecated |
| 11430 | public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11431 | |
| 11432 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11433 | * WFC mode on home/non-roaming network. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11434 | * <p> |
| 11435 | * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only |
| 11436 | * |
| 11437 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11438 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11439 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11440 | @Deprecated |
| 11441 | public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11442 | |
| 11443 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11444 | * WFC mode on roaming network. |
| 11445 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 11446 | * Type: int - see {@link #WFC_IMS_MODE} for values |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11447 | * |
| 11448 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11449 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE} |
| 11450 | * instead. |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11451 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11452 | @Deprecated |
| 11453 | 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] | 11454 | |
| 11455 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11456 | * Whether WFC roaming is enabled |
| 11457 | * <p> |
| 11458 | * Type: int (0 for false, 1 for true) |
| 11459 | * |
| 11460 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11461 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED} |
| 11462 | * instead |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11463 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11464 | @Deprecated |
| 11465 | public static final String WFC_IMS_ROAMING_ENABLED = |
| 11466 | SubscriptionManager.WFC_IMS_ROAMING_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11467 | |
| 11468 | /** |
Amit Mahajan | 4fea092 | 2014-11-18 12:56:28 -0800 | [diff] [blame] | 11469 | * Whether user can enable/disable LTE as a preferred network. A carrier might control |
| 11470 | * this via gservices, OMA-DM, carrier app, etc. |
| 11471 | * <p> |
| 11472 | * Type: int (0 for false, 1 for true) |
| 11473 | * @hide |
| 11474 | */ |
| 11475 | public static final String LTE_SERVICE_FORCED = "lte_service_forced"; |
| 11476 | |
| 11477 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11478 | * Ephemeral app cookie max size in bytes. |
| 11479 | * <p> |
| 11480 | * Type: int |
| 11481 | * @hide |
| 11482 | */ |
| 11483 | public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = |
| 11484 | "ephemeral_cookie_max_size_bytes"; |
| 11485 | |
| 11486 | /** |
Todd Kennedy | d15bb75 | 2016-09-13 16:38:31 -0700 | [diff] [blame] | 11487 | * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is |
| 11488 | * enabled. Set to zero to disable. |
| 11489 | * <p> |
| 11490 | * Type: int (0 for false, 1 for true) |
| 11491 | * |
| 11492 | * @hide |
| 11493 | */ |
| 11494 | public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; |
| 11495 | |
| 11496 | /** |
Todd Kennedy | 133c5da | 2017-06-15 09:44:34 -0700 | [diff] [blame] | 11497 | * Toggle to enable/disable dexopt for instant applications. The default is for dexopt |
| 11498 | * to be disabled. |
| 11499 | * <p> |
| 11500 | * Type: int (0 to disable, 1 to enable) |
| 11501 | * |
| 11502 | * @hide |
| 11503 | */ |
| 11504 | public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; |
| 11505 | |
| 11506 | /** |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11507 | * The min period for caching installed instant apps in milliseconds. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11508 | * <p> |
| 11509 | * Type: long |
| 11510 | * @hide |
| 11511 | */ |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11512 | public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11513 | "installed_instant_app_min_cache_period"; |
| 11514 | |
| 11515 | /** |
| 11516 | * The max period for caching installed instant apps in milliseconds. |
| 11517 | * <p> |
| 11518 | * Type: long |
| 11519 | * @hide |
| 11520 | */ |
| 11521 | public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11522 | "installed_instant_app_max_cache_period"; |
| 11523 | |
| 11524 | /** |
| 11525 | * The min period for caching uninstalled instant apps in milliseconds. |
| 11526 | * <p> |
| 11527 | * Type: long |
| 11528 | * @hide |
| 11529 | */ |
| 11530 | public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11531 | "uninstalled_instant_app_min_cache_period"; |
| 11532 | |
| 11533 | /** |
| 11534 | * The max period for caching uninstalled instant apps in milliseconds. |
| 11535 | * <p> |
| 11536 | * Type: long |
| 11537 | * @hide |
| 11538 | */ |
| 11539 | public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11540 | "uninstalled_instant_app_max_cache_period"; |
| 11541 | |
| 11542 | /** |
| 11543 | * The min period for caching unused static shared libs in milliseconds. |
| 11544 | * <p> |
| 11545 | * Type: long |
| 11546 | * @hide |
| 11547 | */ |
| 11548 | public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = |
| 11549 | "unused_static_shared_lib_min_cache_period"; |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11550 | |
| 11551 | /** |
Fyodor Kupolov | 07140f7 | 2016-02-17 10:46:11 -0800 | [diff] [blame] | 11552 | * Allows switching users when system user is locked. |
| 11553 | * <p> |
| 11554 | * Type: int |
| 11555 | * @hide |
| 11556 | */ |
| 11557 | public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = |
| 11558 | "allow_user_switching_when_system_user_locked"; |
| 11559 | |
| 11560 | /** |
Kenny Guy | c4db5ca | 2017-09-21 11:40:44 +0100 | [diff] [blame] | 11561 | * Boot count since the device starts running API level 24. |
Daichi Hirono | 82ab980 | 2016-03-02 13:23:29 +0900 | [diff] [blame] | 11562 | * <p> |
| 11563 | * Type: int |
| 11564 | */ |
| 11565 | public static final String BOOT_COUNT = "boot_count"; |
| 11566 | |
| 11567 | /** |
Lenka Trochtova | 6474f0e | 2016-03-24 16:43:10 +0100 | [diff] [blame] | 11568 | * Whether the safe boot is disallowed. |
| 11569 | * |
| 11570 | * <p>This setting should have the identical value as the corresponding user restriction. |
| 11571 | * The purpose of the setting is to make the restriction available in early boot stages |
| 11572 | * before the user restrictions are loaded. |
| 11573 | * @hide |
| 11574 | */ |
| 11575 | public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; |
| 11576 | |
| 11577 | /** |
Amith Yamasani | eb437d4 | 2016-04-29 09:31:25 -0700 | [diff] [blame] | 11578 | * Whether this device is currently in retail demo mode. If true, device |
| 11579 | * usage is severely limited. |
| 11580 | * <p> |
| 11581 | * Type: int (0 for false, 1 for true) |
| 11582 | * @hide |
| 11583 | */ |
| 11584 | public static final String DEVICE_DEMO_MODE = "device_demo_mode"; |
| 11585 | |
| 11586 | /** |
Sudheer Shanka | 5918c67 | 2017-03-21 19:31:37 -0700 | [diff] [blame] | 11587 | * Indicates the maximum time that an app is blocked for the network rules to get updated. |
| 11588 | * |
| 11589 | * Type: long |
| 11590 | * |
| 11591 | * @hide |
| 11592 | */ |
| 11593 | public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; |
| 11594 | |
| 11595 | /** |
Svetoslav Ganov | 264c7a9 | 2016-08-24 17:31:14 -0700 | [diff] [blame] | 11596 | * The reason for the settings database being downgraded. This is only for |
| 11597 | * troubleshooting purposes and its value should not be interpreted in any way. |
| 11598 | * |
| 11599 | * Type: string |
| 11600 | * |
| 11601 | * @hide |
| 11602 | */ |
| 11603 | public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; |
| 11604 | |
| 11605 | /** |
Amith Yamasani | 3945202 | 2017-03-21 15:23:47 -0700 | [diff] [blame] | 11606 | * The build id of when the settings database was first created (or re-created due it |
| 11607 | * being missing). |
| 11608 | * |
| 11609 | * Type: string |
| 11610 | * |
| 11611 | * @hide |
| 11612 | */ |
| 11613 | public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; |
| 11614 | |
| 11615 | /** |
Suprabh Shukla | 502fd88 | 2016-09-30 15:06:00 -0700 | [diff] [blame] | 11616 | * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by |
| 11617 | * default. Set to 0 to disable. |
| 11618 | * |
| 11619 | * @hide |
| 11620 | */ |
| 11621 | public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; |
| 11622 | |
| 11623 | /** |
songchenxi | 825f69a | 2017-01-19 14:18:41 -0800 | [diff] [blame] | 11624 | * Flag to enable the link to location permissions in location setting. Set to 0 to disable. |
| 11625 | * |
| 11626 | * @hide |
| 11627 | */ |
| 11628 | public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = |
| 11629 | "location_settings_link_to_permissions_enabled"; |
| 11630 | |
| 11631 | /** |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11632 | * Flag to set the waiting time for euicc factory reset inside System > Settings |
| 11633 | * Type: long |
| 11634 | * |
| 11635 | * @hide |
| 11636 | */ |
qingxi | 2f23151 | 2017-06-23 15:32:53 -0700 | [diff] [blame] | 11637 | public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = |
| 11638 | "euicc_factory_reset_timeout_millis"; |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11639 | |
| 11640 | /** |
Daniel Nishi | 5782b5c | 2017-08-24 10:28:52 -0700 | [diff] [blame] | 11641 | * Flag to set the timeout for when to refresh the storage settings cached data. |
| 11642 | * Type: long |
| 11643 | * |
| 11644 | * @hide |
| 11645 | */ |
| 11646 | public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = |
| 11647 | "storage_settings_clobber_threshold"; |
| 11648 | |
| 11649 | /** |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11650 | * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} |
| 11651 | * temporarily for all users. |
| 11652 | * |
| 11653 | * @hide |
| 11654 | */ |
Makoto Onuki | 8e49825 | 2018-01-22 17:00:00 -0800 | [diff] [blame] | 11655 | @TestApi |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11656 | public static final String LOCATION_GLOBAL_KILL_SWITCH = |
| 11657 | "location_global_kill_switch"; |
| 11658 | |
| 11659 | /** |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11660 | * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored |
| 11661 | * and restoring to lower version of platform API will be skipped. |
| 11662 | * |
| 11663 | * @hide |
| 11664 | */ |
| 11665 | public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = |
| 11666 | "override_settings_provider_restore_any_version"; |
Narayan Kamath | 8d82825 | 2018-01-11 15:22:37 +0000 | [diff] [blame] | 11667 | /** |
| 11668 | * Flag to toggle whether system services report attribution chains when they attribute |
| 11669 | * battery use via a {@code WorkSource}. |
| 11670 | * |
| 11671 | * Type: int (0 to disable, 1 to enable) |
| 11672 | * |
| 11673 | * @hide |
| 11674 | */ |
| 11675 | public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = |
| 11676 | "chained_battery_attribution_enabled"; |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11677 | |
| 11678 | /** |
Svetoslav Ganov | a6ebff0f0 | 2018-02-14 14:07:02 -0800 | [diff] [blame] | 11679 | * The packages whitelisted to be run in autofill compatibility mode. The list |
Felipe Leme | 1c7eb0c | 2018-03-09 14:13:18 -0800 | [diff] [blame] | 11680 | * of packages is {@code ":"} colon delimited, and each entry has the name of the |
| 11681 | * package and an optional list of url bar resource ids (the list is delimited by |
| 11682 | * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). |
| 11683 | * |
| 11684 | * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where |
| 11685 | * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } |
| 11686 | * have 2 ids {@code url_foo} and {@code url_bas}) would be |
| 11687 | * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} |
Svetoslav Ganov | 24c9045 | 2017-12-27 15:17:14 -0800 | [diff] [blame] | 11688 | * |
| 11689 | * @hide |
| 11690 | */ |
| 11691 | @SystemApi |
Svet Ganov | 47b37aa | 2018-02-16 00:11:39 -0800 | [diff] [blame] | 11692 | @TestApi |
Felipe Leme | fd4003b | 2018-03-20 17:12:17 -0700 | [diff] [blame] | 11693 | public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = |
| 11694 | "autofill_compat_mode_allowed_packages"; |
Svetoslav Ganov | 24c9045 | 2017-12-27 15:17:14 -0800 | [diff] [blame] | 11695 | |
| 11696 | /** |
Mathew Inwood | 169cb3b | 2018-02-08 12:23:59 +0000 | [diff] [blame] | 11697 | * Exemptions to the hidden API blacklist. |
| 11698 | * |
| 11699 | * @hide |
| 11700 | */ |
Mathew Inwood | 5518c75 | 2018-02-27 16:36:11 +0000 | [diff] [blame] | 11701 | @TestApi |
Mathew Inwood | 169cb3b | 2018-02-08 12:23:59 +0000 | [diff] [blame] | 11702 | public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = |
| 11703 | "hidden_api_blacklist_exemptions"; |
| 11704 | |
| 11705 | /** |
Philip P. Moltmann | 18e3eb8 | 2018-03-09 16:55:55 -0800 | [diff] [blame] | 11706 | * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} |
| 11707 | * operation (in ms). |
| 11708 | * |
| 11709 | * @hide |
| 11710 | */ |
| 11711 | public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = |
| 11712 | "sound_trigger_detection_service_op_timeout"; |
| 11713 | |
| 11714 | /** |
| 11715 | * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} |
| 11716 | * operations per day. |
| 11717 | * |
| 11718 | * @hide |
| 11719 | */ |
| 11720 | public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = |
| 11721 | "max_sound_trigger_detection_service_ops_per_day"; |
| 11722 | |
| 11723 | /** |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11724 | * Settings to backup. This is here so that it's in the same place as the settings |
| 11725 | * keys and easy to update. |
| 11726 | * |
| 11727 | * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System |
| 11728 | * and Secure as well. This is because those tables drive both backup and |
| 11729 | * restore, and restore needs to properly whitelist keys that used to live |
| 11730 | * in those namespaces. The keys will only actually be backed up / restored |
| 11731 | * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). |
| 11732 | * |
| 11733 | * NOTE: Settings are backed up and restored in the order they appear |
| 11734 | * in this array. If you have one setting depending on another, |
| 11735 | * make sure that they are ordered appropriately. |
| 11736 | * |
| 11737 | * @hide |
| 11738 | */ |
| 11739 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 11740 | BUGREPORT_IN_POWER_MENU, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11741 | STAY_ON_WHILE_PLUGGED_IN, |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 11742 | APP_AUTO_RESTRICTION_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11743 | AUTO_TIME, |
| 11744 | AUTO_TIME_ZONE, |
| 11745 | POWER_SOUNDS_ENABLED, |
| 11746 | DOCK_SOUNDS_ENABLED, |
Ritesh Reddy | f8f1213 | 2015-11-20 16:43:28 +0000 | [diff] [blame] | 11747 | CHARGING_SOUNDS_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11748 | USB_MASS_STORAGE_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11749 | NETWORK_RECOMMENDATIONS_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11750 | WIFI_WAKEUP_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11751 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11752 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 11753 | USE_OPEN_WIFI_PACKAGE, |
Christopher Tate | 16eb7cd | 2012-10-09 15:26:30 -0700 | [diff] [blame] | 11754 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11755 | EMERGENCY_TONE, |
| 11756 | CALL_AUTO_RETRY, |
Amith Yamasani | 9400524 | 2014-10-31 11:35:13 -0700 | [diff] [blame] | 11757 | DOCK_AUDIO_MEDIA_ENABLED, |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11758 | ENCODED_SURROUND_OUTPUT, |
Stanley Tng | 767f05f | 2017-05-01 21:27:31 -0700 | [diff] [blame] | 11759 | LOW_POWER_MODE_TRIGGER_LEVEL, |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 11760 | BLUETOOTH_ON, |
| 11761 | PRIVATE_DNS_MODE, |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 11762 | PRIVATE_DNS_SPECIFIER, |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11763 | SOFT_AP_TIMEOUT_ENABLED, |
| 11764 | ZEN_DURATION, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11765 | }; |
| 11766 | |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11767 | /** |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11768 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 11769 | * otherwise they won't be restored. |
| 11770 | * |
| 11771 | * @hide |
| 11772 | */ |
| 11773 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 11774 | static { |
| 11775 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 11776 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 11777 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 11778 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
| 11779 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 11780 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
| 11781 | VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR); |
| 11782 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 11783 | VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, |
| 11784 | NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR); |
| 11785 | VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR); |
| 11786 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11787 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 11788 | VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR); |
| 11789 | VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
| 11790 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR); |
| 11791 | VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); |
| 11792 | VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); |
| 11793 | VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); |
| 11794 | VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); |
| 11795 | 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] | 11796 | VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX, |
| 11797 | LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11798 | VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR); |
| 11799 | VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR); |
| 11800 | VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR); |
| 11801 | VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR); |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11802 | VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11803 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
jackqdyulei | 3cd42a0 | 2018-02-27 11:18:00 -0800 | [diff] [blame] | 11804 | VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR); |
Beverly | 09da25f | 2018-02-26 09:17:07 -0500 | [diff] [blame] | 11805 | VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11806 | } |
| 11807 | |
| 11808 | /** |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11809 | * Global settings that shouldn't be persisted. |
| 11810 | * |
| 11811 | * @hide |
| 11812 | */ |
| 11813 | public static final String[] TRANSIENT_SETTINGS = { |
| 11814 | LOCATION_GLOBAL_KILL_SWITCH, |
| 11815 | }; |
| 11816 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 11817 | /** |
| 11818 | * Keys we no longer back up under the current schema, but want to continue to |
| 11819 | * process when restoring historical backup datasets. |
| 11820 | * |
| 11821 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 11822 | * otherwise they won't be restored. |
| 11823 | * |
| 11824 | * @hide |
| 11825 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 11826 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 11827 | }; |
| 11828 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11829 | private static final ContentProviderHolder sProviderHolder = |
| 11830 | new ContentProviderHolder(CONTENT_URI); |
| 11831 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11832 | // Populated lazily, guarded by class object: |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11833 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11834 | CONTENT_URI, |
| 11835 | CALL_METHOD_GET_GLOBAL, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11836 | CALL_METHOD_PUT_GLOBAL, |
| 11837 | sProviderHolder); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11838 | |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11839 | // Certain settings have been moved from global to the per-user secure namespace |
| 11840 | private static final HashSet<String> MOVED_TO_SECURE; |
| 11841 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 11842 | MOVED_TO_SECURE = new HashSet<>(1); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11843 | MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); |
| 11844 | } |
| 11845 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 11846 | /** @hide */ |
| 11847 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 11848 | outKeySet.addAll(MOVED_TO_SECURE); |
| 11849 | } |
| 11850 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 11851 | /** @hide */ |
| 11852 | public static void clearProviderForTest() { |
| 11853 | sProviderHolder.clearProviderForTest(); |
| 11854 | sNameValueCache.clearGenerationTrackerForTest(); |
| 11855 | } |
| 11856 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11857 | /** |
| 11858 | * Look up a name in the database. |
| 11859 | * @param resolver to access the database with |
| 11860 | * @param name to look up in the table |
| 11861 | * @return the corresponding value, or null if not present |
| 11862 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11863 | public static String getString(ContentResolver resolver, String name) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 11864 | return getStringForUser(resolver, name, resolver.getUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11865 | } |
| 11866 | |
| 11867 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11868 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11869 | int userHandle) { |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11870 | if (MOVED_TO_SECURE.contains(name)) { |
| 11871 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 11872 | + " to android.provider.Settings.Secure, returning read-only value."); |
| 11873 | return Secure.getStringForUser(resolver, name, userHandle); |
| 11874 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11875 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
| 11876 | } |
| 11877 | |
| 11878 | /** |
| 11879 | * Store a name/value pair into the database. |
| 11880 | * @param resolver to access the database with |
| 11881 | * @param name to store |
| 11882 | * @param value to associate with the name |
| 11883 | * @return true if the value was set, false on database errors |
| 11884 | */ |
| 11885 | public static boolean putString(ContentResolver resolver, |
| 11886 | String name, String value) { |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 11887 | return putStringForUser(resolver, name, value, null, false, resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11888 | } |
| 11889 | |
| 11890 | /** |
| 11891 | * Store a name/value pair into the database. |
| 11892 | * <p> |
| 11893 | * The method takes an optional tag to associate with the setting |
| 11894 | * which can be used to clear only settings made by your package and |
| 11895 | * associated with this tag by passing the tag to {@link |
| 11896 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 11897 | * the current tag. Also if another package changes the setting |
| 11898 | * then the tag will be set to the one specified in the set call |
| 11899 | * which can be null. Also any of the settings setters that do not |
| 11900 | * take a tag as an argument effectively clears the tag. |
| 11901 | * </p><p> |
| 11902 | * For example, if you set settings A and B with tags T1 and T2 and |
| 11903 | * another app changes setting A (potentially to the same value), it |
| 11904 | * can assign to it a tag T3 (note that now the package that changed |
| 11905 | * the setting is not yours). Now if you reset your changes for T1 and |
| 11906 | * T2 only setting B will be reset and A not (as it was changed by |
| 11907 | * another package) but since A did not change you are in the desired |
| 11908 | * initial state. Now if the other app changes the value of A (assuming |
| 11909 | * you registered an observer in the beginning) you would detect that |
| 11910 | * the setting was changed by another app and handle this appropriately |
| 11911 | * (ignore, set back to some value, etc). |
| 11912 | * </p><p> |
| 11913 | * Also the method takes an argument whether to make the value the |
| 11914 | * default for this setting. If the system already specified a default |
| 11915 | * value, then the one passed in here will <strong>not</strong> |
| 11916 | * be set as the default. |
| 11917 | * </p> |
| 11918 | * |
| 11919 | * @param resolver to access the database with. |
| 11920 | * @param name to store. |
| 11921 | * @param value to associate with the name. |
| 11922 | * @param tag to associated with the setting. |
| 11923 | * @param makeDefault whether to make the value the default one. |
| 11924 | * @return true if the value was set, false on database errors. |
| 11925 | * |
| 11926 | * @see #resetToDefaults(ContentResolver, String) |
| 11927 | * |
| 11928 | * @hide |
| 11929 | */ |
| 11930 | @SystemApi |
| 11931 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 11932 | public static boolean putString(@NonNull ContentResolver resolver, |
| 11933 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 11934 | boolean makeDefault) { |
| 11935 | return putStringForUser(resolver, name, value, tag, makeDefault, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 11936 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11937 | } |
| 11938 | |
| 11939 | /** |
| 11940 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 11941 | * settings set by the caller's package. Think of it of a way to undo your own |
| 11942 | * changes to the secure settings. Passing in the optional tag will reset only |
| 11943 | * settings changed by your package and associated with this tag. |
| 11944 | * |
| 11945 | * @param resolver Handle to the content resolver. |
| 11946 | * @param tag Optional tag which should be associated with the settings to reset. |
| 11947 | * |
| 11948 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 11949 | * |
| 11950 | * @hide |
| 11951 | */ |
| 11952 | @SystemApi |
| 11953 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 11954 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 11955 | @Nullable String tag) { |
| 11956 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
Jeff Sharkey | ad357d1 | 2018-02-02 13:25:31 -0700 | [diff] [blame] | 11957 | resolver.getUserId()); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11958 | } |
| 11959 | |
| 11960 | /** |
| 11961 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 11962 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 11963 | * allowing resetting the settings made by a package and associated with the tag. |
| 11964 | * |
| 11965 | * @param resolver Handle to the content resolver. |
| 11966 | * @param tag Optional tag which should be associated with the settings to reset. |
| 11967 | * @param mode The reset mode. |
| 11968 | * @param userHandle The user for which to reset to defaults. |
| 11969 | * |
| 11970 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 11971 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 11972 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 11973 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 11974 | * |
| 11975 | * @hide |
| 11976 | */ |
| 11977 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 11978 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 11979 | try { |
| 11980 | Bundle arg = new Bundle(); |
| 11981 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 11982 | if (tag != null) { |
| 11983 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 11984 | } |
| 11985 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 11986 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 11987 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); |
| 11988 | } catch (RemoteException e) { |
| 11989 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 11990 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11991 | } |
| 11992 | |
| 11993 | /** @hide */ |
| 11994 | public static boolean putStringForUser(ContentResolver resolver, |
| 11995 | String name, String value, int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11996 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 11997 | } |
| 11998 | |
| 11999 | /** @hide */ |
| 12000 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 12001 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 12002 | boolean makeDefault, @UserIdInt int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12003 | if (LOCAL_LOGV) { |
| 12004 | Log.v(TAG, "Global.putString(name=" + name + ", value=" + value |
| 12005 | + " for " + userHandle); |
| 12006 | } |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 12007 | // Global and Secure have the same access policy so we can forward writes |
| 12008 | if (MOVED_TO_SECURE.contains(name)) { |
| 12009 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 12010 | + " to android.provider.Settings.Secure, value is unchanged."); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12011 | return Secure.putStringForUser(resolver, name, value, tag, |
| 12012 | makeDefault, userHandle); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 12013 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 12014 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 12015 | makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12016 | } |
| 12017 | |
| 12018 | /** |
| 12019 | * Construct the content URI for a particular name/value pair, |
| 12020 | * useful for monitoring changes with a ContentObserver. |
| 12021 | * @param name to look up in the table |
| 12022 | * @return the corresponding content URI, or null if not present |
| 12023 | */ |
| 12024 | public static Uri getUriFor(String name) { |
| 12025 | return getUriFor(CONTENT_URI, name); |
| 12026 | } |
| 12027 | |
| 12028 | /** |
| 12029 | * Convenience function for retrieving a single secure settings value |
| 12030 | * as an integer. Note that internally setting values are always |
| 12031 | * stored as strings; this function converts the string to an integer |
| 12032 | * for you. The default value will be returned if the setting is |
| 12033 | * not defined or not an integer. |
| 12034 | * |
| 12035 | * @param cr The ContentResolver to access. |
| 12036 | * @param name The name of the setting to retrieve. |
| 12037 | * @param def Value to return if the setting is not defined. |
| 12038 | * |
| 12039 | * @return The setting's current value, or 'def' if it is not defined |
| 12040 | * or not a valid integer. |
| 12041 | */ |
| 12042 | public static int getInt(ContentResolver cr, String name, int def) { |
| 12043 | String v = getString(cr, name); |
| 12044 | try { |
| 12045 | return v != null ? Integer.parseInt(v) : def; |
| 12046 | } catch (NumberFormatException e) { |
| 12047 | return def; |
| 12048 | } |
| 12049 | } |
| 12050 | |
| 12051 | /** |
| 12052 | * Convenience function for retrieving a single secure settings value |
| 12053 | * as an integer. Note that internally setting values are always |
| 12054 | * stored as strings; this function converts the string to an integer |
| 12055 | * for you. |
| 12056 | * <p> |
| 12057 | * This version does not take a default value. If the setting has not |
| 12058 | * been set, or the string value is not a number, |
| 12059 | * it throws {@link SettingNotFoundException}. |
| 12060 | * |
| 12061 | * @param cr The ContentResolver to access. |
| 12062 | * @param name The name of the setting to retrieve. |
| 12063 | * |
| 12064 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 12065 | * name can't be found or the setting value is not an integer. |
| 12066 | * |
| 12067 | * @return The setting's current value. |
| 12068 | */ |
| 12069 | public static int getInt(ContentResolver cr, String name) |
| 12070 | throws SettingNotFoundException { |
| 12071 | String v = getString(cr, name); |
| 12072 | try { |
| 12073 | return Integer.parseInt(v); |
| 12074 | } catch (NumberFormatException e) { |
| 12075 | throw new SettingNotFoundException(name); |
| 12076 | } |
| 12077 | } |
| 12078 | |
| 12079 | /** |
| 12080 | * Convenience function for updating a single settings value as an |
| 12081 | * integer. This will either create a new entry in the table if the |
| 12082 | * given name does not exist, or modify the value of the existing row |
| 12083 | * with that name. Note that internally setting values are always |
| 12084 | * stored as strings, so this function converts the given value to a |
| 12085 | * string before storing it. |
| 12086 | * |
| 12087 | * @param cr The ContentResolver to access. |
| 12088 | * @param name The name of the setting to modify. |
| 12089 | * @param value The new value for the setting. |
| 12090 | * @return true if the value was set, false on database errors |
| 12091 | */ |
| 12092 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 12093 | return putString(cr, name, Integer.toString(value)); |
| 12094 | } |
| 12095 | |
| 12096 | /** |
| 12097 | * Convenience function for retrieving a single secure settings value |
| 12098 | * as a {@code long}. Note that internally setting values are always |
| 12099 | * stored as strings; this function converts the string to a {@code long} |
| 12100 | * for you. The default value will be returned if the setting is |
| 12101 | * not defined or not a {@code long}. |
| 12102 | * |
| 12103 | * @param cr The ContentResolver to access. |
| 12104 | * @param name The name of the setting to retrieve. |
| 12105 | * @param def Value to return if the setting is not defined. |
| 12106 | * |
| 12107 | * @return The setting's current value, or 'def' if it is not defined |
| 12108 | * or not a valid {@code long}. |
| 12109 | */ |
| 12110 | public static long getLong(ContentResolver cr, String name, long def) { |
| 12111 | String valString = getString(cr, name); |
| 12112 | long value; |
| 12113 | try { |
| 12114 | value = valString != null ? Long.parseLong(valString) : def; |
| 12115 | } catch (NumberFormatException e) { |
| 12116 | value = def; |
| 12117 | } |
| 12118 | return value; |
| 12119 | } |
| 12120 | |
| 12121 | /** |
| 12122 | * Convenience function for retrieving a single secure settings value |
| 12123 | * as a {@code long}. Note that internally setting values are always |
| 12124 | * stored as strings; this function converts the string to a {@code long} |
| 12125 | * for you. |
| 12126 | * <p> |
| 12127 | * This version does not take a default value. If the setting has not |
| 12128 | * been set, or the string value is not a number, |
| 12129 | * it throws {@link SettingNotFoundException}. |
| 12130 | * |
| 12131 | * @param cr The ContentResolver to access. |
| 12132 | * @param name The name of the setting to retrieve. |
| 12133 | * |
| 12134 | * @return The setting's current value. |
| 12135 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 12136 | * name can't be found or the setting value is not an integer. |
| 12137 | */ |
| 12138 | public static long getLong(ContentResolver cr, String name) |
| 12139 | throws SettingNotFoundException { |
| 12140 | String valString = getString(cr, name); |
| 12141 | try { |
| 12142 | return Long.parseLong(valString); |
| 12143 | } catch (NumberFormatException e) { |
| 12144 | throw new SettingNotFoundException(name); |
| 12145 | } |
| 12146 | } |
| 12147 | |
| 12148 | /** |
| 12149 | * Convenience function for updating a secure settings value as a long |
| 12150 | * integer. This will either create a new entry in the table if the |
| 12151 | * given name does not exist, or modify the value of the existing row |
| 12152 | * with that name. Note that internally setting values are always |
| 12153 | * stored as strings, so this function converts the given value to a |
| 12154 | * string before storing it. |
| 12155 | * |
| 12156 | * @param cr The ContentResolver to access. |
| 12157 | * @param name The name of the setting to modify. |
| 12158 | * @param value The new value for the setting. |
| 12159 | * @return true if the value was set, false on database errors |
| 12160 | */ |
| 12161 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 12162 | return putString(cr, name, Long.toString(value)); |
| 12163 | } |
| 12164 | |
| 12165 | /** |
| 12166 | * Convenience function for retrieving a single secure settings value |
| 12167 | * as a floating point number. Note that internally setting values are |
| 12168 | * always stored as strings; this function converts the string to an |
| 12169 | * float for you. The default value will be returned if the setting |
| 12170 | * is not defined or not a valid float. |
| 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 float. |
| 12178 | */ |
| 12179 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 12180 | String v = getString(cr, name); |
| 12181 | try { |
| 12182 | return v != null ? Float.parseFloat(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 a float. Note that internally setting values are always |
| 12191 | * stored as strings; this function converts the string to a float |
| 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 a float. |
| 12203 | * |
| 12204 | * @return The setting's current value. |
| 12205 | */ |
| 12206 | public static float getFloat(ContentResolver cr, String name) |
| 12207 | throws SettingNotFoundException { |
| 12208 | String v = getString(cr, name); |
| 12209 | if (v == null) { |
| 12210 | throw new SettingNotFoundException(name); |
| 12211 | } |
| 12212 | try { |
| 12213 | return Float.parseFloat(v); |
| 12214 | } catch (NumberFormatException e) { |
| 12215 | throw new SettingNotFoundException(name); |
| 12216 | } |
| 12217 | } |
| 12218 | |
| 12219 | /** |
| 12220 | * Convenience function for updating a single settings value as a |
| 12221 | * floating point number. This will either create a new entry in the |
| 12222 | * table if the given name does not exist, or modify the value of the |
| 12223 | * existing row with that name. Note that internally setting values |
| 12224 | * are always stored as strings, so this function converts the given |
| 12225 | * value to a string before storing it. |
| 12226 | * |
| 12227 | * @param cr The ContentResolver to access. |
| 12228 | * @param name The name of the setting to modify. |
| 12229 | * @param value The new value for the setting. |
| 12230 | * @return true if the value was set, false on database errors |
| 12231 | */ |
| 12232 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 12233 | return putString(cr, name, Float.toString(value)); |
| 12234 | } |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12235 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12236 | /** |
| 12237 | * Subscription to be used for voice call on a multi sim device. The supported values |
| 12238 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12239 | * @hide |
| 12240 | */ |
| 12241 | public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; |
| 12242 | |
| 12243 | /** |
| 12244 | * Used to provide option to user to select subscription during dial. |
| 12245 | * The supported values are 0 = disable or 1 = enable prompt. |
| 12246 | * @hide |
| 12247 | */ |
| 12248 | public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; |
| 12249 | |
| 12250 | /** |
| 12251 | * Subscription to be used for data call on a multi sim device. The supported values |
| 12252 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12253 | * @hide |
| 12254 | */ |
| 12255 | public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; |
| 12256 | |
| 12257 | /** |
| 12258 | * Subscription to be used for SMS on a multi sim device. The supported values |
| 12259 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 12260 | * @hide |
| 12261 | */ |
| 12262 | public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; |
| 12263 | |
| 12264 | /** |
| 12265 | * Used to provide option to user to select subscription during send SMS. |
| 12266 | * The value 1 - enable, 0 - disable |
| 12267 | * @hide |
| 12268 | */ |
| 12269 | public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; |
| 12270 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12271 | /** User preferred subscriptions setting. |
| 12272 | * 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] | 12273 | * the activation status. Each settings string have the comma separated values |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 12274 | * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index |
| 12275 | * @hide |
| 12276 | */ |
| 12277 | public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", |
| 12278 | "user_preferred_sub2","user_preferred_sub3"}; |
Zheng Fu | b218ff4 | 2015-04-13 16:31:16 -0700 | [diff] [blame] | 12279 | |
| 12280 | /** |
| 12281 | * Whether to enable new contacts aggregator or not. |
| 12282 | * The value 1 - enable, 0 - disable |
| 12283 | * @hide |
| 12284 | */ |
| 12285 | public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12286 | |
| 12287 | /** |
| 12288 | * Whether to enable contacts metadata syncing or not |
| 12289 | * The value 1 - enable, 0 - disable |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12290 | * |
| 12291 | * @removed |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12292 | */ |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12293 | @Deprecated |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 12294 | public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 12295 | |
| 12296 | /** |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 12297 | * Whether to enable contacts metadata syncing or not |
| 12298 | * The value 1 - enable, 0 - disable |
| 12299 | */ |
| 12300 | public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; |
| 12301 | |
| 12302 | /** |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 12303 | * Whether to enable cellular on boot. |
| 12304 | * The value 1 - enable, 0 - disable |
| 12305 | * @hide |
| 12306 | */ |
| 12307 | public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; |
Steven Ng | dc20ba6 | 2016-04-26 18:19:04 +0100 | [diff] [blame] | 12308 | |
| 12309 | /** |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 12310 | * The maximum allowed notification enqueue rate in Hertz. |
| 12311 | * |
Julia Reynolds | 76c096d | 2017-06-19 08:16:04 -0400 | [diff] [blame] | 12312 | * Should be a float, and includes updates only. |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 12313 | * @hide |
| 12314 | */ |
| 12315 | public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; |
Doris Ling | 628cea4 | 2016-06-09 10:35:02 -0700 | [diff] [blame] | 12316 | |
| 12317 | /** |
Geoffrey Pitsch | 4c6eef2 | 2017-04-19 10:26:45 -0400 | [diff] [blame] | 12318 | * Displays toasts when an app posts a notification that does not specify a valid channel. |
| 12319 | * |
| 12320 | * The value 1 - enable, 0 - disable |
| 12321 | * @hide |
| 12322 | */ |
| 12323 | public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = |
| 12324 | "show_notification_channel_warnings"; |
| 12325 | |
| 12326 | /** |
Chris Manton | 95a6c89 | 2016-03-15 13:26:11 -0700 | [diff] [blame] | 12327 | * Whether cell is enabled/disabled |
| 12328 | * @hide |
| 12329 | */ |
| 12330 | public static final String CELL_ON = "cell_on"; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12331 | |
| 12332 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12333 | * Global settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12334 | * @hide |
| 12335 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12336 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12337 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 12338 | INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); |
| 12339 | INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); |
| 12340 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); |
| 12341 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); |
| 12342 | INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); |
Chad Brubaker | 1f6a266 | 2017-03-20 11:11:30 -0700 | [diff] [blame] | 12343 | INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); |
Chad Brubaker | 91d2e28 | 2017-04-03 14:34:50 -0700 | [diff] [blame] | 12344 | INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); |
| 12345 | INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); |
| 12346 | INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); |
| 12347 | INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 12348 | INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); |
Chad Brubaker | a6170b8 | 2017-09-01 14:48:46 -0700 | [diff] [blame] | 12349 | INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); |
Svet Ganov | 8f90bcc | 2017-12-22 23:29:24 -0800 | [diff] [blame] | 12350 | INSTANT_APP_SETTINGS.add(ZEN_MODE); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 12351 | } |
| 12352 | |
Andrew Sapperstein | e335256 | 2017-01-20 15:41:03 -0800 | [diff] [blame] | 12353 | /** |
| 12354 | * Whether to show the high temperature warning notification. |
| 12355 | * @hide |
| 12356 | */ |
| 12357 | public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; |
| 12358 | |
| 12359 | /** |
| 12360 | * Temperature at which the high temperature warning notification should be shown. |
| 12361 | * @hide |
| 12362 | */ |
| 12363 | public static final String WARNING_TEMPERATURE = "warning_temperature"; |
Daniel Nishi | 88e45dc | 2017-01-25 11:43:55 -0800 | [diff] [blame] | 12364 | |
| 12365 | /** |
| 12366 | * Whether the diskstats logging task is enabled/disabled. |
| 12367 | * @hide |
| 12368 | */ |
| 12369 | public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; |
Daniel Nishi | 0f703e6 | 2017-02-21 15:19:27 -0800 | [diff] [blame] | 12370 | |
| 12371 | /** |
| 12372 | * Whether the cache quota calculation task is enabled/disabled. |
| 12373 | * @hide |
| 12374 | */ |
| 12375 | public static final String ENABLE_CACHE_QUOTA_CALCULATION = |
| 12376 | "enable_cache_quota_calculation"; |
Daniel Nishi | 4f5320e | 2017-06-13 17:51:21 -0700 | [diff] [blame] | 12377 | |
| 12378 | /** |
| 12379 | * Whether the Deletion Helper no threshold toggle is available. |
| 12380 | * @hide |
| 12381 | */ |
| 12382 | public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = |
| 12383 | "enable_deletion_helper_no_threshold_toggle"; |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 12384 | |
| 12385 | /** |
| 12386 | * The list of snooze options for notifications |
| 12387 | * This is encoded as a key=value list, separated by commas. Ex: |
| 12388 | * |
| 12389 | * "default=60,options_array=15:30:60:120" |
| 12390 | * |
| 12391 | * The following keys are supported: |
| 12392 | * |
| 12393 | * <pre> |
| 12394 | * default (int) |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 12395 | * options_array (int[]) |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 12396 | * </pre> |
| 12397 | * |
| 12398 | * All delays in integer minutes. Array order is respected. |
| 12399 | * Options will be used in order up to the maximum allowed by the UI. |
| 12400 | * @hide |
| 12401 | */ |
| 12402 | public static final String NOTIFICATION_SNOOZE_OPTIONS = |
| 12403 | "notification_snooze_options"; |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 12404 | |
| 12405 | /** |
Fyodor Kupolov | ee90c03 | 2017-12-12 11:52:57 -0800 | [diff] [blame] | 12406 | * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated |
| 12407 | * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF |
| 12408 | * |
| 12409 | * Supported keys: |
| 12410 | * compatibility_wal_supported (boolean) |
| 12411 | * wal_syncmode (String) |
| 12412 | * |
| 12413 | * @hide |
| 12414 | */ |
| 12415 | public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = |
| 12416 | "sqlite_compatibility_wal_flags"; |
| 12417 | |
| 12418 | /** |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 12419 | * Enable GNSS Raw Measurements Full Tracking? |
| 12420 | * 0 = no |
| 12421 | * 1 = yes |
| 12422 | * @hide |
| 12423 | */ |
| 12424 | public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = |
| 12425 | "enable_gnss_raw_meas_full_tracking"; |
Daniel Colascione | 766b632 | 2018-01-08 19:10:36 -0800 | [diff] [blame] | 12426 | |
| 12427 | /** |
goneil | 4291960 | 2018-01-23 17:37:26 -0800 | [diff] [blame] | 12428 | * Whether the notification should be ongoing (persistent) when a carrier app install is |
| 12429 | * required. |
| 12430 | * |
| 12431 | * The value is a boolean (1 or 0). |
| 12432 | * @hide |
| 12433 | */ |
| 12434 | @SystemApi |
| 12435 | public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = |
| 12436 | "install_carrier_app_notification_persistent"; |
| 12437 | |
| 12438 | /** |
| 12439 | * The amount of time (ms) to hide the install carrier app notification after the user has |
| 12440 | * ignored it. After this time passes, the notification will be shown again |
| 12441 | * |
| 12442 | * The value is a long |
| 12443 | * @hide |
| 12444 | */ |
| 12445 | @SystemApi |
| 12446 | public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = |
| 12447 | "install_carrier_app_notification_sleep_millis"; |
| 12448 | |
| 12449 | /** |
Daniel Colascione | 766b632 | 2018-01-08 19:10:36 -0800 | [diff] [blame] | 12450 | * Whether we've enabled zram on this device. Takes effect on |
| 12451 | * reboot. The value "1" enables zram; "0" disables it, and |
| 12452 | * everything else is unspecified. |
| 12453 | * @hide |
| 12454 | */ |
| 12455 | public static final String ZRAM_ENABLED = |
| 12456 | "zram_enabled"; |
Petr Cermak | 9669e90 | 2018-01-16 16:37:22 +0000 | [diff] [blame] | 12457 | |
| 12458 | /** |
Alice Sheng | 59a9488 | 2018-03-19 23:46:56 +0000 | [diff] [blame] | 12459 | * Whether we have enable CPU frequency scaling for this device. |
| 12460 | * For Wear, default is disable. |
| 12461 | * |
| 12462 | * The value is "1" for enable, "0" for disable. |
| 12463 | * @hide |
| 12464 | */ |
| 12465 | public static final String CPU_SCALING_ENABLED = |
| 12466 | "cpu_frequency_scaling_enabled"; |
| 12467 | |
| 12468 | /** |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12469 | * Configuration flags for smart replies in notifications. |
| 12470 | * This is encoded as a key=value list, separated by commas. Ex: |
| 12471 | * |
| 12472 | * "enabled=1,max_squeeze_remeasure_count=3" |
| 12473 | * |
| 12474 | * The following keys are supported: |
| 12475 | * |
| 12476 | * <pre> |
| 12477 | * enabled (boolean) |
Richard Ledley | 4069f7a | 2018-02-26 10:36:00 +0000 | [diff] [blame] | 12478 | * requires_targeting_p (boolean) |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12479 | * max_squeeze_remeasure_attempts (int) |
| 12480 | * </pre> |
| 12481 | * @see com.android.systemui.statusbar.policy.SmartReplyConstants |
Petr Cermak | 9669e90 | 2018-01-16 16:37:22 +0000 | [diff] [blame] | 12482 | * @hide |
| 12483 | */ |
Petr Cermak | 10011fa | 2018-02-05 19:00:54 +0000 | [diff] [blame] | 12484 | public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = |
| 12485 | "smart_replies_in_notifications_flags"; |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 12486 | |
| 12487 | /** |
| 12488 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 12489 | * Otherwise, the process will be silently killed. |
| 12490 | * @hide |
| 12491 | */ |
| 12492 | public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; |
Andrew Sapperstein | 5b679c4 | 2018-01-16 11:13:40 -0800 | [diff] [blame] | 12493 | |
| 12494 | /** |
| 12495 | * If nonzero, crash dialogs will show an option to restart the app. |
| 12496 | * @hide |
| 12497 | */ |
| 12498 | public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; |
| 12499 | |
| 12500 | /** |
| 12501 | * If nonzero, crash dialogs will show an option to mute all future crash dialogs for |
| 12502 | * this app. |
| 12503 | * @hide |
| 12504 | */ |
| 12505 | 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] | 12506 | |
| 12507 | /** |
| 12508 | * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. |
| 12509 | * @hide |
| 12510 | */ |
| 12511 | public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; |
Annie Meng | d069a88 | 2018-03-13 15:31:40 +0000 | [diff] [blame] | 12512 | |
| 12513 | /** |
| 12514 | * Backup and restore agent timeout parameters. |
| 12515 | * These parameters are represented by a comma-delimited key-value list. |
| 12516 | * |
| 12517 | * The following strings are supported as keys: |
| 12518 | * <pre> |
| 12519 | * kv_backup_agent_timeout_millis (long) |
| 12520 | * full_backup_agent_timeout_millis (long) |
| 12521 | * shared_backup_agent_timeout_millis (long) |
| 12522 | * restore_agent_timeout_millis (long) |
| 12523 | * restore_agent_finished_timeout_millis (long) |
| 12524 | * </pre> |
| 12525 | * |
| 12526 | * They map to milliseconds represented as longs. |
| 12527 | * |
| 12528 | * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" |
| 12529 | * |
| 12530 | * @hide |
| 12531 | */ |
| 12532 | public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = |
| 12533 | "backup_agent_timeout_parameters"; |
Alice Sheng | b32b1ad | 2018-03-14 12:00:44 -0700 | [diff] [blame] | 12534 | |
| 12535 | /** |
| 12536 | * Whether we have enabled swapping on this device. For Wear, default is |
| 12537 | * enabled. |
| 12538 | * |
| 12539 | * The value is "1" for enable, "0" for disable. |
| 12540 | * @hide |
| 12541 | */ |
| 12542 | public static final String SWAP_ENABLED = "swap_enabled"; |
| 12543 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12544 | } |
| 12545 | |
| 12546 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12547 | * User-defined bookmarks and shortcuts. The target of each bookmark is an |
| 12548 | * Intent URL, allowing it to be either a web page or a particular |
| 12549 | * application activity. |
| 12550 | * |
| 12551 | * @hide |
| 12552 | */ |
| 12553 | public static final class Bookmarks implements BaseColumns |
| 12554 | { |
| 12555 | private static final String TAG = "Bookmarks"; |
| 12556 | |
| 12557 | /** |
| 12558 | * The content:// style URL for this table |
| 12559 | */ |
| 12560 | public static final Uri CONTENT_URI = |
| 12561 | Uri.parse("content://" + AUTHORITY + "/bookmarks"); |
| 12562 | |
| 12563 | /** |
| 12564 | * The row ID. |
| 12565 | * <p>Type: INTEGER</p> |
| 12566 | */ |
| 12567 | public static final String ID = "_id"; |
| 12568 | |
| 12569 | /** |
| 12570 | * Descriptive name of the bookmark that can be displayed to the user. |
| 12571 | * If this is empty, the title should be resolved at display time (use |
| 12572 | * {@link #getTitle(Context, Cursor)} any time you want to display the |
| 12573 | * title of a bookmark.) |
| 12574 | * <P> |
| 12575 | * Type: TEXT |
| 12576 | * </P> |
| 12577 | */ |
| 12578 | public static final String TITLE = "title"; |
| 12579 | |
| 12580 | /** |
| 12581 | * Arbitrary string (displayed to the user) that allows bookmarks to be |
| 12582 | * organized into categories. There are some special names for |
| 12583 | * standard folders, which all start with '@'. The label displayed for |
| 12584 | * the folder changes with the locale (via {@link #getLabelForFolder}) but |
| 12585 | * the folder name does not change so you can consistently query for |
| 12586 | * the folder regardless of the current locale. |
| 12587 | * |
| 12588 | * <P>Type: TEXT</P> |
| 12589 | * |
| 12590 | */ |
| 12591 | public static final String FOLDER = "folder"; |
| 12592 | |
| 12593 | /** |
| 12594 | * The Intent URL of the bookmark, describing what it points to. This |
| 12595 | * value is given to {@link android.content.Intent#getIntent} to create |
| 12596 | * an Intent that can be launched. |
| 12597 | * <P>Type: TEXT</P> |
| 12598 | */ |
| 12599 | public static final String INTENT = "intent"; |
| 12600 | |
| 12601 | /** |
| 12602 | * Optional shortcut character associated with this bookmark. |
| 12603 | * <P>Type: INTEGER</P> |
| 12604 | */ |
| 12605 | public static final String SHORTCUT = "shortcut"; |
| 12606 | |
| 12607 | /** |
| 12608 | * The order in which the bookmark should be displayed |
| 12609 | * <P>Type: INTEGER</P> |
| 12610 | */ |
| 12611 | public static final String ORDERING = "ordering"; |
| 12612 | |
| 12613 | private static final String[] sIntentProjection = { INTENT }; |
| 12614 | private static final String[] sShortcutProjection = { ID, SHORTCUT }; |
| 12615 | private static final String sShortcutSelection = SHORTCUT + "=?"; |
| 12616 | |
| 12617 | /** |
| 12618 | * Convenience function to retrieve the bookmarked Intent for a |
| 12619 | * particular shortcut key. |
| 12620 | * |
| 12621 | * @param cr The ContentResolver to query. |
| 12622 | * @param shortcut The shortcut key. |
| 12623 | * |
| 12624 | * @return Intent The bookmarked URL, or null if there is no bookmark |
| 12625 | * matching the given shortcut. |
| 12626 | */ |
| 12627 | public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) |
| 12628 | { |
| 12629 | Intent intent = null; |
| 12630 | |
| 12631 | Cursor c = cr.query(CONTENT_URI, |
| 12632 | sIntentProjection, sShortcutSelection, |
| 12633 | new String[] { String.valueOf((int) shortcut) }, ORDERING); |
| 12634 | // Keep trying until we find a valid shortcut |
| 12635 | try { |
| 12636 | while (intent == null && c.moveToNext()) { |
| 12637 | try { |
| 12638 | String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12639 | intent = Intent.parseUri(intentURI, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12640 | } catch (java.net.URISyntaxException e) { |
| 12641 | // The stored URL is bad... ignore it. |
| 12642 | } catch (IllegalArgumentException e) { |
| 12643 | // Column not found |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 12644 | Log.w(TAG, "Intent column not found", e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12645 | } |
| 12646 | } |
| 12647 | } finally { |
| 12648 | if (c != null) c.close(); |
| 12649 | } |
| 12650 | |
| 12651 | return intent; |
| 12652 | } |
| 12653 | |
| 12654 | /** |
| 12655 | * Add a new bookmark to the system. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12656 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12657 | * @param cr The ContentResolver to query. |
| 12658 | * @param intent The desired target of the bookmark. |
| 12659 | * @param title Bookmark title that is shown to the user; null if none |
| 12660 | * or it should be resolved to the intent's title. |
| 12661 | * @param folder Folder in which to place the bookmark; null if none. |
| 12662 | * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If |
| 12663 | * this is non-zero and there is an existing bookmark entry |
| 12664 | * with this same shortcut, then that existing shortcut is |
| 12665 | * cleared (the bookmark is not removed). |
| 12666 | * @return The unique content URL for the new bookmark entry. |
| 12667 | */ |
| 12668 | public static Uri add(ContentResolver cr, |
| 12669 | Intent intent, |
| 12670 | String title, |
| 12671 | String folder, |
| 12672 | char shortcut, |
| 12673 | int ordering) |
| 12674 | { |
| 12675 | // If a shortcut is supplied, and it is already defined for |
| 12676 | // another bookmark, then remove the old definition. |
| 12677 | if (shortcut != 0) { |
Jeff Hamilton | 7cd51ef | 2010-05-12 17:30:27 -0500 | [diff] [blame] | 12678 | cr.delete(CONTENT_URI, sShortcutSelection, |
| 12679 | new String[] { String.valueOf((int) shortcut) }); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12680 | } |
| 12681 | |
| 12682 | ContentValues values = new ContentValues(); |
| 12683 | if (title != null) values.put(TITLE, title); |
| 12684 | if (folder != null) values.put(FOLDER, folder); |
Jean-Baptiste Queru | 3b9f0a3 | 2010-06-21 13:46:59 -0700 | [diff] [blame] | 12685 | values.put(INTENT, intent.toUri(0)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12686 | if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); |
| 12687 | values.put(ORDERING, ordering); |
| 12688 | return cr.insert(CONTENT_URI, values); |
| 12689 | } |
| 12690 | |
| 12691 | /** |
| 12692 | * Return the folder name as it should be displayed to the user. This |
| 12693 | * takes care of localizing special folders. |
| 12694 | * |
| 12695 | * @param r Resources object for current locale; only need access to |
| 12696 | * system resources. |
| 12697 | * @param folder The value found in the {@link #FOLDER} column. |
| 12698 | * |
| 12699 | * @return CharSequence The label for this folder that should be shown |
| 12700 | * to the user. |
| 12701 | */ |
| 12702 | public static CharSequence getLabelForFolder(Resources r, String folder) { |
| 12703 | return folder; |
| 12704 | } |
| 12705 | |
| 12706 | /** |
| 12707 | * Return the title as it should be displayed to the user. This takes |
| 12708 | * care of localizing bookmarks that point to activities. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12709 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12710 | * @param context A context. |
| 12711 | * @param cursor A cursor pointing to the row whose title should be |
| 12712 | * returned. The cursor must contain at least the {@link #TITLE} |
| 12713 | * and {@link #INTENT} columns. |
| 12714 | * @return A title that is localized and can be displayed to the user, |
| 12715 | * or the empty string if one could not be found. |
| 12716 | */ |
| 12717 | public static CharSequence getTitle(Context context, Cursor cursor) { |
| 12718 | int titleColumn = cursor.getColumnIndex(TITLE); |
| 12719 | int intentColumn = cursor.getColumnIndex(INTENT); |
| 12720 | if (titleColumn == -1 || intentColumn == -1) { |
| 12721 | throw new IllegalArgumentException( |
| 12722 | "The cursor must contain the TITLE and INTENT columns."); |
| 12723 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12724 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12725 | String title = cursor.getString(titleColumn); |
| 12726 | if (!TextUtils.isEmpty(title)) { |
| 12727 | return title; |
| 12728 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12729 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12730 | String intentUri = cursor.getString(intentColumn); |
| 12731 | if (TextUtils.isEmpty(intentUri)) { |
| 12732 | return ""; |
| 12733 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12734 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12735 | Intent intent; |
| 12736 | try { |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12737 | intent = Intent.parseUri(intentUri, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12738 | } catch (URISyntaxException e) { |
| 12739 | return ""; |
| 12740 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12741 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12742 | PackageManager packageManager = context.getPackageManager(); |
| 12743 | ResolveInfo info = packageManager.resolveActivity(intent, 0); |
| 12744 | return info != null ? info.loadLabel(packageManager) : ""; |
| 12745 | } |
| 12746 | } |
| 12747 | |
| 12748 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12749 | * Returns the device ID that we should use when connecting to the mobile gtalk server. |
| 12750 | * This is a string like "android-0x1242", where the hex string is the Android ID obtained |
| 12751 | * from the GoogleLoginService. |
| 12752 | * |
| 12753 | * @param androidId The Android ID for this device. |
| 12754 | * @return The device ID that should be used when connecting to the mobile gtalk server. |
| 12755 | * @hide |
| 12756 | */ |
| 12757 | public static String getGTalkDeviceId(long androidId) { |
| 12758 | return "android-" + Long.toHexString(androidId); |
| 12759 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12760 | |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12761 | private static final String[] PM_WRITE_SETTINGS = { |
| 12762 | android.Manifest.permission.WRITE_SETTINGS |
| 12763 | }; |
| 12764 | private static final String[] PM_CHANGE_NETWORK_STATE = { |
| 12765 | android.Manifest.permission.CHANGE_NETWORK_STATE, |
| 12766 | android.Manifest.permission.WRITE_SETTINGS |
| 12767 | }; |
| 12768 | private static final String[] PM_SYSTEM_ALERT_WINDOW = { |
| 12769 | android.Manifest.permission.SYSTEM_ALERT_WINDOW |
| 12770 | }; |
| 12771 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12772 | /** |
| 12773 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12774 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12775 | * privileged/preinstalled apps. If the provided uid does not match the |
| 12776 | * callingPackage, a negative result will be returned. |
| 12777 | * @hide |
| 12778 | */ |
| 12779 | public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, |
| 12780 | String callingPackage, boolean throwException) { |
| 12781 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12782 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12783 | PM_WRITE_SETTINGS, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12784 | } |
| 12785 | |
| 12786 | /** |
| 12787 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12788 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12789 | * privileged/preinstalled apps. If the provided uid does not match the |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12790 | * 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] | 12791 | * the WRITE_SETTINGS permission declared. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12792 | * |
| 12793 | * Note: if the check is successful, the operation of this app will be updated to the |
| 12794 | * current time. |
| 12795 | * @hide |
| 12796 | */ |
| 12797 | public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, |
| 12798 | String callingPackage, boolean throwException) { |
| 12799 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12800 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12801 | PM_WRITE_SETTINGS, true); |
| 12802 | } |
| 12803 | |
| 12804 | /** |
| 12805 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12806 | * 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] | 12807 | * privileged/preinstalled apps. The caller is expected to have either the |
| 12808 | * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these |
| 12809 | * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and |
| 12810 | * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal |
| 12811 | * permission and cannot be revoked. See http://b/23597341 |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12812 | * |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12813 | * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation |
| 12814 | * of this app will be updated to the current time. |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12815 | * @hide |
| 12816 | */ |
| 12817 | public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, |
| 12818 | String callingPackage, boolean throwException) { |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12819 | if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) |
| 12820 | == PackageManager.PERMISSION_GRANTED) { |
| 12821 | return true; |
| 12822 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12823 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12824 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
| 12825 | PM_CHANGE_NETWORK_STATE, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12826 | } |
| 12827 | |
| 12828 | /** |
| 12829 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12830 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 12831 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 12832 | * a negative result will be returned. |
| 12833 | * @hide |
| 12834 | */ |
| 12835 | public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, |
| 12836 | String callingPackage, boolean throwException) { |
| 12837 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12838 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12839 | PM_SYSTEM_ALERT_WINDOW, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12840 | } |
| 12841 | |
| 12842 | /** |
| 12843 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12844 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 12845 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 12846 | * a negative result will be returned. |
| 12847 | * |
| 12848 | * Note: if the check is successful, the operation of this app will be updated to the |
| 12849 | * current time. |
| 12850 | * @hide |
| 12851 | */ |
| 12852 | public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String |
| 12853 | callingPackage, boolean throwException) { |
| 12854 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12855 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12856 | PM_SYSTEM_ALERT_WINDOW, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12857 | } |
| 12858 | |
| 12859 | /** |
| 12860 | * Helper method to perform a general and comprehensive check of whether an operation that is |
| 12861 | * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and |
| 12862 | * OP_WRITE_SETTINGS |
| 12863 | * @hide |
| 12864 | */ |
| 12865 | public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12866 | int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] |
| 12867 | permissions, boolean makeNote) { |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12868 | if (callingPackage == null) { |
| 12869 | return false; |
| 12870 | } |
| 12871 | |
| 12872 | AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); |
| 12873 | int mode = AppOpsManager.MODE_DEFAULT; |
| 12874 | if (makeNote) { |
| 12875 | mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 12876 | } else { |
| 12877 | mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 12878 | } |
| 12879 | |
| 12880 | switch (mode) { |
| 12881 | case AppOpsManager.MODE_ALLOWED: |
| 12882 | return true; |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12883 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12884 | case AppOpsManager.MODE_DEFAULT: |
| 12885 | // this is the default operating mode after an app's installation |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12886 | // In this case we will check all associated static permission to see |
| 12887 | // if it is granted during install time. |
| 12888 | for (String permission : permissions) { |
| 12889 | if (context.checkCallingOrSelfPermission(permission) == PackageManager |
| 12890 | .PERMISSION_GRANTED) { |
| 12891 | // if either of the permissions are granted, we will allow it |
| 12892 | return true; |
| 12893 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12894 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12895 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12896 | default: |
| 12897 | // this is for all other cases trickled down here... |
| 12898 | if (!throwException) { |
| 12899 | return false; |
| 12900 | } |
| 12901 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12902 | |
| 12903 | // prepare string to throw SecurityException |
| 12904 | StringBuilder exceptionMessage = new StringBuilder(); |
| 12905 | exceptionMessage.append(callingPackage); |
| 12906 | exceptionMessage.append(" was not granted "); |
| 12907 | if (permissions.length > 1) { |
| 12908 | exceptionMessage.append(" either of these permissions: "); |
| 12909 | } else { |
| 12910 | exceptionMessage.append(" this permission: "); |
| 12911 | } |
| 12912 | for (int i = 0; i < permissions.length; i++) { |
| 12913 | exceptionMessage.append(permissions[i]); |
| 12914 | exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); |
| 12915 | } |
| 12916 | |
| 12917 | throw new SecurityException(exceptionMessage.toString()); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12918 | } |
| 12919 | |
| 12920 | /** |
| 12921 | * Retrieves a correponding package name for a given uid. It will query all |
| 12922 | * packages that are associated with the given uid, but it will return only |
| 12923 | * the zeroth result. |
| 12924 | * Note: If package could not be found, a null is returned. |
| 12925 | * @hide |
| 12926 | */ |
| 12927 | public static String getPackageNameForUid(Context context, int uid) { |
| 12928 | String[] packages = context.getPackageManager().getPackagesForUid(uid); |
| 12929 | if (packages == null) { |
| 12930 | return null; |
| 12931 | } |
| 12932 | return packages[0]; |
| 12933 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12934 | } |