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; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 86 | import android.util.StatsLog; |
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 | /** |
| 432 | * Activity Action: Show settings to allow configuration of Bluetooth. |
| 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_BLUETOOTH_SETTINGS = |
| 443 | "android.settings.BLUETOOTH_SETTINGS"; |
| 444 | |
| 445 | /** |
Kevin Chyn | 268a96c | 2017-06-17 17:32:49 -0700 | [diff] [blame] | 446 | * Activity Action: Show settings to allow configuration of Assist Gesture. |
| 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 | * @hide |
| 455 | */ |
| 456 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 457 | public static final String ACTION_ASSIST_GESTURE_SETTINGS = |
| 458 | "android.settings.ASSIST_GESTURE_SETTINGS"; |
| 459 | |
| 460 | /** |
Kevin Chyn | 83ff28c | 2017-10-13 16:35:17 -0700 | [diff] [blame] | 461 | * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if |
| 462 | * necessary. |
| 463 | * <p> |
| 464 | * Input: Nothing. |
| 465 | * <p> |
| 466 | * Output: Nothing. |
| 467 | */ |
| 468 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 469 | public static final String ACTION_FINGERPRINT_ENROLL = |
| 470 | "android.settings.FINGERPRINT_ENROLL"; |
| 471 | |
| 472 | /** |
Jeff Brown | c05c1ae | 2015-05-05 13:46:30 -0700 | [diff] [blame] | 473 | * Activity Action: Show settings to allow configuration of cast endpoints. |
Jeff Brown | 1a937b0 | 2014-07-01 22:13:04 -0700 | [diff] [blame] | 474 | * <p> |
| 475 | * In some cases, a matching Activity may not exist, so ensure you |
| 476 | * safeguard against this. |
| 477 | * <p> |
| 478 | * Input: Nothing. |
| 479 | * <p> |
| 480 | * Output: Nothing. |
| 481 | */ |
| 482 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 483 | public static final String ACTION_CAST_SETTINGS = |
| 484 | "android.settings.CAST_SETTINGS"; |
| 485 | |
| 486 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 487 | * Activity Action: Show settings to allow configuration of date and time. |
| 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_DATE_SETTINGS = |
| 498 | "android.settings.DATE_SETTINGS"; |
| 499 | |
| 500 | /** |
| 501 | * Activity Action: Show settings to allow configuration of sound and volume. |
| 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_SOUND_SETTINGS = |
| 512 | "android.settings.SOUND_SETTINGS"; |
| 513 | |
| 514 | /** |
| 515 | * Activity Action: Show settings to allow configuration of display. |
| 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_DISPLAY_SETTINGS = |
| 526 | "android.settings.DISPLAY_SETTINGS"; |
| 527 | |
| 528 | /** |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 529 | * Activity Action: Show settings to allow configuration of Night 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. |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 537 | */ |
| 538 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 539 | public static final String ACTION_NIGHT_DISPLAY_SETTINGS = |
| 540 | "android.settings.NIGHT_DISPLAY_SETTINGS"; |
| 541 | |
| 542 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 543 | * Activity Action: Show settings to allow configuration of locale. |
| 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. |
| 551 | */ |
| 552 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 553 | public static final String ACTION_LOCALE_SETTINGS = |
| 554 | "android.settings.LOCALE_SETTINGS"; |
| 555 | |
| 556 | /** |
| 557 | * Activity Action: Show settings to configure input methods, in particular |
| 558 | * allowing the user to enable input methods. |
| 559 | * <p> |
| 560 | * In some cases, a matching Activity may not exist, so ensure you |
| 561 | * safeguard against this. |
| 562 | * <p> |
| 563 | * Input: Nothing. |
| 564 | * <p> |
| 565 | * Output: Nothing. |
| 566 | */ |
| 567 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 568 | public static final String ACTION_VOICE_INPUT_SETTINGS = |
| 569 | "android.settings.VOICE_INPUT_SETTINGS"; |
| 570 | |
| 571 | /** |
| 572 | * Activity Action: Show settings to configure input methods, in particular |
| 573 | * allowing the user to enable input methods. |
| 574 | * <p> |
| 575 | * In some cases, a matching Activity may not exist, so ensure you |
| 576 | * safeguard against this. |
| 577 | * <p> |
| 578 | * Input: Nothing. |
| 579 | * <p> |
| 580 | * Output: Nothing. |
| 581 | */ |
| 582 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 583 | public static final String ACTION_INPUT_METHOD_SETTINGS = |
| 584 | "android.settings.INPUT_METHOD_SETTINGS"; |
| 585 | |
| 586 | /** |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 587 | * Activity Action: Show settings to enable/disable input method subtypes. |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 588 | * <p> |
| 589 | * In some cases, a matching Activity may not exist, so ensure you |
| 590 | * safeguard against this. |
| 591 | * <p> |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 592 | * To tell which input method's subtypes are displayed in the settings, add |
| 593 | * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. |
| 594 | * If there is no extra in this Intent, subtypes from all installed input methods |
| 595 | * will be displayed in the settings. |
| 596 | * |
| 597 | * @see android.view.inputmethod.InputMethodInfo#getId |
| 598 | * <p> |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 599 | * Input: Nothing. |
| 600 | * <p> |
| 601 | * Output: Nothing. |
| 602 | */ |
| 603 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 604 | public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = |
| 605 | "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 606 | |
| 607 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 608 | * Activity Action: Show settings to manage the user input dictionary. |
| 609 | * <p> |
Chet Haase | e8222dd | 2013-09-05 07:44:18 -0700 | [diff] [blame] | 610 | * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, |
Satoshi Kataoka | 2aa2bc5 | 2013-07-30 14:25:11 +0900 | [diff] [blame] | 611 | * it is guaranteed there will always be an appropriate implementation for this Intent action. |
| 612 | * 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] | 613 | * <p> |
| 614 | * Input: Nothing. |
| 615 | * <p> |
| 616 | * Output: Nothing. |
| 617 | */ |
| 618 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 619 | public static final String ACTION_USER_DICTIONARY_SETTINGS = |
| 620 | "android.settings.USER_DICTIONARY_SETTINGS"; |
| 621 | |
| 622 | /** |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 623 | * Activity Action: Show settings to configure the hardware keyboard. |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 624 | * <p> |
| 625 | * In some cases, a matching Activity may not exist, so ensure you |
| 626 | * safeguard against this. |
| 627 | * <p> |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 628 | * Input: Nothing. |
| 629 | * <p> |
| 630 | * Output: Nothing. |
| 631 | */ |
| 632 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 633 | public static final String ACTION_HARD_KEYBOARD_SETTINGS = |
| 634 | "android.settings.HARD_KEYBOARD_SETTINGS"; |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 635 | |
| 636 | /** |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 637 | * Activity Action: Adds a word to the user dictionary. |
| 638 | * <p> |
| 639 | * In some cases, a matching Activity may not exist, so ensure you |
| 640 | * safeguard against this. |
| 641 | * <p> |
| 642 | * Input: An extra with key <code>word</code> that contains the word |
| 643 | * that should be added to the dictionary. |
| 644 | * <p> |
| 645 | * Output: Nothing. |
| 646 | * |
| 647 | * @hide |
| 648 | */ |
| 649 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 650 | public static final String ACTION_USER_DICTIONARY_INSERT = |
| 651 | "com.android.settings.USER_DICTIONARY_INSERT"; |
| 652 | |
| 653 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 654 | * Activity Action: Show settings to allow configuration of application-related settings. |
| 655 | * <p> |
| 656 | * In some cases, a matching Activity may not exist, so ensure you |
| 657 | * safeguard against this. |
| 658 | * <p> |
| 659 | * Input: Nothing. |
| 660 | * <p> |
| 661 | * Output: Nothing. |
| 662 | */ |
| 663 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 664 | public static final String ACTION_APPLICATION_SETTINGS = |
| 665 | "android.settings.APPLICATION_SETTINGS"; |
| 666 | |
| 667 | /** |
| 668 | * Activity Action: Show settings to allow configuration of application |
Dianne Hackborn | 8d866e5 | 2012-10-10 18:39:45 -0700 | [diff] [blame] | 669 | * development-related settings. As of |
| 670 | * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is |
| 671 | * a required part of the platform. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 672 | * <p> |
| 673 | * Input: Nothing. |
| 674 | * <p> |
| 675 | * Output: Nothing. |
| 676 | */ |
| 677 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 678 | public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = |
| 679 | "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; |
| 680 | |
| 681 | /** |
| 682 | * Activity Action: Show settings to allow configuration of quick launch shortcuts. |
| 683 | * <p> |
| 684 | * In some cases, a matching Activity may not exist, so ensure you |
| 685 | * safeguard against this. |
| 686 | * <p> |
| 687 | * Input: Nothing. |
| 688 | * <p> |
| 689 | * Output: Nothing. |
| 690 | */ |
| 691 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 692 | public static final String ACTION_QUICK_LAUNCH_SETTINGS = |
| 693 | "android.settings.QUICK_LAUNCH_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 694 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 695 | /** |
| 696 | * Activity Action: Show settings to manage installed applications. |
| 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_MANAGE_APPLICATIONS_SETTINGS = |
| 707 | "android.settings.MANAGE_APPLICATIONS_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 | /** |
Winson Chung | 44e8ff9 | 2010-09-27 14:36:52 -0700 | [diff] [blame] | 710 | * Activity Action: Show settings to manage all 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_ALL_APPLICATIONS_SETTINGS = |
| 721 | "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; |
| 722 | |
| 723 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 724 | * 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] | 725 | * <p> |
| 726 | * In some cases, a matching Activity may not exist, so ensure you |
| 727 | * safeguard against this. |
| 728 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 729 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 730 | * directly invoke the management GUI specific to the package name. For example |
| 731 | * "package:com.my.app". |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 732 | * <p> |
| 733 | * Output: Nothing. |
| 734 | */ |
| 735 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 736 | public static final String ACTION_MANAGE_OVERLAY_PERMISSION = |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 737 | "android.settings.action.MANAGE_OVERLAY_PERMISSION"; |
| 738 | |
| 739 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 740 | * Activity Action: Show screen for controlling which apps are allowed to write/modify |
| 741 | * system settings. |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 742 | * <p> |
| 743 | * In some cases, a matching Activity may not exist, so ensure you |
| 744 | * safeguard against this. |
| 745 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 746 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 747 | * directly invoke the management GUI specific to the package name. For example |
| 748 | * "package:com.my.app". |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 749 | * <p> |
| 750 | * Output: Nothing. |
| 751 | */ |
| 752 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 753 | public static final String ACTION_MANAGE_WRITE_SETTINGS = |
| 754 | "android.settings.action.MANAGE_WRITE_SETTINGS"; |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 755 | |
| 756 | /** |
Dianne Hackborn | b7bb3b3 | 2010-06-06 22:47:50 -0700 | [diff] [blame] | 757 | * Activity Action: Show screen of details about a particular application. |
| 758 | * <p> |
| 759 | * In some cases, a matching Activity may not exist, so ensure you |
| 760 | * safeguard against this. |
| 761 | * <p> |
| 762 | * Input: The Intent's data URI specifies the application package name |
| 763 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 764 | * <p> |
| 765 | * Output: Nothing. |
| 766 | */ |
| 767 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 768 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS = |
| 769 | "android.settings.APPLICATION_DETAILS_SETTINGS"; |
| 770 | |
| 771 | /** |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 772 | * Activity Action: Show list of applications that have been running |
| 773 | * foreground services (to the user "running in the background"). |
| 774 | * <p> |
| 775 | * Input: Extras "packages" is a string array of package names. |
| 776 | * <p> |
| 777 | * Output: Nothing. |
| 778 | * @hide |
| 779 | */ |
| 780 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 781 | public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = |
| 782 | "android.settings.FOREGROUND_SERVICES_SETTINGS"; |
| 783 | |
| 784 | /** |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 785 | * Activity Action: Show screen for controlling which apps can ignore battery optimizations. |
| 786 | * <p> |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 787 | * Input: Nothing. |
| 788 | * <p> |
| 789 | * Output: Nothing. |
| 790 | * <p> |
| 791 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 792 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 793 | * already ignoring optimizations. You can use |
| 794 | * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you |
| 795 | * on this list. |
| 796 | */ |
| 797 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 798 | public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = |
| 799 | "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; |
| 800 | |
| 801 | /** |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 802 | * 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] | 803 | * put them on the whitelist of apps shown by |
| 804 | * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also |
| 805 | * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} |
| 806 | * permission. |
| 807 | * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities |
| 808 | * 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] | 809 | * 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] | 810 | * 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] | 811 | * 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] | 812 | * <p> |
| 813 | * Input: The Intent's data URI must specify the application package name |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 814 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 815 | * <p> |
| 816 | * Output: Nothing. |
Dianne Hackborn | 1958e5e | 2015-06-12 18:11:41 -0700 | [diff] [blame] | 817 | * <p> |
| 818 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 819 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 820 | * already ignoring optimizations. |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 821 | */ |
| 822 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 823 | public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = |
| 824 | "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 825 | |
| 826 | /** |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 827 | * Activity Action: Show screen for controlling background data |
| 828 | * restrictions for a particular application. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 829 | * <p> |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 830 | * Input: Intent's data URI set with an application name, using the |
| 831 | * "package" schema (like "package:com.my.app"). |
| 832 | * |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 833 | * <p> |
| 834 | * Output: Nothing. |
| 835 | * <p> |
| 836 | * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 837 | * ConnectivityManager#getRestrictBackgroundStatus()} to determine the |
| 838 | * status of the background data restrictions for them. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 839 | */ |
| 840 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 841 | public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = |
| 842 | "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; |
| 843 | |
| 844 | /** |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 845 | * @hide |
| 846 | * Activity Action: Show the "app ops" settings screen. |
| 847 | * <p> |
| 848 | * Input: Nothing. |
| 849 | * <p> |
| 850 | * Output: Nothing. |
| 851 | */ |
| 852 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 853 | public static final String ACTION_APP_OPS_SETTINGS = |
| 854 | "android.settings.APP_OPS_SETTINGS"; |
| 855 | |
| 856 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 857 | * Activity Action: Show settings for system update functionality. |
| 858 | * <p> |
| 859 | * In some cases, a matching Activity may not exist, so ensure you |
| 860 | * safeguard against this. |
| 861 | * <p> |
| 862 | * Input: Nothing. |
| 863 | * <p> |
| 864 | * Output: Nothing. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 865 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 866 | * @hide |
| 867 | */ |
| 868 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 869 | public static final String ACTION_SYSTEM_UPDATE_SETTINGS = |
| 870 | "android.settings.SYSTEM_UPDATE_SETTINGS"; |
| 871 | |
| 872 | /** |
Ricky Wai | 38bb832 | 2017-02-01 15:23:50 +0000 | [diff] [blame] | 873 | * Activity Action: Show settings for managed profile settings. |
| 874 | * <p> |
| 875 | * In some cases, a matching Activity may not exist, so ensure you |
| 876 | * safeguard against this. |
| 877 | * <p> |
| 878 | * Input: Nothing. |
| 879 | * <p> |
| 880 | * Output: Nothing. |
| 881 | * |
| 882 | * @hide |
| 883 | */ |
| 884 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 885 | public static final String ACTION_MANAGED_PROFILE_SETTINGS = |
| 886 | "android.settings.MANAGED_PROFILE_SETTINGS"; |
| 887 | |
| 888 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 889 | * Activity Action: Show settings to allow configuration of sync settings. |
| 890 | * <p> |
| 891 | * In some cases, a matching Activity may not exist, so ensure you |
| 892 | * safeguard against this. |
| 893 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 894 | * The account types available to add via the add account button may be restricted by adding an |
| 895 | * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's |
| 896 | * authorities. Only account types which can sync with that content provider will be offered to |
| 897 | * the user. |
| 898 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 899 | * Input: Nothing. |
| 900 | * <p> |
| 901 | * Output: Nothing. |
| 902 | */ |
| 903 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 904 | public static final String ACTION_SYNC_SETTINGS = |
| 905 | "android.settings.SYNC_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 906 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 907 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 908 | * Activity Action: Show add account screen for creating a new account. |
| 909 | * <p> |
| 910 | * In some cases, a matching Activity may not exist, so ensure you |
| 911 | * safeguard against this. |
| 912 | * <p> |
| 913 | * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} |
| 914 | * extra to the Intent with one or more syncable content provider's authorities. Only account |
| 915 | * types which can sync with that content provider will be offered to the user. |
| 916 | * <p> |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 917 | * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the |
| 918 | * Intent with one or more account types. |
| 919 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 920 | * Input: Nothing. |
| 921 | * <p> |
| 922 | * Output: Nothing. |
| 923 | */ |
| 924 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 925 | public static final String ACTION_ADD_ACCOUNT = |
| 926 | "android.settings.ADD_ACCOUNT_SETTINGS"; |
| 927 | |
| 928 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 929 | * Activity Action: Show settings for selecting the network operator. |
| 930 | * <p> |
| 931 | * In some cases, a matching Activity may not exist, so ensure you |
| 932 | * safeguard against this. |
| 933 | * <p> |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 934 | * The subscription ID of the subscription for which available network operators should be |
| 935 | * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. |
| 936 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 937 | * Input: Nothing. |
| 938 | * <p> |
| 939 | * Output: Nothing. |
| 940 | */ |
| 941 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 942 | public static final String ACTION_NETWORK_OPERATOR_SETTINGS = |
| 943 | "android.settings.NETWORK_OPERATOR_SETTINGS"; |
| 944 | |
| 945 | /** |
| 946 | * Activity Action: Show settings for selection of 2G/3G. |
| 947 | * <p> |
| 948 | * In some cases, a matching Activity may not exist, so ensure you |
| 949 | * safeguard against this. |
| 950 | * <p> |
| 951 | * Input: Nothing. |
| 952 | * <p> |
| 953 | * Output: Nothing. |
| 954 | */ |
| 955 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 956 | public static final String ACTION_DATA_ROAMING_SETTINGS = |
| 957 | "android.settings.DATA_ROAMING_SETTINGS"; |
| 958 | |
| 959 | /** |
| 960 | * Activity Action: Show settings for internal storage. |
| 961 | * <p> |
| 962 | * In some cases, a matching Activity may not exist, so ensure you |
| 963 | * safeguard against this. |
| 964 | * <p> |
| 965 | * Input: Nothing. |
| 966 | * <p> |
| 967 | * Output: Nothing. |
| 968 | */ |
| 969 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 970 | public static final String ACTION_INTERNAL_STORAGE_SETTINGS = |
| 971 | "android.settings.INTERNAL_STORAGE_SETTINGS"; |
| 972 | /** |
| 973 | * Activity Action: Show settings for memory card storage. |
| 974 | * <p> |
| 975 | * In some cases, a matching Activity may not exist, so ensure you |
| 976 | * safeguard against this. |
| 977 | * <p> |
| 978 | * Input: Nothing. |
| 979 | * <p> |
| 980 | * Output: Nothing. |
| 981 | */ |
| 982 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 983 | public static final String ACTION_MEMORY_CARD_SETTINGS = |
| 984 | "android.settings.MEMORY_CARD_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 985 | |
Justin Mattson | ef34035 | 2010-01-13 21:05:46 -0800 | [diff] [blame] | 986 | /** |
| 987 | * Activity Action: Show settings for global search. |
| 988 | * <p> |
| 989 | * In some cases, a matching Activity may not exist, so ensure you |
| 990 | * safeguard against this. |
| 991 | * <p> |
| 992 | * Input: Nothing. |
| 993 | * <p> |
| 994 | * Output: Nothing |
| 995 | */ |
| 996 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 997 | public static final String ACTION_SEARCH_SETTINGS = |
| 998 | "android.search.action.SEARCH_SETTINGS"; |
| 999 | |
Daniel Sandler | 9d8b876 | 2010-01-22 20:50:15 -0500 | [diff] [blame] | 1000 | /** |
| 1001 | * Activity Action: Show general device information settings (serial |
| 1002 | * number, software version, phone number, etc.). |
| 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_DEVICE_INFO_SETTINGS = |
| 1013 | "android.settings.DEVICE_INFO_SETTINGS"; |
| 1014 | |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1015 | /** |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1016 | * Activity Action: Show NFC settings. |
| 1017 | * <p> |
| 1018 | * This shows UI that allows NFC to be turned on or off. |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1019 | * <p> |
| 1020 | * In some cases, a matching Activity may not exist, so ensure you |
| 1021 | * safeguard against this. |
| 1022 | * <p> |
| 1023 | * Input: Nothing. |
| 1024 | * <p> |
| 1025 | * Output: Nothing |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1026 | * @see android.nfc.NfcAdapter#isEnabled() |
| 1027 | */ |
| 1028 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1029 | public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; |
| 1030 | |
| 1031 | /** |
| 1032 | * Activity Action: Show NFC Sharing settings. |
| 1033 | * <p> |
| 1034 | * This shows UI that allows NDEF Push (Android Beam) to be turned on or |
| 1035 | * off. |
| 1036 | * <p> |
| 1037 | * In some cases, a matching Activity may not exist, so ensure you |
| 1038 | * safeguard against this. |
| 1039 | * <p> |
| 1040 | * Input: Nothing. |
| 1041 | * <p> |
| 1042 | * Output: Nothing |
| 1043 | * @see android.nfc.NfcAdapter#isNdefPushEnabled() |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1044 | */ |
| 1045 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1046 | public static final String ACTION_NFCSHARING_SETTINGS = |
| 1047 | "android.settings.NFCSHARING_SETTINGS"; |
| 1048 | |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1049 | /** |
Martijn Coenen | 62c196a | 2013-08-09 13:43:34 -0700 | [diff] [blame] | 1050 | * Activity Action: Show NFC Tap & Pay settings |
| 1051 | * <p> |
| 1052 | * This shows UI that allows the user to configure Tap&Pay |
| 1053 | * settings. |
| 1054 | * <p> |
| 1055 | * In some cases, a matching Activity may not exist, so ensure you |
| 1056 | * safeguard against this. |
| 1057 | * <p> |
| 1058 | * Input: Nothing. |
| 1059 | * <p> |
| 1060 | * Output: Nothing |
| 1061 | */ |
| 1062 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1063 | public static final String ACTION_NFC_PAYMENT_SETTINGS = |
| 1064 | "android.settings.NFC_PAYMENT_SETTINGS"; |
| 1065 | |
| 1066 | /** |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1067 | * Activity Action: Show Daydream settings. |
| 1068 | * <p> |
| 1069 | * In some cases, a matching Activity may not exist, so ensure you |
| 1070 | * safeguard against this. |
| 1071 | * <p> |
| 1072 | * Input: Nothing. |
| 1073 | * <p> |
| 1074 | * Output: Nothing. |
| 1075 | * @see android.service.dreams.DreamService |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1076 | */ |
| 1077 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1078 | public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; |
| 1079 | |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1080 | /** |
| 1081 | * Activity Action: Show Notification listener settings. |
| 1082 | * <p> |
| 1083 | * In some cases, a matching Activity may not exist, so ensure you |
| 1084 | * safeguard against this. |
| 1085 | * <p> |
| 1086 | * Input: Nothing. |
| 1087 | * <p> |
| 1088 | * Output: Nothing. |
| 1089 | * @see android.service.notification.NotificationListenerService |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1090 | */ |
| 1091 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1092 | public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS |
Chris Wren | 8326a8a | 2014-10-22 14:13:32 -0400 | [diff] [blame] | 1093 | = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1094 | |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1095 | /** |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1096 | * Activity Action: Show Do Not Disturb access settings. |
| 1097 | * <p> |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1098 | * Users can grant and deny access to Do Not Disturb configuration from here. |
| 1099 | * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more |
| 1100 | * details. |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1101 | * <p> |
| 1102 | * Input: Nothing. |
| 1103 | * <p> |
| 1104 | * Output: Nothing. |
| 1105 | */ |
| 1106 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1107 | public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS |
| 1108 | = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1109 | |
| 1110 | /** |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 1111 | * @hide |
| 1112 | */ |
| 1113 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1114 | public static final String ACTION_CONDITION_PROVIDER_SETTINGS |
| 1115 | = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; |
| 1116 | |
| 1117 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1118 | * Activity Action: Show settings for video captioning. |
| 1119 | * <p> |
| 1120 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1121 | * against this. |
| 1122 | * <p> |
| 1123 | * Input: Nothing. |
| 1124 | * <p> |
| 1125 | * Output: Nothing. |
| 1126 | */ |
| 1127 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1128 | public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; |
| 1129 | |
Svetoslav | 773f54d | 2013-09-03 14:01:43 -0700 | [diff] [blame] | 1130 | /** |
| 1131 | * Activity Action: Show the top level print settings. |
| 1132 | * <p> |
| 1133 | * In some cases, a matching Activity may not exist, so ensure you |
| 1134 | * safeguard against this. |
| 1135 | * <p> |
| 1136 | * Input: Nothing. |
| 1137 | * <p> |
| 1138 | * Output: Nothing. |
| 1139 | */ |
| 1140 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1141 | public static final String ACTION_PRINT_SETTINGS = |
| 1142 | "android.settings.ACTION_PRINT_SETTINGS"; |
| 1143 | |
John Spurlock | de54700 | 2014-02-28 17:50:39 -0500 | [diff] [blame] | 1144 | /** |
| 1145 | * Activity Action: Show Zen Mode configuration settings. |
| 1146 | * |
| 1147 | * @hide |
| 1148 | */ |
| 1149 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1150 | public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; |
| 1151 | |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1152 | /** |
Julia Reynolds | a11d0b1 | 2017-02-16 15:01:36 -0500 | [diff] [blame] | 1153 | * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. |
John Spurlock | fc746f8 | 2015-04-03 13:47:14 -0400 | [diff] [blame] | 1154 | */ |
| 1155 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1156 | public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS |
| 1157 | = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; |
| 1158 | |
| 1159 | /** |
John Spurlock | 7af1018 | 2015-04-03 15:10:31 -0400 | [diff] [blame] | 1160 | * Activity Action: Show Zen Mode automation configuration settings. |
| 1161 | * |
| 1162 | * @hide |
| 1163 | */ |
| 1164 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1165 | public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS |
| 1166 | = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; |
| 1167 | |
| 1168 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1169 | * Activity Action: Modify do not disturb mode settings. |
| 1170 | * <p> |
| 1171 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1172 | * <p> |
| 1173 | * This intent MUST be started using |
| 1174 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1175 | * startVoiceActivity}. |
| 1176 | * <p> |
| 1177 | * Note: The Activity implementing this intent MUST verify that |
| 1178 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. |
| 1179 | * returns true before modifying the setting. |
| 1180 | * <p> |
| 1181 | * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate |
| 1182 | * how long the user wishes to avoid interruptions for. The optional |
| 1183 | * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is |
| 1184 | * enabling or disabling do not disturb mode. If either extra is not included, the |
| 1185 | * user maybe asked to provide the value. |
| 1186 | * <p> |
| 1187 | * Output: Nothing. |
| 1188 | */ |
| 1189 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1190 | public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = |
| 1191 | "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; |
| 1192 | |
| 1193 | /** |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 1194 | * Activity Action: Show Zen Mode schedule rule configuration settings. |
| 1195 | * |
| 1196 | * @hide |
| 1197 | */ |
| 1198 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1199 | public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS |
| 1200 | = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; |
| 1201 | |
| 1202 | /** |
John Spurlock | d60258f | 2015-04-30 09:30:52 -0400 | [diff] [blame] | 1203 | * Activity Action: Show Zen Mode event rule configuration settings. |
| 1204 | * |
| 1205 | * @hide |
| 1206 | */ |
| 1207 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1208 | public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS |
| 1209 | = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; |
| 1210 | |
| 1211 | /** |
John Spurlock | 39581cc | 2015-04-10 11:59:01 -0400 | [diff] [blame] | 1212 | * Activity Action: Show Zen Mode external rule configuration settings. |
| 1213 | * |
| 1214 | * @hide |
| 1215 | */ |
| 1216 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1217 | public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS |
| 1218 | = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; |
| 1219 | |
| 1220 | /** |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1221 | * Activity Action: Show the regulatory information screen for the device. |
| 1222 | * <p> |
| 1223 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1224 | * against this. |
| 1225 | * <p> |
| 1226 | * Input: Nothing. |
| 1227 | * <p> |
| 1228 | * Output: Nothing. |
| 1229 | */ |
Jeff Sharkey | dd77fda | 2014-04-16 17:23:08 -0700 | [diff] [blame] | 1230 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1231 | public static final String |
| 1232 | ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; |
| 1233 | |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1234 | /** |
| 1235 | * Activity Action: Show Device Name Settings. |
| 1236 | * <p> |
| 1237 | * 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] | 1238 | * against this. |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1239 | * |
| 1240 | * @hide |
| 1241 | */ |
| 1242 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1243 | public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; |
| 1244 | |
Tim Kilbourn | 87cd0dc | 2014-04-14 15:37:51 -0700 | [diff] [blame] | 1245 | /** |
| 1246 | * Activity Action: Show pairing settings. |
| 1247 | * <p> |
| 1248 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1249 | * against this. |
| 1250 | * |
| 1251 | * @hide |
| 1252 | */ |
| 1253 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1254 | public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; |
| 1255 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1256 | /** |
| 1257 | * Activity Action: Show battery saver settings. |
John Spurlock | 7346666 | 2014-10-30 13:42:05 -0400 | [diff] [blame] | 1258 | * <p> |
| 1259 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1260 | * against this. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1261 | */ |
| 1262 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1263 | public static final String ACTION_BATTERY_SAVER_SETTINGS |
| 1264 | = "android.settings.BATTERY_SAVER_SETTINGS"; |
| 1265 | |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1266 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1267 | * Activity Action: Modify Battery Saver mode setting using a voice command. |
| 1268 | * <p> |
| 1269 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1270 | * <p> |
| 1271 | * This intent MUST be started using |
| 1272 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1273 | * startVoiceActivity}. |
| 1274 | * <p> |
| 1275 | * Note: The activity implementing this intent MUST verify that |
| 1276 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 1277 | * modifying the setting. |
| 1278 | * <p> |
| 1279 | * Input: To tell which state batter saver mode should be set to, add the |
| 1280 | * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. |
| 1281 | * If the extra is not included, no changes will be made. |
| 1282 | * <p> |
| 1283 | * Output: Nothing. |
| 1284 | */ |
| 1285 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1286 | public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = |
| 1287 | "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; |
| 1288 | |
| 1289 | /** |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1290 | * Activity Action: Show Home selection settings. If there are multiple activities |
| 1291 | * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you |
| 1292 | * to pick your preferred activity. |
| 1293 | */ |
| 1294 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1295 | public static final String ACTION_HOME_SETTINGS |
| 1296 | = "android.settings.HOME_SETTINGS"; |
| 1297 | |
Julia Reynolds | 7eba593 | 2015-12-11 16:40:39 -0500 | [diff] [blame] | 1298 | /** |
| 1299 | * Activity Action: Show Default apps settings. |
| 1300 | * <p> |
| 1301 | * In some cases, a matching Activity may not exist, so ensure you |
| 1302 | * safeguard against this. |
| 1303 | * <p> |
| 1304 | * Input: Nothing. |
| 1305 | * <p> |
| 1306 | * Output: Nothing. |
| 1307 | */ |
| 1308 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1309 | public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS |
| 1310 | = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; |
| 1311 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1312 | /** |
| 1313 | * Activity Action: Show notification settings. |
| 1314 | * |
| 1315 | * @hide |
| 1316 | */ |
| 1317 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1318 | public static final String ACTION_NOTIFICATION_SETTINGS |
| 1319 | = "android.settings.NOTIFICATION_SETTINGS"; |
| 1320 | |
| 1321 | /** |
| 1322 | * Activity Action: Show notification settings for a single app. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1323 | * <p> |
| 1324 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1325 | * Input: Optionally, {@link #EXTRA_CHANNEL_ID}, to highlight that channel. |
| 1326 | * <p> |
| 1327 | * Output: Nothing. |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1328 | */ |
| 1329 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1330 | public static final String ACTION_APP_NOTIFICATION_SETTINGS |
| 1331 | = "android.settings.APP_NOTIFICATION_SETTINGS"; |
| 1332 | |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1333 | /** |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1334 | * Activity Action: Show notification settings for a single {@link NotificationChannel}. |
| 1335 | * <p> |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1336 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1337 | * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. |
| 1338 | * <p> |
| 1339 | * Output: Nothing. |
| 1340 | */ |
| 1341 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1342 | public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS |
| 1343 | = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; |
| 1344 | |
| 1345 | /** |
| 1346 | * Activity Extra: The package owner of the notification channel settings to display. |
| 1347 | * <p> |
| 1348 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1349 | */ |
| 1350 | public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; |
| 1351 | |
| 1352 | /** |
| 1353 | * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings |
| 1354 | * to display. |
| 1355 | * <p> |
| 1356 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1357 | */ |
| 1358 | public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; |
| 1359 | |
| 1360 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1361 | * Activity Action: Show notification redaction settings. |
| 1362 | * |
| 1363 | * @hide |
| 1364 | */ |
| 1365 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1366 | public static final String ACTION_APP_NOTIFICATION_REDACTION |
| 1367 | = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; |
| 1368 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1369 | /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1370 | |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1371 | /** |
| 1372 | * Activity Action: Show a dialog with disabled by policy message. |
| 1373 | * <p> If an user action is disabled by policy, this dialog can be triggered to let |
| 1374 | * the user know about this. |
| 1375 | * <p> |
| 1376 | * Input: Nothing. |
| 1377 | * <p> |
| 1378 | * Output: Nothing. |
Sudheer Shanka | aebd5dd | 2016-02-18 12:37:14 +0000 | [diff] [blame] | 1379 | * |
| 1380 | * @hide |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1381 | */ |
| 1382 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1383 | public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS |
| 1384 | = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; |
| 1385 | |
Michal Karpinski | ba24409 | 2016-02-25 17:28:24 +0000 | [diff] [blame] | 1386 | /** |
| 1387 | * Activity Action: Show a dialog for remote bugreport flow. |
| 1388 | * <p> |
| 1389 | * Input: Nothing. |
| 1390 | * <p> |
| 1391 | * Output: Nothing. |
| 1392 | * |
| 1393 | * @hide |
| 1394 | */ |
| 1395 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1396 | public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG |
| 1397 | = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; |
| 1398 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 1399 | /** |
| 1400 | * Activity Action: Show VR listener settings. |
| 1401 | * <p> |
| 1402 | * Input: Nothing. |
| 1403 | * <p> |
| 1404 | * Output: Nothing. |
| 1405 | * |
| 1406 | * @see android.service.vr.VrListenerService |
| 1407 | */ |
| 1408 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1409 | public static final String ACTION_VR_LISTENER_SETTINGS |
| 1410 | = "android.settings.VR_LISTENER_SETTINGS"; |
| 1411 | |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1412 | /** |
Winson Chung | 59fda9e | 2017-01-20 16:14:51 -0800 | [diff] [blame] | 1413 | * Activity Action: Show Picture-in-picture settings. |
| 1414 | * <p> |
| 1415 | * Input: Nothing. |
| 1416 | * <p> |
| 1417 | * Output: Nothing. |
| 1418 | * |
| 1419 | * @hide |
| 1420 | */ |
| 1421 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1422 | public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS |
| 1423 | = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; |
| 1424 | |
| 1425 | /** |
Daniel Nishi | e58d2a7 | 2016-09-20 16:42:19 -0700 | [diff] [blame] | 1426 | * Activity Action: Show Storage Manager settings. |
| 1427 | * <p> |
| 1428 | * Input: Nothing. |
| 1429 | * <p> |
| 1430 | * Output: Nothing. |
| 1431 | * |
| 1432 | * @hide |
| 1433 | */ |
| 1434 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1435 | public static final String ACTION_STORAGE_MANAGER_SETTINGS |
| 1436 | = "android.settings.STORAGE_MANAGER_SETTINGS"; |
| 1437 | |
| 1438 | /** |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1439 | * Activity Action: Allows user to select current webview implementation. |
| 1440 | * <p> |
| 1441 | * Input: Nothing. |
| 1442 | * <p> |
| 1443 | * Output: Nothing. |
| 1444 | */ |
| 1445 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1446 | public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; |
| 1447 | |
Bartosz Fabianowski | 46bea2e | 2016-12-06 01:20:29 +0100 | [diff] [blame] | 1448 | /** |
| 1449 | * Activity Action: Show enterprise privacy section. |
| 1450 | * <p> |
| 1451 | * Input: Nothing. |
| 1452 | * <p> |
| 1453 | * Output: Nothing. |
| 1454 | * @hide |
| 1455 | */ |
| 1456 | @SystemApi |
| 1457 | @TestApi |
| 1458 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1459 | public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS |
| 1460 | = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; |
| 1461 | |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1462 | /** |
| 1463 | * Activity Action: Show screen that let user select its Autofill Service. |
| 1464 | * <p> |
| 1465 | * Input: Intent's data URI set with an application name, using the |
| 1466 | * "package" schema (like "package:com.my.app"). |
| 1467 | * |
| 1468 | * <p> |
| 1469 | * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging |
| 1470 | * to the caller package. |
| 1471 | * |
| 1472 | * <p> |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1473 | * <b>NOTE: </b> Applications should call |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1474 | * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1475 | * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action |
| 1476 | * 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] | 1477 | */ |
| 1478 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1479 | public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = |
| 1480 | "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; |
| 1481 | |
Felipe Leme | d82096e | 2018-01-22 13:44:01 -0800 | [diff] [blame] | 1482 | /** |
| 1483 | * Activity Action: Show screen for controlling which apps have access on volume directories. |
| 1484 | * <p> |
| 1485 | * Input: Nothing. |
| 1486 | * <p> |
| 1487 | * Output: Nothing. |
| 1488 | * <p> |
| 1489 | * Applications typically use this action to ask the user to revert the "Do not ask again" |
| 1490 | * status of directory access requests made by |
| 1491 | * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. |
| 1492 | */ |
| 1493 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1494 | public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = |
| 1495 | "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; |
| 1496 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1497 | // End of Intent actions for Settings |
| 1498 | |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1499 | /** |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1500 | * @hide - Private call() method on SettingsProvider to read from 'system' table. |
| 1501 | */ |
| 1502 | public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; |
| 1503 | |
| 1504 | /** |
| 1505 | * @hide - Private call() method on SettingsProvider to read from 'secure' table. |
| 1506 | */ |
| 1507 | public static final String CALL_METHOD_GET_SECURE = "GET_secure"; |
| 1508 | |
| 1509 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1510 | * @hide - Private call() method on SettingsProvider to read from 'global' table. |
| 1511 | */ |
| 1512 | public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; |
| 1513 | |
| 1514 | /** |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1515 | * @hide - Specifies that the caller of the fast-path call()-based flow tracks |
| 1516 | * the settings generation in order to cache values locally. If this key is |
| 1517 | * mapped to a <code>null</code> string extra in the request bundle, the response |
| 1518 | * bundle will contain the same key mapped to a parcelable extra which would be |
| 1519 | * an {@link android.util.MemoryIntArray}. The response will also contain an |
| 1520 | * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the |
| 1521 | * index in the array clients should use to lookup the generation. For efficiency |
| 1522 | * the caller should request the generation tracking memory array only if it |
| 1523 | * doesn't already have it. |
| 1524 | * |
| 1525 | * @see #CALL_METHOD_GENERATION_INDEX_KEY |
| 1526 | */ |
| 1527 | public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; |
| 1528 | |
| 1529 | /** |
| 1530 | * @hide Key with the location in the {@link android.util.MemoryIntArray} where |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1531 | * 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] | 1532 | * |
| 1533 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1534 | */ |
| 1535 | public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; |
| 1536 | |
| 1537 | /** |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1538 | * @hide Key with the settings table generation. The value is an integer. |
| 1539 | * |
| 1540 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1541 | */ |
| 1542 | public static final String CALL_METHOD_GENERATION_KEY = "_generation"; |
| 1543 | |
| 1544 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1545 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1546 | */ |
| 1547 | public static final String CALL_METHOD_USER_KEY = "_user"; |
| 1548 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1549 | /** |
| 1550 | * @hide - Boolean argument extra to the fast-path call()-based requests |
| 1551 | */ |
| 1552 | public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; |
| 1553 | |
| 1554 | /** |
| 1555 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1556 | */ |
| 1557 | public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; |
| 1558 | |
| 1559 | /** |
| 1560 | * @hide - String argument extra to the fast-path call()-based requests |
| 1561 | */ |
| 1562 | public static final String CALL_METHOD_TAG_KEY = "_tag"; |
| 1563 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1564 | /** @hide - Private call() method to write to 'system' table */ |
| 1565 | public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; |
| 1566 | |
| 1567 | /** @hide - Private call() method to write to 'secure' table */ |
| 1568 | public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; |
| 1569 | |
| 1570 | /** @hide - Private call() method to write to 'global' table */ |
| 1571 | public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; |
| 1572 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1573 | /** @hide - Private call() method to reset to defaults the 'global' table */ |
| 1574 | public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; |
| 1575 | |
| 1576 | /** @hide - Private call() method to reset to defaults the 'secure' table */ |
| 1577 | public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; |
| 1578 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1579 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1580 | * Activity Extra: Limit available options in launched activity based on the given authority. |
| 1581 | * <p> |
| 1582 | * This can be passed as an extra field in an Activity Intent with one or more syncable content |
| 1583 | * provider's authorities as a String[]. This field is used by some intents to alter the |
| 1584 | * behavior of the called activity. |
| 1585 | * <p> |
| 1586 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based |
| 1587 | * on the authority given. |
| 1588 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1589 | public static final String EXTRA_AUTHORITIES = "authorities"; |
| 1590 | |
Alon Albert | d35bf1f | 2013-04-18 14:26:51 -0700 | [diff] [blame] | 1591 | /** |
| 1592 | * Activity Extra: Limit available options in launched activity based on the given account |
| 1593 | * types. |
| 1594 | * <p> |
| 1595 | * This can be passed as an extra field in an Activity Intent with one or more account types |
| 1596 | * as a String[]. This field is used by some intents to alter the behavior of the called |
| 1597 | * activity. |
| 1598 | * <p> |
| 1599 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified |
| 1600 | * list. |
| 1601 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1602 | public static final String EXTRA_ACCOUNT_TYPES = "account_types"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1603 | |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 1604 | public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; |
| 1605 | |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1606 | /** |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1607 | * Activity Extra: The device identifier to act upon. |
| 1608 | * <p> |
| 1609 | * This can be passed as an extra field in an Activity Intent with a single |
| 1610 | * InputDeviceIdentifier. This field is used by some activities to jump straight into the |
| 1611 | * settings for the given device. |
| 1612 | * <p> |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 1613 | * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout |
| 1614 | * dialog for the given device. |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1615 | * @hide |
| 1616 | */ |
| 1617 | public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; |
| 1618 | |
| 1619 | /** |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1620 | * Activity Extra: Enable or disable Airplane Mode. |
| 1621 | * <p> |
| 1622 | * 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] | 1623 | * intent as a boolean to indicate if it should be enabled. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1624 | */ |
| 1625 | public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; |
| 1626 | |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1627 | /** |
| 1628 | * Activity Extra: Enable or disable Battery saver mode. |
| 1629 | * <p> |
| 1630 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} |
| 1631 | * intent as a boolean to indicate if it should be enabled. |
| 1632 | */ |
| 1633 | public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = |
| 1634 | "android.settings.extra.battery_saver_mode_enabled"; |
| 1635 | |
| 1636 | /** |
| 1637 | * Activity Extra: Enable or disable Do Not Disturb mode. |
| 1638 | * <p> |
| 1639 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1640 | * intent as a boolean to indicate if it should be enabled. |
| 1641 | */ |
| 1642 | public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = |
| 1643 | "android.settings.extra.do_not_disturb_mode_enabled"; |
| 1644 | |
| 1645 | /** |
| 1646 | * Activity Extra: How many minutes to enable do not disturb mode for. |
| 1647 | * <p> |
| 1648 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1649 | * intent to indicate how long do not disturb mode should be enabled for. |
| 1650 | */ |
| 1651 | public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = |
| 1652 | "android.settings.extra.do_not_disturb_mode_minutes"; |
| 1653 | |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1654 | /** |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1655 | * Reset mode: reset to defaults only settings changed by the |
| 1656 | * calling package. If there is a default set the setting |
| 1657 | * will be set to it, otherwise the setting will be deleted. |
| 1658 | * This is the only type of reset available to non-system clients. |
| 1659 | * @hide |
| 1660 | */ |
| 1661 | public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; |
| 1662 | |
| 1663 | /** |
| 1664 | * Reset mode: reset all settings set by untrusted packages, which is |
| 1665 | * packages that aren't a part of the system, to the current defaults. |
| 1666 | * If there is a default set the setting will be set to it, otherwise |
| 1667 | * the setting will be deleted. This mode is only available to the system. |
| 1668 | * @hide |
| 1669 | */ |
| 1670 | public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; |
| 1671 | |
| 1672 | /** |
| 1673 | * Reset mode: delete all settings set by untrusted packages, which is |
| 1674 | * packages that aren't a part of the system. If a setting is set by an |
| 1675 | * untrusted package it will be deleted if its default is not provided |
| 1676 | * by the system, otherwise the setting will be set to its default. |
| 1677 | * This mode is only available to the system. |
| 1678 | * @hide |
| 1679 | */ |
| 1680 | public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; |
| 1681 | |
| 1682 | /** |
| 1683 | * Reset mode: reset all settings to defaults specified by trusted |
| 1684 | * packages, which is packages that are a part of the system, and |
| 1685 | * delete all settings set by untrusted packages. If a setting has |
| 1686 | * a default set by a system package it will be set to the default, |
| 1687 | * otherwise the setting will be deleted. This mode is only available |
| 1688 | * to the system. |
| 1689 | * @hide |
| 1690 | */ |
| 1691 | public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; |
| 1692 | |
| 1693 | /** @hide */ |
| 1694 | @Retention(RetentionPolicy.SOURCE) |
Jeff Sharkey | ce8db99 | 2017-12-13 20:05:05 -0700 | [diff] [blame] | 1695 | @IntDef(prefix = { "RESET_MODE_" }, value = { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1696 | RESET_MODE_PACKAGE_DEFAULTS, |
| 1697 | RESET_MODE_UNTRUSTED_DEFAULTS, |
| 1698 | RESET_MODE_UNTRUSTED_CHANGES, |
| 1699 | RESET_MODE_TRUSTED_DEFAULTS |
| 1700 | }) |
| 1701 | public @interface ResetMode{} |
| 1702 | |
| 1703 | /** |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1704 | * Activity Extra: Number of certificates |
| 1705 | * <p> |
| 1706 | * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} |
| 1707 | * intent to indicate the number of certificates |
| 1708 | * @hide |
| 1709 | */ |
| 1710 | public static final String EXTRA_NUMBER_OF_CERTIFICATES = |
| 1711 | "android.settings.extra.number_of_certificates"; |
| 1712 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1713 | private static final String JID_RESOURCE_PREFIX = "android"; |
| 1714 | |
| 1715 | public static final String AUTHORITY = "settings"; |
| 1716 | |
| 1717 | private static final String TAG = "Settings"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1718 | private static final boolean LOCAL_LOGV = false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1719 | |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 1720 | // Lock ensures that when enabling/disabling the master location switch, we don't end up |
| 1721 | // with a partial enable/disable state in multi-threaded situations. |
| 1722 | private static final Object mLocationSettingsLock = new Object(); |
| 1723 | |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1724 | // Used in system server calling uid workaround in call() |
| 1725 | private static boolean sInSystemServer = false; |
| 1726 | private static final Object sInSystemServerLock = new Object(); |
| 1727 | |
| 1728 | /** @hide */ |
| 1729 | public static void setInSystemServer() { |
| 1730 | synchronized (sInSystemServerLock) { |
| 1731 | sInSystemServer = true; |
| 1732 | } |
| 1733 | } |
| 1734 | |
| 1735 | /** @hide */ |
| 1736 | public static boolean isInSystemServer() { |
| 1737 | synchronized (sInSystemServerLock) { |
| 1738 | return sInSystemServer; |
| 1739 | } |
| 1740 | } |
| 1741 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1742 | public static class SettingNotFoundException extends AndroidException { |
| 1743 | public SettingNotFoundException(String msg) { |
| 1744 | super(msg); |
| 1745 | } |
| 1746 | } |
| 1747 | |
| 1748 | /** |
| 1749 | * Common base for tables of name/value settings. |
| 1750 | */ |
| 1751 | public static class NameValueTable implements BaseColumns { |
| 1752 | public static final String NAME = "name"; |
| 1753 | public static final String VALUE = "value"; |
| 1754 | |
| 1755 | protected static boolean putString(ContentResolver resolver, Uri uri, |
| 1756 | String name, String value) { |
| 1757 | // The database will take care of replacing duplicates. |
| 1758 | try { |
| 1759 | ContentValues values = new ContentValues(); |
| 1760 | values.put(NAME, name); |
| 1761 | values.put(VALUE, value); |
| 1762 | resolver.insert(uri, values); |
| 1763 | return true; |
| 1764 | } catch (SQLException e) { |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 1765 | 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] | 1766 | return false; |
| 1767 | } |
| 1768 | } |
| 1769 | |
| 1770 | public static Uri getUriFor(Uri uri, String name) { |
| 1771 | return Uri.withAppendedPath(uri, name); |
| 1772 | } |
| 1773 | } |
| 1774 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1775 | private static final class GenerationTracker { |
| 1776 | private final MemoryIntArray mArray; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1777 | private final Runnable mErrorHandler; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1778 | private final int mIndex; |
| 1779 | private int mCurrentGeneration; |
| 1780 | |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1781 | public GenerationTracker(@NonNull MemoryIntArray array, int index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1782 | int generation, Runnable errorHandler) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1783 | mArray = array; |
| 1784 | mIndex = index; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1785 | mErrorHandler = errorHandler; |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1786 | mCurrentGeneration = generation; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1787 | } |
| 1788 | |
| 1789 | public boolean isGenerationChanged() { |
| 1790 | final int currentGeneration = readCurrentGeneration(); |
| 1791 | if (currentGeneration >= 0) { |
| 1792 | if (currentGeneration == mCurrentGeneration) { |
| 1793 | return false; |
| 1794 | } |
| 1795 | mCurrentGeneration = currentGeneration; |
| 1796 | } |
| 1797 | return true; |
| 1798 | } |
| 1799 | |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1800 | public int getCurrentGeneration() { |
| 1801 | return mCurrentGeneration; |
| 1802 | } |
| 1803 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1804 | private int readCurrentGeneration() { |
| 1805 | try { |
| 1806 | return mArray.get(mIndex); |
| 1807 | } catch (IOException e) { |
| 1808 | Log.e(TAG, "Error getting current generation", e); |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1809 | if (mErrorHandler != null) { |
| 1810 | mErrorHandler.run(); |
| 1811 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1812 | } |
| 1813 | return -1; |
| 1814 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1815 | |
| 1816 | public void destroy() { |
| 1817 | try { |
| 1818 | mArray.close(); |
| 1819 | } catch (IOException e) { |
| 1820 | Log.e(TAG, "Error closing backing array", e); |
| 1821 | if (mErrorHandler != null) { |
| 1822 | mErrorHandler.run(); |
| 1823 | } |
| 1824 | } |
| 1825 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1826 | } |
| 1827 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1828 | private static final class ContentProviderHolder { |
| 1829 | private final Object mLock = new Object(); |
| 1830 | |
| 1831 | @GuardedBy("mLock") |
| 1832 | private final Uri mUri; |
| 1833 | @GuardedBy("mLock") |
| 1834 | private IContentProvider mContentProvider; |
| 1835 | |
| 1836 | public ContentProviderHolder(Uri uri) { |
| 1837 | mUri = uri; |
| 1838 | } |
| 1839 | |
| 1840 | public IContentProvider getProvider(ContentResolver contentResolver) { |
| 1841 | synchronized (mLock) { |
| 1842 | if (mContentProvider == null) { |
| 1843 | mContentProvider = contentResolver |
| 1844 | .acquireProvider(mUri.getAuthority()); |
| 1845 | } |
| 1846 | return mContentProvider; |
| 1847 | } |
| 1848 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 1849 | |
| 1850 | public void clearProviderForTest() { |
| 1851 | synchronized (mLock) { |
| 1852 | mContentProvider = null; |
| 1853 | } |
| 1854 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1855 | } |
| 1856 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1857 | // Thread-safe. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1858 | private static class NameValueCache { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1859 | private static final boolean DEBUG = false; |
| 1860 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1861 | private static final String[] SELECT_VALUE_PROJECTION = new String[] { |
| 1862 | Settings.NameValueTable.VALUE |
| 1863 | }; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1864 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1865 | private static final String NAME_EQ_PLACEHOLDER = "name=?"; |
| 1866 | |
| 1867 | // Must synchronize on 'this' to access mValues and mValuesVersion. |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1868 | private final HashMap<String, String> mValues = new HashMap<>(); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1869 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1870 | private final Uri mUri; |
| 1871 | private final ContentProviderHolder mProviderHolder; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1872 | |
| 1873 | // The method we'll call (or null, to not use) on the provider |
| 1874 | // for the fast path of retrieving settings. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1875 | private final String mCallGetCommand; |
| 1876 | private final String mCallSetCommand; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1877 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1878 | @GuardedBy("this") |
| 1879 | private GenerationTracker mGenerationTracker; |
| 1880 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1881 | public NameValueCache(Uri uri, String getCommand, String setCommand, |
| 1882 | ContentProviderHolder providerHolder) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1883 | mUri = uri; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1884 | mCallGetCommand = getCommand; |
| 1885 | mCallSetCommand = setCommand; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1886 | mProviderHolder = providerHolder; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1887 | } |
| 1888 | |
| 1889 | public boolean putStringForUser(ContentResolver cr, String name, String value, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1890 | String tag, boolean makeDefault, final int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1891 | try { |
| 1892 | Bundle arg = new Bundle(); |
| 1893 | arg.putString(Settings.NameValueTable.VALUE, value); |
Christopher Tate | d5fe147 | 2012-09-10 15:48:38 -0700 | [diff] [blame] | 1894 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1895 | if (tag != null) { |
| 1896 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 1897 | } |
| 1898 | if (makeDefault) { |
| 1899 | arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); |
| 1900 | } |
| 1901 | IContentProvider cp = mProviderHolder.getProvider(cr); |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1902 | String prevValue = getStringForUser(cr, name, userHandle); |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 1903 | cp.call(cr.getPackageName(), mCallSetCommand, name, arg); |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1904 | String newValue = getStringForUser(cr, name, userHandle); |
| 1905 | StatsLog.write(StatsLog.SETTING_CHANGED, name, value, newValue, prevValue, tag, |
| 1906 | makeDefault ? 1 : 0, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1907 | } catch (RemoteException e) { |
| 1908 | Log.w(TAG, "Can't set key " + name + " in " + mUri, e); |
| 1909 | return false; |
| 1910 | } |
| 1911 | return true; |
| 1912 | } |
| 1913 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1914 | public String getStringForUser(ContentResolver cr, String name, final int userHandle) { |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1915 | final boolean isSelf = (userHandle == UserHandle.myUserId()); |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1916 | int currentGeneration = -1; |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1917 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1918 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1919 | if (mGenerationTracker != null) { |
| 1920 | if (mGenerationTracker.isGenerationChanged()) { |
| 1921 | if (DEBUG) { |
| 1922 | Log.i(TAG, "Generation changed for type:" |
| 1923 | + mUri.getPath() + " in package:" |
| 1924 | + cr.getPackageName() +" and user:" + userHandle); |
| 1925 | } |
| 1926 | mValues.clear(); |
| 1927 | } else if (mValues.containsKey(name)) { |
| 1928 | return mValues.get(name); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1929 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1930 | if (mGenerationTracker != null) { |
| 1931 | currentGeneration = mGenerationTracker.getCurrentGeneration(); |
| 1932 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1933 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1934 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1935 | } else { |
| 1936 | if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle |
| 1937 | + " by user " + UserHandle.myUserId() + " so skipping cache"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1938 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1939 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1940 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1941 | |
| 1942 | // Try the fast path first, not using query(). If this |
| 1943 | // fails (alternate Settings provider that doesn't support |
| 1944 | // this interface?) then we fall back to the query/table |
| 1945 | // interface. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1946 | if (mCallGetCommand != null) { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1947 | try { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1948 | Bundle args = null; |
Christopher Tate | 5e08af0 | 2012-09-21 17:17:22 -0700 | [diff] [blame] | 1949 | if (!isSelf) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1950 | args = new Bundle(); |
| 1951 | args.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 1952 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1953 | boolean needsGenerationTracker = false; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1954 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1955 | if (isSelf && mGenerationTracker == null) { |
| 1956 | needsGenerationTracker = true; |
| 1957 | if (args == null) { |
| 1958 | args = new Bundle(); |
| 1959 | } |
| 1960 | args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); |
| 1961 | if (DEBUG) { |
| 1962 | Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() |
| 1963 | + " in package:" + cr.getPackageName() +" and user:" |
| 1964 | + userHandle); |
| 1965 | } |
| 1966 | } |
| 1967 | } |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1968 | Bundle b; |
| 1969 | // If we're in system server and in a binder transaction we need to clear the |
| 1970 | // calling uid. This works around code in system server that did not call |
| 1971 | // clearCallingIdentity, previously this wasn't needed because reading settings |
| 1972 | // did not do permission checking but thats no longer the case. |
| 1973 | // Long term this should be removed and callers should properly call |
| 1974 | // clearCallingIdentity or use a ContentResolver from the caller as needed. |
| 1975 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 1976 | final long token = Binder.clearCallingIdentity(); |
| 1977 | try { |
| 1978 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 1979 | } finally { |
| 1980 | Binder.restoreCallingIdentity(token); |
| 1981 | } |
| 1982 | } else { |
| 1983 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 1984 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1985 | if (b != null) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1986 | String value = b.getString(Settings.NameValueTable.VALUE); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1987 | // Don't update our cache for reads of other users' data |
| 1988 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1989 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1990 | if (needsGenerationTracker) { |
| 1991 | MemoryIntArray array = b.getParcelable( |
| 1992 | CALL_METHOD_TRACK_GENERATION_KEY); |
| 1993 | final int index = b.getInt( |
| 1994 | CALL_METHOD_GENERATION_INDEX_KEY, -1); |
| 1995 | if (array != null && index >= 0) { |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1996 | final int generation = b.getInt( |
| 1997 | CALL_METHOD_GENERATION_KEY, 0); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1998 | if (DEBUG) { |
| 1999 | Log.i(TAG, "Received generation tracker for type:" |
| 2000 | + mUri.getPath() + " in package:" |
| 2001 | + cr.getPackageName() + " and user:" |
| 2002 | + userHandle + " with index:" + index); |
| 2003 | } |
Svet Ganov | 9d723d3 | 2016-08-27 11:05:56 -0700 | [diff] [blame] | 2004 | if (mGenerationTracker != null) { |
| 2005 | mGenerationTracker.destroy(); |
| 2006 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2007 | mGenerationTracker = new GenerationTracker(array, index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2008 | generation, () -> { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2009 | synchronized (NameValueCache.this) { |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2010 | Log.e(TAG, "Error accessing generation" |
| 2011 | + " tracker - removing"); |
| 2012 | if (mGenerationTracker != null) { |
| 2013 | GenerationTracker generationTracker = |
| 2014 | mGenerationTracker; |
| 2015 | mGenerationTracker = null; |
| 2016 | generationTracker.destroy(); |
| 2017 | mValues.clear(); |
| 2018 | } |
| 2019 | } |
| 2020 | }); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2021 | } |
| 2022 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2023 | if (mGenerationTracker != null && currentGeneration == |
| 2024 | mGenerationTracker.getCurrentGeneration()) { |
| 2025 | mValues.put(name, value); |
| 2026 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2027 | } |
| 2028 | } else { |
| 2029 | if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle |
| 2030 | + " by " + UserHandle.myUserId() |
| 2031 | + " so not updating cache"); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2032 | } |
| 2033 | return value; |
| 2034 | } |
| 2035 | // If the response Bundle is null, we fall through |
| 2036 | // to the query interface below. |
| 2037 | } catch (RemoteException e) { |
| 2038 | // Not supported by the remote side? Fall through |
| 2039 | // to query(). |
| 2040 | } |
| 2041 | } |
| 2042 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2043 | Cursor c = null; |
| 2044 | try { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2045 | Bundle queryArgs = ContentResolver.createSqlQueryBundle( |
| 2046 | NAME_EQ_PLACEHOLDER, new String[]{name}, null); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2047 | // Same workaround as above. |
| 2048 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2049 | final long token = Binder.clearCallingIdentity(); |
| 2050 | try { |
| 2051 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2052 | null); |
| 2053 | } finally { |
| 2054 | Binder.restoreCallingIdentity(token); |
| 2055 | } |
| 2056 | } else { |
| 2057 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2058 | null); |
| 2059 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2060 | if (c == null) { |
| 2061 | Log.w(TAG, "Can't get key " + name + " from " + mUri); |
| 2062 | return null; |
| 2063 | } |
| 2064 | |
| 2065 | String value = c.moveToNext() ? c.getString(0) : null; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2066 | synchronized (NameValueCache.this) { |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2067 | if(mGenerationTracker != null && |
| 2068 | currentGeneration == mGenerationTracker.getCurrentGeneration()) { |
| 2069 | mValues.put(name, value); |
| 2070 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2071 | } |
| 2072 | if (LOCAL_LOGV) { |
| 2073 | Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + |
| 2074 | name + " = " + (value == null ? "(null)" : value)); |
| 2075 | } |
| 2076 | return value; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2077 | } catch (RemoteException e) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2078 | Log.w(TAG, "Can't get key " + name + " from " + mUri, e); |
| 2079 | return null; // Return null, but don't cache it. |
| 2080 | } finally { |
| 2081 | if (c != null) c.close(); |
| 2082 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2083 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2084 | |
| 2085 | public void clearGenerationTrackerForTest() { |
| 2086 | synchronized (NameValueCache.this) { |
| 2087 | if (mGenerationTracker != null) { |
| 2088 | mGenerationTracker.destroy(); |
| 2089 | } |
| 2090 | mValues.clear(); |
| 2091 | mGenerationTracker = null; |
| 2092 | } |
| 2093 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2094 | } |
| 2095 | |
| 2096 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2097 | * Checks if the specified context can draw on top of other apps. As of API |
| 2098 | * level 23, an app cannot draw on top of other apps unless it declares the |
| 2099 | * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its |
| 2100 | * manifest, <em>and</em> the user specifically grants the app this |
| 2101 | * capability. To prompt the user to grant this approval, the app must send an |
| 2102 | * intent with the action |
| 2103 | * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which |
| 2104 | * causes the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2105 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2106 | * @param context App context. |
| 2107 | * @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] | 2108 | */ |
| 2109 | public static boolean canDrawOverlays(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 2110 | return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), |
| 2111 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2112 | } |
| 2113 | |
| 2114 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2115 | * System settings, containing miscellaneous system preferences. This |
| 2116 | * table holds simple name/value pairs. There are convenience |
| 2117 | * functions for accessing individual settings entries. |
| 2118 | */ |
| 2119 | public static final class System extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 2120 | // NOTE: If you add new settings here, be sure to add them to |
| 2121 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. |
| 2122 | |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2123 | private static final float DEFAULT_FONT_SCALE = 1.0f; |
| 2124 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2125 | /** |
| 2126 | * The content:// style URL for this table |
| 2127 | */ |
| 2128 | public static final Uri CONTENT_URI = |
| 2129 | Uri.parse("content://" + AUTHORITY + "/system"); |
| 2130 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2131 | private static final ContentProviderHolder sProviderHolder = |
| 2132 | new ContentProviderHolder(CONTENT_URI); |
| 2133 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2134 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2135 | CONTENT_URI, |
| 2136 | CALL_METHOD_GET_SYSTEM, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2137 | CALL_METHOD_PUT_SYSTEM, |
| 2138 | sProviderHolder); |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2139 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2140 | private static final HashSet<String> MOVED_TO_SECURE; |
| 2141 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2142 | MOVED_TO_SECURE = new HashSet<>(30); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2143 | MOVED_TO_SECURE.add(Secure.ANDROID_ID); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2144 | MOVED_TO_SECURE.add(Secure.HTTP_PROXY); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2145 | MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 2146 | MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2147 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); |
| 2148 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); |
| 2149 | 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] | 2150 | MOVED_TO_SECURE.add(Secure.LOGGING_ID); |
| 2151 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); |
| 2152 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); |
| 2153 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); |
| 2154 | MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2155 | MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); |
| 2156 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 2157 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 2158 | MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 2159 | MOVED_TO_SECURE.add(Secure.WIFI_ON); |
| 2160 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); |
| 2161 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); |
| 2162 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); |
| 2163 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); |
| 2164 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); |
| 2165 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); |
| 2166 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); |
| 2167 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); |
| 2168 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); |
| 2169 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); |
| 2170 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 2171 | |
| 2172 | // At one time in System, then Global, but now back in Secure |
| 2173 | MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2174 | } |
| 2175 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2176 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2177 | private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2178 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2179 | MOVED_TO_GLOBAL = new HashSet<>(); |
| 2180 | MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2181 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2182 | // these were originally in system but migrated to secure in the past, |
| 2183 | // so are duplicated in the Secure.* namespace |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2184 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); |
| 2185 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); |
| 2186 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); |
| 2187 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2188 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); |
| 2189 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2190 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2191 | // these are moving directly from system to global |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2192 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); |
| 2193 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); |
| 2194 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); |
| 2195 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); |
| 2196 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); |
| 2197 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); |
| 2198 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); |
| 2199 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); |
| 2200 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); |
| 2201 | MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); |
| 2202 | MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); |
| 2203 | MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); |
| 2204 | MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); |
| 2205 | MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); |
| 2206 | MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); |
| 2207 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2208 | MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2209 | MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); |
| 2210 | MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); |
| 2211 | MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); |
| 2212 | MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); |
| 2213 | MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); |
| 2214 | MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); |
| 2215 | MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); |
| 2216 | MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); |
| 2217 | MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2218 | MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 2219 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); |
| 2220 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); |
| 2221 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); |
| 2222 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); |
| 2223 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); |
| 2224 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); |
| 2225 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); |
| 2226 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2227 | } |
| 2228 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2229 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2230 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2231 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2232 | outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); |
| 2233 | } |
| 2234 | |
| 2235 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2236 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 2237 | outKeySet.addAll(MOVED_TO_SECURE); |
| 2238 | } |
| 2239 | |
| 2240 | /** @hide */ |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2241 | public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { |
| 2242 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2243 | } |
| 2244 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2245 | /** @hide */ |
| 2246 | public static void clearProviderForTest() { |
| 2247 | sProviderHolder.clearProviderForTest(); |
| 2248 | sNameValueCache.clearGenerationTrackerForTest(); |
| 2249 | } |
| 2250 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2251 | /** |
| 2252 | * Look up a name in the database. |
| 2253 | * @param resolver to access the database with |
| 2254 | * @param name to look up in the table |
| 2255 | * @return the corresponding value, or null if not present |
| 2256 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2257 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2258 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 2259 | } |
| 2260 | |
| 2261 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2262 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2263 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2264 | if (MOVED_TO_SECURE.contains(name)) { |
| 2265 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2266 | + " to android.provider.Settings.Secure, returning read-only value."); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2267 | return Secure.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2268 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2269 | 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] | 2270 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2271 | + " to android.provider.Settings.Global, returning read-only value."); |
| 2272 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2273 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2274 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2275 | } |
| 2276 | |
| 2277 | /** |
| 2278 | * Store a name/value pair into the database. |
| 2279 | * @param resolver to access the database with |
| 2280 | * @param name to store |
| 2281 | * @param value to associate with the name |
| 2282 | * @return true if the value was set, false on database errors |
| 2283 | */ |
| 2284 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2285 | return putStringForUser(resolver, name, value, UserHandle.myUserId()); |
| 2286 | } |
| 2287 | |
| 2288 | /** @hide */ |
| 2289 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 2290 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2291 | if (MOVED_TO_SECURE.contains(name)) { |
| 2292 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2293 | + " to android.provider.Settings.Secure, value is unchanged."); |
| 2294 | return false; |
| 2295 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2296 | 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] | 2297 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2298 | + " to android.provider.Settings.Global, value is unchanged."); |
| 2299 | return false; |
| 2300 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2301 | return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2302 | } |
| 2303 | |
| 2304 | /** |
| 2305 | * Construct the content URI for a particular name/value pair, |
| 2306 | * useful for monitoring changes with a ContentObserver. |
| 2307 | * @param name to look up in the table |
| 2308 | * @return the corresponding content URI, or null if not present |
| 2309 | */ |
| 2310 | public static Uri getUriFor(String name) { |
| 2311 | if (MOVED_TO_SECURE.contains(name)) { |
| 2312 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2313 | + " to android.provider.Settings.Secure, returning Secure URI."); |
| 2314 | return Secure.getUriFor(Secure.CONTENT_URI, name); |
| 2315 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2316 | 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] | 2317 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2318 | + " to android.provider.Settings.Global, returning read-only global URI."); |
| 2319 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 2320 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2321 | return getUriFor(CONTENT_URI, name); |
| 2322 | } |
| 2323 | |
| 2324 | /** |
| 2325 | * Convenience function for retrieving a single system settings value |
| 2326 | * as an integer. Note that internally setting values are always |
| 2327 | * stored as strings; this function converts the string to an integer |
| 2328 | * for you. The default value will be returned if the setting is |
| 2329 | * not defined or not an integer. |
| 2330 | * |
| 2331 | * @param cr The ContentResolver to access. |
| 2332 | * @param name The name of the setting to retrieve. |
| 2333 | * @param def Value to return if the setting is not defined. |
| 2334 | * |
| 2335 | * @return The setting's current value, or 'def' if it is not defined |
| 2336 | * or not a valid integer. |
| 2337 | */ |
| 2338 | public static int getInt(ContentResolver cr, String name, int def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2339 | return getIntForUser(cr, name, def, UserHandle.myUserId()); |
| 2340 | } |
| 2341 | |
| 2342 | /** @hide */ |
| 2343 | public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { |
| 2344 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2345 | try { |
| 2346 | return v != null ? Integer.parseInt(v) : def; |
| 2347 | } catch (NumberFormatException e) { |
| 2348 | return def; |
| 2349 | } |
| 2350 | } |
| 2351 | |
| 2352 | /** |
| 2353 | * Convenience function for retrieving a single system settings value |
| 2354 | * as an integer. Note that internally setting values are always |
| 2355 | * stored as strings; this function converts the string to an integer |
| 2356 | * for you. |
| 2357 | * <p> |
| 2358 | * This version does not take a default value. If the setting has not |
| 2359 | * been set, or the string value is not a number, |
| 2360 | * it throws {@link SettingNotFoundException}. |
| 2361 | * |
| 2362 | * @param cr The ContentResolver to access. |
| 2363 | * @param name The name of the setting to retrieve. |
| 2364 | * |
| 2365 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2366 | * name can't be found or the setting value is not an integer. |
| 2367 | * |
| 2368 | * @return The setting's current value. |
| 2369 | */ |
| 2370 | public static int getInt(ContentResolver cr, String name) |
| 2371 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2372 | return getIntForUser(cr, name, UserHandle.myUserId()); |
| 2373 | } |
| 2374 | |
| 2375 | /** @hide */ |
| 2376 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 2377 | throws SettingNotFoundException { |
| 2378 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2379 | try { |
| 2380 | return Integer.parseInt(v); |
| 2381 | } catch (NumberFormatException e) { |
| 2382 | throw new SettingNotFoundException(name); |
| 2383 | } |
| 2384 | } |
| 2385 | |
| 2386 | /** |
| 2387 | * Convenience function for updating a single settings value as an |
| 2388 | * integer. This will either create a new entry in the table if the |
| 2389 | * given name does not exist, or modify the value of the existing row |
| 2390 | * with that name. Note that internally setting values are always |
| 2391 | * stored as strings, so this function converts the given value to a |
| 2392 | * string before storing it. |
| 2393 | * |
| 2394 | * @param cr The ContentResolver to access. |
| 2395 | * @param name The name of the setting to modify. |
| 2396 | * @param value The new value for the setting. |
| 2397 | * @return true if the value was set, false on database errors |
| 2398 | */ |
| 2399 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2400 | return putIntForUser(cr, name, value, UserHandle.myUserId()); |
| 2401 | } |
| 2402 | |
| 2403 | /** @hide */ |
| 2404 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 2405 | int userHandle) { |
| 2406 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2407 | } |
| 2408 | |
| 2409 | /** |
| 2410 | * Convenience function for retrieving a single system settings value |
| 2411 | * as a {@code long}. Note that internally setting values are always |
| 2412 | * stored as strings; this function converts the string to a {@code long} |
| 2413 | * for you. The default value will be returned if the setting is |
| 2414 | * not defined or not a {@code long}. |
| 2415 | * |
| 2416 | * @param cr The ContentResolver to access. |
| 2417 | * @param name The name of the setting to retrieve. |
| 2418 | * @param def Value to return if the setting is not defined. |
| 2419 | * |
| 2420 | * @return The setting's current value, or 'def' if it is not defined |
| 2421 | * or not a valid {@code long}. |
| 2422 | */ |
| 2423 | public static long getLong(ContentResolver cr, String name, long def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2424 | return getLongForUser(cr, name, def, UserHandle.myUserId()); |
| 2425 | } |
| 2426 | |
| 2427 | /** @hide */ |
| 2428 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 2429 | int userHandle) { |
| 2430 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2431 | long value; |
| 2432 | try { |
| 2433 | value = valString != null ? Long.parseLong(valString) : def; |
| 2434 | } catch (NumberFormatException e) { |
| 2435 | value = def; |
| 2436 | } |
| 2437 | return value; |
| 2438 | } |
| 2439 | |
| 2440 | /** |
| 2441 | * Convenience function for retrieving a single system settings value |
| 2442 | * as a {@code long}. Note that internally setting values are always |
| 2443 | * stored as strings; this function converts the string to a {@code long} |
| 2444 | * for you. |
| 2445 | * <p> |
| 2446 | * This version does not take a default value. If the setting has not |
| 2447 | * been set, or the string value is not a number, |
| 2448 | * it throws {@link SettingNotFoundException}. |
| 2449 | * |
| 2450 | * @param cr The ContentResolver to access. |
| 2451 | * @param name The name of the setting to retrieve. |
| 2452 | * |
| 2453 | * @return The setting's current value. |
| 2454 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2455 | * name can't be found or the setting value is not an integer. |
| 2456 | */ |
| 2457 | public static long getLong(ContentResolver cr, String name) |
| 2458 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2459 | return getLongForUser(cr, name, UserHandle.myUserId()); |
| 2460 | } |
| 2461 | |
| 2462 | /** @hide */ |
| 2463 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 2464 | throws SettingNotFoundException { |
| 2465 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2466 | try { |
| 2467 | return Long.parseLong(valString); |
| 2468 | } catch (NumberFormatException e) { |
| 2469 | throw new SettingNotFoundException(name); |
| 2470 | } |
| 2471 | } |
| 2472 | |
| 2473 | /** |
| 2474 | * Convenience function for updating a single settings value as a long |
| 2475 | * integer. This will either create a new entry in the table if the |
| 2476 | * given name does not exist, or modify the value of the existing row |
| 2477 | * with that name. Note that internally setting values are always |
| 2478 | * stored as strings, so this function converts the given value to a |
| 2479 | * string before storing it. |
| 2480 | * |
| 2481 | * @param cr The ContentResolver to access. |
| 2482 | * @param name The name of the setting to modify. |
| 2483 | * @param value The new value for the setting. |
| 2484 | * @return true if the value was set, false on database errors |
| 2485 | */ |
| 2486 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2487 | return putLongForUser(cr, name, value, UserHandle.myUserId()); |
| 2488 | } |
| 2489 | |
| 2490 | /** @hide */ |
| 2491 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 2492 | int userHandle) { |
| 2493 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2494 | } |
| 2495 | |
| 2496 | /** |
| 2497 | * Convenience function for retrieving a single system settings value |
| 2498 | * as a floating point number. Note that internally setting values are |
| 2499 | * always stored as strings; this function converts the string to an |
| 2500 | * float for you. The default value will be returned if the setting |
| 2501 | * is not defined or not a valid float. |
| 2502 | * |
| 2503 | * @param cr The ContentResolver to access. |
| 2504 | * @param name The name of the setting to retrieve. |
| 2505 | * @param def Value to return if the setting is not defined. |
| 2506 | * |
| 2507 | * @return The setting's current value, or 'def' if it is not defined |
| 2508 | * or not a valid float. |
| 2509 | */ |
| 2510 | public static float getFloat(ContentResolver cr, String name, float def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2511 | return getFloatForUser(cr, name, def, UserHandle.myUserId()); |
| 2512 | } |
| 2513 | |
| 2514 | /** @hide */ |
| 2515 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 2516 | int userHandle) { |
| 2517 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2518 | try { |
| 2519 | return v != null ? Float.parseFloat(v) : def; |
| 2520 | } catch (NumberFormatException e) { |
| 2521 | return def; |
| 2522 | } |
| 2523 | } |
| 2524 | |
| 2525 | /** |
| 2526 | * Convenience function for retrieving a single system settings value |
| 2527 | * as a float. Note that internally setting values are always |
| 2528 | * stored as strings; this function converts the string to a float |
| 2529 | * for you. |
| 2530 | * <p> |
| 2531 | * This version does not take a default value. If the setting has not |
| 2532 | * been set, or the string value is not a number, |
| 2533 | * it throws {@link SettingNotFoundException}. |
| 2534 | * |
| 2535 | * @param cr The ContentResolver to access. |
| 2536 | * @param name The name of the setting to retrieve. |
| 2537 | * |
| 2538 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2539 | * name can't be found or the setting value is not a float. |
| 2540 | * |
| 2541 | * @return The setting's current value. |
| 2542 | */ |
| 2543 | public static float getFloat(ContentResolver cr, String name) |
| 2544 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2545 | return getFloatForUser(cr, name, UserHandle.myUserId()); |
| 2546 | } |
| 2547 | |
| 2548 | /** @hide */ |
| 2549 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 2550 | throws SettingNotFoundException { |
| 2551 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 2552 | if (v == null) { |
| 2553 | throw new SettingNotFoundException(name); |
| 2554 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2555 | try { |
| 2556 | return Float.parseFloat(v); |
| 2557 | } catch (NumberFormatException e) { |
| 2558 | throw new SettingNotFoundException(name); |
| 2559 | } |
| 2560 | } |
| 2561 | |
| 2562 | /** |
| 2563 | * Convenience function for updating a single settings value as a |
| 2564 | * floating point number. This will either create a new entry in the |
| 2565 | * table if the given name does not exist, or modify the value of the |
| 2566 | * existing row with that name. Note that internally setting values |
| 2567 | * are always stored as strings, so this function converts the given |
| 2568 | * value to a string before storing it. |
| 2569 | * |
| 2570 | * @param cr The ContentResolver to access. |
| 2571 | * @param name The name of the setting to modify. |
| 2572 | * @param value The new value for the setting. |
| 2573 | * @return true if the value was set, false on database errors |
| 2574 | */ |
| 2575 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2576 | return putFloatForUser(cr, name, value, UserHandle.myUserId()); |
| 2577 | } |
| 2578 | |
| 2579 | /** @hide */ |
| 2580 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 2581 | int userHandle) { |
| 2582 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2583 | } |
| 2584 | |
| 2585 | /** |
| 2586 | * Convenience function to read all of the current |
| 2587 | * configuration-related settings into a |
| 2588 | * {@link Configuration} object. |
| 2589 | * |
| 2590 | * @param cr The ContentResolver to access. |
| 2591 | * @param outConfig Where to place the configuration settings. |
| 2592 | */ |
| 2593 | public static void getConfiguration(ContentResolver cr, Configuration outConfig) { |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2594 | adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(), |
| 2595 | false /* updateSettingsIfEmpty */); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2596 | } |
| 2597 | |
| 2598 | /** @hide */ |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2599 | public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, |
| 2600 | int userHandle, boolean updateSettingsIfEmpty) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2601 | outConfig.fontScale = Settings.System.getFloatForUser( |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2602 | cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2603 | if (outConfig.fontScale < 0) { |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2604 | outConfig.fontScale = DEFAULT_FONT_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2605 | } |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2606 | |
| 2607 | final String localeValue = |
| 2608 | Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); |
| 2609 | if (localeValue != null) { |
| 2610 | outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); |
| 2611 | } else { |
| 2612 | // Do not update configuration with emtpy settings since we need to take over the |
| 2613 | // locale list of previous user if the settings value is empty. This happens when a |
| 2614 | // new user is created. |
| 2615 | |
| 2616 | if (updateSettingsIfEmpty) { |
| 2617 | // Make current configuration persistent. This is necessary the first time a |
| 2618 | // user log in. At the first login, the configuration settings are empty, so we |
| 2619 | // need to store the adjusted configuration as the initial settings. |
| 2620 | Settings.System.putStringForUser( |
| 2621 | cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), |
| 2622 | userHandle); |
| 2623 | } |
| 2624 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2625 | } |
| 2626 | |
| 2627 | /** |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2628 | * @hide Erase the fields in the Configuration that should be applied |
| 2629 | * by the settings. |
| 2630 | */ |
| 2631 | public static void clearConfiguration(Configuration inoutConfig) { |
| 2632 | inoutConfig.fontScale = 0; |
Seigo Nonaka | d403151 | 2016-03-17 21:18:53 +0900 | [diff] [blame] | 2633 | if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { |
Seigo Nonaka | bd5cac6 | 2016-05-13 15:11:37 +0900 | [diff] [blame] | 2634 | inoutConfig.clearLocales(); |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2635 | } |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2636 | } |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2637 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2638 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2639 | * Convenience function to write a batch of configuration-related |
| 2640 | * settings from a {@link Configuration} object. |
| 2641 | * |
| 2642 | * @param cr The ContentResolver to access. |
| 2643 | * @param config The settings to write. |
| 2644 | * @return true if the values were set, false on database errors |
| 2645 | */ |
| 2646 | public static boolean putConfiguration(ContentResolver cr, Configuration config) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2647 | return putConfigurationForUser(cr, config, UserHandle.myUserId()); |
| 2648 | } |
| 2649 | |
| 2650 | /** @hide */ |
| 2651 | public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, |
| 2652 | int userHandle) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2653 | return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && |
| 2654 | Settings.System.putStringForUser( |
| 2655 | cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2656 | } |
| 2657 | |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2658 | /** @hide */ |
| 2659 | public static boolean hasInterestingConfigurationChanges(int changes) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2660 | return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || |
| 2661 | (changes & ActivityInfo.CONFIG_LOCALE) != 0; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2662 | } |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2663 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2664 | /** @deprecated - Do not use */ |
| 2665 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2666 | public static boolean getShowGTalkServiceStatus(ContentResolver cr) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2667 | return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2668 | } |
| 2669 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2670 | /** |
| 2671 | * @hide |
| 2672 | * @deprecated - Do not use |
| 2673 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 2674 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2675 | public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, |
| 2676 | int userHandle) { |
| 2677 | return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; |
| 2678 | } |
| 2679 | |
| 2680 | /** @deprecated - Do not use */ |
| 2681 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2682 | public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { |
Christopher Tate | c8c0838 | 2012-09-19 17:18:18 -0700 | [diff] [blame] | 2683 | setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2684 | } |
| 2685 | |
| 2686 | /** |
| 2687 | * @hide |
| 2688 | * @deprecated - Do not use |
| 2689 | */ |
| 2690 | @Deprecated |
| 2691 | public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, |
| 2692 | int userHandle) { |
| 2693 | 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] | 2694 | } |
| 2695 | |
| 2696 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2697 | * @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] | 2698 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2699 | @Deprecated |
| 2700 | 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] | 2701 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2702 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 2703 | @Override |
| 2704 | public boolean validate(String value) { |
| 2705 | try { |
| 2706 | int val = Integer.parseInt(value); |
| 2707 | return (val == 0) |
| 2708 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 2709 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 2710 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 2711 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2712 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 2713 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2714 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2715 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 2716 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 2717 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 2718 | | BatteryManager.BATTERY_PLUGGED_USB |
| 2719 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 2720 | } catch (NumberFormatException e) { |
| 2721 | return false; |
| 2722 | } |
| 2723 | } |
| 2724 | }; |
| 2725 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2726 | /** |
| 2727 | * What happens when the user presses the end call button if they're not |
| 2728 | * on a call.<br/> |
| 2729 | * <b>Values:</b><br/> |
| 2730 | * 0 - The end button does nothing.<br/> |
| 2731 | * 1 - The end button goes to the home screen.<br/> |
| 2732 | * 2 - The end button puts the device to sleep and locks the keyguard.<br/> |
| 2733 | * 3 - The end button goes to the home screen. If the user is already on the |
| 2734 | * home screen, it puts the device to sleep. |
| 2735 | */ |
| 2736 | public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; |
| 2737 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2738 | private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2739 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2740 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2741 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 2742 | * END_BUTTON_BEHAVIOR value for "go home". |
| 2743 | * @hide |
| 2744 | */ |
| 2745 | public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; |
| 2746 | |
| 2747 | /** |
| 2748 | * END_BUTTON_BEHAVIOR value for "go to sleep". |
| 2749 | * @hide |
| 2750 | */ |
| 2751 | public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; |
| 2752 | |
| 2753 | /** |
| 2754 | * END_BUTTON_BEHAVIOR default value. |
| 2755 | * @hide |
| 2756 | */ |
| 2757 | public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; |
| 2758 | |
| 2759 | /** |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2760 | * Is advanced settings mode turned on. 0 == no, 1 == yes |
| 2761 | * @hide |
| 2762 | */ |
| 2763 | public static final String ADVANCED_SETTINGS = "advanced_settings"; |
| 2764 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2765 | private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2766 | |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2767 | /** |
| 2768 | * ADVANCED_SETTINGS default value. |
| 2769 | * @hide |
| 2770 | */ |
| 2771 | public static final int ADVANCED_SETTINGS_DEFAULT = 0; |
| 2772 | |
| 2773 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2774 | * @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] | 2775 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2776 | @Deprecated |
| 2777 | 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] | 2778 | |
| 2779 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2780 | * @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] | 2781 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2782 | @Deprecated |
| 2783 | public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2784 | |
| 2785 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2786 | * @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] | 2787 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2788 | @Deprecated |
| 2789 | public static final String RADIO_WIFI = Global.RADIO_WIFI; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2790 | |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2791 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2792 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2793 | * {@hide} |
| 2794 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2795 | @Deprecated |
| 2796 | public static final String RADIO_WIMAX = Global.RADIO_WIMAX; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2797 | |
| 2798 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2799 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2800 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2801 | @Deprecated |
| 2802 | public static final String RADIO_CELL = Global.RADIO_CELL; |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2803 | |
| 2804 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2805 | * @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] | 2806 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2807 | @Deprecated |
| 2808 | public static final String RADIO_NFC = Global.RADIO_NFC; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2809 | |
| 2810 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2811 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead |
| 2812 | */ |
| 2813 | @Deprecated |
| 2814 | public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; |
| 2815 | |
| 2816 | /** |
| 2817 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2818 | * |
| 2819 | * {@hide} |
| 2820 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2821 | @Deprecated |
| 2822 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = |
| 2823 | Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2824 | |
| 2825 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2826 | * @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] | 2827 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2828 | @Deprecated |
| 2829 | 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] | 2830 | |
| 2831 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2832 | * @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] | 2833 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2834 | @Deprecated |
| 2835 | 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] | 2836 | |
| 2837 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2838 | * @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] | 2839 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2840 | @Deprecated |
| 2841 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = |
| 2842 | Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2843 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2844 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2845 | * @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] | 2846 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2847 | @Deprecated |
| 2848 | 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] | 2849 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2850 | /** |
| 2851 | * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead |
| 2852 | */ |
| 2853 | @Deprecated |
| 2854 | public static final String MODE_RINGER = Global.MODE_RINGER; |
| 2855 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2856 | /** |
| 2857 | * Whether to use static IP and other static network attributes. |
| 2858 | * <p> |
| 2859 | * Set to 1 for true and 0 for false. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2860 | * |
| 2861 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2862 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2863 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2864 | public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; |
| 2865 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2866 | private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2867 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2868 | /** |
| 2869 | * The static IP address. |
| 2870 | * <p> |
| 2871 | * Example: "192.168.1.51" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2872 | * |
| 2873 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2874 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2875 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2876 | public static final String WIFI_STATIC_IP = "wifi_static_ip"; |
| 2877 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2878 | private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2879 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2880 | /** |
| 2881 | * If using static IP, the gateway's IP address. |
| 2882 | * <p> |
| 2883 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2884 | * |
| 2885 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2886 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2887 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2888 | public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; |
| 2889 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2890 | private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2891 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2892 | /** |
| 2893 | * If using static IP, the net mask. |
| 2894 | * <p> |
| 2895 | * Example: "255.255.255.0" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2896 | * |
| 2897 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2898 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2899 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2900 | public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; |
| 2901 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2902 | private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2903 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2904 | /** |
| 2905 | * If using static IP, the primary DNS's IP address. |
| 2906 | * <p> |
| 2907 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2908 | * |
| 2909 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2910 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2911 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2912 | public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; |
| 2913 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2914 | private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2915 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2916 | /** |
| 2917 | * If using static IP, the secondary DNS's IP address. |
| 2918 | * <p> |
| 2919 | * Example: "192.168.1.2" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2920 | * |
| 2921 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2922 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2923 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2924 | public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; |
| 2925 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2926 | 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] | 2927 | |
| 2928 | /** |
| 2929 | * Determines whether remote devices may discover and/or connect to |
| 2930 | * this device. |
| 2931 | * <P>Type: INT</P> |
| 2932 | * 2 -- discoverable and connectable |
| 2933 | * 1 -- connectable but not discoverable |
| 2934 | * 0 -- neither connectable nor discoverable |
| 2935 | */ |
| 2936 | public static final String BLUETOOTH_DISCOVERABILITY = |
| 2937 | "bluetooth_discoverability"; |
| 2938 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2939 | private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2940 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2941 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2942 | /** |
| 2943 | * Bluetooth discoverability timeout. If this value is nonzero, then |
| 2944 | * Bluetooth becomes discoverable for a certain number of seconds, |
| 2945 | * after which is becomes simply connectable. The value is in seconds. |
| 2946 | */ |
| 2947 | public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = |
| 2948 | "bluetooth_discoverability_timeout"; |
| 2949 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2950 | private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 2951 | NON_NEGATIVE_INTEGER_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 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2954 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} |
| 2955 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2956 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2957 | @Deprecated |
| 2958 | 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] | 2959 | |
| 2960 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2961 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} |
| 2962 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2963 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2964 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2965 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 2966 | |
| 2967 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2968 | * @deprecated Use |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2969 | * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} |
| 2970 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2971 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2972 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2973 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 2974 | "lock_pattern_tactile_feedback_enabled"; |
| 2975 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2976 | /** |
| 2977 | * A formatted string of the next alarm that is set, or the empty string |
| 2978 | * if there is no alarm set. |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 2979 | * |
| 2980 | * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2981 | */ |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 2982 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2983 | public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; |
| 2984 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2985 | private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { |
| 2986 | private static final int MAX_LENGTH = 1000; |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 2987 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2988 | @Override |
| 2989 | public boolean validate(String value) { |
| 2990 | // TODO: No idea what the correct format is. |
Svetoslav | 64d6e9c | 2015-02-12 11:30:36 -0800 | [diff] [blame] | 2991 | return value == null || value.length() < MAX_LENGTH; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2992 | } |
| 2993 | }; |
| 2994 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2995 | /** |
| 2996 | * Scaling factor for fonts, float. |
| 2997 | */ |
| 2998 | public static final String FONT_SCALE = "font_scale"; |
| 2999 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3000 | private static final Validator FONT_SCALE_VALIDATOR = new Validator() { |
| 3001 | @Override |
| 3002 | public boolean validate(String value) { |
| 3003 | try { |
| 3004 | return Float.parseFloat(value) >= 0; |
| 3005 | } catch (NumberFormatException e) { |
| 3006 | return false; |
| 3007 | } |
| 3008 | } |
| 3009 | }; |
| 3010 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3011 | /** |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3012 | * The serialized system locale value. |
| 3013 | * |
| 3014 | * Do not use this value directory. |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 3015 | * To get system locale, use {@link LocaleList#getDefault} instead. |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3016 | * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} |
| 3017 | * instead. |
| 3018 | * @hide |
| 3019 | */ |
| 3020 | public static final String SYSTEM_LOCALES = "system_locales"; |
| 3021 | |
| 3022 | |
| 3023 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3024 | * Name of an application package to be debugged. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3025 | * |
| 3026 | * @deprecated Use {@link Global#DEBUG_APP} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3027 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3028 | @Deprecated |
| 3029 | public static final String DEBUG_APP = Global.DEBUG_APP; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3030 | |
| 3031 | /** |
| 3032 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 3033 | * starting user code. If 0, it will run normally. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3034 | * |
| 3035 | * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3036 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3037 | @Deprecated |
| 3038 | 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] | 3039 | |
| 3040 | /** |
| 3041 | * Whether or not to dim the screen. 0=no 1=yes |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3042 | * @deprecated This setting is no longer used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3043 | */ |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3044 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3045 | public static final String DIM_SCREEN = "dim_screen"; |
| 3046 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3047 | private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3048 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3049 | /** |
Christine Franks | 8ad7149 | 2017-10-24 19:04:22 -0700 | [diff] [blame] | 3050 | * The display color mode. |
| 3051 | * @hide |
| 3052 | */ |
| 3053 | public static final String DISPLAY_COLOR_MODE = "display_color_mode"; |
| 3054 | |
| 3055 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 3056 | * The amount of time in milliseconds before the device goes to sleep or begins |
| 3057 | * to dream after a period of inactivity. This value is also known as the |
| 3058 | * user activity timeout period since the screen isn't necessarily turned off |
| 3059 | * when it expires. |
yuemingw | 0de748d | 2017-11-15 19:22:27 +0000 | [diff] [blame] | 3060 | * |
| 3061 | * <p> |
| 3062 | * This value is bounded by maximum timeout set by |
| 3063 | * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3064 | */ |
| 3065 | public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; |
| 3066 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3067 | private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = |
| 3068 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3069 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3070 | /** |
| 3071 | * The screen backlight brightness between 0 and 255. |
| 3072 | */ |
| 3073 | public static final String SCREEN_BRIGHTNESS = "screen_brightness"; |
| 3074 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3075 | private static final Validator SCREEN_BRIGHTNESS_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3076 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3077 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3078 | /** |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3079 | * The screen backlight brightness between 0 and 255. |
| 3080 | * @hide |
| 3081 | */ |
| 3082 | public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; |
| 3083 | |
| 3084 | private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3085 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3086 | |
| 3087 | /** |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3088 | * Control whether to enable automatic brightness mode. |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3089 | */ |
| 3090 | public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; |
| 3091 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3092 | private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3093 | |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3094 | /** |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3095 | * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) |
| 3096 | * or less (<0.0 >-1.0) bright. |
Dianne Hackborn | 518a3d8 | 2012-05-09 16:30:49 -0700 | [diff] [blame] | 3097 | * @hide |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3098 | */ |
| 3099 | public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; |
| 3100 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3101 | private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3102 | new SettingsValidators.InclusiveFloatRangeValidator(-1, 1); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3103 | |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3104 | /** |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3105 | * SCREEN_BRIGHTNESS_MODE value for manual mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3106 | */ |
| 3107 | public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; |
| 3108 | |
| 3109 | /** |
Scott Main | 52bfc24 | 2012-02-09 10:09:14 -0800 | [diff] [blame] | 3110 | * SCREEN_BRIGHTNESS_MODE value for automatic mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3111 | */ |
| 3112 | public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; |
| 3113 | |
| 3114 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3115 | * Control whether the process CPU usage meter should be shown. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3116 | * |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 3117 | * @deprecated This functionality is no longer available as of |
| 3118 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3119 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3120 | @Deprecated |
| 3121 | public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3122 | |
| 3123 | /** |
| 3124 | * If 1, the activity manager will aggressively finish activities and |
| 3125 | * processes as soon as they are no longer needed. If 0, the normal |
| 3126 | * extended lifetime is used. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3127 | * |
| 3128 | * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3129 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3130 | @Deprecated |
| 3131 | 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] | 3132 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3133 | /** |
| 3134 | * Determines which streams are affected by ringer mode changes. The |
| 3135 | * stream type's bit should be set to 1 if it should be muted when going |
| 3136 | * into an inaudible ringer mode. |
| 3137 | */ |
| 3138 | public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; |
| 3139 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3140 | private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3141 | NON_NEGATIVE_INTEGER_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3142 | |
| 3143 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3144 | * Determines which streams are affected by mute. The |
| 3145 | * stream type's bit should be set to 1 if it should be muted when a mute request |
| 3146 | * is received. |
| 3147 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3148 | public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; |
| 3149 | |
| 3150 | private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3151 | NON_NEGATIVE_INTEGER_VALIDATOR; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3152 | |
| 3153 | /** |
| 3154 | * Whether vibrate is on for different events. This is used internally, |
| 3155 | * changing this value will not change the vibrate. See AudioManager. |
| 3156 | */ |
| 3157 | public static final String VIBRATE_ON = "vibrate_on"; |
| 3158 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3159 | private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3160 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3161 | /** |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3162 | * If 1, redirects the system vibrator to all currently attached input devices |
| 3163 | * that support vibration. If there are no such input devices, then the system |
| 3164 | * vibrator is used instead. |
| 3165 | * If 0, does not register the system vibrator. |
| 3166 | * |
| 3167 | * This setting is mainly intended to provide a compatibility mechanism for |
| 3168 | * applications that only know about the system vibrator and do not use the |
| 3169 | * input device vibrator API. |
| 3170 | * |
| 3171 | * @hide |
| 3172 | */ |
| 3173 | public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; |
| 3174 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3175 | private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3176 | |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3177 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3178 | * Ringer volume. This is used internally, changing this value will not |
| 3179 | * change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3180 | * |
| 3181 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3182 | */ |
| 3183 | public static final String VOLUME_RING = "volume_ring"; |
| 3184 | |
| 3185 | /** |
| 3186 | * System/notifications volume. This is used internally, changing this |
| 3187 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3188 | * |
| 3189 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3190 | */ |
| 3191 | public static final String VOLUME_SYSTEM = "volume_system"; |
| 3192 | |
| 3193 | /** |
| 3194 | * Voice call volume. This is used internally, changing this value will |
| 3195 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3196 | * |
| 3197 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3198 | */ |
| 3199 | public static final String VOLUME_VOICE = "volume_voice"; |
| 3200 | |
| 3201 | /** |
| 3202 | * Music/media/gaming volume. This is used internally, changing this |
| 3203 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3204 | * |
| 3205 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3206 | */ |
| 3207 | public static final String VOLUME_MUSIC = "volume_music"; |
| 3208 | |
| 3209 | /** |
| 3210 | * Alarm volume. This is used internally, changing this |
| 3211 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3212 | * |
| 3213 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3214 | */ |
| 3215 | public static final String VOLUME_ALARM = "volume_alarm"; |
| 3216 | |
| 3217 | /** |
| 3218 | * Notification volume. This is used internally, changing this |
| 3219 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3220 | * |
| 3221 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3222 | */ |
| 3223 | public static final String VOLUME_NOTIFICATION = "volume_notification"; |
| 3224 | |
| 3225 | /** |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3226 | * Bluetooth Headset volume. This is used internally, changing this value will |
| 3227 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3228 | * |
| 3229 | * @removed Not used by anything since API 2. |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3230 | */ |
| 3231 | public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; |
| 3232 | |
| 3233 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3234 | * @hide |
| 3235 | * Acessibility volume. This is used internally, changing this |
| 3236 | * value will not change the volume. |
| 3237 | */ |
| 3238 | public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; |
| 3239 | |
| 3240 | /** |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3241 | * Master volume (float in the range 0.0f to 1.0f). |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3242 | * |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3243 | * @hide |
| 3244 | */ |
| 3245 | public static final String VOLUME_MASTER = "volume_master"; |
| 3246 | |
| 3247 | /** |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3248 | * Master mono (int 1 = mono, 0 = normal). |
| 3249 | * |
| 3250 | * @hide |
| 3251 | */ |
| 3252 | public static final String MASTER_MONO = "master_mono"; |
| 3253 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3254 | private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR; |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3255 | |
| 3256 | /** |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3257 | * Whether the notifications should use the ring volume (value of 1) or |
| 3258 | * a separate notification volume (value of 0). In most cases, users |
| 3259 | * will have this enabled so the notification and ringer volumes will be |
| 3260 | * the same. However, power users can disable this and use the separate |
| 3261 | * notification volume control. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3262 | * <p> |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3263 | * Note: This is a one-off setting that will be removed in the future |
| 3264 | * when there is profile support. For this reason, it is kept hidden |
| 3265 | * from the public APIs. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3266 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3267 | * @hide |
Amith Yamasani | 42722bf | 2011-07-22 10:34:27 -0700 | [diff] [blame] | 3268 | * @deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3269 | */ |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 3270 | @Deprecated |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3271 | public static final String NOTIFICATIONS_USE_RING_VOLUME = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3272 | "notifications_use_ring_volume"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3273 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3274 | private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3275 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3276 | /** |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3277 | * Whether silent mode should allow vibration feedback. This is used |
| 3278 | * internally in AudioService and the Sound settings activity to |
| 3279 | * coordinate decoupling of vibrate and silent modes. This setting |
| 3280 | * will likely be removed in a future release with support for |
| 3281 | * audio/vibe feedback profiles. |
| 3282 | * |
Eric Laurent | bffc3d1 | 2012-05-07 17:43:49 -0700 | [diff] [blame] | 3283 | * Not used anymore. On devices with vibrator, the user explicitly selects |
| 3284 | * silent or vibrate mode. |
| 3285 | * Kept for use by legacy database upgrade code in DatabaseHelper. |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3286 | * @hide |
| 3287 | */ |
| 3288 | public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; |
| 3289 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3290 | private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3291 | |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3292 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3293 | * The mapping of stream type (integer) to its setting. |
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_SETTINGS = { |
| 3298 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3299 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3300 | }; |
| 3301 | |
| 3302 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3303 | * @hide |
| 3304 | * The mapping of stream type (integer) to its setting. |
| 3305 | * Unlike the VOLUME_SETTINGS array, this one contains as many entries as |
| 3306 | * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes |
| 3307 | * are never persisted. |
| 3308 | */ |
| 3309 | public static final String[] VOLUME_SETTINGS_INT = { |
| 3310 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
| 3311 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, |
| 3312 | "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, |
| 3313 | "" /*STREAM_DTMF, no setting for this stream*/, |
| 3314 | "" /*STREAM_TTS, no setting for this stream*/, |
| 3315 | VOLUME_ACCESSIBILITY |
| 3316 | }; |
| 3317 | |
| 3318 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3319 | * Appended to various volume related settings to record the previous |
| 3320 | * values before they the settings were affected by a silent/vibrate |
| 3321 | * ringer mode change. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3322 | * |
| 3323 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3324 | */ |
| 3325 | public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; |
| 3326 | |
| 3327 | /** |
| 3328 | * Persistent store for the system-wide default ringtone URI. |
| 3329 | * <p> |
| 3330 | * If you need to play the default ringtone at any given time, it is recommended |
| 3331 | * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve |
| 3332 | * to the set default ringtone at the time of playing. |
| 3333 | * |
| 3334 | * @see #DEFAULT_RINGTONE_URI |
| 3335 | */ |
| 3336 | public static final String RINGTONE = "ringtone"; |
| 3337 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3338 | private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3339 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3340 | /** |
| 3341 | * A {@link Uri} that will point to the current default ringtone at any |
| 3342 | * given time. |
| 3343 | * <p> |
| 3344 | * If the current default ringtone is in the DRM provider and the caller |
| 3345 | * does not have permission, the exception will be a |
| 3346 | * FileNotFoundException. |
| 3347 | */ |
| 3348 | public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); |
| 3349 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3350 | /** {@hide} */ |
| 3351 | public static final String RINGTONE_CACHE = "ringtone_cache"; |
| 3352 | /** {@hide} */ |
| 3353 | public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); |
| 3354 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3355 | /** |
| 3356 | * Persistent store for the system-wide default notification sound. |
| 3357 | * |
| 3358 | * @see #RINGTONE |
| 3359 | * @see #DEFAULT_NOTIFICATION_URI |
| 3360 | */ |
| 3361 | public static final String NOTIFICATION_SOUND = "notification_sound"; |
| 3362 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3363 | private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3364 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3365 | /** |
| 3366 | * A {@link Uri} that will point to the current default notification |
| 3367 | * sound at any given time. |
| 3368 | * |
| 3369 | * @see #DEFAULT_RINGTONE_URI |
| 3370 | */ |
| 3371 | public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); |
| 3372 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3373 | /** {@hide} */ |
| 3374 | public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; |
| 3375 | /** {@hide} */ |
| 3376 | public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); |
| 3377 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3378 | /** |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3379 | * Persistent store for the system-wide default alarm alert. |
| 3380 | * |
| 3381 | * @see #RINGTONE |
| 3382 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3383 | */ |
| 3384 | public static final String ALARM_ALERT = "alarm_alert"; |
| 3385 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3386 | private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3387 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3388 | /** |
| 3389 | * A {@link Uri} that will point to the current default alarm alert at |
| 3390 | * any given time. |
| 3391 | * |
| 3392 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3393 | */ |
| 3394 | public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); |
| 3395 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3396 | /** {@hide} */ |
| 3397 | public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; |
| 3398 | /** {@hide} */ |
| 3399 | public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); |
| 3400 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3401 | /** |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3402 | * Persistent store for the system default media button event receiver. |
| 3403 | * |
| 3404 | * @hide |
| 3405 | */ |
| 3406 | public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; |
| 3407 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3408 | private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3409 | |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3410 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3411 | * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off |
| 3412 | */ |
| 3413 | public static final String TEXT_AUTO_REPLACE = "auto_replace"; |
| 3414 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3415 | private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3416 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3417 | /** |
| 3418 | * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off |
| 3419 | */ |
| 3420 | public static final String TEXT_AUTO_CAPS = "auto_caps"; |
| 3421 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3422 | private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3423 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3424 | /** |
| 3425 | * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This |
| 3426 | * feature converts two spaces to a "." and space. |
| 3427 | */ |
| 3428 | public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3429 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3430 | private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3431 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3432 | /** |
| 3433 | * Setting to showing password characters in text editors. 1 = On, 0 = Off |
| 3434 | */ |
| 3435 | public static final String TEXT_SHOW_PASSWORD = "show_password"; |
| 3436 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3437 | private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3438 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3439 | public static final String SHOW_GTALK_SERVICE_STATUS = |
| 3440 | "SHOW_GTALK_SERVICE_STATUS"; |
| 3441 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3442 | private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3443 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3444 | /** |
| 3445 | * Name of activity to use for wallpaper on the home screen. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3446 | * |
| 3447 | * @deprecated Use {@link WallpaperManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3448 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3449 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3450 | public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; |
| 3451 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3452 | private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { |
| 3453 | private static final int MAX_LENGTH = 1000; |
| 3454 | |
| 3455 | @Override |
| 3456 | public boolean validate(String value) { |
| 3457 | if (value != null && value.length() > MAX_LENGTH) { |
| 3458 | return false; |
| 3459 | } |
| 3460 | return ComponentName.unflattenFromString(value) != null; |
| 3461 | } |
| 3462 | }; |
| 3463 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3464 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3465 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} |
| 3466 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3467 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3468 | @Deprecated |
| 3469 | public static final String AUTO_TIME = Global.AUTO_TIME; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3470 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3471 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3472 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3473 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3474 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} |
| 3475 | * instead |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3476 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3477 | @Deprecated |
| 3478 | public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3479 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3480 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3481 | |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3482 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3483 | * Display times as 12 or 24 hours |
| 3484 | * 12 |
| 3485 | * 24 |
| 3486 | */ |
| 3487 | public static final String TIME_12_24 = "time_12_24"; |
| 3488 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3489 | /** @hide */ |
| 3490 | public static final Validator TIME_12_24_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3491 | new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3492 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3493 | /** |
| 3494 | * Date format string |
| 3495 | * mm/dd/yyyy |
| 3496 | * dd/mm/yyyy |
| 3497 | * yyyy/mm/dd |
| 3498 | */ |
| 3499 | public static final String DATE_FORMAT = "date_format"; |
| 3500 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3501 | /** @hide */ |
| 3502 | public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { |
| 3503 | @Override |
| 3504 | public boolean validate(String value) { |
| 3505 | try { |
| 3506 | new SimpleDateFormat(value); |
| 3507 | return true; |
| 3508 | } catch (IllegalArgumentException e) { |
| 3509 | return false; |
| 3510 | } |
| 3511 | } |
| 3512 | }; |
| 3513 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3514 | /** |
| 3515 | * Whether the setup wizard has been run before (on first boot), or if |
| 3516 | * it still needs to be run. |
| 3517 | * |
| 3518 | * nonzero = it has been run in the past |
| 3519 | * 0 = it has not been run in the past |
| 3520 | */ |
| 3521 | public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; |
| 3522 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3523 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3524 | public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3525 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3526 | /** |
| 3527 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 3528 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3529 | * |
| 3530 | * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3531 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3532 | @Deprecated |
| 3533 | 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] | 3534 | |
| 3535 | /** |
| 3536 | * Scaling factor for activity transition animations. Setting to 0 will disable window |
| 3537 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3538 | * |
| 3539 | * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3540 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3541 | @Deprecated |
| 3542 | 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] | 3543 | |
| 3544 | /** |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3545 | * Scaling factor for Animator-based animations. This affects both the start delay and |
| 3546 | * duration of all such animations. Setting to 0 will cause animations to end immediately. |
| 3547 | * The default value is 1. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3548 | * |
| 3549 | * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3550 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3551 | @Deprecated |
| 3552 | 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] | 3553 | |
| 3554 | /** |
| 3555 | * Control whether the accelerometer will be used to change screen |
| 3556 | * orientation. If 0, it will not be used unless explicitly requested |
| 3557 | * by the application; if 1, it will be used by default unless explicitly |
| 3558 | * disabled by the application. |
| 3559 | */ |
| 3560 | public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; |
| 3561 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3562 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3563 | public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3564 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3565 | /** |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3566 | * Default screen rotation when no other policy applies. |
| 3567 | * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a |
| 3568 | * preference, this rotation value will be used. Must be one of the |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 3569 | * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3570 | * |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3571 | * @see android.view.Display#getRotation |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3572 | */ |
| 3573 | public static final String USER_ROTATION = "user_rotation"; |
| 3574 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3575 | /** @hide */ |
| 3576 | public static final Validator USER_ROTATION_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3577 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3578 | |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3579 | /** |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3580 | * Control whether the rotation lock toggle in the System UI should be hidden. |
| 3581 | * Typically this is done for accessibility purposes to make it harder for |
| 3582 | * the user to accidentally toggle the rotation lock while the display rotation |
| 3583 | * has been locked for accessibility. |
| 3584 | * |
| 3585 | * If 0, then rotation lock toggle is not hidden for accessibility (although it may be |
| 3586 | * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. |
| 3587 | * |
| 3588 | * @hide |
| 3589 | */ |
| 3590 | public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = |
| 3591 | "hide_rotation_lock_toggle_for_accessibility"; |
| 3592 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3593 | /** @hide */ |
| 3594 | public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3595 | BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3596 | |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3597 | /** |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3598 | * Whether the phone vibrates when it is ringing due to an incoming call. This will |
| 3599 | * be used by Phone and Setting apps; it shouldn't affect other apps. |
| 3600 | * The value is boolean (1 or 0). |
| 3601 | * |
| 3602 | * Note: this is not same as "vibrate on ring", which had been available until ICS. |
| 3603 | * It was about AudioManager's setting and thus affected all the applications which |
| 3604 | * relied on the setting, while this is purely about the vibration setting for incoming |
| 3605 | * calls. |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3606 | */ |
| 3607 | public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; |
| 3608 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3609 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3610 | public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3611 | |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3612 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3613 | * Whether the audible DTMF tones are played by the dialer when dialing. The value is |
| 3614 | * boolean (1 or 0). |
| 3615 | */ |
| 3616 | public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; |
| 3617 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3618 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3619 | public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3620 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3621 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3622 | * CDMA only settings |
| 3623 | * DTMF tone type played by the dialer when dialing. |
| 3624 | * 0 = Normal |
| 3625 | * 1 = Long |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3626 | */ |
| 3627 | public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; |
| 3628 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3629 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3630 | public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3631 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3632 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3633 | * Whether the hearing aid is enabled. The value is |
| 3634 | * boolean (1 or 0). |
| 3635 | * @hide |
| 3636 | */ |
| 3637 | public static final String HEARING_AID = "hearing_aid"; |
| 3638 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3639 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3640 | public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3641 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3642 | /** |
| 3643 | * CDMA only settings |
| 3644 | * TTY Mode |
| 3645 | * 0 = OFF |
| 3646 | * 1 = FULL |
| 3647 | * 2 = VCO |
| 3648 | * 3 = HCO |
| 3649 | * @hide |
| 3650 | */ |
| 3651 | public static final String TTY_MODE = "tty_mode"; |
| 3652 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3653 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3654 | public static final Validator TTY_MODE_VALIDATOR = |
| 3655 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3656 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3657 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3658 | * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is |
| 3659 | * boolean (1 or 0). |
| 3660 | */ |
| 3661 | public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3662 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3663 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3664 | public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3665 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3666 | /** |
| 3667 | * Whether the haptic feedback (long presses, ...) are enabled. The value is |
| 3668 | * boolean (1 or 0). |
| 3669 | */ |
| 3670 | public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 3671 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3672 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3673 | public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3674 | |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3675 | /** |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3676 | * @deprecated Each application that shows web suggestions should have its own |
| 3677 | * setting for this. |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3678 | */ |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3679 | @Deprecated |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3680 | public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3681 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3682 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3683 | public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3684 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3685 | /** |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3686 | * Whether the notification LED should repeatedly flash when a notification is |
| 3687 | * pending. The value is boolean (1 or 0). |
| 3688 | * @hide |
| 3689 | */ |
| 3690 | public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; |
| 3691 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3692 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3693 | public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3694 | |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3695 | /** |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3696 | * Show pointer location on screen? |
| 3697 | * 0 = no |
| 3698 | * 1 = yes |
| 3699 | * @hide |
| 3700 | */ |
| 3701 | public static final String POINTER_LOCATION = "pointer_location"; |
| 3702 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3703 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3704 | public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3705 | |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3706 | /** |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3707 | * Show touch positions on screen? |
| 3708 | * 0 = no |
| 3709 | * 1 = yes |
| 3710 | * @hide |
| 3711 | */ |
| 3712 | public static final String SHOW_TOUCHES = "show_touches"; |
| 3713 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3714 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3715 | public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3716 | |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3717 | /** |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3718 | * Log raw orientation data from |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 3719 | * {@link com.android.server.policy.WindowOrientationListener} for use with the |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3720 | * orientationplot.py tool. |
| 3721 | * 0 = no |
| 3722 | * 1 = yes |
| 3723 | * @hide |
| 3724 | */ |
| 3725 | public static final String WINDOW_ORIENTATION_LISTENER_LOG = |
| 3726 | "window_orientation_listener_log"; |
| 3727 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3728 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3729 | public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3730 | |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3731 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3732 | * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} |
| 3733 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3734 | * @hide |
| 3735 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3736 | @Deprecated |
| 3737 | public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3738 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3739 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3740 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3741 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3742 | * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} |
| 3743 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3744 | * @hide |
| 3745 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3746 | @Deprecated |
| 3747 | public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3748 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3749 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 3750 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3751 | /** |
| 3752 | * Whether to play sounds when the keyguard is shown and dismissed. |
| 3753 | * @hide |
| 3754 | */ |
| 3755 | public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; |
| 3756 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3757 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3758 | public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3759 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3760 | /** |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3761 | * Whether the lockscreen should be completely disabled. |
| 3762 | * @hide |
| 3763 | */ |
| 3764 | public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; |
| 3765 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3766 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3767 | public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3768 | |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3769 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3770 | * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} |
| 3771 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3772 | * @hide |
| 3773 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3774 | @Deprecated |
| 3775 | public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3776 | |
| 3777 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3778 | * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} |
| 3779 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3780 | * @hide |
| 3781 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3782 | @Deprecated |
| 3783 | public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3784 | |
| 3785 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3786 | * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} |
| 3787 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3788 | * @hide |
| 3789 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3790 | @Deprecated |
| 3791 | public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3792 | |
| 3793 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3794 | * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} |
| 3795 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3796 | * @hide |
| 3797 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3798 | @Deprecated |
| 3799 | public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3800 | |
| 3801 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3802 | * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} |
| 3803 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3804 | * @hide |
| 3805 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3806 | @Deprecated |
| 3807 | public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3808 | |
| 3809 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3810 | * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} |
| 3811 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3812 | * @hide |
| 3813 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3814 | @Deprecated |
| 3815 | public static final String LOCK_SOUND = Global.LOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3816 | |
| 3817 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3818 | * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} |
| 3819 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3820 | * @hide |
| 3821 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3822 | @Deprecated |
| 3823 | public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3824 | |
| 3825 | /** |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3826 | * Receive incoming SIP calls? |
| 3827 | * 0 = no |
| 3828 | * 1 = yes |
| 3829 | * @hide |
| 3830 | */ |
| 3831 | public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; |
| 3832 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3833 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3834 | public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3835 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3836 | /** |
| 3837 | * Call Preference String. |
| 3838 | * "SIP_ALWAYS" : Always use SIP with network access |
| 3839 | * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3840 | * @hide |
| 3841 | */ |
| 3842 | public static final String SIP_CALL_OPTIONS = "sip_call_options"; |
| 3843 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3844 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3845 | public static final Validator SIP_CALL_OPTIONS_VALIDATOR = |
| 3846 | new SettingsValidators.DiscreteValueValidator( |
| 3847 | new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3848 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3849 | /** |
| 3850 | * One of the sip call options: Always use SIP with network access. |
| 3851 | * @hide |
| 3852 | */ |
| 3853 | public static final String SIP_ALWAYS = "SIP_ALWAYS"; |
| 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 SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3857 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3858 | /** |
| 3859 | * One of the sip call options: Only if destination is a SIP address. |
| 3860 | * @hide |
| 3861 | */ |
| 3862 | public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; |
| 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 SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3866 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3867 | /** |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3868 | * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that |
| 3869 | * the user should be prompted each time a call is made whether it should be placed using |
| 3870 | * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with |
| 3871 | * SIP_ADDRESS_ONLY. |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3872 | * @hide |
| 3873 | */ |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3874 | @Deprecated |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3875 | public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; |
| 3876 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3877 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3878 | public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3879 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3880 | /** |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3881 | * Pointer speed setting. |
| 3882 | * This is an integer value in a range between -7 and +7, so there are 15 possible values. |
| 3883 | * -7 = slowest |
| 3884 | * 0 = default speed |
| 3885 | * +7 = fastest |
| 3886 | * @hide |
| 3887 | */ |
| 3888 | public static final String POINTER_SPEED = "pointer_speed"; |
| 3889 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3890 | /** @hide */ |
| 3891 | public static final Validator POINTER_SPEED_VALIDATOR = |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3892 | new SettingsValidators.InclusiveFloatRangeValidator(-7, 7); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3893 | |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3894 | /** |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 3895 | * Whether lock-to-app will be triggered by long-press on recents. |
| 3896 | * @hide |
| 3897 | */ |
| 3898 | public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; |
| 3899 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3900 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3901 | public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3902 | |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 3903 | /** |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 3904 | * I am the lolrus. |
| 3905 | * <p> |
| 3906 | * Nonzero values indicate that the user has a bukkit. |
| 3907 | * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. |
| 3908 | * @hide |
| 3909 | */ |
| 3910 | public static final String EGG_MODE = "egg_mode"; |
| 3911 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3912 | /** @hide */ |
Svet Ganov | b1918a0 | 2015-05-15 09:32:55 -0700 | [diff] [blame] | 3913 | public static final Validator EGG_MODE_VALIDATOR = new Validator() { |
| 3914 | @Override |
| 3915 | public boolean validate(String value) { |
| 3916 | try { |
| 3917 | return Long.parseLong(value) >= 0; |
| 3918 | } catch (NumberFormatException e) { |
| 3919 | return false; |
| 3920 | } |
| 3921 | } |
| 3922 | }; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3923 | |
| 3924 | /** |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 3925 | * Setting to determine whether or not to show the battery percentage in the status bar. |
| 3926 | * 0 - Don't show percentage |
| 3927 | * 1 - Show percentage |
| 3928 | * @hide |
| 3929 | */ |
| 3930 | public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; |
| 3931 | |
| 3932 | /** @hide */ |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 3933 | private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR; |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 3934 | |
| 3935 | /** |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3936 | * IMPORTANT: If you add a new public settings you also have to add it to |
| 3937 | * PUBLIC_SETTINGS below. If the new setting is hidden you have to add |
| 3938 | * it to PRIVATE_SETTINGS below. Also add a validator that can validate |
| 3939 | * the setting value. See an example above. |
| 3940 | */ |
| 3941 | |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 3942 | /** |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3943 | * Settings to backup. This is here so that it's in the same place as the settings |
| 3944 | * keys and easy to update. |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 3945 | * |
| 3946 | * NOTE: Settings are backed up and restored in the order they appear |
| 3947 | * in this array. If you have one setting depending on another, |
| 3948 | * make sure that they are ordered appropriately. |
| 3949 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3950 | * @hide |
| 3951 | */ |
| 3952 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 3953 | STAY_ON_WHILE_PLUGGED_IN, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3954 | WIFI_USE_STATIC_IP, |
| 3955 | WIFI_STATIC_IP, |
| 3956 | WIFI_STATIC_GATEWAY, |
| 3957 | WIFI_STATIC_NETMASK, |
| 3958 | WIFI_STATIC_DNS1, |
| 3959 | WIFI_STATIC_DNS2, |
| 3960 | BLUETOOTH_DISCOVERABILITY, |
| 3961 | BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
Casey Burkhardt | 86b867f | 2015-12-29 18:03:36 -0800 | [diff] [blame] | 3962 | FONT_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3963 | DIM_SCREEN, |
| 3964 | SCREEN_OFF_TIMEOUT, |
| 3965 | SCREEN_BRIGHTNESS, |
Christopher Tate | 362aca6 | 2009-09-25 15:58:03 -0700 | [diff] [blame] | 3966 | SCREEN_BRIGHTNESS_MODE, |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3967 | SCREEN_AUTO_BRIGHTNESS_ADJ, |
Santos Cordon | bd9dd55 | 2017-02-13 13:37:45 -0800 | [diff] [blame] | 3968 | SCREEN_BRIGHTNESS_FOR_VR, |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3969 | VIBRATE_INPUT_DEVICES, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 3970 | MODE_RINGER_STREAMS_AFFECTED, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3971 | TEXT_AUTO_REPLACE, |
| 3972 | TEXT_AUTO_CAPS, |
| 3973 | TEXT_AUTO_PUNCTUATE, |
| 3974 | TEXT_SHOW_PASSWORD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 3975 | AUTO_TIME, // moved to global |
| 3976 | AUTO_TIME_ZONE, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3977 | TIME_12_24, |
| 3978 | DATE_FORMAT, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3979 | DTMF_TONE_WHEN_DIALING, |
| 3980 | DTMF_TONE_TYPE_WHEN_DIALING, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3981 | HEARING_AID, |
| 3982 | TTY_MODE, |
Christopher Tate | ea2d6e8 | 2016-05-19 16:55:49 -0700 | [diff] [blame] | 3983 | MASTER_MONO, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3984 | SOUND_EFFECTS_ENABLED, |
| 3985 | HAPTIC_FEEDBACK_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 3986 | POWER_SOUNDS_ENABLED, // moved to global |
| 3987 | DOCK_SOUNDS_ENABLED, // moved to global |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 3988 | LOCKSCREEN_SOUNDS_ENABLED, |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3989 | SHOW_WEB_SUGGESTIONS, |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3990 | SIP_CALL_OPTIONS, |
Nick Pelly | 038cabe | 2010-09-23 16:12:11 -0700 | [diff] [blame] | 3991 | SIP_RECEIVE_CALLS, |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3992 | POINTER_SPEED, |
Amith Yamasani | 622bf222 | 2013-09-06 13:54:28 -0700 | [diff] [blame] | 3993 | VIBRATE_WHEN_RINGING, |
| 3994 | RINGTONE, |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 3995 | LOCK_TO_APP_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 3996 | NOTIFICATION_SOUND, |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 3997 | ACCELEROMETER_ROTATION, |
| 3998 | SHOW_BATTERY_PERCENT |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3999 | }; |
| 4000 | |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4001 | /** |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4002 | * Keys we no longer back up under the current schema, but want to continue to |
| 4003 | * process when restoring historical backup datasets. |
| 4004 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4005 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 4006 | * otherwise they won't be restored. |
| 4007 | * |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4008 | * @hide |
| 4009 | */ |
| 4010 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 4011 | }; |
| 4012 | |
| 4013 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4014 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4015 | * |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4016 | * @hide |
| 4017 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4018 | public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); |
| 4019 | static { |
| 4020 | PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4021 | PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4022 | PUBLIC_SETTINGS.add(WIFI_STATIC_IP); |
| 4023 | PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); |
| 4024 | PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); |
| 4025 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); |
| 4026 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); |
| 4027 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); |
| 4028 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); |
| 4029 | PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); |
| 4030 | PUBLIC_SETTINGS.add(FONT_SCALE); |
| 4031 | PUBLIC_SETTINGS.add(DIM_SCREEN); |
| 4032 | PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); |
| 4033 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); |
| 4034 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); |
| 4035 | PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); |
| 4036 | PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); |
| 4037 | PUBLIC_SETTINGS.add(VIBRATE_ON); |
| 4038 | PUBLIC_SETTINGS.add(VOLUME_RING); |
| 4039 | PUBLIC_SETTINGS.add(VOLUME_SYSTEM); |
| 4040 | PUBLIC_SETTINGS.add(VOLUME_VOICE); |
| 4041 | PUBLIC_SETTINGS.add(VOLUME_MUSIC); |
| 4042 | PUBLIC_SETTINGS.add(VOLUME_ALARM); |
| 4043 | PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); |
| 4044 | PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); |
| 4045 | PUBLIC_SETTINGS.add(RINGTONE); |
| 4046 | PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); |
| 4047 | PUBLIC_SETTINGS.add(ALARM_ALERT); |
| 4048 | PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4049 | PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4050 | PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4051 | PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4052 | PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); |
| 4053 | PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); |
| 4054 | PUBLIC_SETTINGS.add(TIME_12_24); |
| 4055 | PUBLIC_SETTINGS.add(DATE_FORMAT); |
| 4056 | PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); |
| 4057 | PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); |
| 4058 | PUBLIC_SETTINGS.add(USER_ROTATION); |
| 4059 | PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); |
| 4060 | PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
| 4061 | PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4062 | PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); |
Svetoslav Ganov | d263163 | 2015-12-09 16:29:22 -0800 | [diff] [blame] | 4063 | PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4064 | } |
| 4065 | |
| 4066 | /** |
| 4067 | * These are all hidden system settings. |
| 4068 | * |
| 4069 | * @hide |
| 4070 | */ |
| 4071 | public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); |
| 4072 | static { |
| 4073 | PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4074 | PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4075 | PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); |
| 4076 | PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); |
| 4077 | PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); |
| 4078 | PRIVATE_SETTINGS.add(VOLUME_MASTER); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4079 | PRIVATE_SETTINGS.add(MASTER_MONO); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4080 | PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); |
| 4081 | PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); |
| 4082 | PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); |
| 4083 | PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4084 | PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); |
| 4085 | PRIVATE_SETTINGS.add(HEARING_AID); |
| 4086 | PRIVATE_SETTINGS.add(TTY_MODE); |
| 4087 | PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); |
| 4088 | PRIVATE_SETTINGS.add(POINTER_LOCATION); |
| 4089 | PRIVATE_SETTINGS.add(SHOW_TOUCHES); |
| 4090 | PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); |
| 4091 | PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); |
| 4092 | PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); |
| 4093 | PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); |
| 4094 | PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); |
| 4095 | PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); |
| 4096 | PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); |
| 4097 | PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); |
| 4098 | PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); |
| 4099 | PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); |
| 4100 | PRIVATE_SETTINGS.add(LOCK_SOUND); |
| 4101 | PRIVATE_SETTINGS.add(UNLOCK_SOUND); |
| 4102 | PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); |
| 4103 | PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); |
| 4104 | PRIVATE_SETTINGS.add(SIP_ALWAYS); |
| 4105 | PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); |
| 4106 | PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); |
| 4107 | PRIVATE_SETTINGS.add(POINTER_SPEED); |
| 4108 | PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); |
| 4109 | PRIVATE_SETTINGS.add(EGG_MODE); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4110 | PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 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 | * |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4116 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 4117 | * otherwise they won't be restored. |
| 4118 | * |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4119 | * @hide |
| 4120 | */ |
| 4121 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 4122 | static { |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4123 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 4124 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4125 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4126 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); |
| 4127 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
| 4128 | BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); |
| 4129 | VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); |
| 4130 | VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); |
| 4131 | VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); |
| 4132 | VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); |
| 4133 | VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 4134 | VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4135 | VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); |
| 4136 | VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); |
| 4137 | VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); |
| 4138 | VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4139 | VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); |
| 4140 | VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); |
| 4141 | VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); |
| 4142 | VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); |
| 4143 | VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); |
| 4144 | VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); |
| 4145 | VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4146 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 4147 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4148 | VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); |
| 4149 | VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); |
| 4150 | VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); |
| 4151 | VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); |
| 4152 | VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); |
| 4153 | VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); |
| 4154 | VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); |
| 4155 | VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); |
| 4156 | VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); |
| 4157 | VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 4158 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 4159 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4160 | VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); |
| 4161 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4162 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
| 4163 | VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); |
| 4164 | VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); |
| 4165 | VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4166 | VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4167 | VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); |
| 4168 | VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); |
| 4169 | VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); |
| 4170 | VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, |
| 4171 | HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); |
| 4172 | VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); |
| 4173 | VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); |
| 4174 | VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); |
| 4175 | VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); |
| 4176 | VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); |
| 4177 | VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); |
| 4178 | VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); |
| 4179 | VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, |
| 4180 | WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); |
| 4181 | VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); |
| 4182 | VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); |
| 4183 | VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); |
| 4184 | VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); |
| 4185 | VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); |
| 4186 | VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); |
| 4187 | VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); |
| 4188 | VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); |
| 4189 | VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); |
| 4190 | VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); |
| 4191 | VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); |
| 4192 | VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); |
| 4193 | VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); |
| 4194 | VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); |
| 4195 | VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4196 | VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4197 | } |
| 4198 | |
| 4199 | /** |
| 4200 | * These entries are considered common between the personal and the managed profile, |
| 4201 | * since the managed profile doesn't get to change them. |
| 4202 | */ |
| 4203 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
| 4204 | static { |
| 4205 | CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); |
| 4206 | CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); |
| 4207 | CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); |
| 4208 | CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); |
| 4209 | CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); |
| 4210 | } |
| 4211 | |
| 4212 | /** @hide */ |
| 4213 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 4214 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 4215 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4216 | |
| 4217 | /** |
Andre Lago | 3fa139c | 2016-08-04 13:53:44 +0100 | [diff] [blame] | 4218 | * These entries should be cloned from this profile's parent only if the dependency's |
| 4219 | * value is true ("1") |
| 4220 | * |
| 4221 | * Note: the dependencies must be Secure settings |
| 4222 | * |
| 4223 | * @hide |
| 4224 | */ |
| 4225 | public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); |
| 4226 | static { |
| 4227 | CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); |
| 4228 | CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); |
| 4229 | CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); |
| 4230 | } |
| 4231 | |
| 4232 | /** @hide */ |
| 4233 | public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { |
| 4234 | outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); |
| 4235 | } |
| 4236 | |
| 4237 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4238 | * System settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4239 | * @hide |
| 4240 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4241 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4242 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4243 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4244 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4245 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4246 | INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4247 | INSTANT_APP_SETTINGS.add(DATE_FORMAT); |
| 4248 | INSTANT_APP_SETTINGS.add(FONT_SCALE); |
| 4249 | INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4250 | INSTANT_APP_SETTINGS.add(TIME_12_24); |
| 4251 | INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 4252 | INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4253 | } |
| 4254 | |
| 4255 | /** |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4256 | * When to use Wi-Fi calling |
| 4257 | * |
| 4258 | * @see android.telephony.TelephonyManager.WifiCallingChoices |
| 4259 | * @hide |
| 4260 | */ |
| 4261 | public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; |
| 4262 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4263 | // Settings moved to Settings.Secure |
| 4264 | |
| 4265 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4266 | * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4267 | * instead |
| 4268 | */ |
| 4269 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4270 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4271 | |
| 4272 | /** |
| 4273 | * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead |
| 4274 | */ |
| 4275 | @Deprecated |
| 4276 | public static final String ANDROID_ID = Secure.ANDROID_ID; |
| 4277 | |
| 4278 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4279 | * @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] | 4280 | */ |
| 4281 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4282 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4283 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4284 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4285 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4286 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4287 | * @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] | 4288 | */ |
| 4289 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4290 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4291 | |
| 4292 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4293 | * @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] | 4294 | */ |
| 4295 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4296 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4297 | |
| 4298 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4299 | * @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] | 4300 | */ |
| 4301 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4302 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4303 | |
| 4304 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4305 | * @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] | 4306 | */ |
| 4307 | @Deprecated |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4308 | 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] | 4309 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4310 | /** |
| 4311 | * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} |
| 4312 | * instead |
| 4313 | */ |
| 4314 | @Deprecated |
| 4315 | public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; |
| 4316 | |
| 4317 | /** |
| 4318 | * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead |
| 4319 | */ |
| 4320 | @Deprecated |
| 4321 | public static final String LOGGING_ID = Secure.LOGGING_ID; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4322 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4323 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4324 | * @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] | 4325 | */ |
| 4326 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4327 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4328 | |
| 4329 | /** |
| 4330 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} |
| 4331 | * instead |
| 4332 | */ |
| 4333 | @Deprecated |
| 4334 | public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; |
| 4335 | |
| 4336 | /** |
| 4337 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} |
| 4338 | * instead |
| 4339 | */ |
| 4340 | @Deprecated |
| 4341 | public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; |
| 4342 | |
| 4343 | /** |
| 4344 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} |
| 4345 | * instead |
| 4346 | */ |
| 4347 | @Deprecated |
| 4348 | public static final String PARENTAL_CONTROL_REDIRECT_URL = |
| 4349 | Secure.PARENTAL_CONTROL_REDIRECT_URL; |
| 4350 | |
| 4351 | /** |
| 4352 | * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead |
| 4353 | */ |
| 4354 | @Deprecated |
| 4355 | public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; |
| 4356 | |
| 4357 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4358 | * @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] | 4359 | */ |
| 4360 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4361 | 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] | 4362 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4363 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 4364 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4365 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4366 | * @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] | 4367 | */ |
| 4368 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4369 | 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] | 4370 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4371 | /** |
| 4372 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4373 | * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4374 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4375 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4376 | 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] | 4377 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4378 | /** |
| 4379 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4380 | * {@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] | 4381 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4382 | @Deprecated |
| 4383 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4384 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4385 | |
| 4386 | /** |
| 4387 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4388 | * {@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] | 4389 | */ |
| 4390 | @Deprecated |
| 4391 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4392 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4393 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4394 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 4395 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 4396 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4397 | /** |
| 4398 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4399 | * {@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] | 4400 | */ |
| 4401 | @Deprecated |
| 4402 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4403 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4404 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4405 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 4406 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4407 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4408 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4409 | * @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] | 4410 | * instead |
| 4411 | */ |
| 4412 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4413 | 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] | 4414 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 4415 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 4416 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 4417 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4418 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4419 | * @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] | 4420 | */ |
| 4421 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4422 | public static final String WIFI_ON = Global.WIFI_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4423 | |
| 4424 | /** |
| 4425 | * @deprecated Use |
| 4426 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} |
| 4427 | * instead |
| 4428 | */ |
| 4429 | @Deprecated |
| 4430 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 4431 | Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; |
| 4432 | |
| 4433 | /** |
| 4434 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead |
| 4435 | */ |
| 4436 | @Deprecated |
| 4437 | public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; |
| 4438 | |
| 4439 | /** |
| 4440 | * @deprecated Use |
| 4441 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead |
| 4442 | */ |
| 4443 | @Deprecated |
| 4444 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 4445 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4446 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4447 | /** |
| 4448 | * @deprecated Use |
| 4449 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead |
| 4450 | */ |
| 4451 | @Deprecated |
| 4452 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 4453 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; |
| 4454 | |
| 4455 | /** |
| 4456 | * @deprecated Use |
| 4457 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} |
| 4458 | * instead |
| 4459 | */ |
| 4460 | @Deprecated |
| 4461 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 4462 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; |
| 4463 | |
| 4464 | /** |
| 4465 | * @deprecated Use |
| 4466 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead |
| 4467 | */ |
| 4468 | @Deprecated |
| 4469 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 4470 | Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; |
| 4471 | |
| 4472 | /** |
| 4473 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} |
| 4474 | * instead |
| 4475 | */ |
| 4476 | @Deprecated |
| 4477 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; |
| 4478 | |
| 4479 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4480 | * @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] | 4481 | */ |
| 4482 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4483 | 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] | 4484 | |
| 4485 | /** |
| 4486 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead |
| 4487 | */ |
| 4488 | @Deprecated |
| 4489 | public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; |
| 4490 | |
| 4491 | /** |
| 4492 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} |
| 4493 | * instead |
| 4494 | */ |
| 4495 | @Deprecated |
| 4496 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; |
| 4497 | |
| 4498 | /** |
| 4499 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} |
| 4500 | * instead |
| 4501 | */ |
| 4502 | @Deprecated |
| 4503 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = |
| 4504 | Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4505 | |
| 4506 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4507 | * Checks if the specified app can modify system settings. As of API |
| 4508 | * level 23, an app cannot modify system settings unless it declares the |
| 4509 | * {@link android.Manifest.permission#WRITE_SETTINGS} |
| 4510 | * permission in its manifest, <em>and</em> the user specifically grants |
| 4511 | * the app this capability. To prompt the user to grant this approval, |
| 4512 | * the app must send an intent with the action {@link |
| 4513 | * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes |
| 4514 | * the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4515 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4516 | * @param context App context. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4517 | * @return true if the calling app can write to system settings, false otherwise |
| 4518 | */ |
| 4519 | public static boolean canWrite(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 4520 | return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), |
| 4521 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4522 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4523 | } |
| 4524 | |
| 4525 | /** |
| 4526 | * Secure system settings, containing system preferences that applications |
| 4527 | * can read but are not allowed to write. These are for preferences that |
| 4528 | * the user must explicitly modify through the system UI or specialized |
| 4529 | * APIs for those values, not modified directly by applications. |
| 4530 | */ |
| 4531 | public static final class Secure extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 4532 | // NOTE: If you add new settings here, be sure to add them to |
| 4533 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. |
| 4534 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4535 | /** |
| 4536 | * The content:// style URL for this table |
| 4537 | */ |
| 4538 | public static final Uri CONTENT_URI = |
| 4539 | Uri.parse("content://" + AUTHORITY + "/secure"); |
| 4540 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4541 | private static final ContentProviderHolder sProviderHolder = |
| 4542 | new ContentProviderHolder(CONTENT_URI); |
| 4543 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 4544 | // Populated lazily, guarded by class object: |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4545 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4546 | CONTENT_URI, |
| 4547 | CALL_METHOD_GET_SECURE, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4548 | CALL_METHOD_PUT_SECURE, |
| 4549 | sProviderHolder); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4550 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4551 | private static ILockSettings sLockSettings = null; |
| 4552 | |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 4553 | private static boolean sIsSystemProcess; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4554 | private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4555 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4556 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4557 | MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4558 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); |
| 4559 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); |
| 4560 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4561 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4562 | MOVED_TO_GLOBAL = new HashSet<>(); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4563 | MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); |
| 4564 | MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); |
| 4565 | MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 4566 | MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4567 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); |
| 4568 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); |
| 4569 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); |
| 4570 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); |
| 4571 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); |
| 4572 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); |
| 4573 | MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); |
| 4574 | MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4575 | MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); |
| 4576 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); |
| 4577 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4578 | MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); |
| 4579 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); |
| 4580 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); |
| 4581 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); |
| 4582 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); |
| 4583 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); |
| 4584 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); |
| 4585 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4586 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); |
| 4587 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); |
| 4588 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); |
| 4589 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); |
| 4590 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); |
| 4591 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); |
| 4592 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); |
| 4593 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); |
| 4594 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); |
| 4595 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); |
| 4596 | MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); |
| 4597 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); |
| 4598 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); |
| 4599 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); |
| 4600 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); |
| 4601 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); |
| 4602 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); |
| 4603 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); |
| 4604 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); |
| 4605 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4606 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); |
| 4607 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); |
| 4608 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); |
| 4609 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); |
| 4610 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); |
| 4611 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4612 | MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); |
| 4613 | MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 4614 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4615 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); |
| 4616 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); |
| 4617 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); |
| 4618 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); |
| 4619 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); |
| 4620 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 4621 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 4622 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 4623 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); |
| 4624 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); |
| 4625 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); |
| 4626 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); |
| 4627 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 4628 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 4629 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); |
| 4630 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4631 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); |
| 4632 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4633 | MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 4634 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); |
| 4635 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); |
| 4636 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); |
| 4637 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); |
| 4638 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); |
| 4639 | MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4640 | MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4641 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); |
| 4642 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); |
| 4643 | MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); |
| 4644 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); |
| 4645 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); |
| 4646 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); |
| 4647 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); |
| 4648 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); |
| 4649 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); |
| 4650 | MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); |
| 4651 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); |
| 4652 | MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); |
| 4653 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); |
| 4654 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); |
| 4655 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); |
| 4656 | MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); |
| 4657 | MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); |
| 4658 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); |
| 4659 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); |
| 4660 | MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); |
| 4661 | MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); |
| 4662 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); |
| 4663 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); |
| 4664 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); |
| 4665 | MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); |
| 4666 | MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); |
| 4667 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); |
| 4668 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); |
| 4669 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); |
| 4670 | MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); |
| 4671 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 4672 | MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 4673 | MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4674 | } |
| 4675 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4676 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4677 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4678 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 4679 | } |
| 4680 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 4681 | /** @hide */ |
| 4682 | public static void clearProviderForTest() { |
| 4683 | sProviderHolder.clearProviderForTest(); |
| 4684 | sNameValueCache.clearGenerationTrackerForTest(); |
| 4685 | } |
| 4686 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4687 | /** |
| 4688 | * Look up a name in the database. |
| 4689 | * @param resolver to access the database with |
| 4690 | * @param name to look up in the table |
| 4691 | * @return the corresponding value, or null if not present |
| 4692 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4693 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4694 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 4695 | } |
| 4696 | |
| 4697 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4698 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4699 | int userHandle) { |
| 4700 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4701 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4702 | + " to android.provider.Settings.Global."); |
| 4703 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4704 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4705 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4706 | if (MOVED_TO_LOCK_SETTINGS.contains(name)) { |
| 4707 | synchronized (Secure.class) { |
| 4708 | if (sLockSettings == null) { |
| 4709 | sLockSettings = ILockSettings.Stub.asInterface( |
| 4710 | (IBinder) ServiceManager.getService("lock_settings")); |
| 4711 | sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; |
| 4712 | } |
| 4713 | } |
| 4714 | if (sLockSettings != null && !sIsSystemProcess) { |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 4715 | // No context; use the ActivityThread's context as an approximation for |
| 4716 | // determining the target API level. |
| 4717 | Application application = ActivityThread.currentApplication(); |
| 4718 | |
| 4719 | boolean isPreMnc = application != null |
| 4720 | && application.getApplicationInfo() != null |
| 4721 | && application.getApplicationInfo().targetSdkVersion |
| 4722 | <= VERSION_CODES.LOLLIPOP_MR1; |
| 4723 | if (isPreMnc) { |
| 4724 | try { |
| 4725 | return sLockSettings.getString(name, "0", userHandle); |
| 4726 | } catch (RemoteException re) { |
| 4727 | // Fall through |
| 4728 | } |
| 4729 | } else { |
| 4730 | throw new SecurityException("Settings.Secure." + name |
| 4731 | + " is deprecated and no longer accessible." |
| 4732 | + " See API documentation for potential replacements."); |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4733 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4734 | } |
| 4735 | } |
| 4736 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4737 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4738 | } |
| 4739 | |
| 4740 | /** |
| 4741 | * Store a name/value pair into the database. |
| 4742 | * @param resolver to access the database with |
| 4743 | * @param name to store |
| 4744 | * @param value to associate with the name |
| 4745 | * @return true if the value was set, false on database errors |
| 4746 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4747 | public static boolean putString(ContentResolver resolver, String name, String value) { |
| 4748 | return putStringForUser(resolver, name, value, UserHandle.myUserId()); |
| 4749 | } |
| 4750 | |
| 4751 | /** @hide */ |
| 4752 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 4753 | int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4754 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 4755 | } |
| 4756 | |
| 4757 | /** @hide */ |
| 4758 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 4759 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4760 | boolean makeDefault, @UserIdInt int userHandle) { |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4761 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4762 | // Map LOCATION_MODE to underlying location provider storage API |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4763 | return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); |
| 4764 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4765 | if (MOVED_TO_GLOBAL.contains(name)) { |
Robin Lee | 7af9a74 | 2017-02-20 14:47:30 +0000 | [diff] [blame] | 4766 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4767 | + " to android.provider.Settings.Global"); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4768 | return Global.putStringForUser(resolver, name, value, |
| 4769 | tag, makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4770 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4771 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 4772 | makeDefault, userHandle); |
| 4773 | } |
| 4774 | |
| 4775 | /** |
| 4776 | * Store a name/value pair into the database. |
| 4777 | * <p> |
| 4778 | * The method takes an optional tag to associate with the setting |
| 4779 | * which can be used to clear only settings made by your package and |
| 4780 | * associated with this tag by passing the tag to {@link |
| 4781 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 4782 | * the current tag. Also if another package changes the setting |
| 4783 | * then the tag will be set to the one specified in the set call |
| 4784 | * which can be null. Also any of the settings setters that do not |
| 4785 | * take a tag as an argument effectively clears the tag. |
| 4786 | * </p><p> |
| 4787 | * For example, if you set settings A and B with tags T1 and T2 and |
| 4788 | * another app changes setting A (potentially to the same value), it |
| 4789 | * can assign to it a tag T3 (note that now the package that changed |
| 4790 | * the setting is not yours). Now if you reset your changes for T1 and |
| 4791 | * T2 only setting B will be reset and A not (as it was changed by |
| 4792 | * another package) but since A did not change you are in the desired |
| 4793 | * initial state. Now if the other app changes the value of A (assuming |
| 4794 | * you registered an observer in the beginning) you would detect that |
| 4795 | * the setting was changed by another app and handle this appropriately |
| 4796 | * (ignore, set back to some value, etc). |
| 4797 | * </p><p> |
| 4798 | * Also the method takes an argument whether to make the value the |
| 4799 | * default for this setting. If the system already specified a default |
| 4800 | * value, then the one passed in here will <strong>not</strong> |
| 4801 | * be set as the default. |
| 4802 | * </p> |
| 4803 | * |
| 4804 | * @param resolver to access the database with. |
| 4805 | * @param name to store. |
| 4806 | * @param value to associate with the name. |
| 4807 | * @param tag to associate with the setting. |
| 4808 | * @param makeDefault whether to make the value the default one. |
| 4809 | * @return true if the value was set, false on database errors. |
| 4810 | * |
| 4811 | * @see #resetToDefaults(ContentResolver, String) |
| 4812 | * |
| 4813 | * @hide |
| 4814 | */ |
| 4815 | @SystemApi |
| 4816 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4817 | public static boolean putString(@NonNull ContentResolver resolver, |
| 4818 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4819 | boolean makeDefault) { |
| 4820 | return putStringForUser(resolver, name, value, tag, makeDefault, |
| 4821 | UserHandle.myUserId()); |
| 4822 | } |
| 4823 | |
| 4824 | /** |
| 4825 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 4826 | * settings set by the caller's package. Think of it of a way to undo your own |
| 4827 | * changes to the global settings. Passing in the optional tag will reset only |
| 4828 | * settings changed by your package and associated with this tag. |
| 4829 | * |
| 4830 | * @param resolver Handle to the content resolver. |
| 4831 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4832 | * |
| 4833 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 4834 | * |
| 4835 | * @hide |
| 4836 | */ |
| 4837 | @SystemApi |
| 4838 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4839 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 4840 | @Nullable String tag) { |
| 4841 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
| 4842 | UserHandle.myUserId()); |
| 4843 | } |
| 4844 | |
| 4845 | /** |
| 4846 | * |
| 4847 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 4848 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 4849 | * allowing resetting the settings made by a package and associated with the tag. |
| 4850 | * |
| 4851 | * @param resolver Handle to the content resolver. |
| 4852 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4853 | * @param mode The reset mode. |
| 4854 | * @param userHandle The user for which to reset to defaults. |
| 4855 | * |
| 4856 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 4857 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 4858 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 4859 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 4860 | * |
| 4861 | * @hide |
| 4862 | */ |
| 4863 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 4864 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 4865 | try { |
| 4866 | Bundle arg = new Bundle(); |
| 4867 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 4868 | if (tag != null) { |
| 4869 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 4870 | } |
| 4871 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 4872 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 4873 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); |
| 4874 | } catch (RemoteException e) { |
| 4875 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 4876 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4877 | } |
| 4878 | |
| 4879 | /** |
| 4880 | * Construct the content URI for a particular name/value pair, |
| 4881 | * useful for monitoring changes with a ContentObserver. |
| 4882 | * @param name to look up in the table |
| 4883 | * @return the corresponding content URI, or null if not present |
| 4884 | */ |
| 4885 | public static Uri getUriFor(String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4886 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4887 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4888 | + " to android.provider.Settings.Global, returning global URI."); |
| 4889 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 4890 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4891 | return getUriFor(CONTENT_URI, name); |
| 4892 | } |
| 4893 | |
| 4894 | /** |
| 4895 | * Convenience function for retrieving a single secure settings value |
| 4896 | * as an integer. Note that internally setting values are always |
| 4897 | * stored as strings; this function converts the string to an integer |
| 4898 | * for you. The default value will be returned if the setting is |
| 4899 | * not defined or not an integer. |
| 4900 | * |
| 4901 | * @param cr The ContentResolver to access. |
| 4902 | * @param name The name of the setting to retrieve. |
| 4903 | * @param def Value to return if the setting is not defined. |
| 4904 | * |
| 4905 | * @return The setting's current value, or 'def' if it is not defined |
| 4906 | * or not a valid integer. |
| 4907 | */ |
| 4908 | public static int getInt(ContentResolver cr, String name, int def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4909 | return getIntForUser(cr, name, def, UserHandle.myUserId()); |
| 4910 | } |
| 4911 | |
| 4912 | /** @hide */ |
| 4913 | 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] | 4914 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4915 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4916 | return getLocationModeForUser(cr, userHandle); |
| 4917 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4918 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4919 | try { |
| 4920 | return v != null ? Integer.parseInt(v) : def; |
| 4921 | } catch (NumberFormatException e) { |
| 4922 | return def; |
| 4923 | } |
| 4924 | } |
| 4925 | |
| 4926 | /** |
| 4927 | * Convenience function for retrieving a single secure settings value |
| 4928 | * as an integer. Note that internally setting values are always |
| 4929 | * stored as strings; this function converts the string to an integer |
| 4930 | * for you. |
| 4931 | * <p> |
| 4932 | * This version does not take a default value. If the setting has not |
| 4933 | * been set, or the string value is not a number, |
| 4934 | * it throws {@link SettingNotFoundException}. |
| 4935 | * |
| 4936 | * @param cr The ContentResolver to access. |
| 4937 | * @param name The name of the setting to retrieve. |
| 4938 | * |
| 4939 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 4940 | * name can't be found or the setting value is not an integer. |
| 4941 | * |
| 4942 | * @return The setting's current value. |
| 4943 | */ |
| 4944 | public static int getInt(ContentResolver cr, String name) |
| 4945 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4946 | return getIntForUser(cr, name, UserHandle.myUserId()); |
| 4947 | } |
| 4948 | |
| 4949 | /** @hide */ |
| 4950 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 4951 | throws SettingNotFoundException { |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4952 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4953 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4954 | return getLocationModeForUser(cr, userHandle); |
| 4955 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4956 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4957 | try { |
| 4958 | return Integer.parseInt(v); |
| 4959 | } catch (NumberFormatException e) { |
| 4960 | throw new SettingNotFoundException(name); |
| 4961 | } |
| 4962 | } |
| 4963 | |
| 4964 | /** |
| 4965 | * Convenience function for updating a single settings value as an |
| 4966 | * integer. This will either create a new entry in the table if the |
| 4967 | * given name does not exist, or modify the value of the existing row |
| 4968 | * with that name. Note that internally setting values are always |
| 4969 | * stored as strings, so this function converts the given value to a |
| 4970 | * string before storing it. |
| 4971 | * |
| 4972 | * @param cr The ContentResolver to access. |
| 4973 | * @param name The name of the setting to modify. |
| 4974 | * @param value The new value for the setting. |
| 4975 | * @return true if the value was set, false on database errors |
| 4976 | */ |
| 4977 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4978 | return putIntForUser(cr, name, value, UserHandle.myUserId()); |
| 4979 | } |
| 4980 | |
| 4981 | /** @hide */ |
| 4982 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 4983 | int userHandle) { |
| 4984 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4985 | } |
| 4986 | |
| 4987 | /** |
| 4988 | * Convenience function for retrieving a single secure settings value |
| 4989 | * as a {@code long}. Note that internally setting values are always |
| 4990 | * stored as strings; this function converts the string to a {@code long} |
| 4991 | * for you. The default value will be returned if the setting is |
| 4992 | * not defined or not a {@code long}. |
| 4993 | * |
| 4994 | * @param cr The ContentResolver to access. |
| 4995 | * @param name The name of the setting to retrieve. |
| 4996 | * @param def Value to return if the setting is not defined. |
| 4997 | * |
| 4998 | * @return The setting's current value, or 'def' if it is not defined |
| 4999 | * or not a valid {@code long}. |
| 5000 | */ |
| 5001 | public static long getLong(ContentResolver cr, String name, long def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5002 | return getLongForUser(cr, name, def, UserHandle.myUserId()); |
| 5003 | } |
| 5004 | |
| 5005 | /** @hide */ |
| 5006 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 5007 | int userHandle) { |
| 5008 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5009 | long value; |
| 5010 | try { |
| 5011 | value = valString != null ? Long.parseLong(valString) : def; |
| 5012 | } catch (NumberFormatException e) { |
| 5013 | value = def; |
| 5014 | } |
| 5015 | return value; |
| 5016 | } |
| 5017 | |
| 5018 | /** |
| 5019 | * Convenience function for retrieving a single secure settings value |
| 5020 | * as a {@code long}. Note that internally setting values are always |
| 5021 | * stored as strings; this function converts the string to a {@code long} |
| 5022 | * for you. |
| 5023 | * <p> |
| 5024 | * This version does not take a default value. If the setting has not |
| 5025 | * been set, or the string value is not a number, |
| 5026 | * it throws {@link SettingNotFoundException}. |
| 5027 | * |
| 5028 | * @param cr The ContentResolver to access. |
| 5029 | * @param name The name of the setting to retrieve. |
| 5030 | * |
| 5031 | * @return The setting's current value. |
| 5032 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5033 | * name can't be found or the setting value is not an integer. |
| 5034 | */ |
| 5035 | public static long getLong(ContentResolver cr, String name) |
| 5036 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5037 | return getLongForUser(cr, name, UserHandle.myUserId()); |
| 5038 | } |
| 5039 | |
| 5040 | /** @hide */ |
| 5041 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 5042 | throws SettingNotFoundException { |
| 5043 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5044 | try { |
| 5045 | return Long.parseLong(valString); |
| 5046 | } catch (NumberFormatException e) { |
| 5047 | throw new SettingNotFoundException(name); |
| 5048 | } |
| 5049 | } |
| 5050 | |
| 5051 | /** |
| 5052 | * Convenience function for updating a secure settings value as a long |
| 5053 | * integer. This will either create a new entry in the table if the |
| 5054 | * given name does not exist, or modify the value of the existing row |
| 5055 | * with that name. Note that internally setting values are always |
| 5056 | * stored as strings, so this function converts the given value to a |
| 5057 | * string before storing it. |
| 5058 | * |
| 5059 | * @param cr The ContentResolver to access. |
| 5060 | * @param name The name of the setting to modify. |
| 5061 | * @param value The new value for the setting. |
| 5062 | * @return true if the value was set, false on database errors |
| 5063 | */ |
| 5064 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5065 | return putLongForUser(cr, name, value, UserHandle.myUserId()); |
| 5066 | } |
| 5067 | |
| 5068 | /** @hide */ |
| 5069 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 5070 | int userHandle) { |
| 5071 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5072 | } |
| 5073 | |
| 5074 | /** |
| 5075 | * Convenience function for retrieving a single secure settings value |
| 5076 | * as a floating point number. Note that internally setting values are |
| 5077 | * always stored as strings; this function converts the string to an |
| 5078 | * float for you. The default value will be returned if the setting |
| 5079 | * is not defined or not a valid float. |
| 5080 | * |
| 5081 | * @param cr The ContentResolver to access. |
| 5082 | * @param name The name of the setting to retrieve. |
| 5083 | * @param def Value to return if the setting is not defined. |
| 5084 | * |
| 5085 | * @return The setting's current value, or 'def' if it is not defined |
| 5086 | * or not a valid float. |
| 5087 | */ |
| 5088 | public static float getFloat(ContentResolver cr, String name, float def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5089 | return getFloatForUser(cr, name, def, UserHandle.myUserId()); |
| 5090 | } |
| 5091 | |
| 5092 | /** @hide */ |
| 5093 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 5094 | int userHandle) { |
| 5095 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5096 | try { |
| 5097 | return v != null ? Float.parseFloat(v) : def; |
| 5098 | } catch (NumberFormatException e) { |
| 5099 | return def; |
| 5100 | } |
| 5101 | } |
| 5102 | |
| 5103 | /** |
| 5104 | * Convenience function for retrieving a single secure settings value |
| 5105 | * as a float. Note that internally setting values are always |
| 5106 | * stored as strings; this function converts the string to a float |
| 5107 | * for you. |
| 5108 | * <p> |
| 5109 | * This version does not take a default value. If the setting has not |
| 5110 | * been set, or the string value is not a number, |
| 5111 | * it throws {@link SettingNotFoundException}. |
| 5112 | * |
| 5113 | * @param cr The ContentResolver to access. |
| 5114 | * @param name The name of the setting to retrieve. |
| 5115 | * |
| 5116 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5117 | * name can't be found or the setting value is not a float. |
| 5118 | * |
| 5119 | * @return The setting's current value. |
| 5120 | */ |
| 5121 | public static float getFloat(ContentResolver cr, String name) |
| 5122 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5123 | return getFloatForUser(cr, name, UserHandle.myUserId()); |
| 5124 | } |
| 5125 | |
| 5126 | /** @hide */ |
| 5127 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 5128 | throws SettingNotFoundException { |
| 5129 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 5130 | if (v == null) { |
| 5131 | throw new SettingNotFoundException(name); |
| 5132 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5133 | try { |
| 5134 | return Float.parseFloat(v); |
| 5135 | } catch (NumberFormatException e) { |
| 5136 | throw new SettingNotFoundException(name); |
| 5137 | } |
| 5138 | } |
| 5139 | |
| 5140 | /** |
| 5141 | * Convenience function for updating a single settings value as a |
| 5142 | * floating point number. This will either create a new entry in the |
| 5143 | * table if the given name does not exist, or modify the value of the |
| 5144 | * existing row with that name. Note that internally setting values |
| 5145 | * are always stored as strings, so this function converts the given |
| 5146 | * value to a string before storing it. |
| 5147 | * |
| 5148 | * @param cr The ContentResolver to access. |
| 5149 | * @param name The name of the setting to modify. |
| 5150 | * @param value The new value for the setting. |
| 5151 | * @return true if the value was set, false on database errors |
| 5152 | */ |
| 5153 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5154 | return putFloatForUser(cr, name, value, UserHandle.myUserId()); |
| 5155 | } |
| 5156 | |
| 5157 | /** @hide */ |
| 5158 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 5159 | int userHandle) { |
| 5160 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5161 | } |
| 5162 | |
| 5163 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5164 | * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} |
| 5165 | * instead |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5166 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5167 | @Deprecated |
| 5168 | public static final String DEVELOPMENT_SETTINGS_ENABLED = |
| 5169 | Global.DEVELOPMENT_SETTINGS_ENABLED; |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5170 | |
| 5171 | /** |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5172 | * When the user has enable the option to have a "bug report" command |
| 5173 | * in the power menu. |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5174 | * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5175 | * @hide |
| 5176 | */ |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5177 | @Deprecated |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5178 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 5179 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5180 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5181 | |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5182 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5183 | * @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] | 5184 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5185 | @Deprecated |
| 5186 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5187 | |
| 5188 | /** |
| 5189 | * Setting to allow mock locations and location provider status to be injected into the |
| 5190 | * LocationManager service for testing purposes during application development. These |
| 5191 | * locations and status values override actual location and status information generated |
| 5192 | * by network, gps, or other location providers. |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5193 | * |
| 5194 | * @deprecated This settings is not used anymore. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5195 | */ |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5196 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5197 | public static final String ALLOW_MOCK_LOCATION = "mock_location"; |
| 5198 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5199 | private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5200 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5201 | /** |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5202 | * On Android 8.0 (API level 26) and higher versions of the platform, |
| 5203 | * a 64-bit number (expressed as a hexadecimal string), unique to |
| 5204 | * each combination of app-signing key, user, and device. |
| 5205 | * Values of {@code ANDROID_ID} are scoped by signing key and user. |
| 5206 | * The value may change if a factory reset is performed on the |
| 5207 | * device or if an APK signing key changes. |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5208 | * |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5209 | * For more information about how the platform handles {@code ANDROID_ID} |
| 5210 | * in Android 8.0 (API level 26) and higher, see <a |
| 5211 | * href="{@docRoot}preview/behavior-changes.html#privacy-all"> |
| 5212 | * Android 8.0 Behavior Changes</a>. |
| 5213 | * |
| 5214 | * <p class="note"><strong>Note:</strong> For apps that were installed |
| 5215 | * prior to updating the device to a version of Android 8.0 |
| 5216 | * (API level 26) or higher, the value of {@code ANDROID_ID} changes |
| 5217 | * if the app is uninstalled and then reinstalled after the OTA. |
| 5218 | * To preserve values across uninstalls after an OTA to Android 8.0 |
| 5219 | * or higher, developers can use |
| 5220 | * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> |
| 5221 | * Key/Value Backup</a>.</p> |
| 5222 | * |
| 5223 | * <p>In versions of the platform lower than Android 8.0 (API level 26), |
| 5224 | * a 64-bit number (expressed as a hexadecimal string) that is randomly |
| 5225 | * generated when the user first sets up the device and should remain |
| 5226 | * constant for the lifetime of the user's device. |
| 5227 | * |
| 5228 | * On devices that have |
| 5229 | * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> |
| 5230 | * multiple users</a>, each user appears as a |
| 5231 | * completely separate device, so the {@code ANDROID_ID} value is |
| 5232 | * unique to each user.</p> |
| 5233 | * |
| 5234 | * <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] | 5235 | * to the Instant App, it is generated when the Instant App is first installed and reset if |
| 5236 | * the user clears the Instant App. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5237 | */ |
| 5238 | public static final String ANDROID_ID = "android_id"; |
| 5239 | |
| 5240 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5241 | * @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] | 5242 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5243 | @Deprecated |
| 5244 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5245 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5246 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5247 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5248 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5249 | * @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] | 5250 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 5251 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5252 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5253 | |
| 5254 | /** |
| 5255 | * Setting to record the input method used by default, holding the ID |
| 5256 | * of the desired method. |
| 5257 | */ |
| 5258 | public static final String DEFAULT_INPUT_METHOD = "default_input_method"; |
| 5259 | |
| 5260 | /** |
satok | ab751aa | 2010-09-14 19:17:36 +0900 | [diff] [blame] | 5261 | * Setting to record the input method subtype used by default, holding the ID |
| 5262 | * of the desired method. |
| 5263 | */ |
| 5264 | public static final String SELECTED_INPUT_METHOD_SUBTYPE = |
| 5265 | "selected_input_method_subtype"; |
| 5266 | |
| 5267 | /** |
satok | 723a27e | 2010-11-11 14:58:11 +0900 | [diff] [blame] | 5268 | * Setting to record the history of input method subtype, holding the pair of ID of IME |
| 5269 | * and its last used subtype. |
| 5270 | * @hide |
| 5271 | */ |
| 5272 | public static final String INPUT_METHODS_SUBTYPE_HISTORY = |
| 5273 | "input_methods_subtype_history"; |
| 5274 | |
| 5275 | /** |
satok | 5c58dfc | 2010-12-14 21:54:47 +0900 | [diff] [blame] | 5276 | * Setting to record the visibility of input method selector |
| 5277 | */ |
| 5278 | public static final String INPUT_METHOD_SELECTOR_VISIBILITY = |
| 5279 | "input_method_selector_visibility"; |
| 5280 | |
| 5281 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5282 | * The currently selected voice interaction service flattened ComponentName. |
| 5283 | * @hide |
| 5284 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 5285 | @TestApi |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5286 | public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; |
| 5287 | |
| 5288 | /** |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5289 | * The currently selected autofill service flattened ComponentName. |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5290 | * @hide |
| 5291 | */ |
| 5292 | @TestApi |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5293 | public static final String AUTOFILL_SERVICE = "autofill_service"; |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5294 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5295 | private static final Validator AUTOFILL_SERVICE_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 5296 | |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5297 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5298 | * Boolean indicating if Autofill supports field classification. |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5299 | * |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5300 | * @see android.service.autofill.AutofillService |
| 5301 | * |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5302 | * @hide |
| 5303 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5304 | @SystemApi |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5305 | @TestApi |
Felipe Leme | 329d040 | 2017-12-06 09:22:43 -0800 | [diff] [blame] | 5306 | public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = |
| 5307 | "autofill_field_classification"; |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5308 | |
| 5309 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5310 | * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5311 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5312 | * @hide |
| 5313 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5314 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5315 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5316 | public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = |
| 5317 | "autofill_user_data_max_user_data_size"; |
| 5318 | |
| 5319 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5320 | * Defines value returned by |
| 5321 | * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5322 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5323 | * @hide |
| 5324 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5325 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5326 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5327 | public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = |
| 5328 | "autofill_user_data_max_field_classification_size"; |
| 5329 | |
| 5330 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5331 | * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5332 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5333 | * @hide |
| 5334 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5335 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5336 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5337 | public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = |
| 5338 | "autofill_user_data_max_value_length"; |
| 5339 | |
| 5340 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5341 | * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5342 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5343 | * @hide |
| 5344 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5345 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5346 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5347 | public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = |
| 5348 | "autofill_user_data_min_value_length"; |
| 5349 | |
| 5350 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5351 | * @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] | 5352 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5353 | @Deprecated |
| 5354 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5355 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5356 | /** |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5357 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5358 | * @hide |
| 5359 | */ |
Felipe Leme | 9923012 | 2017-06-12 14:33:02 -0700 | [diff] [blame] | 5360 | @TestApi |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5361 | public static final String USER_SETUP_COMPLETE = "user_setup_complete"; |
| 5362 | |
| 5363 | /** |
Sujith Ramakrishnan | 314df16 | 2017-06-16 18:03:18 -0700 | [diff] [blame] | 5364 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5365 | * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 |
| 5366 | * in case SetupWizard has been re-enabled on TV devices. |
| 5367 | * |
| 5368 | * @hide |
| 5369 | */ |
| 5370 | public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; |
| 5371 | |
| 5372 | /** |
Ido Ofir | d193c67 | 2016-03-01 13:27:54 -0800 | [diff] [blame] | 5373 | * Prefix for category name that marks whether a suggested action from that category was |
| 5374 | * completed. |
| 5375 | * @hide |
| 5376 | */ |
| 5377 | public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; |
| 5378 | |
| 5379 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5380 | * List of input methods that are currently enabled. This is a string |
| 5381 | * containing the IDs of all enabled input methods, each ID separated |
| 5382 | * by ':'. |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5383 | * |
| 5384 | * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" |
| 5385 | * where imeId is ComponentName and subtype is int32. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5386 | */ |
| 5387 | public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5388 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5389 | private static final Validator ENABLED_INPUT_METHODS_VALIDATOR = new Validator() { |
| 5390 | @Override |
| 5391 | public boolean validate(String value) { |
| 5392 | if (value == null) { |
| 5393 | return false; |
| 5394 | } |
| 5395 | String[] inputMethods = value.split(":"); |
| 5396 | boolean valid = true; |
| 5397 | for (String inputMethod : inputMethods) { |
| 5398 | if (inputMethod.length() == 0) { |
| 5399 | return false; |
| 5400 | } |
| 5401 | String[] subparts = inputMethod.split(";"); |
| 5402 | for (String subpart : subparts) { |
| 5403 | // allow either a non negative integer or a ComponentName |
| 5404 | valid |= (NON_NEGATIVE_INTEGER_VALIDATOR.validate(subpart) |
| 5405 | || COMPONENT_NAME_VALIDATOR.validate(subpart)); |
| 5406 | } |
| 5407 | if (!valid) { |
| 5408 | return false; |
| 5409 | } |
| 5410 | } |
| 5411 | return valid; |
| 5412 | } |
| 5413 | }; |
| 5414 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5415 | /** |
Amith Yamasani | e861ec1 | 2010-03-24 21:39:27 -0700 | [diff] [blame] | 5416 | * List of system input methods that are currently disabled. This is a string |
| 5417 | * containing the IDs of all disabled input methods, each ID separated |
| 5418 | * by ':'. |
| 5419 | * @hide |
| 5420 | */ |
| 5421 | public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; |
| 5422 | |
| 5423 | /** |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5424 | * Whether to show the IME when a hard keyboard is connected. This is a boolean that |
| 5425 | * determines if the IME should be shown when a hard keyboard is attached. |
| 5426 | * @hide |
| 5427 | */ |
| 5428 | public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; |
| 5429 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5430 | private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5431 | |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5432 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5433 | * Host name and port for global http proxy. Uses ':' seperator for |
| 5434 | * between host and port. |
| 5435 | * |
| 5436 | * @deprecated Use {@link Global#HTTP_PROXY} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5437 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5438 | @Deprecated |
| 5439 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
Robert Greenwalt | e90aa5e | 2010-09-01 11:34:05 -0700 | [diff] [blame] | 5440 | |
| 5441 | /** |
Robin Lee | 244ce8e | 2016-01-05 18:03:46 +0000 | [diff] [blame] | 5442 | * Package designated as always-on VPN provider. |
| 5443 | * |
| 5444 | * @hide |
| 5445 | */ |
| 5446 | public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; |
| 5447 | |
| 5448 | /** |
Robin Lee | 17e6183 | 2016-05-09 13:46:28 +0100 | [diff] [blame] | 5449 | * Whether to block networking outside of VPN connections while always-on is set. |
| 5450 | * @see #ALWAYS_ON_VPN_APP |
| 5451 | * |
| 5452 | * @hide |
| 5453 | */ |
| 5454 | public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; |
| 5455 | |
| 5456 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5457 | * Whether applications can be installed for this user via the system's |
| 5458 | * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. |
| 5459 | * |
| 5460 | * <p>1 = permit app installation via the system package installer intent |
| 5461 | * <p>0 = do not allow use of the package installer |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5462 | * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use |
| 5463 | * {@link PackageManager#canRequestPackageInstalls()} |
| 5464 | * @see PackageManager#canRequestPackageInstalls() |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5465 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5466 | public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5467 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5468 | /** |
Suprabh Shukla | 0b1356f | 2017-02-21 14:33:50 -0800 | [diff] [blame] | 5469 | * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that |
| 5470 | * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it |
| 5471 | * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} |
| 5472 | * on behalf of the profile owner if needed to make the change transparent for profile |
| 5473 | * owners. |
| 5474 | * |
| 5475 | * @hide |
| 5476 | */ |
| 5477 | public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = |
| 5478 | "unknown_sources_default_reversed"; |
| 5479 | |
| 5480 | /** |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5481 | * Comma-separated list of location providers that activities may access. Do not rely on |
| 5482 | * this value being present in settings.db or on ContentObserver notifications on the |
| 5483 | * corresponding Uri. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5484 | * |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5485 | * @deprecated use {@link #LOCATION_MODE} and |
| 5486 | * {@link LocationManager#MODE_CHANGED_ACTION} (or |
| 5487 | * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5488 | */ |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5489 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5490 | public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5491 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5492 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5493 | * The degree of location access enabled by the user. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5494 | * <p> |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5495 | * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link |
| 5496 | * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link |
| 5497 | * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link |
| 5498 | * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location |
| 5499 | * modes that might be added in the future. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5500 | * <p> |
| 5501 | * Note: do not rely on this value being present in settings.db or on ContentObserver |
| 5502 | * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} |
| 5503 | * to receive changes in this value. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5504 | * |
| 5505 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5506 | * get the status of a location provider, use |
| 5507 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5508 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5509 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5510 | public static final String LOCATION_MODE = "location_mode"; |
| 5511 | |
| 5512 | /** |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 5513 | * The App or module that changes the location mode. |
| 5514 | * @hide |
| 5515 | */ |
| 5516 | public static final String LOCATION_CHANGER = "location_changer"; |
| 5517 | /** |
| 5518 | * The location changer is unknown or unable to detect. |
| 5519 | * @hide |
| 5520 | */ |
| 5521 | public static final int LOCATION_CHANGER_UNKNOWN = 0; |
| 5522 | /** |
| 5523 | * Location settings in system settings. |
| 5524 | * @hide |
| 5525 | */ |
| 5526 | public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; |
| 5527 | /** |
| 5528 | * The location icon in drop down notification drawer. |
| 5529 | * @hide |
| 5530 | */ |
| 5531 | public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; |
| 5532 | |
| 5533 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5534 | * Location access disabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5535 | * |
| 5536 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5537 | * get the status of a location provider, use |
| 5538 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5539 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5540 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5541 | public static final int LOCATION_MODE_OFF = 0; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5542 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5543 | /** |
| 5544 | * Network Location Provider disabled, but GPS and other sensors enabled. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5545 | * |
| 5546 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5547 | * get the status of a location provider, use |
| 5548 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5549 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5550 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5551 | public static final int LOCATION_MODE_SENSORS_ONLY = 1; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5552 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5553 | /** |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 5554 | * Reduced power usage, such as limiting the number of GPS updates per hour. Requests |
| 5555 | * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to |
| 5556 | * {@link android.location.Criteria#POWER_MEDIUM}. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5557 | * |
| 5558 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5559 | * get the status of a location provider, use |
| 5560 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5561 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5562 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5563 | public static final int LOCATION_MODE_BATTERY_SAVING = 2; |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5564 | |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5565 | /** |
| 5566 | * Best-effort location computation allowed. |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5567 | * |
| 5568 | * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To |
| 5569 | * get the status of a location provider, use |
| 5570 | * {@link LocationManager#isProviderEnabled(String)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5571 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 5572 | @Deprecated |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5573 | public static final int LOCATION_MODE_HIGH_ACCURACY = 3; |
| 5574 | |
| 5575 | /** |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5576 | * A flag containing settings used for biometric weak |
| 5577 | * @hide |
| 5578 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5579 | @Deprecated |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5580 | public static final String LOCK_BIOMETRIC_WEAK_FLAGS = |
| 5581 | "lock_biometric_weak_flags"; |
| 5582 | |
| 5583 | /** |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 5584 | * Whether lock-to-app will lock the keyguard when exiting. |
| 5585 | * @hide |
| 5586 | */ |
| 5587 | public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; |
| 5588 | |
| 5589 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5590 | * Whether autolock is enabled (0 = false, 1 = true) |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5591 | * |
| 5592 | * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5593 | * 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] | 5594 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5595 | */ |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5596 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5597 | public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; |
| 5598 | |
| 5599 | /** |
| 5600 | * Whether lock pattern is visible as user enters (0 = false, 1 = true) |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5601 | * |
| 5602 | * @deprecated Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5603 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5604 | */ |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5605 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5606 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 5607 | |
| 5608 | /** |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5609 | * Whether lock pattern will vibrate as user enters (0 = false, 1 = |
| 5610 | * true) |
| 5611 | * |
| 5612 | * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the |
| 5613 | * lockscreen uses |
| 5614 | * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5615 | * Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5616 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5617 | */ |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5618 | @Deprecated |
| 5619 | public static final String |
| 5620 | LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5621 | |
| 5622 | /** |
Jim Miller | bc4603b | 2010-08-30 21:21:34 -0700 | [diff] [blame] | 5623 | * This preference allows the device to be locked given time after screen goes off, |
| 5624 | * subject to current DeviceAdmin policy limits. |
| 5625 | * @hide |
| 5626 | */ |
| 5627 | public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; |
| 5628 | |
| 5629 | |
| 5630 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5631 | * This preference contains the string that shows for owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5632 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5633 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5634 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5635 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5636 | public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; |
| 5637 | |
| 5638 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5639 | * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5640 | * @hide |
| 5641 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5642 | @Deprecated |
Michael Jurka | aa2859a | 2012-10-24 12:46:49 -0700 | [diff] [blame] | 5643 | public static final String LOCK_SCREEN_APPWIDGET_IDS = |
| 5644 | "lock_screen_appwidget_ids"; |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5645 | |
| 5646 | /** |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5647 | * Id of the appwidget shown on the lock screen when appwidgets are disabled. |
| 5648 | * @hide |
| 5649 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5650 | @Deprecated |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5651 | public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = |
| 5652 | "lock_screen_fallback_appwidget_id"; |
| 5653 | |
| 5654 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5655 | * Index of the lockscreen appwidget to restore, -1 if none. |
| 5656 | * @hide |
| 5657 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5658 | @Deprecated |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5659 | public static final String LOCK_SCREEN_STICKY_APPWIDGET = |
| 5660 | "lock_screen_sticky_appwidget"; |
| 5661 | |
| 5662 | /** |
| 5663 | * This preference enables showing the owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5664 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5665 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5666 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5667 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5668 | public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = |
| 5669 | "lock_screen_owner_info_enabled"; |
| 5670 | |
| 5671 | /** |
Dan Sandler | 5d7c3cc | 2014-02-18 17:35:15 -0500 | [diff] [blame] | 5672 | * When set by a user, allows notifications to be shown atop a securely locked screen |
| 5673 | * in their full "private" form (same as when the device is unlocked). |
Dan Sandler | fd16d56 | 2014-02-13 18:43:31 -0800 | [diff] [blame] | 5674 | * @hide |
| 5675 | */ |
| 5676 | public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = |
| 5677 | "lock_screen_allow_private_notifications"; |
| 5678 | |
| 5679 | /** |
Adrian Roos | 3aec638 | 2016-02-05 14:19:01 -0800 | [diff] [blame] | 5680 | * When set by a user, allows notification remote input atop a securely locked screen |
| 5681 | * without having to unlock |
| 5682 | * @hide |
| 5683 | */ |
| 5684 | public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = |
| 5685 | "lock_screen_allow_remote_input"; |
| 5686 | |
| 5687 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 5688 | * Set by the system to track if the user needs to see the call to action for |
| 5689 | * the lockscreen notification policy. |
| 5690 | * @hide |
| 5691 | */ |
| 5692 | public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = |
| 5693 | "show_note_about_notification_hiding"; |
| 5694 | |
| 5695 | /** |
Adrian Roos | 3870d45 | 2014-09-05 18:22:28 +0200 | [diff] [blame] | 5696 | * Set to 1 by the system after trust agents have been initialized. |
| 5697 | * @hide |
| 5698 | */ |
| 5699 | public static final String TRUST_AGENTS_INITIALIZED = |
| 5700 | "trust_agents_initialized"; |
| 5701 | |
| 5702 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5703 | * The Logging ID (a unique 64-bit value) as a hex string. |
| 5704 | * Used as a pseudonymous identifier for logging. |
| 5705 | * @deprecated This identifier is poorly initialized and has |
| 5706 | * many collisions. It should not be used. |
| 5707 | */ |
| 5708 | @Deprecated |
| 5709 | public static final String LOGGING_ID = "logging_id"; |
| 5710 | |
| 5711 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5712 | * @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] | 5713 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5714 | @Deprecated |
| 5715 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5716 | |
| 5717 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5718 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5719 | */ |
| 5720 | public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5721 | |
| 5722 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5723 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5724 | */ |
| 5725 | public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5726 | |
| 5727 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5728 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5729 | */ |
| 5730 | public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5731 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5732 | /** |
| 5733 | * Settings classname to launch when Settings is clicked from All |
| 5734 | * Applications. Needed because of user testing between the old |
| 5735 | * and new Settings apps. |
| 5736 | */ |
| 5737 | // TODO: 881807 |
| 5738 | public static final String SETTINGS_CLASSNAME = "settings_classname"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5739 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5740 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5741 | * @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] | 5742 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5743 | @Deprecated |
| 5744 | 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] | 5745 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 5746 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5747 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5748 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5749 | * @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] | 5750 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5751 | @Deprecated |
| 5752 | public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5753 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5754 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5755 | * If accessibility is enabled. |
| 5756 | */ |
| 5757 | public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; |
| 5758 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5759 | private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5760 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5761 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5762 | * Setting specifying if the accessibility shortcut is enabled. |
| 5763 | * @hide |
| 5764 | */ |
| 5765 | public static final String ACCESSIBILITY_SHORTCUT_ENABLED = |
| 5766 | "accessibility_shortcut_enabled"; |
| 5767 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5768 | private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5769 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5770 | /** |
| 5771 | * Setting specifying if the accessibility shortcut is enabled. |
| 5772 | * @hide |
| 5773 | */ |
| 5774 | public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = |
| 5775 | "accessibility_shortcut_on_lock_screen"; |
| 5776 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5777 | private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR = |
| 5778 | BOOLEAN_VALIDATOR; |
| 5779 | |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5780 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5781 | * Setting specifying if the accessibility shortcut dialog has been shown to this user. |
| 5782 | * @hide |
| 5783 | */ |
| 5784 | public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = |
| 5785 | "accessibility_shortcut_dialog_shown"; |
| 5786 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5787 | private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR = |
| 5788 | BOOLEAN_VALIDATOR; |
| 5789 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5790 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5791 | * Setting specifying the accessibility service to be toggled via the accessibility |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5792 | * shortcut. Must be its flattened {@link ComponentName}. |
| 5793 | * @hide |
| 5794 | */ |
| 5795 | public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = |
| 5796 | "accessibility_shortcut_target_service"; |
| 5797 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5798 | private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR = |
| 5799 | COMPONENT_NAME_VALIDATOR; |
| 5800 | |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5801 | /** |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5802 | * Setting specifying the accessibility service or feature to be toggled via the |
| 5803 | * accessibility button in the navigation bar. This is either a flattened |
| 5804 | * {@link ComponentName} or the class name of a system class implementing a supported |
| 5805 | * accessibility feature. |
| 5806 | * @hide |
| 5807 | */ |
| 5808 | public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = |
| 5809 | "accessibility_button_target_component"; |
| 5810 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5811 | private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR = |
| 5812 | new Validator() { |
| 5813 | @Override |
| 5814 | public boolean validate(String value) { |
| 5815 | // technically either ComponentName or class name, but there's proper value |
| 5816 | // validation at callsites, so allow any non-null string |
| 5817 | return value != null; |
| 5818 | } |
| 5819 | }; |
| 5820 | |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5821 | /** |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5822 | * If touch exploration is enabled. |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5823 | */ |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5824 | public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5825 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5826 | private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5827 | |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5828 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5829 | * List of the enabled accessibility providers. |
| 5830 | */ |
| 5831 | public static final String ENABLED_ACCESSIBILITY_SERVICES = |
| 5832 | "enabled_accessibility_services"; |
| 5833 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5834 | private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5835 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5836 | |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5837 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 5838 | * List of the accessibility services to which the user has granted |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5839 | * permission to put the device into touch exploration mode. |
| 5840 | * |
| 5841 | * @hide |
| 5842 | */ |
| 5843 | public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = |
| 5844 | "touch_exploration_granted_accessibility_services"; |
| 5845 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5846 | private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR = |
| 5847 | new SettingsValidators.ComponentNameListValidator(":"); |
| 5848 | |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5849 | /** |
Lucas Dupin | 6bd8601 | 2017-12-05 17:58:57 -0800 | [diff] [blame] | 5850 | * Uri of the slice that's presented on the keyguard. |
| 5851 | * Defaults to a slice with the date and next alarm. |
| 5852 | * |
| 5853 | * @hide |
| 5854 | */ |
| 5855 | public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; |
| 5856 | |
| 5857 | /** |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5858 | * Whether to speak passwords while in accessibility mode. |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5859 | * |
| 5860 | * @deprecated The speaking of passwords is controlled by individual accessibility services. |
| 5861 | * Apps should ignore this setting and provide complete information to accessibility |
| 5862 | * 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] | 5863 | */ |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5864 | @Deprecated |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5865 | public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; |
| 5866 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5867 | private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; |
| 5868 | |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5869 | /** |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 5870 | * Whether to draw text with high contrast while in accessibility mode. |
| 5871 | * |
| 5872 | * @hide |
| 5873 | */ |
| 5874 | public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = |
| 5875 | "high_text_contrast_enabled"; |
| 5876 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5877 | private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR = |
| 5878 | BOOLEAN_VALIDATOR; |
| 5879 | |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 5880 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5881 | * Setting that specifies whether the display magnification is enabled via a system-wide |
| 5882 | * triple tap gesture. Display magnifications allows the user to zoom in the display content |
| 5883 | * and is targeted to low vision users. The current magnification scale is controlled by |
| 5884 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5885 | * |
| 5886 | * @hide |
| 5887 | */ |
Eugene Susla | a55f74e | 2017-09-21 13:48:50 -0700 | [diff] [blame] | 5888 | @TestApi |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5889 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = |
| 5890 | "accessibility_display_magnification_enabled"; |
| 5891 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5892 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR = |
| 5893 | BOOLEAN_VALIDATOR; |
| 5894 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5895 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5896 | * Setting that specifies whether the display magnification is enabled via a shortcut |
| 5897 | * affordance within the system's navigation area. Display magnifications allows the user to |
| 5898 | * zoom in the display content and is targeted to low vision users. The current |
| 5899 | * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
| 5900 | * |
| 5901 | * @hide |
| 5902 | */ |
| 5903 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = |
| 5904 | "accessibility_display_magnification_navbar_enabled"; |
| 5905 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5906 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR |
| 5907 | = BOOLEAN_VALIDATOR; |
| 5908 | |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5909 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5910 | * Setting that specifies what the display magnification scale is. |
| 5911 | * Display magnifications allows the user to zoom in the display |
| 5912 | * content and is targeted to low vision users. Whether a display |
| 5913 | * magnification is performed is controlled by |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5914 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and |
| 5915 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5916 | * |
| 5917 | * @hide |
| 5918 | */ |
| 5919 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = |
| 5920 | "accessibility_display_magnification_scale"; |
| 5921 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5922 | private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR = |
| 5923 | new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE); |
| 5924 | |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5925 | /** |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 5926 | * Unused mangnification setting |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5927 | * |
| 5928 | * @hide |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 5929 | * @deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5930 | */ |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 5931 | @Deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5932 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = |
| 5933 | "accessibility_display_magnification_auto_update"; |
| 5934 | |
| 5935 | /** |
Anna Galusza | 9b27811 | 2016-01-04 11:37:37 -0800 | [diff] [blame] | 5936 | * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be |
| 5937 | * modified from an AccessibilityService using the SoftKeyboardController. |
| 5938 | * |
| 5939 | * @hide |
| 5940 | */ |
| 5941 | public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = |
| 5942 | "accessibility_soft_keyboard_mode"; |
| 5943 | |
| 5944 | /** |
| 5945 | * Default soft keyboard behavior. |
| 5946 | * |
| 5947 | * @hide |
| 5948 | */ |
| 5949 | public static final int SHOW_MODE_AUTO = 0; |
| 5950 | |
| 5951 | /** |
| 5952 | * Soft keyboard is never shown. |
| 5953 | * |
| 5954 | * @hide |
| 5955 | */ |
| 5956 | public static final int SHOW_MODE_HIDDEN = 1; |
| 5957 | |
| 5958 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5959 | * Setting that specifies whether timed text (captions) should be |
| 5960 | * displayed in video content. Text display properties are controlled by |
| 5961 | * the following settings: |
| 5962 | * <ul> |
| 5963 | * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} |
| 5964 | * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} |
| 5965 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} |
| 5966 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} |
| 5967 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} |
| 5968 | * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5969 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5970 | * </ul> |
| 5971 | * |
| 5972 | * @hide |
| 5973 | */ |
| 5974 | public static final String ACCESSIBILITY_CAPTIONING_ENABLED = |
| 5975 | "accessibility_captioning_enabled"; |
| 5976 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5977 | private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR = |
| 5978 | BOOLEAN_VALIDATOR; |
| 5979 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5980 | /** |
| 5981 | * Setting that specifies the language for captions as a locale string, |
| 5982 | * e.g. en_US. |
| 5983 | * |
| 5984 | * @see java.util.Locale#toString |
| 5985 | * @hide |
| 5986 | */ |
| 5987 | public static final String ACCESSIBILITY_CAPTIONING_LOCALE = |
| 5988 | "accessibility_captioning_locale"; |
| 5989 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 5990 | private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR; |
| 5991 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5992 | /** |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 5993 | * Integer property that specifies the preset style for captions, one |
| 5994 | * of: |
| 5995 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5996 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} |
| 5997 | * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 5998 | * </ul> |
| 5999 | * |
| 6000 | * @see java.util.Locale#toString |
| 6001 | * @hide |
| 6002 | */ |
| 6003 | public static final String ACCESSIBILITY_CAPTIONING_PRESET = |
| 6004 | "accessibility_captioning_preset"; |
| 6005 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6006 | private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR = |
| 6007 | new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2", |
| 6008 | "3", "4"}); |
| 6009 | |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 6010 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6011 | * Integer property that specifes the background color for captions as a |
| 6012 | * packed 32-bit color. |
| 6013 | * |
| 6014 | * @see android.graphics.Color#argb |
| 6015 | * @hide |
| 6016 | */ |
| 6017 | public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = |
| 6018 | "accessibility_captioning_background_color"; |
| 6019 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6020 | private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR = |
| 6021 | ANY_INTEGER_VALIDATOR; |
| 6022 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6023 | /** |
| 6024 | * Integer property that specifes the foreground color for captions as a |
| 6025 | * packed 32-bit color. |
| 6026 | * |
| 6027 | * @see android.graphics.Color#argb |
| 6028 | * @hide |
| 6029 | */ |
| 6030 | public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = |
| 6031 | "accessibility_captioning_foreground_color"; |
| 6032 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6033 | private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR = |
| 6034 | ANY_INTEGER_VALIDATOR; |
| 6035 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6036 | /** |
| 6037 | * Integer property that specifes the edge type for captions, one of: |
| 6038 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6039 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} |
| 6040 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} |
| 6041 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6042 | * </ul> |
| 6043 | * |
| 6044 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR |
| 6045 | * @hide |
| 6046 | */ |
| 6047 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = |
| 6048 | "accessibility_captioning_edge_type"; |
| 6049 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6050 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR = |
| 6051 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"}); |
| 6052 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6053 | /** |
| 6054 | * Integer property that specifes the edge color for captions as a |
| 6055 | * packed 32-bit color. |
| 6056 | * |
| 6057 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE |
| 6058 | * @see android.graphics.Color#argb |
| 6059 | * @hide |
| 6060 | */ |
| 6061 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = |
| 6062 | "accessibility_captioning_edge_color"; |
| 6063 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6064 | private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR = |
| 6065 | ANY_INTEGER_VALIDATOR; |
| 6066 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6067 | /** |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6068 | * Integer property that specifes the window color for captions as a |
| 6069 | * packed 32-bit color. |
| 6070 | * |
| 6071 | * @see android.graphics.Color#argb |
| 6072 | * @hide |
| 6073 | */ |
| 6074 | public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = |
| 6075 | "accessibility_captioning_window_color"; |
| 6076 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6077 | private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR = |
| 6078 | ANY_INTEGER_VALIDATOR; |
| 6079 | |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 6080 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6081 | * String property that specifies the typeface for captions, one of: |
| 6082 | * <ul> |
| 6083 | * <li>DEFAULT |
| 6084 | * <li>MONOSPACE |
| 6085 | * <li>SANS_SERIF |
| 6086 | * <li>SERIF |
| 6087 | * </ul> |
| 6088 | * |
| 6089 | * @see android.graphics.Typeface |
| 6090 | * @hide |
| 6091 | */ |
| 6092 | public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = |
| 6093 | "accessibility_captioning_typeface"; |
| 6094 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6095 | private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR = |
| 6096 | new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT", |
| 6097 | "MONOSPACE", "SANS_SERIF", "SERIF"}); |
| 6098 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6099 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6100 | * Floating point property that specifies font scaling for captions. |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6101 | * |
| 6102 | * @hide |
| 6103 | */ |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 6104 | public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = |
| 6105 | "accessibility_captioning_font_scale"; |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6106 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6107 | private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR = |
| 6108 | new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f); |
| 6109 | |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 6110 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6111 | * Setting that specifies whether display color inversion is enabled. |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6112 | */ |
| 6113 | public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = |
| 6114 | "accessibility_display_inversion_enabled"; |
| 6115 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6116 | private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR = |
| 6117 | BOOLEAN_VALIDATOR; |
| 6118 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6119 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6120 | * Setting that specifies whether display color space adjustment is |
| 6121 | * enabled. |
| 6122 | * |
| 6123 | * @hide |
| 6124 | */ |
| 6125 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = |
| 6126 | "accessibility_display_daltonizer_enabled"; |
| 6127 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6128 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR = |
| 6129 | BOOLEAN_VALIDATOR; |
| 6130 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6131 | /** |
| 6132 | * Integer property that specifies the type of color space adjustment to |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6133 | * perform. Valid values are defined in AccessibilityManager: |
| 6134 | * - AccessibilityManager.DALTONIZER_DISABLED = -1 |
| 6135 | * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 |
| 6136 | * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY = 12 |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6137 | * |
| 6138 | * @hide |
| 6139 | */ |
| 6140 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = |
| 6141 | "accessibility_display_daltonizer"; |
| 6142 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6143 | private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR = |
| 6144 | new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "12"}); |
| 6145 | |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6146 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6147 | * Setting that specifies whether automatic click when the mouse pointer stops moving is |
| 6148 | * enabled. |
| 6149 | * |
| 6150 | * @hide |
| 6151 | */ |
| 6152 | public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = |
| 6153 | "accessibility_autoclick_enabled"; |
| 6154 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6155 | private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR = |
| 6156 | BOOLEAN_VALIDATOR; |
| 6157 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6158 | /** |
| 6159 | * Integer setting specifying amount of time in ms the mouse pointer has to stay still |
| 6160 | * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. |
| 6161 | * |
| 6162 | * @see #ACCESSIBILITY_AUTOCLICK_ENABLED |
| 6163 | * @hide |
| 6164 | */ |
| 6165 | public static final String ACCESSIBILITY_AUTOCLICK_DELAY = |
| 6166 | "accessibility_autoclick_delay"; |
| 6167 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6168 | private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR = |
| 6169 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6170 | |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6171 | /** |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6172 | * Whether or not larger size icons are used for the pointer of mouse/trackpad for |
| 6173 | * accessibility. |
| 6174 | * (0 = false, 1 = true) |
| 6175 | * @hide |
| 6176 | */ |
| 6177 | public static final String ACCESSIBILITY_LARGE_POINTER_ICON = |
| 6178 | "accessibility_large_pointer_icon"; |
| 6179 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6180 | private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR = |
| 6181 | BOOLEAN_VALIDATOR; |
| 6182 | |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6183 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6184 | * 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] | 6185 | * @hide |
| 6186 | */ |
| 6187 | public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; |
| 6188 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6189 | private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR = |
| 6190 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6191 | |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 6192 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 6193 | * The duration in milliseconds between the first tap's up event and the second tap's |
| 6194 | * down event for an interaction to be considered part of the same multi-press. |
| 6195 | * @hide |
| 6196 | */ |
| 6197 | public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; |
| 6198 | |
| 6199 | /** |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6200 | * List of the enabled print services. |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6201 | * |
| 6202 | * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade |
| 6203 | * from pre-N. |
| 6204 | * |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 6205 | * @hide |
| 6206 | */ |
| 6207 | public static final String ENABLED_PRINT_SERVICES = |
| 6208 | "enabled_print_services"; |
| 6209 | |
| 6210 | /** |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6211 | * List of the disabled print services. |
| 6212 | * |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6213 | * @hide |
| 6214 | */ |
Svetoslav Ganov | 2dcedc12 | 2017-06-07 18:50:02 -0700 | [diff] [blame] | 6215 | @TestApi |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6216 | public static final String DISABLED_PRINT_SERVICES = |
| 6217 | "disabled_print_services"; |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6218 | |
| 6219 | /** |
Alan Viverette | 5e8d837 | 2016-02-03 15:38:59 -0500 | [diff] [blame] | 6220 | * The saved value for WindowManagerService.setForcedDisplayDensity() |
| 6221 | * formatted as a single integer representing DPI. If unset, then use |
| 6222 | * the real display density. |
| 6223 | * |
| 6224 | * @hide |
| 6225 | */ |
| 6226 | public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; |
| 6227 | |
| 6228 | /** |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6229 | * Setting to always use the default text-to-speech settings regardless |
| 6230 | * of the application settings. |
| 6231 | * 1 = override application settings, |
| 6232 | * 0 = use application settings (if specified). |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6233 | * |
| 6234 | * @deprecated The value of this setting is no longer respected by |
| 6235 | * 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] | 6236 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6237 | @Deprecated |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6238 | public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; |
| 6239 | |
| 6240 | /** |
| 6241 | * Default text-to-speech engine speech rate. 100 = 1x |
| 6242 | */ |
| 6243 | public static final String TTS_DEFAULT_RATE = "tts_default_rate"; |
| 6244 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6245 | private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6246 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6247 | /** |
| 6248 | * Default text-to-speech engine pitch. 100 = 1x |
| 6249 | */ |
| 6250 | public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; |
| 6251 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6252 | private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6253 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6254 | /** |
| 6255 | * Default text-to-speech engine. |
| 6256 | */ |
| 6257 | public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; |
| 6258 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6259 | private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR; |
| 6260 | |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6261 | /** |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6262 | * Default text-to-speech language. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6263 | * |
| 6264 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6265 | * Sandwich release. Apps should never need to read this setting directly, |
| 6266 | * instead can query the TextToSpeech framework classes for the default |
| 6267 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6268 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6269 | @Deprecated |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6270 | public static final String TTS_DEFAULT_LANG = "tts_default_lang"; |
| 6271 | |
| 6272 | /** |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6273 | * Default text-to-speech country. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6274 | * |
| 6275 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6276 | * Sandwich release. Apps should never need to read this setting directly, |
| 6277 | * instead can query the TextToSpeech framework classes for the default |
| 6278 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6279 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6280 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6281 | public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; |
| 6282 | |
| 6283 | /** |
| 6284 | * Default text-to-speech locale variant. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6285 | * |
| 6286 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6287 | * Sandwich release. Apps should never need to read this setting directly, |
| 6288 | * instead can query the TextToSpeech framework classes for the |
| 6289 | * locale that is in use {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6290 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6291 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6292 | public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; |
| 6293 | |
| 6294 | /** |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6295 | * Stores the default tts locales on a per engine basis. Stored as |
| 6296 | * a comma seperated list of values, each value being of the form |
| 6297 | * {@code engine_name:locale} for example, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6298 | * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This |
| 6299 | * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and |
| 6300 | * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this |
| 6301 | * setting directly, and can query the TextToSpeech framework classes |
| 6302 | * for the locale that is in use. |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6303 | * |
| 6304 | * @hide |
| 6305 | */ |
| 6306 | public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; |
| 6307 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6308 | private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() { |
| 6309 | @Override |
| 6310 | public boolean validate(String value) { |
| 6311 | if (value == null || value.length() == 0) { |
| 6312 | return false; |
| 6313 | } |
| 6314 | String[] ttsLocales = value.split(","); |
| 6315 | boolean valid = true; |
| 6316 | for (String ttsLocale : ttsLocales) { |
| 6317 | String[] parts = ttsLocale.split(":"); |
| 6318 | valid |= ((parts.length == 2) |
| 6319 | && (parts[0].length() > 0) |
| 6320 | && ANY_STRING_VALIDATOR.validate(parts[0]) |
| 6321 | && LOCALE_VALIDATOR.validate(parts[1])); |
| 6322 | } |
| 6323 | return valid; |
| 6324 | } |
| 6325 | }; |
| 6326 | |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6327 | /** |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6328 | * Space delimited list of plugin packages that are enabled. |
| 6329 | */ |
| 6330 | public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; |
| 6331 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6332 | private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR = |
| 6333 | new SettingsValidators.PackageNameListValidator(" "); |
| 6334 | |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6335 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6336 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} |
| 6337 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6338 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6339 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6340 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6341 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6342 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6343 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 6344 | BOOLEAN_VALIDATOR; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 6345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6346 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6347 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} |
| 6348 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6349 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6350 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6351 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6352 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6353 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6354 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 6355 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6356 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6357 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6358 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} |
| 6359 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6360 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6361 | @Deprecated |
| 6362 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = |
| 6363 | Global.WIFI_NUM_OPEN_NETWORKS_KEPT; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6364 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6365 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 6366 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 6367 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6368 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6369 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} |
| 6370 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6371 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6372 | @Deprecated |
| 6373 | public static final String WIFI_ON = Global.WIFI_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6374 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6375 | /** |
| 6376 | * The acceptable packet loss percentage (range 0 - 100) before trying |
| 6377 | * another AP on the same network. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6378 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6379 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6380 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6381 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 6382 | "wifi_watchdog_acceptable_packet_loss_percentage"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6383 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6384 | /** |
| 6385 | * The number of access points required for a network in order for the |
| 6386 | * watchdog to monitor it. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6387 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6388 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6389 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6390 | public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6391 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6392 | /** |
| 6393 | * The delay between background checks. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6394 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6395 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6396 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6397 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 6398 | "wifi_watchdog_background_check_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6399 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6400 | /** |
| 6401 | * Whether the Wi-Fi watchdog is enabled for background checking even |
| 6402 | * after it thinks the user has connected to a good access point. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6403 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6404 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6405 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6406 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 6407 | "wifi_watchdog_background_check_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6408 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6409 | /** |
| 6410 | * The timeout for a background ping |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6411 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6412 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6413 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6414 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 6415 | "wifi_watchdog_background_check_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6416 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6417 | /** |
| 6418 | * The number of initial pings to perform that *may* be ignored if they |
| 6419 | * fail. Again, if these fail, they will *not* be used in packet loss |
| 6420 | * calculation. For example, one network always seemed to time out for |
| 6421 | * the first couple pings, so this is set to 3 by default. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6422 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6423 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6424 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6425 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 6426 | "wifi_watchdog_initial_ignored_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6427 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6428 | /** |
| 6429 | * The maximum number of access points (per network) to attempt to test. |
| 6430 | * If this number is reached, the watchdog will no longer monitor the |
| 6431 | * initial connection state for the network. This is a safeguard for |
| 6432 | * networks containing multiple APs whose DNS does not respond to pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6433 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6434 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6435 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6436 | 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] | 6437 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6438 | /** |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6439 | * @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] | 6440 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6441 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6442 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 6443 | |
| 6444 | /** |
| 6445 | * 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] | 6446 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6447 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6448 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6449 | public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; |
| 6450 | |
| 6451 | /** |
| 6452 | * 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] | 6453 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6454 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6455 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6456 | public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6457 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6458 | /** |
| 6459 | * The delay between pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6460 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6461 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6462 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6463 | 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] | 6464 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6465 | /** |
| 6466 | * The timeout per ping. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6467 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6468 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6469 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6470 | 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] | 6471 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6472 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6473 | * @deprecated Use |
| 6474 | * {@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] | 6475 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6476 | @Deprecated |
| 6477 | 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] | 6478 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6479 | /** |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6480 | * @deprecated Use |
| 6481 | * {@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] | 6482 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6483 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6484 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6485 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6486 | |
| 6487 | /** |
Jeremy Joslin | 7929484 | 2014-12-03 17:15:28 -0800 | [diff] [blame] | 6488 | * The number of milliseconds to hold on to a PendingIntent based request. This delay gives |
| 6489 | * the receivers of the PendingIntent an opportunity to make a new network request before |
| 6490 | * the Network satisfying the request is potentially removed. |
| 6491 | * |
| 6492 | * @hide |
| 6493 | */ |
| 6494 | public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = |
| 6495 | "connectivity_release_pending_intent_delay_ms"; |
| 6496 | |
| 6497 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 6498 | * Whether background data usage is allowed. |
| 6499 | * |
| 6500 | * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, |
| 6501 | * availability of background data depends on several |
| 6502 | * combined factors. When background data is unavailable, |
| 6503 | * {@link ConnectivityManager#getActiveNetworkInfo()} will |
| 6504 | * now appear disconnected. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6505 | */ |
Jeff Sharkey | 3a844fc | 2011-08-16 14:37:57 -0700 | [diff] [blame] | 6506 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6507 | public static final String BACKGROUND_DATA = "background_data"; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6508 | |
| 6509 | /** |
Bjorn Bringert | 98bfa39 | 2010-03-24 10:59:48 +0000 | [diff] [blame] | 6510 | * Origins for which browsers should allow geolocation by default. |
| 6511 | * The value is a space-separated list of origins. |
| 6512 | */ |
| 6513 | public static final String ALLOWED_GEOLOCATION_ORIGINS |
| 6514 | = "allowed_geolocation_origins"; |
| 6515 | |
| 6516 | /** |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 6517 | * The preferred TTY mode 0 = TTy Off, CDMA default |
| 6518 | * 1 = TTY Full |
| 6519 | * 2 = TTY HCO |
| 6520 | * 3 = TTY VCO |
| 6521 | * @hide |
| 6522 | */ |
| 6523 | public static final String PREFERRED_TTY_MODE = |
| 6524 | "preferred_tty_mode"; |
| 6525 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6526 | private static final Validator PREFERRED_TTY_MODE_VALIDATOR = |
| 6527 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"}); |
| 6528 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6529 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6530 | * Whether the enhanced voice privacy mode is enabled. |
| 6531 | * 0 = normal voice privacy |
| 6532 | * 1 = enhanced voice privacy |
| 6533 | * @hide |
| 6534 | */ |
| 6535 | public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; |
| 6536 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6537 | private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6538 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6539 | /** |
| 6540 | * Whether the TTY mode mode is enabled. |
| 6541 | * 0 = disabled |
| 6542 | * 1 = enabled |
| 6543 | * @hide |
| 6544 | */ |
| 6545 | public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6546 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6547 | private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6548 | |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6549 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6550 | * Controls whether settings backup is enabled. |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6551 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6552 | * @hide |
| 6553 | */ |
| 6554 | public static final String BACKUP_ENABLED = "backup_enabled"; |
| 6555 | |
| 6556 | /** |
Christopher Tate | cce9da5 | 2010-02-03 15:11:15 -0800 | [diff] [blame] | 6557 | * Controls whether application data is automatically restored from backup |
| 6558 | * at install time. |
| 6559 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6560 | * @hide |
| 6561 | */ |
| 6562 | public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; |
| 6563 | |
| 6564 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6565 | * Indicates whether settings backup has been fully provisioned. |
| 6566 | * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) |
| 6567 | * @hide |
| 6568 | */ |
| 6569 | public static final String BACKUP_PROVISIONED = "backup_provisioned"; |
| 6570 | |
| 6571 | /** |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6572 | * Component of the transport to use for backup/restore. |
| 6573 | * @hide |
| 6574 | */ |
| 6575 | public static final String BACKUP_TRANSPORT = "backup_transport"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 6576 | |
Dianne Hackborn | d7cd29d | 2009-07-01 11:22:45 -0700 | [diff] [blame] | 6577 | /** |
| 6578 | * Version for which the setup wizard was last shown. Bumped for |
| 6579 | * each release when there is new setup information to show. |
| 6580 | * @hide |
| 6581 | */ |
| 6582 | public static final String LAST_SETUP_SHOWN = "last_setup_shown"; |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6583 | |
| 6584 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6585 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 6586 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 6587 | * the mobile data network. |
| 6588 | * @hide |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6589 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} |
| 6590 | * instead. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6591 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6592 | @Deprecated |
| 6593 | public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6594 | |
| 6595 | /** |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 6596 | * The global search provider chosen by the user (if multiple global |
| 6597 | * search providers are installed). This will be the provider returned |
| 6598 | * by {@link SearchManager#getGlobalSearchActivity()} if it's still |
| 6599 | * installed. This setting is stored as a flattened component name as |
| 6600 | * per {@link ComponentName#flattenToString()}. |
| 6601 | * |
| 6602 | * @hide |
| 6603 | */ |
| 6604 | public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = |
| 6605 | "search_global_search_activity"; |
| 6606 | |
| 6607 | /** |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6608 | * The number of promoted sources in GlobalSearch. |
| 6609 | * @hide |
| 6610 | */ |
| 6611 | public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; |
| 6612 | /** |
| 6613 | * The maximum number of suggestions returned by GlobalSearch. |
| 6614 | * @hide |
| 6615 | */ |
| 6616 | public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; |
| 6617 | /** |
| 6618 | * The number of suggestions GlobalSearch will ask each non-web search source for. |
| 6619 | * @hide |
| 6620 | */ |
| 6621 | public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; |
| 6622 | /** |
| 6623 | * The number of suggestions the GlobalSearch will ask the web search source for. |
| 6624 | * @hide |
| 6625 | */ |
| 6626 | public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = |
| 6627 | "search_web_results_override_limit"; |
| 6628 | /** |
| 6629 | * The number of milliseconds that GlobalSearch will wait for suggestions from |
| 6630 | * promoted sources before continuing with all other sources. |
| 6631 | * @hide |
| 6632 | */ |
| 6633 | public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = |
| 6634 | "search_promoted_source_deadline_millis"; |
| 6635 | /** |
| 6636 | * The number of milliseconds before GlobalSearch aborts search suggesiton queries. |
| 6637 | * @hide |
| 6638 | */ |
| 6639 | public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; |
| 6640 | /** |
| 6641 | * The maximum number of milliseconds that GlobalSearch shows the previous results |
| 6642 | * after receiving a new query. |
| 6643 | * @hide |
| 6644 | */ |
| 6645 | public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; |
| 6646 | /** |
| 6647 | * The maximum age of log data used for shortcuts in GlobalSearch. |
| 6648 | * @hide |
| 6649 | */ |
| 6650 | public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; |
| 6651 | /** |
| 6652 | * The maximum age of log data used for source ranking in GlobalSearch. |
| 6653 | * @hide |
| 6654 | */ |
| 6655 | public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = |
| 6656 | "search_max_source_event_age_millis"; |
| 6657 | /** |
| 6658 | * The minimum number of impressions needed to rank a source in GlobalSearch. |
| 6659 | * @hide |
| 6660 | */ |
| 6661 | public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = |
| 6662 | "search_min_impressions_for_source_ranking"; |
| 6663 | /** |
| 6664 | * The minimum number of clicks needed to rank a source in GlobalSearch. |
| 6665 | * @hide |
| 6666 | */ |
| 6667 | public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = |
| 6668 | "search_min_clicks_for_source_ranking"; |
| 6669 | /** |
| 6670 | * The maximum number of shortcuts shown by GlobalSearch. |
| 6671 | * @hide |
| 6672 | */ |
| 6673 | public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; |
| 6674 | /** |
| 6675 | * The size of the core thread pool for suggestion queries in GlobalSearch. |
| 6676 | * @hide |
| 6677 | */ |
| 6678 | public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = |
| 6679 | "search_query_thread_core_pool_size"; |
| 6680 | /** |
| 6681 | * The maximum size of the thread pool for suggestion queries in GlobalSearch. |
| 6682 | * @hide |
| 6683 | */ |
| 6684 | public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = |
| 6685 | "search_query_thread_max_pool_size"; |
| 6686 | /** |
| 6687 | * The size of the core thread pool for shortcut refreshing in GlobalSearch. |
| 6688 | * @hide |
| 6689 | */ |
| 6690 | public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = |
| 6691 | "search_shortcut_refresh_core_pool_size"; |
| 6692 | /** |
| 6693 | * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. |
| 6694 | * @hide |
| 6695 | */ |
| 6696 | public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = |
| 6697 | "search_shortcut_refresh_max_pool_size"; |
| 6698 | /** |
| 6699 | * The maximun time that excess threads in the GlobalSeach thread pools will |
| 6700 | * wait before terminating. |
| 6701 | * @hide |
| 6702 | */ |
| 6703 | public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = |
| 6704 | "search_thread_keepalive_seconds"; |
| 6705 | /** |
| 6706 | * The maximum number of concurrent suggestion queries to each source. |
| 6707 | * @hide |
| 6708 | */ |
| 6709 | public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = |
| 6710 | "search_per_source_concurrent_query_limit"; |
| 6711 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6712 | /** |
Sudheer Shanka | 2250d56 | 2016-11-07 15:41:02 -0800 | [diff] [blame] | 6713 | * Whether or not alert sounds are played on StorageManagerService events. |
| 6714 | * (0 = false, 1 = true) |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6715 | * @hide |
| 6716 | */ |
| 6717 | public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; |
| 6718 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6719 | private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6720 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6721 | /** |
| 6722 | * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) |
| 6723 | * @hide |
| 6724 | */ |
| 6725 | public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; |
| 6726 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6727 | private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6728 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6729 | /** |
| 6730 | * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) |
| 6731 | * @hide |
| 6732 | */ |
| 6733 | public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; |
| 6734 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6735 | private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6736 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6737 | /** |
| 6738 | * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) |
| 6739 | * @hide |
| 6740 | */ |
| 6741 | public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6742 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6743 | private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6744 | |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6745 | /** |
| 6746 | * If nonzero, ANRs in invisible background processes bring up a dialog. |
| 6747 | * Otherwise, the process will be silently killed. |
Adrian Roos | 6a7e089 | 2016-08-23 14:26:39 +0200 | [diff] [blame] | 6748 | * |
| 6749 | * Also prevents ANRs and crash dialogs from being suppressed. |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6750 | * @hide |
| 6751 | */ |
| 6752 | public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6753 | |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6754 | /** |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6755 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 6756 | * Otherwise, the process will be silently killed. |
| 6757 | * @hide |
| 6758 | */ |
| 6759 | public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = |
| 6760 | "show_first_crash_dialog_dev_option"; |
| 6761 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6762 | private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR = |
| 6763 | BOOLEAN_VALIDATOR; |
| 6764 | |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 6765 | /** |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6766 | * The {@link ComponentName} string of the service to be used as the voice recognition |
| 6767 | * service. |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6768 | * |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6769 | * @hide |
| 6770 | */ |
| 6771 | public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6772 | |
William Luh | 623a428 | 2013-06-24 12:14:18 -0700 | [diff] [blame] | 6773 | /** |
| 6774 | * Stores whether an user has consented to have apps verified through PAM. |
| 6775 | * The value is boolean (1 or 0). |
| 6776 | * |
| 6777 | * @hide |
| 6778 | */ |
| 6779 | public static final String PACKAGE_VERIFIER_USER_CONSENT = |
| 6780 | "package_verifier_user_consent"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6781 | |
| 6782 | /** |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6783 | * The {@link ComponentName} string of the selected spell checker service which is |
| 6784 | * one of the services managed by the text service manager. |
| 6785 | * |
| 6786 | * @hide |
| 6787 | */ |
| 6788 | public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; |
| 6789 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6790 | private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR; |
| 6791 | |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6792 | /** |
| 6793 | * The {@link ComponentName} string of the selected subtype of the selected spell checker |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6794 | * service which is one of the services managed by the text service manager. |
| 6795 | * |
| 6796 | * @hide |
| 6797 | */ |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6798 | public static final String SELECTED_SPELL_CHECKER_SUBTYPE = |
| 6799 | "selected_spell_checker_subtype"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6800 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6801 | private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR = |
| 6802 | COMPONENT_NAME_VALIDATOR; |
| 6803 | |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6804 | /** |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6805 | * Whether spell checker is enabled or not. |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6806 | * |
| 6807 | * @hide |
| 6808 | */ |
| 6809 | public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; |
| 6810 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6811 | private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6812 | |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6813 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6814 | * What happens when the user presses the Power button while in-call |
| 6815 | * and the screen is on.<br/> |
| 6816 | * <b>Values:</b><br/> |
| 6817 | * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> |
| 6818 | * 2 - The Power button hangs up the current call.<br/> |
| 6819 | * |
| 6820 | * @hide |
| 6821 | */ |
| 6822 | public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; |
| 6823 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6824 | private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR = |
| 6825 | new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"}); |
| 6826 | |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6827 | /** |
| 6828 | * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". |
| 6829 | * @hide |
| 6830 | */ |
| 6831 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; |
| 6832 | |
| 6833 | /** |
| 6834 | * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". |
| 6835 | * @hide |
| 6836 | */ |
| 6837 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; |
| 6838 | |
| 6839 | /** |
| 6840 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6841 | * @hide |
| 6842 | */ |
| 6843 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = |
| 6844 | INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; |
| 6845 | |
| 6846 | /** |
Bryce Lee | db776ce | 2016-09-03 15:02:00 -0700 | [diff] [blame] | 6847 | * What happens when the user presses the Back button while in-call |
| 6848 | * and the screen is on.<br/> |
| 6849 | * <b>Values:</b><br/> |
| 6850 | * 0 - The Back buttons does nothing different.<br/> |
| 6851 | * 1 - The Back button hangs up the current call.<br/> |
| 6852 | * |
| 6853 | * @hide |
| 6854 | */ |
| 6855 | public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; |
| 6856 | |
| 6857 | /** |
| 6858 | * INCALL_BACK_BUTTON_BEHAVIOR value for no action. |
| 6859 | * @hide |
| 6860 | */ |
| 6861 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; |
| 6862 | |
| 6863 | /** |
| 6864 | * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". |
| 6865 | * @hide |
| 6866 | */ |
| 6867 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; |
| 6868 | |
| 6869 | /** |
| 6870 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6871 | * @hide |
| 6872 | */ |
| 6873 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = |
| 6874 | INCALL_BACK_BUTTON_BEHAVIOR_NONE; |
| 6875 | |
| 6876 | /** |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 6877 | * Whether the device should wake when the wake gesture sensor detects motion. |
| 6878 | * @hide |
| 6879 | */ |
| 6880 | public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; |
| 6881 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6882 | private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6883 | |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 6884 | /** |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 6885 | * Whether the device should doze if configured. |
| 6886 | * @hide |
| 6887 | */ |
| 6888 | public static final String DOZE_ENABLED = "doze_enabled"; |
| 6889 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6890 | private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6891 | |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 6892 | /** |
Adrian Roos | ebea7a7 | 2016-10-26 12:51:26 -0700 | [diff] [blame] | 6893 | * Whether doze should be always on. |
| 6894 | * @hide |
| 6895 | */ |
| 6896 | public static final String DOZE_ALWAYS_ON = "doze_always_on"; |
| 6897 | |
| 6898 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6899 | * Whether the device should pulse on pick up gesture. |
| 6900 | * @hide |
| 6901 | */ |
| 6902 | public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; |
| 6903 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6904 | private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6905 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6906 | /** |
Adrian Roos | d0963a0 | 2017-05-15 14:33:37 -0700 | [diff] [blame] | 6907 | * Whether the device should pulse on long press gesture. |
| 6908 | * @hide |
| 6909 | */ |
| 6910 | public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; |
| 6911 | |
| 6912 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6913 | * Whether the device should pulse on double tap gesture. |
| 6914 | * @hide |
| 6915 | */ |
| 6916 | public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; |
| 6917 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6918 | private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6919 | |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6920 | /** |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 6921 | * The current night mode that has been selected by the user. Owned |
| 6922 | * and controlled by UiModeManagerService. Constants are as per |
| 6923 | * UiModeManager. |
| 6924 | * @hide |
| 6925 | */ |
| 6926 | public static final String UI_NIGHT_MODE = "ui_night_mode"; |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 6927 | |
| 6928 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6929 | * Whether screensavers are enabled. |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6930 | * @hide |
| 6931 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6932 | public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6933 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6934 | private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6935 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6936 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6937 | * The user's chosen screensaver components. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6938 | * |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6939 | * 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] | 6940 | * 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] | 6941 | * @hide |
| 6942 | */ |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6943 | public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6944 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6945 | private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR = |
| 6946 | new SettingsValidators.ComponentNameListValidator(","); |
| 6947 | |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6948 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6949 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 6950 | * when the device is inserted into a (desk) dock. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6951 | * @hide |
| 6952 | */ |
| 6953 | public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6954 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6955 | private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6956 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6957 | /** |
| 6958 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 6959 | * when the screen times out when not on battery. |
| 6960 | * @hide |
| 6961 | */ |
| 6962 | public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; |
| 6963 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6964 | private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR; |
| 6965 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6966 | /** |
| 6967 | * If screensavers are enabled, the default screensaver component. |
| 6968 | * @hide |
| 6969 | */ |
| 6970 | public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; |
| 6971 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6972 | /** |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 6973 | * The default NFC payment component |
| 6974 | * @hide |
| 6975 | */ |
| 6976 | public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; |
| 6977 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 6978 | private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR = |
| 6979 | COMPONENT_NAME_VALIDATOR; |
| 6980 | |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 6981 | /** |
Martijn Coenen | 2f6f3a01 | 2014-04-25 17:00:21 -0700 | [diff] [blame] | 6982 | * Whether NFC payment is handled by the foreground application or a default. |
| 6983 | * @hide |
| 6984 | */ |
| 6985 | public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; |
| 6986 | |
| 6987 | /** |
David Braun | f5d8319 | 2013-09-16 13:43:51 -0700 | [diff] [blame] | 6988 | * Specifies the package name currently configured to be the primary sms application |
| 6989 | * @hide |
| 6990 | */ |
| 6991 | public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; |
| 6992 | |
| 6993 | /** |
Yorke Lee | 014de02 | 2015-04-21 17:15:47 -0700 | [diff] [blame] | 6994 | * Specifies the package name currently configured to be the default dialer application |
| 6995 | * @hide |
| 6996 | */ |
| 6997 | public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; |
| 6998 | |
| 6999 | /** |
Adrian Roos | 943eb86 | 2015-03-26 12:31:16 -0700 | [diff] [blame] | 7000 | * Specifies the package name currently configured to be the emergency assistance application |
| 7001 | * |
| 7002 | * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE |
| 7003 | * |
| 7004 | * @hide |
| 7005 | */ |
| 7006 | public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; |
| 7007 | |
| 7008 | /** |
Jorim Jaggi | 9d91083 | 2015-05-18 17:35:26 -0700 | [diff] [blame] | 7009 | * Specifies whether the current app context on scren (assist data) will be sent to the |
| 7010 | * assist application (active voice interaction service). |
| 7011 | * |
| 7012 | * @hide |
| 7013 | */ |
| 7014 | public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; |
| 7015 | |
| 7016 | /** |
Jorim Jaggi | a133f0b | 2015-06-26 16:40:00 -0700 | [diff] [blame] | 7017 | * Specifies whether a screenshot of the screen contents will be sent to the assist |
| 7018 | * application (active voice interaction service). |
| 7019 | * |
| 7020 | * @hide |
| 7021 | */ |
| 7022 | public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; |
| 7023 | |
| 7024 | /** |
Adrian Roos | 2335bd6 | 2016-08-11 15:42:40 -0700 | [diff] [blame] | 7025 | * Specifies whether the screen will show an animation if screen contents are sent to the |
| 7026 | * assist application (active voice interaction service). |
| 7027 | * |
| 7028 | * Note that the disclosure will be forced for third-party assistants or if the device |
| 7029 | * does not support disabling it. |
| 7030 | * |
| 7031 | * @hide |
| 7032 | */ |
| 7033 | public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; |
| 7034 | |
| 7035 | /** |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7036 | * Control if rotation suggestions are sent to System UI when in rotation locked mode. |
| 7037 | * Done to enable screen rotation while the the screen rotation is locked. Enabling will |
| 7038 | * poll the accelerometer in rotation locked mode. |
| 7039 | * |
| 7040 | * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. |
| 7041 | * |
| 7042 | * @hide |
| 7043 | */ |
| 7044 | |
| 7045 | public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; |
| 7046 | |
| 7047 | /** |
| 7048 | * The disabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7049 | * @hide |
| 7050 | */ |
| 7051 | public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; |
| 7052 | |
| 7053 | /** |
| 7054 | * The enabled state of SHOW_ROTATION_SUGGESTIONS. |
| 7055 | * @hide |
| 7056 | */ |
| 7057 | public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; |
| 7058 | |
| 7059 | /** |
| 7060 | * The default state of SHOW_ROTATION_SUGGESTIONS. |
| 7061 | * @hide |
| 7062 | */ |
| 7063 | public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = |
Mike Digman | 02856ba | 2018-01-16 11:21:23 -0800 | [diff] [blame] | 7064 | SHOW_ROTATION_SUGGESTIONS_ENABLED; |
Mike Digman | e14e663 | 2018-01-11 10:43:08 -0800 | [diff] [blame] | 7065 | |
| 7066 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7067 | * 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] | 7068 | * see and assist with all of the user's notifications. |
| 7069 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7070 | * @deprecated Use |
| 7071 | * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7072 | * @hide |
| 7073 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7074 | @Deprecated |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7075 | public static final String ENABLED_NOTIFICATION_ASSISTANT = |
| 7076 | "enabled_notification_assistant"; |
| 7077 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7078 | private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR = |
| 7079 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7080 | |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 7081 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7082 | * 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] | 7083 | * see all of the user's notifications, separated by ':'. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7084 | * |
| 7085 | * @hide |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7086 | * @deprecated Use |
| 7087 | * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7088 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7089 | @Deprecated |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 7090 | public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; |
| 7091 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7092 | private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR = |
| 7093 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7094 | |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 7095 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7096 | * Read only list of the packages that the current user has explicitly allowed to |
| 7097 | * manage do not disturb, separated by ':'. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7098 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7099 | * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7100 | * @hide |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7101 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7102 | @Deprecated |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 7103 | @TestApi |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 7104 | public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = |
| 7105 | "enabled_notification_policy_access_packages"; |
| 7106 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7107 | private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR = |
| 7108 | new SettingsValidators.PackageNameListValidator(":"); |
| 7109 | |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7110 | /** |
| 7111 | * Defines whether managed profile ringtones should be synced from it's parent profile |
| 7112 | * <p> |
| 7113 | * 0 = ringtones are not synced |
| 7114 | * 1 = ringtones are synced from the profile's parent (default) |
| 7115 | * <p> |
| 7116 | * This value is only used for managed profiles. |
| 7117 | * @hide |
| 7118 | */ |
Robin Lee | c74d85f | 2017-03-16 17:19:42 +0000 | [diff] [blame] | 7119 | @TestApi |
| 7120 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 7121 | public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; |
| 7122 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7123 | private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7124 | |
John Spurlock | cdb57ae | 2015-02-11 19:04:11 -0500 | [diff] [blame] | 7125 | /** @hide */ |
John Spurlock | f1a3664 | 2013-10-12 17:50:42 -0400 | [diff] [blame] | 7126 | public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; |
John Spurlock | d67ec25 | 2013-09-05 11:31:54 -0400 | [diff] [blame] | 7127 | |
Yorke Lee | 647f8f3 | 2013-05-07 10:49:44 -0700 | [diff] [blame] | 7128 | /** |
Svetoslav | f43e851 | 2013-09-30 17:33:05 -0700 | [diff] [blame] | 7129 | * This is the query URI for finding a print service to install. |
| 7130 | * |
| 7131 | * @hide |
| 7132 | */ |
| 7133 | public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; |
| 7134 | |
| 7135 | /** |
| 7136 | * This is the query URI for finding a NFC payment service to install. |
| 7137 | * |
| 7138 | * @hide |
| 7139 | */ |
| 7140 | public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; |
| 7141 | |
| 7142 | /** |
Philip P. Moltmann | a30d6e0 | 2017-04-27 15:40:02 -0700 | [diff] [blame] | 7143 | * This is the query URI for finding a auto fill service to install. |
| 7144 | * |
| 7145 | * @hide |
| 7146 | */ |
| 7147 | public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; |
| 7148 | |
| 7149 | /** |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7150 | * 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] | 7151 | * 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] | 7152 | * <p> |
| 7153 | * Type : int (0 to show hints, 1 to skip showing hints) |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 7154 | */ |
| 7155 | public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; |
| 7156 | |
| 7157 | /** |
John Spurlock | aa5ee4d | 2014-07-25 13:05:12 -0400 | [diff] [blame] | 7158 | * Persisted playback time after a user confirmation of an unsafe volume level. |
| 7159 | * |
| 7160 | * @hide |
| 7161 | */ |
| 7162 | public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; |
| 7163 | |
| 7164 | /** |
Dan Sandler | 52e5701e | 2014-07-22 23:14:54 -0400 | [diff] [blame] | 7165 | * This preference enables notification display on the lockscreen. |
| 7166 | * @hide |
| 7167 | */ |
| 7168 | public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = |
| 7169 | "lock_screen_show_notifications"; |
| 7170 | |
| 7171 | /** |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7172 | * List of TV inputs that are currently hidden. This is a string |
Jaewan Kim | f0e530e | 2014-08-22 00:43:31 +0900 | [diff] [blame] | 7173 | * containing the IDs of all hidden TV inputs. Each ID is encoded by |
| 7174 | * {@link android.net.Uri#encode(String)} and separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7175 | * @hide |
| 7176 | */ |
| 7177 | public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; |
| 7178 | |
| 7179 | /** |
| 7180 | * 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] | 7181 | * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} |
| 7182 | * and separated by ','. Each pair is separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 7183 | * @hide |
| 7184 | */ |
| 7185 | public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; |
| 7186 | |
| 7187 | /** |
Glenn Kasten | 34cc4db | 2014-08-13 10:56:38 -0700 | [diff] [blame] | 7188 | * Whether automatic routing of system audio to USB audio peripheral is disabled. |
| 7189 | * The value is boolean (1 or 0), where 1 means automatic routing is disabled, |
| 7190 | * and 0 means automatic routing is enabled. |
| 7191 | * |
| 7192 | * @hide |
| 7193 | */ |
| 7194 | public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = |
| 7195 | "usb_audio_automatic_routing_disabled"; |
| 7196 | |
| 7197 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7198 | * The timeout in milliseconds before the device fully goes to sleep after |
| 7199 | * a period of inactivity. This value sets an upper bound on how long the device |
| 7200 | * will stay awake or dreaming without user activity. It should generally |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 7201 | * 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] | 7202 | * will sleep before it ever has a chance to dream. |
| 7203 | * <p> |
| 7204 | * Use -1 to disable this timeout. |
| 7205 | * </p> |
| 7206 | * |
| 7207 | * @hide |
| 7208 | */ |
| 7209 | public static final String SLEEP_TIMEOUT = "sleep_timeout"; |
| 7210 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7211 | private static final Validator SLEEP_TIMEOUT_VALIDATOR = |
| 7212 | new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE); |
| 7213 | |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 7214 | /** |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7215 | * Controls whether double tap to wake is enabled. |
| 7216 | * @hide |
| 7217 | */ |
| 7218 | public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; |
| 7219 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7220 | private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7221 | |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7222 | /** |
Xiyuan Xia | e6de8b9 | 2015-06-06 22:18:05 -0700 | [diff] [blame] | 7223 | * The current assistant component. It could be a voice interaction service, |
| 7224 | * or an activity that handles ACTION_ASSIST, or empty which means using the default |
| 7225 | * handling. |
| 7226 | * |
| 7227 | * @hide |
| 7228 | */ |
| 7229 | public static final String ASSISTANT = "assistant"; |
| 7230 | |
| 7231 | /** |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7232 | * Whether the camera launch gesture should be disabled. |
| 7233 | * |
| 7234 | * @hide |
| 7235 | */ |
| 7236 | public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; |
| 7237 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7238 | private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7239 | |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7240 | /** |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7241 | * Whether the camera launch gesture to double tap the power button when the screen is off |
| 7242 | * should be disabled. |
| 7243 | * |
| 7244 | * @hide |
| 7245 | */ |
| 7246 | public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = |
| 7247 | "camera_double_tap_power_gesture_disabled"; |
| 7248 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7249 | private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR = |
| 7250 | BOOLEAN_VALIDATOR; |
| 7251 | |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 7252 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7253 | * Whether the camera double twist gesture to flip between front and back mode should be |
| 7254 | * enabled. |
| 7255 | * |
| 7256 | * @hide |
| 7257 | */ |
| 7258 | public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = |
| 7259 | "camera_double_twist_to_flip_enabled"; |
| 7260 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7261 | private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR = |
| 7262 | BOOLEAN_VALIDATOR; |
| 7263 | |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7264 | /** |
Daniel Sheng | 45e0d34 | 2017-04-17 17:27:22 -0700 | [diff] [blame] | 7265 | * Whether or not the smart camera lift trigger that launches the camera when the user moves |
| 7266 | * the phone into a position for taking photos should be enabled. |
| 7267 | * |
| 7268 | * @hide |
| 7269 | */ |
| 7270 | public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; |
| 7271 | |
| 7272 | /** |
Daniel Sheng | 834e572 | 2017-05-30 09:28:52 -0700 | [diff] [blame] | 7273 | * The default enable state of the camera lift trigger. |
| 7274 | * |
| 7275 | * @hide |
| 7276 | */ |
| 7277 | public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; |
| 7278 | |
| 7279 | /** |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7280 | * Whether the assist gesture should be enabled. |
| 7281 | * |
| 7282 | * @hide |
| 7283 | */ |
| 7284 | public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; |
| 7285 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7286 | private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR = |
| 7287 | BOOLEAN_VALIDATOR; |
| 7288 | |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7289 | /** |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7290 | * Sensitivity control for the assist gesture. |
| 7291 | * |
| 7292 | * @hide |
| 7293 | */ |
| 7294 | public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; |
| 7295 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7296 | private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR = |
| 7297 | new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f); |
| 7298 | |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7299 | /** |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7300 | * Whether the assist gesture should silence alerts. |
| 7301 | * |
| 7302 | * @hide |
| 7303 | */ |
| 7304 | public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = |
| 7305 | "assist_gesture_silence_alerts_enabled"; |
| 7306 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7307 | private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR = |
| 7308 | BOOLEAN_VALIDATOR; |
| 7309 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7310 | /** |
| 7311 | * Whether the assist gesture should wake the phone. |
| 7312 | * |
| 7313 | * @hide |
| 7314 | */ |
| 7315 | public static final String ASSIST_GESTURE_WAKE_ENABLED = |
| 7316 | "assist_gesture_wake_enabled"; |
| 7317 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7318 | private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR = |
| 7319 | BOOLEAN_VALIDATOR; |
| 7320 | |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7321 | /** |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7322 | * Whether Assist Gesture Deferred Setup has been completed |
| 7323 | * |
| 7324 | * @hide |
| 7325 | */ |
| 7326 | public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; |
| 7327 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7328 | private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7329 | |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7330 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7331 | * Control whether Night display is currently activated. |
| 7332 | * @hide |
| 7333 | */ |
| 7334 | public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; |
| 7335 | |
| 7336 | /** |
| 7337 | * Control whether Night display will automatically activate/deactivate. |
| 7338 | * @hide |
| 7339 | */ |
| 7340 | public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; |
| 7341 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7342 | private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7343 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7344 | /** |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7345 | * Control the color temperature of Night Display, represented in Kelvin. |
| 7346 | * @hide |
| 7347 | */ |
| 7348 | public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = |
| 7349 | "night_display_color_temperature"; |
| 7350 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7351 | private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR = |
| 7352 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7353 | |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7354 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7355 | * Custom time when Night display is scheduled to activate. |
| 7356 | * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). |
| 7357 | * @hide |
| 7358 | */ |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7359 | public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = |
| 7360 | "night_display_custom_start_time"; |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7361 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7362 | private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR = |
| 7363 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7364 | |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7365 | /** |
| 7366 | * Custom time when Night display is scheduled to deactivate. |
| 7367 | * Represented as milliseconds from midnight (e.g. 21600000 == 6am). |
| 7368 | * @hide |
| 7369 | */ |
| 7370 | 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] | 7371 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7372 | private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR = |
| 7373 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7374 | |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 7375 | /** |
Christine Franks | 0321346 | 2017-08-25 13:57:26 -0700 | [diff] [blame] | 7376 | * A String representing the LocalDateTime when Night display was last activated. Use to |
| 7377 | * decide whether to apply the current activated state after a reboot or user change. In |
| 7378 | * legacy cases, this is represented by the time in milliseconds (since epoch). |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7379 | * @hide |
| 7380 | */ |
| 7381 | public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = |
| 7382 | "night_display_last_activated_time"; |
| 7383 | |
| 7384 | /** |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7385 | * Names of the service components that the current user has explicitly allowed to |
| 7386 | * be a VR mode listener, separated by ':'. |
| 7387 | * |
| 7388 | * @hide |
| 7389 | */ |
| 7390 | public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; |
| 7391 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7392 | private static final Validator ENABLED_VR_LISTENERS_VALIDATOR = |
| 7393 | new SettingsValidators.ComponentNameListValidator(":"); |
| 7394 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7395 | /** |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7396 | * Behavior of the display while in VR mode. |
| 7397 | * |
| 7398 | * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. |
| 7399 | * |
| 7400 | * @hide |
| 7401 | */ |
| 7402 | public static final String VR_DISPLAY_MODE = "vr_display_mode"; |
| 7403 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7404 | private static final Validator VR_DISPLAY_MODE_VALIDATOR = |
| 7405 | new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"}); |
| 7406 | |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7407 | /** |
| 7408 | * Lower the display persistence while the system is in VR mode. |
| 7409 | * |
| 7410 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7411 | * |
| 7412 | * @hide. |
| 7413 | */ |
| 7414 | public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; |
| 7415 | |
| 7416 | /** |
| 7417 | * Do not alter the display persistence while the system is in VR mode. |
| 7418 | * |
| 7419 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7420 | * |
| 7421 | * @hide. |
| 7422 | */ |
| 7423 | public static final int VR_DISPLAY_MODE_OFF = 1; |
| 7424 | |
| 7425 | /** |
Jeff Davidson | 24b9d96 | 2016-07-21 12:35:10 -0700 | [diff] [blame] | 7426 | * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least |
| 7427 | * once. |
| 7428 | * |
| 7429 | * <p>This is used to ensure that we only take one pass which will disable apps that are not |
| 7430 | * privileged (if any). From then on, we only want to enable apps (when a matching SIM is |
| 7431 | * inserted), to avoid disabling an app that the user might actively be using. |
| 7432 | * |
| 7433 | * <p>Will be set to 1 once executed. |
| 7434 | * |
| 7435 | * @hide |
| 7436 | */ |
| 7437 | public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; |
| 7438 | |
| 7439 | /** |
Tony Mak | c820cc5 | 2016-05-03 18:58:28 +0100 | [diff] [blame] | 7440 | * Whether parent user can access remote contact in managed profile. |
| 7441 | * |
| 7442 | * @hide |
| 7443 | */ |
| 7444 | public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = |
| 7445 | "managed_profile_contact_remote_search"; |
| 7446 | |
| 7447 | /** |
Daniel Nishi | 395d387 | 2016-05-23 13:25:21 -0700 | [diff] [blame] | 7448 | * Whether or not the automatic storage manager is enabled and should run on the device. |
| 7449 | * |
| 7450 | * @hide |
| 7451 | */ |
| 7452 | public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = |
| 7453 | "automatic_storage_manager_enabled"; |
| 7454 | |
| 7455 | /** |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7456 | * How many days of information for the automatic storage manager to retain on the device. |
| 7457 | * |
| 7458 | * @hide |
| 7459 | */ |
| 7460 | public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = |
| 7461 | "automatic_storage_manager_days_to_retain"; |
| 7462 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7463 | private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR = |
| 7464 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 7465 | |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7466 | /** |
| 7467 | * Default number of days of information for the automatic storage manager to retain. |
| 7468 | * |
| 7469 | * @hide |
| 7470 | */ |
| 7471 | public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; |
| 7472 | |
| 7473 | /** |
Daniel Nishi | f678cc9 | 2016-06-24 15:49:25 -0700 | [diff] [blame] | 7474 | * How many bytes the automatic storage manager has cleared out. |
| 7475 | * |
| 7476 | * @hide |
| 7477 | */ |
| 7478 | public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = |
| 7479 | "automatic_storage_manager_bytes_cleared"; |
| 7480 | |
| 7481 | |
| 7482 | /** |
| 7483 | * Last run time for the automatic storage manager. |
| 7484 | * |
| 7485 | * @hide |
| 7486 | */ |
| 7487 | public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = |
| 7488 | "automatic_storage_manager_last_run"; |
| 7489 | |
Jorge Gil | 6825a77 | 2016-06-30 11:07:18 -0700 | [diff] [blame] | 7490 | /** |
Daniel Nishi | da7332c | 2017-06-12 10:17:33 -0700 | [diff] [blame] | 7491 | * If the automatic storage manager has been disabled by policy. Note that this doesn't |
| 7492 | * mean that the automatic storage manager is prevented from being re-enabled -- this only |
| 7493 | * means that it was turned off by policy at least once. |
| 7494 | * |
| 7495 | * @hide |
| 7496 | */ |
| 7497 | public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = |
| 7498 | "automatic_storage_manager_turned_off_by_policy"; |
| 7499 | |
| 7500 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7501 | * Whether SystemUI navigation keys is enabled. |
| 7502 | * @hide |
| 7503 | */ |
| 7504 | public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = |
| 7505 | "system_navigation_keys_enabled"; |
| 7506 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7507 | private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7508 | |
Allison Babick | f0bc866 | 2016-07-11 15:39:16 -0700 | [diff] [blame] | 7509 | /** |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7510 | * Holds comma separated list of ordering of QS tiles. |
| 7511 | * @hide |
| 7512 | */ |
| 7513 | public static final String QS_TILES = "sysui_qs_tiles"; |
| 7514 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7515 | private static final Validator QS_TILES_VALIDATOR = new Validator() { |
| 7516 | @Override |
| 7517 | public boolean validate(String value) { |
| 7518 | if (value == null) { |
| 7519 | return false; |
| 7520 | } |
| 7521 | String[] tiles = value.split(","); |
| 7522 | boolean valid = true; |
| 7523 | for (String tile : tiles) { |
| 7524 | // tile can be any non-empty string as specified by OEM |
| 7525 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7526 | } |
| 7527 | return valid; |
| 7528 | } |
| 7529 | }; |
| 7530 | |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7531 | /** |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7532 | * Specifies whether the web action API is enabled. |
| 7533 | * |
| 7534 | * @hide |
| 7535 | */ |
Jesse Evans | fc1bfc4 | 2017-04-07 16:11:26 -0700 | [diff] [blame] | 7536 | @SystemApi |
| 7537 | public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7538 | |
| 7539 | /** |
Greg Plesur | 3514404 | 2016-10-10 16:23:49 -0400 | [diff] [blame] | 7540 | * Has this pairable device been paired or upgraded from a previously paired system. |
| 7541 | * @hide |
| 7542 | */ |
| 7543 | public static final String DEVICE_PAIRED = "device_paired"; |
| 7544 | |
| 7545 | /** |
Shahriyar Amini | 9343f57 | 2017-01-12 12:03:24 -0800 | [diff] [blame] | 7546 | * Integer state indicating whether package verifier is enabled. |
| 7547 | * TODO(b/34259924): Remove this setting. |
| 7548 | * |
| 7549 | * @hide |
| 7550 | */ |
| 7551 | public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; |
| 7552 | |
| 7553 | /** |
Jack Yu | 3902857 | 2017-02-23 09:49:25 -0800 | [diff] [blame] | 7554 | * Specifies additional package name for broadcasting the CMAS messages. |
| 7555 | * @hide |
| 7556 | */ |
| 7557 | public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; |
| 7558 | |
| 7559 | /** |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7560 | * Whether the launcher should show any notification badges. |
| 7561 | * The value is boolean (1 or 0). |
| 7562 | * @hide |
| 7563 | */ |
| 7564 | public static final String NOTIFICATION_BADGING = "notification_badging"; |
| 7565 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7566 | private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7567 | |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7568 | /** |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7569 | * Comma separated list of QS tiles that have been auto-added already. |
| 7570 | * @hide |
| 7571 | */ |
| 7572 | public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; |
| 7573 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7574 | private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() { |
| 7575 | @Override |
| 7576 | public boolean validate(String value) { |
| 7577 | if (value == null) { |
| 7578 | return false; |
| 7579 | } |
| 7580 | String[] tiles = value.split(","); |
| 7581 | boolean valid = true; |
| 7582 | for (String tile : tiles) { |
| 7583 | // tile can be any non-empty string as specified by OEM |
| 7584 | valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); |
| 7585 | } |
| 7586 | return valid; |
| 7587 | } |
| 7588 | }; |
| 7589 | |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7590 | /** |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7591 | * Whether the Lockdown button should be shown in the power menu. |
| 7592 | * @hide |
| 7593 | */ |
| 7594 | public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7595 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7596 | private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 7597 | |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7598 | /** |
| 7599 | * Backup manager behavioral parameters. |
| 7600 | * This is encoded as a key=value list, separated by commas. Ex: |
| 7601 | * |
| 7602 | * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" |
| 7603 | * |
| 7604 | * The following keys are supported: |
| 7605 | * |
| 7606 | * <pre> |
| 7607 | * key_value_backup_interval_milliseconds (long) |
| 7608 | * key_value_backup_fuzz_milliseconds (long) |
| 7609 | * key_value_backup_require_charging (boolean) |
| 7610 | * key_value_backup_required_network_type (int) |
| 7611 | * full_backup_interval_milliseconds (long) |
| 7612 | * full_backup_require_charging (boolean) |
| 7613 | * full_backup_required_network_type (int) |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7614 | * backup_finished_notification_receivers (String[]) |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7615 | * </pre> |
| 7616 | * |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7617 | * backup_finished_notification_receivers uses ":" as delimeter for values. |
| 7618 | * |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7619 | * <p> |
| 7620 | * Type: string |
| 7621 | * @hide |
| 7622 | */ |
| 7623 | public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; |
| 7624 | |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7625 | /** |
Daniel Nishi | 79764127 | 2018-01-02 16:48:33 -0800 | [diff] [blame] | 7626 | * Flag to set if the system should predictively attempt to re-enable Bluetooth while |
| 7627 | * the user is driving. |
| 7628 | * @hide |
| 7629 | */ |
| 7630 | public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; |
| 7631 | |
| 7632 | /** |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7633 | * This are the settings to be backed up. |
| 7634 | * |
| 7635 | * NOTE: Settings are backed up and restored in the order they appear |
| 7636 | * in this array. If you have one setting depending on another, |
| 7637 | * make sure that they are ordered appropriately. |
| 7638 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7639 | * @hide |
| 7640 | */ |
| 7641 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 7642 | BUGREPORT_IN_POWER_MENU, // moved to global |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 7643 | ALLOW_MOCK_LOCATION, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7644 | USB_MASS_STORAGE_ENABLED, // moved to global |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7645 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7646 | ACCESSIBILITY_DISPLAY_DALTONIZER, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7647 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7648 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 7649 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
Svetoslav Ganov | d8561a2 | 2017-04-25 15:26:03 -0700 | [diff] [blame] | 7650 | AUTOFILL_SERVICE, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7651 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7652 | ENABLED_ACCESSIBILITY_SERVICES, |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7653 | ENABLED_VR_LISTENERS, |
Christopher Tate | 7b9a28c | 2015-03-18 13:06:16 -0700 | [diff] [blame] | 7654 | ENABLED_INPUT_METHODS, |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 7655 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
Svetoslav Ganov | a28a16d | 2011-07-28 11:24:21 -0700 | [diff] [blame] | 7656 | TOUCH_EXPLORATION_ENABLED, |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7657 | ACCESSIBILITY_ENABLED, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7658 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 7659 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7660 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 7661 | ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7662 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 7663 | ACCESSIBILITY_SPEAK_PASSWORD, |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 7664 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7665 | ACCESSIBILITY_CAPTIONING_PRESET, |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 7666 | ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7667 | ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7668 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7669 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7670 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7671 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7672 | ACCESSIBILITY_CAPTIONING_TYPEFACE, |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 7673 | ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7674 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7675 | TTS_DEFAULT_RATE, |
| 7676 | TTS_DEFAULT_PITCH, |
| 7677 | TTS_DEFAULT_SYNTH, |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 7678 | TTS_ENABLED_PLUGINS, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 7679 | TTS_DEFAULT_LOCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7680 | SHOW_IME_WITH_HARD_KEYBOARD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7681 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global |
| 7682 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global |
| 7683 | WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global |
Christopher Tate | 06cbadd | 2015-03-16 18:29:42 -0700 | [diff] [blame] | 7684 | SELECTED_SPELL_CHECKER, |
| 7685 | SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7686 | SPELL_CHECKER_ENABLED, |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 7687 | MOUNT_PLAY_NOTIFICATION_SND, |
| 7688 | MOUNT_UMS_AUTOSTART, |
| 7689 | MOUNT_UMS_PROMPT, |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7690 | MOUNT_UMS_NOTIFY_ENABLED, |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7691 | SLEEP_TIMEOUT, |
| 7692 | DOUBLE_TAP_TO_WAKE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7693 | WAKE_GESTURE_ENABLED, |
| 7694 | LONG_PRESS_TIMEOUT, |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7695 | CAMERA_GESTURE_DISABLED, |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 7696 | ACCESSIBILITY_AUTOCLICK_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7697 | ACCESSIBILITY_AUTOCLICK_DELAY, |
| 7698 | ACCESSIBILITY_LARGE_POINTER_ICON, |
| 7699 | PREFERRED_TTY_MODE, |
| 7700 | ENHANCED_VOICE_PRIVACY_ENABLED, |
| 7701 | TTY_MODE_ENABLED, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7702 | INCALL_POWER_BUTTON_BEHAVIOR, |
| 7703 | NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 7704 | NIGHT_DISPLAY_CUSTOM_END_TIME, |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7705 | NIGHT_DISPLAY_COLOR_TEMPERATURE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7706 | NIGHT_DISPLAY_AUTO_MODE, |
Doris Ling | 5fafa3c | 2016-08-26 15:00:49 -0700 | [diff] [blame] | 7707 | SYNC_PARENT_SOUNDS, |
Doris Ling | 8a33273 | 2016-08-24 15:05:43 -0700 | [diff] [blame] | 7708 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 7709 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7710 | SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 7711 | QS_TILES, |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7712 | DOZE_ENABLED, |
| 7713 | DOZE_PULSE_ON_PICK_UP, |
Ruchi Kandoi | 104e0b4 | 2016-12-29 13:31:43 -0800 | [diff] [blame] | 7714 | DOZE_PULSE_ON_DOUBLE_TAP, |
Daniel Nishi | eb70ad4 | 2017-01-27 10:51:35 -0800 | [diff] [blame] | 7715 | NFC_PAYMENT_DEFAULT_COMPONENT, |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7716 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
Santos Cordon | 5bce494 | 2017-02-27 11:50:18 -0800 | [diff] [blame] | 7717 | ASSIST_GESTURE_ENABLED, |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7718 | ASSIST_GESTURE_SENSITIVITY, |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7719 | ASSIST_GESTURE_SETUP_COMPLETE, |
| 7720 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 7721 | ASSIST_GESTURE_WAKE_ENABLED, |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7722 | VR_DISPLAY_MODE, |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7723 | NOTIFICATION_BADGING, |
| 7724 | QS_AUTO_ADDED_TILES, |
Jason Monk | df31eff | 2017-07-10 11:14:19 -0400 | [diff] [blame] | 7725 | SCREENSAVER_ENABLED, |
| 7726 | SCREENSAVER_COMPONENTS, |
| 7727 | SCREENSAVER_ACTIVATE_ON_DOCK, |
| 7728 | SCREENSAVER_ACTIVATE_ON_SLEEP, |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7729 | LOCKDOWN_IN_POWER_MENU, |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 7730 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7731 | }; |
| 7732 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 7733 | /** |
| 7734 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 7735 | * otherwise they won't be restored. |
| 7736 | * |
| 7737 | * @hide |
| 7738 | */ |
| 7739 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 7740 | static { |
| 7741 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 7742 | VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR); |
| 7743 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 7744 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7745 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR); |
| 7746 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, |
| 7747 | ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR); |
| 7748 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
| 7749 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR); |
| 7750 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
| 7751 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR); |
| 7752 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
| 7753 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR); |
| 7754 | VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); |
| 7755 | VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
| 7756 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR); |
| 7757 | VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, |
| 7758 | ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7759 | VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR); |
| 7760 | VALIDATORS.put(ENABLED_INPUT_METHODS, ENABLED_INPUT_METHODS_VALIDATOR); |
| 7761 | VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
| 7762 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR); |
| 7763 | VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR); |
| 7764 | VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR); |
| 7765 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
| 7766 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR); |
| 7767 | VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
| 7768 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR); |
| 7769 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
| 7770 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR); |
| 7771 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7772 | ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR); |
| 7773 | VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
| 7774 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR); |
| 7775 | VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR); |
| 7776 | VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
| 7777 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR); |
| 7778 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, |
| 7779 | ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR); |
| 7780 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7781 | ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR); |
| 7782 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7783 | ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR); |
| 7784 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7785 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR); |
| 7786 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7787 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR); |
| 7788 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7789 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR); |
| 7790 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7791 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR); |
| 7792 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, |
| 7793 | ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR); |
| 7794 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
| 7795 | ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR); |
| 7796 | VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
| 7797 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR); |
| 7798 | VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR); |
| 7799 | VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR); |
| 7800 | VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR); |
| 7801 | VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR); |
| 7802 | VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR); |
| 7803 | VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR); |
| 7804 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 7805 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 7806 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, |
| 7807 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR); |
| 7808 | VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR); |
| 7809 | VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR); |
| 7810 | VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7811 | SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR); |
| 7812 | VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR); |
| 7813 | VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR); |
| 7814 | VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR); |
| 7815 | VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR); |
| 7816 | VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR); |
| 7817 | VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR); |
| 7818 | VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR); |
| 7819 | VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR); |
| 7820 | VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR); |
| 7821 | VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR); |
| 7822 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, |
| 7823 | ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR); |
| 7824 | VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR); |
| 7825 | VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, |
| 7826 | ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR); |
| 7827 | VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR); |
| 7828 | VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, |
| 7829 | ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR); |
| 7830 | VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR); |
| 7831 | VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR); |
| 7832 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 7833 | NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR); |
| 7834 | VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR); |
| 7835 | VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, |
| 7836 | NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR); |
| 7837 | VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR); |
| 7838 | VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR); |
| 7839 | VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 7840 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR); |
| 7841 | VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
| 7842 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR); |
| 7843 | VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 7844 | SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR); |
| 7845 | VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR); |
| 7846 | VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR); |
| 7847 | VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR); |
| 7848 | VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR); |
| 7849 | VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR); |
| 7850 | VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
| 7851 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR); |
| 7852 | VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR); |
| 7853 | VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR); |
| 7854 | VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR); |
| 7855 | VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 7856 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR); |
| 7857 | VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR); |
| 7858 | VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR); |
| 7859 | VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR); |
| 7860 | VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR); |
| 7861 | VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR); |
| 7862 | VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR); |
| 7863 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR); |
| 7864 | VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR); |
| 7865 | VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR); |
| 7866 | VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, |
| 7867 | SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR); |
| 7868 | VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, |
| 7869 | ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting |
| 7870 | VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, |
| 7871 | ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting |
| 7872 | VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, |
| 7873 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting |
| 7874 | } |
| 7875 | |
| 7876 | /** |
| 7877 | * Keys we no longer back up under the current schema, but want to continue to |
| 7878 | * process when restoring historical backup datasets. |
| 7879 | * |
| 7880 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 7881 | * otherwise they won't be restored. |
| 7882 | * |
| 7883 | * @hide |
| 7884 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 7885 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7886 | ENABLED_NOTIFICATION_LISTENERS, |
| 7887 | ENABLED_NOTIFICATION_ASSISTANT, |
| 7888 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 7889 | }; |
| 7890 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7891 | /** |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7892 | * These entries are considered common between the personal and the managed profile, |
| 7893 | * since the managed profile doesn't get to change them. |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7894 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7895 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 7896 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7897 | static { |
| 7898 | CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); |
| 7899 | CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); |
| 7900 | CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); |
Felipe Leme | aa00896 | 2017-04-18 14:54:33 -0700 | [diff] [blame] | 7901 | CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7902 | CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); |
| 7903 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 7904 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); |
Lifu Tang | 0cba58f | 2018-01-23 21:14:15 -0800 | [diff] [blame] | 7905 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7906 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); |
| 7907 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7908 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7909 | } |
| 7910 | |
| 7911 | /** @hide */ |
| 7912 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 7913 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 7914 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7915 | |
| 7916 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7917 | * Secure settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7918 | * @hide |
| 7919 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7920 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7921 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7922 | INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 7923 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); |
| 7924 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); |
Chad Brubaker | 9408d51 | 2017-03-28 16:11:38 -0700 | [diff] [blame] | 7925 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); |
| 7926 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); |
| 7927 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); |
| 7928 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); |
| 7929 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); |
| 7930 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); |
| 7931 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); |
| 7932 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); |
| 7933 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); |
Chad Brubaker | d9285b5 | 2017-04-27 15:28:57 -0700 | [diff] [blame] | 7934 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); |
| 7935 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); |
| 7936 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); |
| 7937 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); |
| 7938 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); |
| 7939 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7940 | |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7941 | INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); |
| 7942 | INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); |
Chad Brubaker | 1bed937 | 2017-03-20 10:52:52 -0700 | [diff] [blame] | 7943 | |
| 7944 | INSTANT_APP_SETTINGS.add(ANDROID_ID); |
Chad Brubaker | 8d7b36f | 2017-04-06 22:57:18 -0700 | [diff] [blame] | 7945 | |
| 7946 | INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 7947 | INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7948 | } |
| 7949 | |
| 7950 | /** |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7951 | * Helper method for determining if a location provider is enabled. |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 7952 | * |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7953 | * @param cr the content resolver to use |
| 7954 | * @param provider the location provider to query |
| 7955 | * @return true if the provider is enabled |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 7956 | * |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 7957 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7958 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7959 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7960 | public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7961 | return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId()); |
| 7962 | } |
| 7963 | |
| 7964 | /** |
| 7965 | * Helper method for determining if a location provider is enabled. |
| 7966 | * @param cr the content resolver to use |
| 7967 | * @param provider the location provider to query |
| 7968 | * @param userId the userId to query |
| 7969 | * @return true if the provider is enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 7970 | * |
| 7971 | * @deprecated use {@link LocationManager#isProviderEnabled(String)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7972 | * @hide |
| 7973 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7974 | @Deprecated |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 7975 | public static final boolean isLocationProviderEnabledForUser( |
| 7976 | ContentResolver cr, String provider, int userId) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7977 | String allowedProviders = Settings.Secure.getStringForUser(cr, |
| 7978 | LOCATION_PROVIDERS_ALLOWED, userId); |
Brad Fitzpatrick | 11fe181 | 2010-09-10 16:07:52 -0700 | [diff] [blame] | 7979 | return TextUtils.delimitedStringContains(allowedProviders, ',', provider); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7980 | } |
| 7981 | |
| 7982 | /** |
| 7983 | * Thread-safe method for enabling or disabling a single location provider. |
| 7984 | * @param cr the content resolver to use |
| 7985 | * @param provider the location provider to enable or disable |
| 7986 | * @param enabled true if the provider should be enabled |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 7987 | * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to |
| 7988 | * change location settings. |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7989 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7990 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7991 | public static final void setLocationProviderEnabled(ContentResolver cr, |
| 7992 | String provider, boolean enabled) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7993 | setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId()); |
| 7994 | } |
| 7995 | |
| 7996 | /** |
| 7997 | * Thread-safe method for enabling or disabling a single location provider. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7998 | * |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7999 | * @param cr the content resolver to use |
| 8000 | * @param provider the location provider to enable or disable |
| 8001 | * @param enabled true if the provider should be enabled |
| 8002 | * @param userId the userId for which to enable/disable providers |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8003 | * @return true if the value was set, false on database errors |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8004 | * |
| 8005 | * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8006 | * @hide |
| 8007 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8008 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8009 | public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 8010 | String provider, boolean enabled, int userId) { |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8011 | synchronized (mLocationSettingsLock) { |
| 8012 | // to ensure thread safety, we write the provider name with a '+' or '-' |
| 8013 | // and let the SettingsProvider handle it rather than reading and modifying |
| 8014 | // the list of enabled providers. |
| 8015 | if (enabled) { |
| 8016 | provider = "+" + provider; |
| 8017 | } else { |
| 8018 | provider = "-" + provider; |
| 8019 | } |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8020 | return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 8021 | userId); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8022 | } |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 8023 | } |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8024 | |
| 8025 | /** |
| 8026 | * Thread-safe method for setting the location mode to one of |
| 8027 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
| 8028 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8029 | * Necessary because the mode is a composite of the underlying location provider |
| 8030 | * settings. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8031 | * |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8032 | * @param cr the content resolver to use |
| 8033 | * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} |
| 8034 | * @param userId the userId for which to change mode |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8035 | * @return true if the value was set, false on database errors |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8036 | * |
| 8037 | * @throws IllegalArgumentException if mode is not one of the supported values |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8038 | * |
| 8039 | * @deprecated To enable/disable location, use |
| 8040 | * {@link LocationManager#setLocationEnabledForUser(boolean, int)}. |
| 8041 | * To enable/disable a specific location provider, use |
| 8042 | * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8043 | */ |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8044 | @Deprecated |
| 8045 | private static boolean setLocationModeForUser( |
| 8046 | ContentResolver cr, int mode, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8047 | synchronized (mLocationSettingsLock) { |
| 8048 | boolean gps = false; |
| 8049 | boolean network = false; |
| 8050 | switch (mode) { |
| 8051 | case LOCATION_MODE_OFF: |
| 8052 | break; |
| 8053 | case LOCATION_MODE_SENSORS_ONLY: |
| 8054 | gps = true; |
| 8055 | break; |
| 8056 | case LOCATION_MODE_BATTERY_SAVING: |
| 8057 | network = true; |
| 8058 | break; |
| 8059 | case LOCATION_MODE_HIGH_ACCURACY: |
| 8060 | gps = true; |
| 8061 | network = true; |
| 8062 | break; |
| 8063 | default: |
| 8064 | throw new IllegalArgumentException("Invalid location mode: " + mode); |
| 8065 | } |
Maggie | aa080f9 | 2018-01-04 15:35:11 -0800 | [diff] [blame] | 8066 | |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8067 | boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8068 | cr, LocationManager.NETWORK_PROVIDER, network, userId); |
Tom O'Neill | 7731a99 | 2014-10-09 11:30:49 -0700 | [diff] [blame] | 8069 | boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
| 8070 | cr, LocationManager.GPS_PROVIDER, gps, userId); |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 8071 | return gpsSuccess && nlpSuccess; |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8072 | } |
| 8073 | } |
| 8074 | |
| 8075 | /** |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8076 | * Thread-safe method for reading the location mode, returns one of |
| 8077 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 8078 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary |
| 8079 | * 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] | 8080 | * |
| 8081 | * @param cr the content resolver to use |
| 8082 | * @param userId the userId for which to read the mode |
| 8083 | * @return the location mode |
| 8084 | */ |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 8085 | private static final int getLocationModeForUser(ContentResolver cr, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 8086 | synchronized (mLocationSettingsLock) { |
| 8087 | boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8088 | cr, LocationManager.GPS_PROVIDER, userId); |
| 8089 | boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 8090 | cr, LocationManager.NETWORK_PROVIDER, userId); |
| 8091 | if (gpsEnabled && networkEnabled) { |
| 8092 | return LOCATION_MODE_HIGH_ACCURACY; |
| 8093 | } else if (gpsEnabled) { |
| 8094 | return LOCATION_MODE_SENSORS_ONLY; |
| 8095 | } else if (networkEnabled) { |
| 8096 | return LOCATION_MODE_BATTERY_SAVING; |
| 8097 | } else { |
| 8098 | return LOCATION_MODE_OFF; |
| 8099 | } |
| 8100 | } |
| 8101 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8102 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 8103 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8104 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8105 | * Global system settings, containing preferences that always apply identically |
| 8106 | * to all defined users. Applications can read these but are not allowed to write; |
| 8107 | * like the "Secure" settings, these are for preferences that the user must |
| 8108 | * explicitly modify through the system UI or specialized APIs for those values. |
| 8109 | */ |
| 8110 | public static final class Global extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 8111 | // NOTE: If you add new settings here, be sure to add them to |
| 8112 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. |
| 8113 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8114 | /** |
| 8115 | * The content:// style URL for global secure settings items. Not public. |
| 8116 | */ |
| 8117 | public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); |
| 8118 | |
| 8119 | /** |
Amith Yamasani | 23a0f05 | 2014-07-25 12:26:53 -0700 | [diff] [blame] | 8120 | * Whether users are allowed to add more users or guest from lockscreen. |
| 8121 | * <p> |
| 8122 | * Type: int |
| 8123 | * @hide |
| 8124 | */ |
| 8125 | public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; |
| 8126 | |
| 8127 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8128 | * Setting whether the global gesture for enabling accessibility is enabled. |
| 8129 | * If this gesture is enabled the user will be able to perfrom it to enable |
| 8130 | * the accessibility state without visiting the settings app. |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8131 | * |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8132 | * @hide |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 8133 | * No longer used. Should be removed once all dependencies have been updated. |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 8134 | */ |
| 8135 | public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = |
| 8136 | "enable_accessibility_global_gesture_enabled"; |
| 8137 | |
| 8138 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8139 | * Whether Airplane Mode is on. |
| 8140 | */ |
| 8141 | public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; |
| 8142 | |
| 8143 | /** |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8144 | * Whether Theater Mode is on. |
| 8145 | * {@hide} |
| 8146 | */ |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 8147 | @SystemApi |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 8148 | public static final String THEATER_MODE_ON = "theater_mode_on"; |
| 8149 | |
| 8150 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8151 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. |
| 8152 | */ |
| 8153 | public static final String RADIO_BLUETOOTH = "bluetooth"; |
| 8154 | |
| 8155 | /** |
| 8156 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. |
| 8157 | */ |
| 8158 | public static final String RADIO_WIFI = "wifi"; |
| 8159 | |
| 8160 | /** |
| 8161 | * {@hide} |
| 8162 | */ |
| 8163 | public static final String RADIO_WIMAX = "wimax"; |
| 8164 | /** |
| 8165 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
| 8166 | */ |
| 8167 | public static final String RADIO_CELL = "cell"; |
| 8168 | |
| 8169 | /** |
| 8170 | * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. |
| 8171 | */ |
| 8172 | public static final String RADIO_NFC = "nfc"; |
| 8173 | |
| 8174 | /** |
| 8175 | * A comma separated list of radios that need to be disabled when airplane mode |
| 8176 | * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are |
| 8177 | * included in the comma separated list. |
| 8178 | */ |
| 8179 | public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; |
| 8180 | |
| 8181 | /** |
| 8182 | * A comma separated list of radios that should to be disabled when airplane mode |
| 8183 | * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is |
| 8184 | * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi |
| 8185 | * will be turned off when entering airplane mode, but the user will be able to reenable |
| 8186 | * Wifi in the Settings app. |
| 8187 | * |
| 8188 | * {@hide} |
| 8189 | */ |
| 8190 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; |
| 8191 | |
| 8192 | /** |
Pulkit Bhuwalka | 547853d | 2017-09-25 17:55:12 -0700 | [diff] [blame] | 8193 | * An integer representing the Bluetooth Class of Device (CoD). |
| 8194 | * |
| 8195 | * @hide |
| 8196 | */ |
| 8197 | public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; |
| 8198 | |
| 8199 | /** |
Bryce Lee | ec85f34 | 2015-12-16 13:32:28 -0800 | [diff] [blame] | 8200 | * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. |
| 8201 | * See {@link android.bluetooth.BluetoothProfile}. |
| 8202 | * {@hide} |
| 8203 | */ |
| 8204 | public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; |
| 8205 | |
| 8206 | /** |
Andre Eisenbach | 82a94d9 | 2016-01-14 14:20:34 -0800 | [diff] [blame] | 8207 | * A semi-colon separated list of Bluetooth interoperability workarounds. |
| 8208 | * Each entry is a partial Bluetooth device address string and an integer representing |
| 8209 | * the feature to be disabled, separated by a comma. The integer must correspond |
| 8210 | * to a interoperability feature as defined in "interop.h" in /system/bt. |
| 8211 | * <p> |
| 8212 | * Example: <br/> |
| 8213 | * "00:11:22,0;01:02:03:04,2" |
| 8214 | * @hide |
| 8215 | */ |
| 8216 | public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; |
| 8217 | |
| 8218 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8219 | * The policy for deciding when Wi-Fi should go to sleep (which will in |
| 8220 | * turn switch to using the mobile data as an Internet connection). |
| 8221 | * <p> |
| 8222 | * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, |
| 8223 | * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or |
| 8224 | * {@link #WIFI_SLEEP_POLICY_NEVER}. |
| 8225 | */ |
| 8226 | public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; |
| 8227 | |
| 8228 | /** |
| 8229 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep |
| 8230 | * policy, which is to sleep shortly after the turning off |
| 8231 | * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. |
| 8232 | */ |
| 8233 | public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; |
| 8234 | |
| 8235 | /** |
| 8236 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when |
| 8237 | * the device is on battery, and never go to sleep when the device is |
| 8238 | * plugged in. |
| 8239 | */ |
| 8240 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; |
| 8241 | |
| 8242 | /** |
| 8243 | * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. |
| 8244 | */ |
| 8245 | public static final int WIFI_SLEEP_POLICY_NEVER = 2; |
| 8246 | |
| 8247 | /** |
| 8248 | * Value to specify if the user prefers the date, time and time zone |
| 8249 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8250 | */ |
| 8251 | public static final String AUTO_TIME = "auto_time"; |
| 8252 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8253 | private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8254 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8255 | /** |
| 8256 | * Value to specify if the user prefers the time zone |
| 8257 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 8258 | */ |
| 8259 | public static final String AUTO_TIME_ZONE = "auto_time_zone"; |
| 8260 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8261 | private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8262 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8263 | /** |
| 8264 | * URI for the car dock "in" event sound. |
| 8265 | * @hide |
| 8266 | */ |
| 8267 | public static final String CAR_DOCK_SOUND = "car_dock_sound"; |
| 8268 | |
| 8269 | /** |
| 8270 | * URI for the car dock "out" event sound. |
| 8271 | * @hide |
| 8272 | */ |
| 8273 | public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; |
| 8274 | |
| 8275 | /** |
| 8276 | * URI for the desk dock "in" event sound. |
| 8277 | * @hide |
| 8278 | */ |
| 8279 | public static final String DESK_DOCK_SOUND = "desk_dock_sound"; |
| 8280 | |
| 8281 | /** |
| 8282 | * URI for the desk dock "out" event sound. |
| 8283 | * @hide |
| 8284 | */ |
| 8285 | public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; |
| 8286 | |
| 8287 | /** |
| 8288 | * Whether to play a sound for dock events. |
| 8289 | * @hide |
| 8290 | */ |
| 8291 | public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; |
| 8292 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8293 | private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8294 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8295 | /** |
Vinod Krishnan | cf11cea | 2016-10-20 22:57:02 -0700 | [diff] [blame] | 8296 | * Whether to play a sound for dock events, only when an accessibility service is on. |
| 8297 | * @hide |
| 8298 | */ |
| 8299 | public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; |
| 8300 | |
| 8301 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8302 | * URI for the "device locked" (keyguard shown) sound. |
| 8303 | * @hide |
| 8304 | */ |
| 8305 | public static final String LOCK_SOUND = "lock_sound"; |
| 8306 | |
| 8307 | /** |
| 8308 | * URI for the "device unlocked" sound. |
| 8309 | * @hide |
| 8310 | */ |
| 8311 | public static final String UNLOCK_SOUND = "unlock_sound"; |
| 8312 | |
| 8313 | /** |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 8314 | * URI for the "device is trusted" sound, which is played when the device enters the trusted |
| 8315 | * state without unlocking. |
| 8316 | * @hide |
| 8317 | */ |
| 8318 | public static final String TRUSTED_SOUND = "trusted_sound"; |
| 8319 | |
| 8320 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8321 | * URI for the low battery sound file. |
| 8322 | * @hide |
| 8323 | */ |
| 8324 | public static final String LOW_BATTERY_SOUND = "low_battery_sound"; |
| 8325 | |
| 8326 | /** |
| 8327 | * Whether to play a sound for low-battery alerts. |
| 8328 | * @hide |
| 8329 | */ |
| 8330 | public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; |
| 8331 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8332 | private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8333 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8334 | /** |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 8335 | * URI for the "wireless charging started" sound. |
| 8336 | * @hide |
| 8337 | */ |
| 8338 | public static final String WIRELESS_CHARGING_STARTED_SOUND = |
| 8339 | "wireless_charging_started_sound"; |
| 8340 | |
| 8341 | /** |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8342 | * Whether to play a sound for charging events. |
| 8343 | * @hide |
| 8344 | */ |
| 8345 | public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; |
| 8346 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8347 | private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8348 | |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 8349 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8350 | * Whether we keep the device on while the device is plugged in. |
| 8351 | * Supported values are: |
| 8352 | * <ul> |
| 8353 | * <li>{@code 0} to never stay on while plugged in</li> |
| 8354 | * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> |
| 8355 | * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> |
| 8356 | * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> |
| 8357 | * </ul> |
| 8358 | * These values can be OR-ed together. |
| 8359 | */ |
| 8360 | public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; |
| 8361 | |
Michal Karpinski | 2c37b08 | 2018-01-18 16:14:27 +0000 | [diff] [blame] | 8362 | private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { |
| 8363 | @Override |
| 8364 | public boolean validate(String value) { |
| 8365 | try { |
| 8366 | int val = Integer.parseInt(value); |
| 8367 | return (val == 0) |
| 8368 | || (val == BatteryManager.BATTERY_PLUGGED_AC) |
| 8369 | || (val == BatteryManager.BATTERY_PLUGGED_USB) |
| 8370 | || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) |
| 8371 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8372 | | BatteryManager.BATTERY_PLUGGED_USB)) |
| 8373 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8374 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8375 | || (val == (BatteryManager.BATTERY_PLUGGED_USB |
| 8376 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)) |
| 8377 | || (val == (BatteryManager.BATTERY_PLUGGED_AC |
| 8378 | | BatteryManager.BATTERY_PLUGGED_USB |
| 8379 | | BatteryManager.BATTERY_PLUGGED_WIRELESS)); |
| 8380 | } catch (NumberFormatException e) { |
| 8381 | return false; |
| 8382 | } |
| 8383 | } |
| 8384 | }; |
| 8385 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8386 | /** |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8387 | * When the user has enable the option to have a "bug report" command |
| 8388 | * in the power menu. |
| 8389 | * @hide |
| 8390 | */ |
| 8391 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 8392 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8393 | private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8394 | |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 8395 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8396 | * Whether ADB is enabled. |
| 8397 | */ |
| 8398 | public static final String ADB_ENABLED = "adb_enabled"; |
| 8399 | |
| 8400 | /** |
Jon Miranda | 836c0a8 | 2014-08-11 12:32:26 -0700 | [diff] [blame] | 8401 | * Whether Views are allowed to save their attribute data. |
| 8402 | * @hide |
| 8403 | */ |
| 8404 | public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; |
| 8405 | |
| 8406 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8407 | * Whether assisted GPS should be enabled or not. |
| 8408 | * @hide |
| 8409 | */ |
| 8410 | public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; |
| 8411 | |
| 8412 | /** |
| 8413 | * Whether bluetooth is enabled/disabled |
| 8414 | * 0=disabled. 1=enabled. |
| 8415 | */ |
| 8416 | public static final String BLUETOOTH_ON = "bluetooth_on"; |
| 8417 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 8418 | private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; |
| 8419 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8420 | /** |
| 8421 | * CDMA Cell Broadcast SMS |
| 8422 | * 0 = CDMA Cell Broadcast SMS disabled |
| 8423 | * 1 = CDMA Cell Broadcast SMS enabled |
| 8424 | * @hide |
| 8425 | */ |
| 8426 | public static final String CDMA_CELL_BROADCAST_SMS = |
| 8427 | "cdma_cell_broadcast_sms"; |
| 8428 | |
| 8429 | /** |
| 8430 | * The CDMA roaming mode 0 = Home Networks, CDMA default |
| 8431 | * 1 = Roaming on Affiliated networks |
| 8432 | * 2 = Roaming on any networks |
| 8433 | * @hide |
| 8434 | */ |
| 8435 | public static final String CDMA_ROAMING_MODE = "roaming_settings"; |
| 8436 | |
| 8437 | /** |
| 8438 | * The CDMA subscription mode 0 = RUIM/SIM (default) |
| 8439 | * 1 = NV |
| 8440 | * @hide |
| 8441 | */ |
| 8442 | public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; |
| 8443 | |
Narayan Kamath | 94bcdbc | 2017-07-17 15:32:53 +0100 | [diff] [blame] | 8444 | /** |
| 8445 | * The default value for whether background data is enabled or not. |
| 8446 | * |
| 8447 | * Used by {@code NetworkPolicyManagerService}. |
| 8448 | * |
| 8449 | * @hide |
| 8450 | */ |
| 8451 | public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = |
| 8452 | "default_restrict_background_data"; |
| 8453 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8454 | /** Inactivity timeout to track mobile data activity. |
| 8455 | * |
| 8456 | * If set to a positive integer, it indicates the inactivity timeout value in seconds to |
| 8457 | * infer the data activity of mobile network. After a period of no activity on mobile |
| 8458 | * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} |
| 8459 | * intent is fired to indicate a transition of network status from "active" to "idle". Any |
| 8460 | * subsequent activity on mobile networks triggers the firing of {@code |
| 8461 | * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". |
| 8462 | * |
| 8463 | * Network activity refers to transmitting or receiving data on the network interfaces. |
| 8464 | * |
| 8465 | * Tracking is disabled if set to zero or negative value. |
| 8466 | * |
| 8467 | * @hide |
| 8468 | */ |
| 8469 | public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; |
| 8470 | |
| 8471 | /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} |
| 8472 | * but for Wifi network. |
| 8473 | * @hide |
| 8474 | */ |
| 8475 | public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; |
| 8476 | |
| 8477 | /** |
| 8478 | * Whether or not data roaming is enabled. (0 = false, 1 = true) |
| 8479 | */ |
| 8480 | public static final String DATA_ROAMING = "data_roaming"; |
| 8481 | |
| 8482 | /** |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 8483 | * The value passed to a Mobile DataConnection via bringUp which defines the |
| 8484 | * number of retries to preform when setting up the initial connection. The default |
| 8485 | * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. |
| 8486 | * @hide |
| 8487 | */ |
| 8488 | public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; |
| 8489 | |
| 8490 | /** |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8491 | * Whether any package can be on external storage. When this is true, any |
| 8492 | * package, regardless of manifest values, is a candidate for installing |
| 8493 | * or moving onto external storage. (0 = false, 1 = true) |
| 8494 | * @hide |
| 8495 | */ |
| 8496 | public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; |
| 8497 | |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8498 | /** |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 8499 | * The default SM-DP+ configured for this device. |
| 8500 | * |
| 8501 | * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to |
| 8502 | * download profiles. If this value is set, the LPA will query this server for any profiles |
| 8503 | * available to this device. If any are available, they may be downloaded during device |
| 8504 | * provisioning or in settings without needing the user to enter an activation code. |
| 8505 | * |
| 8506 | * @see android.service.euicc.EuiccService |
| 8507 | * @hide |
| 8508 | * |
| 8509 | * TODO(b/35851809): Make this a SystemApi. |
| 8510 | */ |
| 8511 | public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; |
| 8512 | |
| 8513 | /** |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 8514 | * Whether any profile has ever been downloaded onto a eUICC on the device. |
| 8515 | * |
| 8516 | * <p>Used to hide eUICC UI from users who have never made use of it and would only be |
| 8517 | * confused by seeing references to it in settings. |
| 8518 | * (0 = false, 1 = true) |
| 8519 | * @hide |
| 8520 | */ |
| 8521 | public static final String EUICC_PROVISIONED = "euicc_provisioned"; |
| 8522 | |
| 8523 | /** |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8524 | * Whether any activity can be resized. When this is true, any |
| 8525 | * activity, regardless of manifest values, can be resized for multi-window. |
| 8526 | * (0 = false, 1 = true) |
| 8527 | * @hide |
| 8528 | */ |
| 8529 | public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES |
| 8530 | = "force_resizable_activities"; |
| 8531 | |
Jorim Jaggi | 6f2efd3 | 2015-12-23 12:04:39 +0100 | [diff] [blame] | 8532 | /** |
| 8533 | * Whether to enable experimental freeform support for windows. |
| 8534 | * @hide |
| 8535 | */ |
| 8536 | public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT |
| 8537 | = "enable_freeform_support"; |
| 8538 | |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8539 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8540 | * Whether user has enabled development settings. |
| 8541 | */ |
| 8542 | public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; |
| 8543 | |
| 8544 | /** |
Amith Yamasani | cb15d66 | 2015-11-10 11:11:15 -0800 | [diff] [blame] | 8545 | * Whether the device has been provisioned (0 = false, 1 = true). |
| 8546 | * <p>On a multiuser device with a separate system user, the screen may be locked |
| 8547 | * as soon as this is set to true and further activities cannot be launched on the |
| 8548 | * system user unless they are marked to show over keyguard. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8549 | */ |
| 8550 | public static final String DEVICE_PROVISIONED = "device_provisioned"; |
| 8551 | |
| 8552 | /** |
Robert Greenwalt | beb482c | 2016-03-28 15:40:56 -0700 | [diff] [blame] | 8553 | * Whether mobile data should be allowed while the device is being provisioned. |
| 8554 | * This allows the provisioning process to turn off mobile data before the user |
| 8555 | * has an opportunity to set things up, preventing other processes from burning |
| 8556 | * precious bytes before wifi is setup. |
| 8557 | * (0 = false, 1 = true) |
| 8558 | * @hide |
| 8559 | */ |
| 8560 | public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = |
| 8561 | "device_provisioning_mobile_data"; |
| 8562 | |
| 8563 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8564 | * The saved value for WindowManagerService.setForcedDisplaySize(). |
| 8565 | * Two integers separated by a comma. If unset, then use the real display size. |
| 8566 | * @hide |
| 8567 | */ |
| 8568 | public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; |
| 8569 | |
| 8570 | /** |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 8571 | * The saved value for WindowManagerService.setForcedDisplayScalingMode(). |
| 8572 | * 0 or unset if scaling is automatic, 1 if scaling is disabled. |
| 8573 | * @hide |
| 8574 | */ |
| 8575 | public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; |
| 8576 | |
| 8577 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8578 | * The maximum size, in bytes, of a download that the download manager will transfer over |
| 8579 | * a non-wifi connection. |
| 8580 | * @hide |
| 8581 | */ |
| 8582 | public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = |
| 8583 | "download_manager_max_bytes_over_mobile"; |
| 8584 | |
| 8585 | /** |
| 8586 | * The recommended maximum size, in bytes, of a download that the download manager should |
| 8587 | * transfer over a non-wifi connection. Over this size, the use will be warned, but will |
| 8588 | * have the option to start the download over the mobile connection anyway. |
| 8589 | * @hide |
| 8590 | */ |
| 8591 | public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = |
| 8592 | "download_manager_recommended_max_bytes_over_mobile"; |
| 8593 | |
| 8594 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8595 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8596 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8597 | @Deprecated |
| 8598 | 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] | 8599 | |
| 8600 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8601 | * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be |
| 8602 | * sent or processed. (0 = false, 1 = true) |
| 8603 | * @hide |
| 8604 | */ |
| 8605 | public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; |
| 8606 | |
| 8607 | /** |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8608 | * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on |
| 8609 | * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will |
| 8610 | * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be |
| 8611 | * activated. |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8612 | * @hide |
| 8613 | */ |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8614 | public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = |
| 8615 | "hdmi_system_audio_control_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8616 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8617 | /** |
| 8618 | * Whether TV will automatically turn on upon reception of the CEC command |
| 8619 | * <Text View On> or <Image View On>. (0 = false, 1 = true) |
| 8620 | * |
| 8621 | * @hide |
| 8622 | */ |
| 8623 | public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = |
| 8624 | "hdmi_control_auto_wakeup_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8625 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8626 | /** |
| 8627 | * Whether TV will also turn off other CEC devices when it goes to standby mode. |
| 8628 | * (0 = false, 1 = true) |
| 8629 | * |
| 8630 | * @hide |
| 8631 | */ |
| 8632 | public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = |
| 8633 | "hdmi_control_auto_device_off_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8634 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8635 | /** |
| 8636 | * If <b>true</b>, enables out-of-the-box execution for priv apps. |
| 8637 | * Default: false |
| 8638 | * Values: 0 = false, 1 = true |
| 8639 | * |
| 8640 | * @hide |
| 8641 | */ |
| 8642 | public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled"; |
| 8643 | |
| 8644 | /** |
| 8645 | * The interval in milliseconds at which location requests will be throttled when they are |
| 8646 | * coming from the background. |
| 8647 | * |
| 8648 | * @hide |
| 8649 | */ |
| 8650 | public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = |
Soonil Nagarkar | 7decfb6 | 2017-01-18 12:18:49 -0800 | [diff] [blame] | 8651 | "location_background_throttle_interval_ms"; |
| 8652 | |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8653 | /** |
Lifu Tang | c94ef4d | 2017-03-23 23:48:00 -0700 | [diff] [blame] | 8654 | * Most frequent location update interval in milliseconds that proximity alert is allowed |
| 8655 | * to request. |
| 8656 | * @hide |
| 8657 | */ |
| 8658 | public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = |
| 8659 | "location_background_throttle_proximity_alert_interval_ms"; |
| 8660 | |
| 8661 | /** |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8662 | * Packages that are whitelisted for background throttling (throttling will not be applied). |
| 8663 | * @hide |
| 8664 | */ |
| 8665 | public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8666 | "location_background_throttle_package_whitelist"; |
| 8667 | |
Wei Wang | cdbffa9 | 2017-04-17 19:49:29 -0700 | [diff] [blame] | 8668 | /** |
| 8669 | * The interval in milliseconds at which wifi scan requests will be throttled when they are |
| 8670 | * coming from the background. |
| 8671 | * @hide |
| 8672 | */ |
| 8673 | public static final String WIFI_SCAN_BACKGROUND_THROTTLE_INTERVAL_MS = |
| 8674 | "wifi_scan_background_throttle_interval_ms"; |
| 8675 | |
| 8676 | /** |
| 8677 | * Packages that are whitelisted to be exempt for wifi background throttling. |
| 8678 | * @hide |
| 8679 | */ |
| 8680 | public static final String WIFI_SCAN_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8681 | "wifi_scan_background_throttle_package_whitelist"; |
| 8682 | |
| 8683 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8684 | * Whether TV will switch to MHL port when a mobile device is plugged in. |
| 8685 | * (0 = false, 1 = true) |
| 8686 | * @hide |
| 8687 | */ |
| 8688 | public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; |
| 8689 | |
| 8690 | /** |
| 8691 | * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) |
| 8692 | * @hide |
| 8693 | */ |
| 8694 | public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; |
| 8695 | |
| 8696 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8697 | * Whether mobile data connections are allowed by the user. See |
| 8698 | * ConnectivityManager for more info. |
| 8699 | * @hide |
| 8700 | */ |
| 8701 | public static final String MOBILE_DATA = "mobile_data"; |
| 8702 | |
Erik Kline | da4bfa8 | 2015-04-30 12:58:40 +0900 | [diff] [blame] | 8703 | /** |
| 8704 | * Whether the mobile data connection should remain active even when higher |
| 8705 | * priority networks like WiFi are active, to help make network switching faster. |
| 8706 | * |
| 8707 | * See ConnectivityService for more info. |
| 8708 | * |
| 8709 | * (0 = disabled, 1 = enabled) |
| 8710 | * @hide |
| 8711 | */ |
| 8712 | public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; |
| 8713 | |
Hugo Benichi | 05686db | 2016-10-19 11:17:28 +0900 | [diff] [blame] | 8714 | /** |
| 8715 | * Size of the event buffer for IP connectivity metrics. |
| 8716 | * @hide |
| 8717 | */ |
| 8718 | public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = |
| 8719 | "connectivity_metrics_buffer_size"; |
| 8720 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8721 | /** {@hide} */ |
| 8722 | public static final String NETSTATS_ENABLED = "netstats_enabled"; |
| 8723 | /** {@hide} */ |
| 8724 | public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; |
| 8725 | /** {@hide} */ |
| 8726 | public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; |
| 8727 | /** {@hide} */ |
| 8728 | public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; |
| 8729 | /** {@hide} */ |
| 8730 | public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; |
Jeff Sharkey | f4de294 | 2017-08-29 15:32:13 -0600 | [diff] [blame] | 8731 | /** {@hide} */ |
| 8732 | public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8733 | |
| 8734 | /** {@hide} */ |
| 8735 | public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; |
| 8736 | /** {@hide} */ |
| 8737 | public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; |
| 8738 | /** {@hide} */ |
| 8739 | public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; |
| 8740 | /** {@hide} */ |
| 8741 | public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; |
| 8742 | |
| 8743 | /** {@hide} */ |
| 8744 | public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; |
| 8745 | /** {@hide} */ |
| 8746 | public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; |
| 8747 | /** {@hide} */ |
| 8748 | public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; |
| 8749 | /** {@hide} */ |
| 8750 | public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; |
| 8751 | |
| 8752 | /** {@hide} */ |
| 8753 | public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; |
| 8754 | /** {@hide} */ |
| 8755 | public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; |
| 8756 | /** {@hide} */ |
| 8757 | public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; |
| 8758 | /** {@hide} */ |
| 8759 | public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; |
| 8760 | |
| 8761 | /** |
| 8762 | * User preference for which network(s) should be used. Only the |
| 8763 | * connectivity service should touch this. |
| 8764 | */ |
| 8765 | public static final String NETWORK_PREFERENCE = "network_preference"; |
| 8766 | |
| 8767 | /** |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 8768 | * Which package name to use for network scoring. If null, or if the package is not a valid |
| 8769 | * scorer app, external network scores will neither be requested nor accepted. |
| 8770 | * @hide |
| 8771 | */ |
| 8772 | public static final String NETWORK_SCORER_APP = "network_scorer_app"; |
| 8773 | |
| 8774 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8775 | * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment |
| 8776 | * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been |
| 8777 | * exceeded. |
| 8778 | * @hide |
| 8779 | */ |
| 8780 | public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; |
| 8781 | |
| 8782 | /** |
| 8783 | * The length of time in milli-seconds that automatic small adjustments to |
| 8784 | * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. |
| 8785 | * @hide |
| 8786 | */ |
| 8787 | public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; |
| 8788 | |
| 8789 | /** Preferred NTP server. {@hide} */ |
| 8790 | public static final String NTP_SERVER = "ntp_server"; |
| 8791 | /** Timeout in milliseconds to wait for NTP server. {@hide} */ |
| 8792 | public static final String NTP_TIMEOUT = "ntp_timeout"; |
| 8793 | |
Jeff Sharkey | e8a4b66 | 2015-06-27 15:43:45 -0700 | [diff] [blame] | 8794 | /** {@hide} */ |
| 8795 | public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; |
| 8796 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8797 | /** |
Pierre Imai | 8e48e67 | 2016-04-21 13:30:43 +0900 | [diff] [blame] | 8798 | * Sample validity in seconds to configure for the system DNS resolver. |
| 8799 | * {@hide} |
| 8800 | */ |
| 8801 | public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = |
| 8802 | "dns_resolver_sample_validity_seconds"; |
| 8803 | |
| 8804 | /** |
| 8805 | * Success threshold in percent for use with the system DNS resolver. |
| 8806 | * {@hide} |
| 8807 | */ |
| 8808 | public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = |
| 8809 | "dns_resolver_success_threshold_percent"; |
| 8810 | |
| 8811 | /** |
| 8812 | * Minimum number of samples needed for statistics to be considered meaningful in the |
| 8813 | * system DNS resolver. |
| 8814 | * {@hide} |
| 8815 | */ |
| 8816 | public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; |
| 8817 | |
| 8818 | /** |
| 8819 | * Maximum number taken into account for statistics purposes in the system DNS resolver. |
| 8820 | * {@hide} |
| 8821 | */ |
| 8822 | public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; |
| 8823 | |
| 8824 | /** |
Tao Bao | fdf7c5d | 2016-02-15 20:59:15 -0800 | [diff] [blame] | 8825 | * Whether to disable the automatic scheduling of system updates. |
| 8826 | * 1 = system updates won't be automatically scheduled (will always |
| 8827 | * present notification instead). |
| 8828 | * 0 = system updates will be automatically scheduled. (default) |
| 8829 | * @hide |
| 8830 | */ |
| 8831 | @SystemApi |
| 8832 | public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; |
| 8833 | |
| 8834 | /** |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8835 | * Whether the package manager should send package verification broadcasts for verifiers to |
| 8836 | * review apps prior to installation. |
| 8837 | * 1 = request apps to be verified prior to installation, if a verifier exists. |
| 8838 | * 0 = do not verify apps before installation |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8839 | * @hide |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8840 | */ |
| 8841 | public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; |
| 8842 | |
| 8843 | /** Timeout for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8844 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8845 | public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; |
| 8846 | |
| 8847 | /** Default response code for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8848 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8849 | public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; |
| 8850 | |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8851 | /** |
| 8852 | * Show package verification setting in the Settings app. |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 8853 | * 1 = show (default) |
| 8854 | * 0 = hide |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8855 | * @hide |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 8856 | */ |
| 8857 | public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; |
| 8858 | |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8859 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 8860 | * Run package verification on apps installed through ADB/ADT/USB |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8861 | * 1 = perform package verification on ADB installs (default) |
| 8862 | * 0 = bypass package verification on ADB installs |
| 8863 | * @hide |
| 8864 | */ |
| 8865 | public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; |
| 8866 | |
| 8867 | /** |
Christopher Tate | 7265abe | 2014-11-21 13:54:45 -0800 | [diff] [blame] | 8868 | * Time since last fstrim (milliseconds) after which we force one to happen |
| 8869 | * during device startup. If unset, the default is 3 days. |
| 8870 | * @hide |
| 8871 | */ |
| 8872 | public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; |
| 8873 | |
| 8874 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8875 | * The interval in milliseconds at which to check packet counts on the |
| 8876 | * mobile data interface when screen is on, to detect possible data |
| 8877 | * connection problems. |
| 8878 | * @hide |
| 8879 | */ |
| 8880 | public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = |
| 8881 | "pdp_watchdog_poll_interval_ms"; |
| 8882 | |
| 8883 | /** |
| 8884 | * The interval in milliseconds at which to check packet counts on the |
| 8885 | * mobile data interface when screen is off, to detect possible data |
| 8886 | * connection problems. |
| 8887 | * @hide |
| 8888 | */ |
| 8889 | public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = |
| 8890 | "pdp_watchdog_long_poll_interval_ms"; |
| 8891 | |
| 8892 | /** |
| 8893 | * The interval in milliseconds at which to check packet counts on the |
| 8894 | * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} |
| 8895 | * outgoing packets has been reached without incoming packets. |
| 8896 | * @hide |
| 8897 | */ |
| 8898 | public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = |
| 8899 | "pdp_watchdog_error_poll_interval_ms"; |
| 8900 | |
| 8901 | /** |
| 8902 | * The number of outgoing packets sent without seeing an incoming packet |
| 8903 | * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} |
| 8904 | * device is logged to the event log |
| 8905 | * @hide |
| 8906 | */ |
| 8907 | public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = |
| 8908 | "pdp_watchdog_trigger_packet_count"; |
| 8909 | |
| 8910 | /** |
| 8911 | * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) |
| 8912 | * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before |
| 8913 | * attempting data connection recovery. |
| 8914 | * @hide |
| 8915 | */ |
| 8916 | public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = |
| 8917 | "pdp_watchdog_error_poll_count"; |
| 8918 | |
| 8919 | /** |
| 8920 | * The number of failed PDP reset attempts before moving to something more |
| 8921 | * drastic: re-registering to the network. |
| 8922 | * @hide |
| 8923 | */ |
| 8924 | public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = |
| 8925 | "pdp_watchdog_max_pdp_reset_fail_count"; |
| 8926 | |
| 8927 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8928 | * URL to open browser on to allow user to manage a prepay account |
| 8929 | * @hide |
| 8930 | */ |
| 8931 | public static final String SETUP_PREPAID_DATA_SERVICE_URL = |
| 8932 | "setup_prepaid_data_service_url"; |
| 8933 | |
| 8934 | /** |
| 8935 | * URL to attempt a GET on to see if this is a prepay device |
| 8936 | * @hide |
| 8937 | */ |
| 8938 | public static final String SETUP_PREPAID_DETECTION_TARGET_URL = |
| 8939 | "setup_prepaid_detection_target_url"; |
| 8940 | |
| 8941 | /** |
| 8942 | * Host to check for a redirect to after an attempt to GET |
| 8943 | * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, |
| 8944 | * this is a prepaid device with zero balance.) |
| 8945 | * @hide |
| 8946 | */ |
| 8947 | public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = |
| 8948 | "setup_prepaid_detection_redir_host"; |
| 8949 | |
| 8950 | /** |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 8951 | * The interval in milliseconds at which to check the number of SMS sent out without asking |
| 8952 | * for use permit, to limit the un-authorized SMS usage. |
| 8953 | * |
| 8954 | * @hide |
| 8955 | */ |
| 8956 | public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = |
| 8957 | "sms_outgoing_check_interval_ms"; |
| 8958 | |
| 8959 | /** |
| 8960 | * The number of outgoing SMS sent without asking for user permit (of {@link |
| 8961 | * #SMS_OUTGOING_CHECK_INTERVAL_MS} |
| 8962 | * |
| 8963 | * @hide |
| 8964 | */ |
| 8965 | public static final String SMS_OUTGOING_CHECK_MAX_COUNT = |
| 8966 | "sms_outgoing_check_max_count"; |
| 8967 | |
| 8968 | /** |
| 8969 | * Used to disable SMS short code confirmation - defaults to true. |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 8970 | * 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] | 8971 | * @see com.android.internal.telephony.SmsUsageMonitor |
| 8972 | * @hide |
| 8973 | */ |
| 8974 | public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; |
| 8975 | |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 8976 | /** |
| 8977 | * Used to select which country we use to determine premium sms codes. |
| 8978 | * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, |
| 8979 | * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, |
| 8980 | * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. |
| 8981 | * @hide |
| 8982 | */ |
| 8983 | public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; |
| 8984 | |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 8985 | /** |
JP Abgrall | 32d1ac4d | 2014-02-21 12:05:20 -0800 | [diff] [blame] | 8986 | * Used to select TCP's default initial receiver window size in segments - defaults to a build config value |
| 8987 | * @hide |
| 8988 | */ |
| 8989 | public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; |
| 8990 | |
| 8991 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8992 | * Used to disable Tethering on a device - defaults to true |
| 8993 | * @hide |
| 8994 | */ |
| 8995 | public static final String TETHER_SUPPORTED = "tether_supported"; |
| 8996 | |
| 8997 | /** |
| 8998 | * Used to require DUN APN on the device or not - defaults to a build config value |
| 8999 | * which defaults to false |
| 9000 | * @hide |
| 9001 | */ |
| 9002 | public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; |
| 9003 | |
| 9004 | /** |
| 9005 | * Used to hold a gservices-provisioned apn value for DUN. If set, or the |
| 9006 | * corresponding build config values are set it will override the APN DB |
| 9007 | * values. |
| 9008 | * Consists of a comma seperated list of strings: |
| 9009 | * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" |
| 9010 | * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" |
| 9011 | * @hide |
| 9012 | */ |
| 9013 | public static final String TETHER_DUN_APN = "tether_dun_apn"; |
| 9014 | |
Erik Kline | 92c4db0 | 2017-05-31 10:21:32 +0900 | [diff] [blame] | 9015 | /** |
| 9016 | * Used to disable trying to talk to any available tethering offload HAL. |
| 9017 | * |
| 9018 | * Integer values are interpreted as boolean, and the absence of an explicit setting |
| 9019 | * is interpreted as |false|. |
| 9020 | * @hide |
| 9021 | */ |
| 9022 | public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; |
| 9023 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9024 | /** |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 9025 | * List of carrier apps which are whitelisted to prompt the user for install when |
| 9026 | * a sim card with matching uicc carrier privilege rules is inserted. |
| 9027 | * |
| 9028 | * The value is "package1;package2;..." |
| 9029 | * @hide |
| 9030 | */ |
| 9031 | public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; |
| 9032 | |
| 9033 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9034 | * USB Mass Storage Enabled |
| 9035 | */ |
| 9036 | public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; |
| 9037 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9038 | private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9039 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9040 | /** |
| 9041 | * If this setting is set (to anything), then all references |
| 9042 | * to Gmail on the device must change to Google Mail. |
| 9043 | */ |
| 9044 | public static final String USE_GOOGLE_MAIL = "use_google_mail"; |
| 9045 | |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 9046 | /** |
| 9047 | * Webview Data reduction proxy key. |
| 9048 | * @hide |
| 9049 | */ |
| 9050 | public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = |
| 9051 | "webview_data_reduction_proxy_key"; |
| 9052 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9053 | /** |
| 9054 | * Whether or not the WebView fallback mechanism should be enabled. |
| 9055 | * 0=disabled, 1=enabled. |
| 9056 | * @hide |
| 9057 | */ |
| 9058 | public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = |
| 9059 | "webview_fallback_logic_enabled"; |
Gustav Sennton | c83e3fa | 2016-02-18 12:19:13 +0000 | [diff] [blame] | 9060 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9061 | /** |
| 9062 | * Name of the package used as WebView provider (if unset the provider is instead determined |
| 9063 | * by the system). |
| 9064 | * @hide |
| 9065 | */ |
| 9066 | public static final String WEBVIEW_PROVIDER = "webview_provider"; |
Gustav Sennton | 14c033c | 2016-02-11 12:51:27 +0000 | [diff] [blame] | 9067 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 9068 | /** |
| 9069 | * Developer setting to enable WebView multiprocess rendering. |
| 9070 | * @hide |
| 9071 | */ |
| 9072 | @SystemApi |
| 9073 | public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; |
| 9074 | |
| 9075 | /** |
| 9076 | * The maximum number of notifications shown in 24 hours when switching networks. |
| 9077 | * @hide |
| 9078 | */ |
| 9079 | public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = |
| 9080 | "network_switch_notification_daily_limit"; |
| 9081 | |
| 9082 | /** |
| 9083 | * The minimum time in milliseconds between notifications when switching networks. |
| 9084 | * @hide |
| 9085 | */ |
| 9086 | public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = |
| 9087 | "network_switch_notification_rate_limit_millis"; |
Tobias Sargeant | da85710 | 2016-02-11 14:52:28 +0000 | [diff] [blame] | 9088 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9089 | /** |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9090 | * Whether to automatically switch away from wifi networks that lose Internet access. |
Lorenzo Colitti | 165c51c | 2016-09-19 01:00:19 +0900 | [diff] [blame] | 9091 | * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always |
| 9092 | * avoids such networks. Valid values are: |
| 9093 | * |
| 9094 | * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. |
| 9095 | * null: Ask the user whether to switch away from bad wifi. |
| 9096 | * 1: Avoid bad wifi. |
| 9097 | * |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 9098 | * @hide |
| 9099 | */ |
| 9100 | public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; |
| 9101 | |
| 9102 | /** |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9103 | * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be |
| 9104 | * overridden by the system based on device or application state. If null, the value |
| 9105 | * specified by config_networkMeteredMultipathPreference is used. |
| 9106 | * |
| 9107 | * @hide |
| 9108 | */ |
| 9109 | public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = |
| 9110 | "network_metered_multipath_preference"; |
| 9111 | |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 9112 | /** |
| 9113 | * Network watchlist last report time. |
| 9114 | * @hide |
| 9115 | */ |
| 9116 | public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = |
| 9117 | "network_watchlist_last_report_time"; |
| 9118 | |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 9119 | /** |
William Mee | cd62f3a | 2017-01-24 18:01:38 -0800 | [diff] [blame] | 9120 | * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of |
| 9121 | * colon-delimited key-value pairs. The key is the badging enum value defined in |
| 9122 | * android.net.ScoredNetwork and the value is the minimum sustained network throughput in |
| 9123 | * kbps required for the badge. For example: "10:3000,20:5000,30:25000" |
| 9124 | * |
| 9125 | * @hide |
| 9126 | */ |
| 9127 | @SystemApi |
| 9128 | public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; |
| 9129 | |
| 9130 | /** |
Jeff Brown | 89d5546 | 2012-09-19 11:33:42 -0700 | [diff] [blame] | 9131 | * Whether Wifi display is enabled/disabled |
| 9132 | * 0=disabled. 1=enabled. |
| 9133 | * @hide |
| 9134 | */ |
| 9135 | public static final String WIFI_DISPLAY_ON = "wifi_display_on"; |
| 9136 | |
| 9137 | /** |
Chong Zhang | 1f3ecaa | 2013-05-03 15:55:36 -0700 | [diff] [blame] | 9138 | * Whether Wifi display certification mode is enabled/disabled |
| 9139 | * 0=disabled. 1=enabled. |
| 9140 | * @hide |
| 9141 | */ |
| 9142 | public static final String WIFI_DISPLAY_CERTIFICATION_ON = |
| 9143 | "wifi_display_certification_on"; |
| 9144 | |
| 9145 | /** |
Chong Zhang | e38af81 | 2013-08-29 17:25:17 -0700 | [diff] [blame] | 9146 | * WPS Configuration method used by Wifi display, this setting only |
| 9147 | * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). |
| 9148 | * |
| 9149 | * Possible values are: |
| 9150 | * |
| 9151 | * WpsInfo.INVALID: use default WPS method chosen by framework |
| 9152 | * WpsInfo.PBC : use Push button |
| 9153 | * WpsInfo.KEYPAD : use Keypad |
| 9154 | * WpsInfo.DISPLAY: use Display |
| 9155 | * @hide |
| 9156 | */ |
| 9157 | public static final String WIFI_DISPLAY_WPS_CONFIG = |
| 9158 | "wifi_display_wps_config"; |
| 9159 | |
| 9160 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9161 | * Whether to notify the user of open networks. |
| 9162 | * <p> |
| 9163 | * If not connected and the scan results have an open network, we will |
| 9164 | * put this notification up. If we attempt to connect to a network or |
| 9165 | * the open network(s) disappear, we remove the notification. When we |
| 9166 | * show the notification, we will not show it again for |
| 9167 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9168 | * |
| 9169 | * @deprecated This feature is no longer controlled by this setting in |
| 9170 | * {@link android.os.Build.VERSION_CODES#O}. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9171 | */ |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9172 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9173 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9174 | "wifi_networks_available_notification_on"; |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 9175 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9176 | private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9177 | BOOLEAN_VALIDATOR; |
| 9178 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9179 | /** |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 9180 | * Whether to notify the user of carrier networks. |
| 9181 | * <p> |
| 9182 | * If not connected and the scan results have a carrier network, we will |
| 9183 | * put this notification up. If we attempt to connect to a network or |
| 9184 | * the carrier network(s) disappear, we remove the notification. When we |
| 9185 | * show the notification, we will not show it again for |
| 9186 | * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
| 9187 | * @hide |
| 9188 | */ |
| 9189 | public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9190 | "wifi_carrier_networks_available_notification_on"; |
| 9191 | |
| 9192 | private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = |
| 9193 | BOOLEAN_VALIDATOR; |
| 9194 | |
| 9195 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9196 | * {@hide} |
| 9197 | */ |
| 9198 | public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 9199 | "wimax_networks_available_notification_on"; |
| 9200 | |
| 9201 | /** |
| 9202 | * Delay (in seconds) before repeating the Wi-Fi networks available notification. |
| 9203 | * Connecting to a network will reset the timer. |
| 9204 | */ |
| 9205 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 9206 | "wifi_networks_available_repeat_delay"; |
| 9207 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9208 | private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = |
| 9209 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9210 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9211 | /** |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 9212 | * 802.11 country code in ISO 3166 format |
| 9213 | * @hide |
| 9214 | */ |
| 9215 | public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; |
| 9216 | |
| 9217 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9218 | * The interval in milliseconds to issue wake up scans when wifi needs |
| 9219 | * to connect. This is necessary to connect to an access point when |
| 9220 | * device is on the move and the screen is off. |
| 9221 | * @hide |
| 9222 | */ |
| 9223 | public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = |
| 9224 | "wifi_framework_scan_interval_ms"; |
| 9225 | |
| 9226 | /** |
| 9227 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 9228 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 9229 | * the mobile data network. |
| 9230 | * @hide |
| 9231 | */ |
| 9232 | public static final String WIFI_IDLE_MS = "wifi_idle_ms"; |
| 9233 | |
| 9234 | /** |
| 9235 | * When the number of open networks exceeds this number, the |
| 9236 | * least-recently-used excess networks will be removed. |
| 9237 | */ |
| 9238 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; |
| 9239 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 9240 | private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = |
| 9241 | NON_NEGATIVE_INTEGER_VALIDATOR; |
| 9242 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9243 | /** |
| 9244 | * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. |
| 9245 | */ |
| 9246 | public static final String WIFI_ON = "wifi_on"; |
| 9247 | |
| 9248 | /** |
Irfan Sheriff | 11aefad | 2013-03-06 07:57:41 -0800 | [diff] [blame] | 9249 | * Setting to allow scans to be enabled even wifi is turned off for connectivity. |
| 9250 | * @hide |
| 9251 | */ |
| 9252 | public static final String WIFI_SCAN_ALWAYS_AVAILABLE = |
| 9253 | "wifi_scan_always_enabled"; |
| 9254 | |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9255 | /** |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9256 | * 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] | 9257 | * |
| 9258 | * Type: int (0 for false, 1 for true) |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9259 | * @hide |
| 9260 | */ |
| 9261 | public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; |
| 9262 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9263 | private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9264 | |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 9265 | /** |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9266 | * Value to specify if Wi-Fi Wakeup feature is enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9267 | * |
| 9268 | * Type: int (0 for false, 1 for true) |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9269 | * @hide |
| 9270 | */ |
| 9271 | @SystemApi |
| 9272 | public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; |
| 9273 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9274 | private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 9275 | |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9276 | /** |
Jeremy Joslin | 45caa25 | 2017-05-04 11:22:46 -0700 | [diff] [blame] | 9277 | * Value to specify if Wi-Fi Wakeup is available. |
| 9278 | * |
| 9279 | * Wi-Fi Wakeup will only operate if it's available |
| 9280 | * and {@link #WIFI_WAKEUP_ENABLED} is true. |
| 9281 | * |
| 9282 | * Type: int (0 for false, 1 for true) |
| 9283 | * @hide |
| 9284 | */ |
| 9285 | public static final String WIFI_WAKEUP_AVAILABLE = "wifi_wakeup_available"; |
| 9286 | |
| 9287 | /** |
Sundeep Ghuman | e869d83 | 2017-01-25 16:23:43 -0800 | [diff] [blame] | 9288 | * Value to specify whether network quality scores and badging should be shown in the UI. |
| 9289 | * |
| 9290 | * Type: int (0 for false, 1 for true) |
| 9291 | * @hide |
| 9292 | */ |
| 9293 | public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; |
| 9294 | |
| 9295 | /** |
Sundeep Ghuman | 9bb85d3 | 2017-08-28 17:04:16 -0700 | [diff] [blame] | 9296 | * Value to specify how long in milliseconds to retain seen score cache curves to be used |
| 9297 | * when generating SSID only bases score curves. |
| 9298 | * |
| 9299 | * Type: long |
| 9300 | * @hide |
| 9301 | */ |
| 9302 | public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = |
| 9303 | "speed_label_cache_eviction_age_millis"; |
| 9304 | |
| 9305 | /** |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9306 | * Value to specify if network recommendations from |
| 9307 | * {@link com.android.server.NetworkScoreService} are enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 9308 | * |
Jeremy Joslin | 9925c6a | 2017-03-06 10:39:35 -0800 | [diff] [blame] | 9309 | * Type: int |
| 9310 | * Valid values: |
| 9311 | * -1 = Forced off |
| 9312 | * 0 = Disabled |
| 9313 | * 1 = Enabled |
| 9314 | * |
| 9315 | * Most readers of this setting should simply check if value == 1 to determined the |
| 9316 | * enabled state. |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9317 | * @hide |
| 9318 | */ |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 9319 | public static final String NETWORK_RECOMMENDATIONS_ENABLED = |
| 9320 | "network_recommendations_enabled"; |
| 9321 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9322 | private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR = |
| 9323 | new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"}); |
| 9324 | |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9325 | /** |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 9326 | * Which package name to use for network recommendations. If null, network recommendations |
| 9327 | * will neither be requested nor accepted. |
| 9328 | * |
| 9329 | * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and |
| 9330 | * {@link NetworkScoreManager#setActiveScorer(String)} to write it. |
| 9331 | * |
| 9332 | * Type: string - package name |
| 9333 | * @hide |
| 9334 | */ |
| 9335 | public static final String NETWORK_RECOMMENDATIONS_PACKAGE = |
| 9336 | "network_recommendations_package"; |
| 9337 | |
| 9338 | /** |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9339 | * The package name of the application that connect and secures high quality open wifi |
| 9340 | * networks automatically. |
| 9341 | * |
| 9342 | * Type: string package name or null if the feature is either not provided or disabled. |
| 9343 | * @hide |
| 9344 | */ |
Eric Enslen | 1e423b9 | 2017-12-18 11:30:21 -0800 | [diff] [blame] | 9345 | @TestApi |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9346 | public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; |
| 9347 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9348 | private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() { |
| 9349 | @Override |
| 9350 | public boolean validate(String value) { |
| 9351 | return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value); |
| 9352 | } |
| 9353 | }; |
| 9354 | |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 9355 | /** |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9356 | * The number of milliseconds the {@link com.android.server.NetworkScoreService} |
| 9357 | * will give a recommendation request to complete before returning a default response. |
| 9358 | * |
| 9359 | * Type: long |
| 9360 | * @hide |
Jeremy Joslin | b1a0139 | 2017-04-14 13:35:48 -0700 | [diff] [blame] | 9361 | * @deprecated to be removed |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 9362 | */ |
| 9363 | public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = |
| 9364 | "network_recommendation_request_timeout_ms"; |
| 9365 | |
Amin Shaikh | d3c8193 | 2017-02-06 16:22:42 -0800 | [diff] [blame] | 9366 | /** |
| 9367 | * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in |
| 9368 | * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. |
| 9369 | * |
| 9370 | * Type: long |
| 9371 | * @hide |
| 9372 | */ |
| 9373 | public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = |
| 9374 | "recommended_network_evaluator_cache_expiry_ms"; |
| 9375 | |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9376 | /** |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9377 | * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for |
| 9378 | * connectivity. |
| 9379 | * @hide |
| 9380 | */ |
Jeremy Klein | 45a9b5d | 2018-01-10 18:01:46 -0800 | [diff] [blame] | 9381 | public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; |
| 9382 | |
| 9383 | /** |
| 9384 | * The length in milliseconds of a BLE scan window in a low-power scan mode. |
| 9385 | * @hide |
| 9386 | */ |
| 9387 | public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; |
| 9388 | |
| 9389 | /** |
| 9390 | * The length in milliseconds of a BLE scan window in a balanced scan mode. |
| 9391 | * @hide |
| 9392 | */ |
| 9393 | public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; |
| 9394 | |
| 9395 | /** |
| 9396 | * The length in milliseconds of a BLE scan window in a low-latency scan mode. |
| 9397 | * @hide |
| 9398 | */ |
| 9399 | public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = |
| 9400 | "ble_scan_low_latency_window_ms"; |
| 9401 | |
| 9402 | /** |
| 9403 | * The length in milliseconds of a BLE scan interval in a low-power scan mode. |
| 9404 | * @hide |
| 9405 | */ |
| 9406 | public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = |
| 9407 | "ble_scan_low_power_interval_ms"; |
| 9408 | |
| 9409 | /** |
| 9410 | * The length in milliseconds of a BLE scan interval in a balanced scan mode. |
| 9411 | * @hide |
| 9412 | */ |
| 9413 | public static final String BLE_SCAN_BALANCED_INTERVAL_MS = |
| 9414 | "ble_scan_balanced_interval_ms"; |
| 9415 | |
| 9416 | /** |
| 9417 | * The length in milliseconds of a BLE scan interval in a low-latency scan mode. |
| 9418 | * @hide |
| 9419 | */ |
| 9420 | public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = |
| 9421 | "ble_scan_low_latency_interval_ms"; |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 9422 | |
| 9423 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9424 | * Used to save the Wifi_ON state prior to tethering. |
| 9425 | * This state will be checked to restore Wifi after |
| 9426 | * the user turns off tethering. |
| 9427 | * |
| 9428 | * @hide |
| 9429 | */ |
| 9430 | public static final String WIFI_SAVED_STATE = "wifi_saved_state"; |
| 9431 | |
| 9432 | /** |
| 9433 | * The interval in milliseconds to scan as used by the wifi supplicant |
| 9434 | * @hide |
| 9435 | */ |
| 9436 | public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = |
| 9437 | "wifi_supplicant_scan_interval_ms"; |
| 9438 | |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 9439 | /** |
| 9440 | * whether frameworks handles wifi auto-join |
| 9441 | * @hide |
| 9442 | */ |
| 9443 | public static final String WIFI_ENHANCED_AUTO_JOIN = |
| 9444 | "wifi_enhanced_auto_join"; |
| 9445 | |
| 9446 | /** |
| 9447 | * whether settings show RSSI |
| 9448 | * @hide |
| 9449 | */ |
| 9450 | public static final String WIFI_NETWORK_SHOW_RSSI = |
| 9451 | "wifi_network_show_rssi"; |
| 9452 | |
| 9453 | /** |
Irfan Sheriff | 3809f50 | 2012-09-17 16:04:57 -0700 | [diff] [blame] | 9454 | * The interval in milliseconds to scan at supplicant when p2p is connected |
| 9455 | * @hide |
| 9456 | */ |
| 9457 | public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = |
| 9458 | "wifi_scan_interval_p2p_connected_ms"; |
| 9459 | |
| 9460 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9461 | * Whether the Wi-Fi watchdog is enabled. |
| 9462 | */ |
| 9463 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 9464 | |
| 9465 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9466 | * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and |
| 9467 | * the setting needs to be set to 0 to disable it. |
| 9468 | * @hide |
| 9469 | */ |
| 9470 | public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = |
| 9471 | "wifi_watchdog_poor_network_test_enabled"; |
| 9472 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 9473 | private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR = |
| 9474 | ANY_STRING_VALIDATOR; |
| 9475 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9476 | /** |
| 9477 | * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and |
| 9478 | * needs to be set to 0 to disable it. |
| 9479 | * @hide |
| 9480 | */ |
| 9481 | public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = |
| 9482 | "wifi_suspend_optimizations_enabled"; |
| 9483 | |
| 9484 | /** |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9485 | * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 |
| 9486 | * will enable it. In the future, additional values may be supported. |
| 9487 | * @hide |
| 9488 | */ |
| 9489 | public static final String WIFI_VERBOSE_LOGGING_ENABLED = |
| 9490 | "wifi_verbose_logging_enabled"; |
| 9491 | |
Jong Wook Kim | 0a20eda | 2018-01-05 18:40:25 -0800 | [diff] [blame] | 9492 | /** |
| 9493 | * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and |
| 9494 | * setting to 1 will enable it. In the future, additional values may be supported. |
| 9495 | * @hide |
| 9496 | */ |
| 9497 | public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = |
| 9498 | "wifi_connected_mac_randomization_enabled"; |
| 9499 | |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 9500 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9501 | * The maximum number of times we will retry a connection to an access |
| 9502 | * point for which we have failed in acquiring an IP address from DHCP. |
| 9503 | * A value of N means that we will make N+1 connection attempts in all. |
| 9504 | */ |
| 9505 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; |
| 9506 | |
| 9507 | /** |
| 9508 | * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile |
| 9509 | * data connectivity to be established after a disconnect from Wi-Fi. |
| 9510 | */ |
| 9511 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 9512 | "wifi_mobile_data_transition_wakelock_timeout_ms"; |
| 9513 | |
| 9514 | /** |
Zoltan Szatmary-Ban | 4045d24 | 2015-05-27 12:42:39 +0100 | [diff] [blame] | 9515 | * This setting controls whether WiFi configurations created by a Device Owner app |
| 9516 | * should be locked down (that is, be editable or removable only by the Device Owner App, |
| 9517 | * not even by Settings app). |
| 9518 | * This setting takes integer values. Non-zero values mean DO created configurations |
| 9519 | * are locked down. Value of zero means they are not. Default value in the absence of |
| 9520 | * actual value to this setting is 0. |
| 9521 | */ |
| 9522 | public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = |
| 9523 | "wifi_device_owner_configs_lockdown"; |
| 9524 | |
| 9525 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9526 | * The operational wifi frequency band |
| 9527 | * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, |
| 9528 | * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or |
| 9529 | * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} |
| 9530 | * |
| 9531 | * @hide |
| 9532 | */ |
| 9533 | public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; |
| 9534 | |
| 9535 | /** |
| 9536 | * The Wi-Fi peer-to-peer device name |
| 9537 | * @hide |
| 9538 | */ |
| 9539 | public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; |
| 9540 | |
| 9541 | /** |
Robert Greenwalt | c12783a | 2013-05-16 12:48:20 -0700 | [diff] [blame] | 9542 | * The min time between wifi disable and wifi enable |
| 9543 | * @hide |
| 9544 | */ |
| 9545 | public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; |
| 9546 | |
| 9547 | /** |
Jeff Davidson | a20ca67d | 2014-12-16 11:48:54 -0800 | [diff] [blame] | 9548 | * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect |
| 9549 | * from an ephemeral network if there is no BSSID for that network with a non-null score that |
| 9550 | * has been seen in this time period. |
| 9551 | * |
| 9552 | * If this is less than or equal to zero, we use a more conservative behavior and only check |
| 9553 | * for a non-null score from the currently connected or target BSSID. |
| 9554 | * @hide |
| 9555 | */ |
| 9556 | public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = |
| 9557 | "wifi_ephemeral_out_of_range_timeout_ms"; |
| 9558 | |
| 9559 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9560 | * The number of milliseconds to delay when checking for data stalls during |
| 9561 | * non-aggressive detection. (screen is turned off.) |
| 9562 | * @hide |
| 9563 | */ |
| 9564 | public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = |
| 9565 | "data_stall_alarm_non_aggressive_delay_in_ms"; |
| 9566 | |
| 9567 | /** |
| 9568 | * The number of milliseconds to delay when checking for data stalls during |
| 9569 | * aggressive detection. (screen on or suspected data stall) |
| 9570 | * @hide |
| 9571 | */ |
| 9572 | public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = |
| 9573 | "data_stall_alarm_aggressive_delay_in_ms"; |
| 9574 | |
| 9575 | /** |
Wink Saville | ce1e379 | 2013-09-03 16:41:44 -0700 | [diff] [blame] | 9576 | * The number of milliseconds to allow the provisioning apn to remain active |
| 9577 | * @hide |
| 9578 | */ |
| 9579 | public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = |
| 9580 | "provisioning_apn_alarm_delay_in_ms"; |
| 9581 | |
| 9582 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 9583 | * The interval in milliseconds at which to check gprs registration |
| 9584 | * after the first registration mismatch of gprs and voice service, |
| 9585 | * to detect possible data network registration problems. |
| 9586 | * |
| 9587 | * @hide |
| 9588 | */ |
| 9589 | public static final String GPRS_REGISTER_CHECK_PERIOD_MS = |
| 9590 | "gprs_register_check_period_ms"; |
| 9591 | |
| 9592 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9593 | * Nonzero causes Log.wtf() to crash. |
| 9594 | * @hide |
| 9595 | */ |
| 9596 | public static final String WTF_IS_FATAL = "wtf_is_fatal"; |
| 9597 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 9598 | /** |
| 9599 | * Ringer mode. This is used internally, changing this value will not |
| 9600 | * change the ringer mode. See AudioManager. |
| 9601 | */ |
| 9602 | public static final String MODE_RINGER = "mode_ringer"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9603 | |
Jeff Brown | d493596 | 2012-09-25 13:27:20 -0700 | [diff] [blame] | 9604 | /** |
| 9605 | * Overlay display devices setting. |
| 9606 | * The associated value is a specially formatted string that describes the |
| 9607 | * size and density of simulated secondary display devices. |
| 9608 | * <p> |
| 9609 | * Format: {width}x{height}/{dpi};... |
| 9610 | * </p><p> |
| 9611 | * Example: |
| 9612 | * <ul> |
| 9613 | * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> |
| 9614 | * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first |
| 9615 | * at 1080p and the second at 720p.</li> |
| 9616 | * <li>If the value is empty, then no overlay display devices are created.</li> |
| 9617 | * </ul></p> |
| 9618 | * |
| 9619 | * @hide |
| 9620 | */ |
| 9621 | public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9622 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9623 | /** |
| 9624 | * Threshold values for the duration and level of a discharge cycle, |
| 9625 | * under which we log discharge cycle info. |
| 9626 | * |
| 9627 | * @hide |
| 9628 | */ |
| 9629 | public static final String |
| 9630 | BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; |
| 9631 | |
| 9632 | /** @hide */ |
| 9633 | public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; |
| 9634 | |
| 9635 | /** |
| 9636 | * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR |
| 9637 | * intents on application crashes and ANRs. If this is disabled, the |
| 9638 | * crash/ANR dialog will never display the "Report" button. |
| 9639 | * <p> |
| 9640 | * Type: int (0 = disallow, 1 = allow) |
| 9641 | * |
| 9642 | * @hide |
| 9643 | */ |
| 9644 | public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; |
| 9645 | |
| 9646 | /** |
| 9647 | * Maximum age of entries kept by {@link DropBoxManager}. |
| 9648 | * |
| 9649 | * @hide |
| 9650 | */ |
| 9651 | public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; |
| 9652 | |
| 9653 | /** |
| 9654 | * Maximum number of entry files which {@link DropBoxManager} will keep |
| 9655 | * around. |
| 9656 | * |
| 9657 | * @hide |
| 9658 | */ |
| 9659 | public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; |
| 9660 | |
| 9661 | /** |
| 9662 | * Maximum amount of disk space used by {@link DropBoxManager} no matter |
| 9663 | * what. |
| 9664 | * |
| 9665 | * @hide |
| 9666 | */ |
| 9667 | public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; |
| 9668 | |
| 9669 | /** |
| 9670 | * Percent of free disk (excluding reserve) which {@link DropBoxManager} |
| 9671 | * will use. |
| 9672 | * |
| 9673 | * @hide |
| 9674 | */ |
| 9675 | public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; |
| 9676 | |
| 9677 | /** |
| 9678 | * Percent of total disk which {@link DropBoxManager} will never dip |
| 9679 | * into. |
| 9680 | * |
| 9681 | * @hide |
| 9682 | */ |
| 9683 | public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; |
| 9684 | |
| 9685 | /** |
| 9686 | * Prefix for per-tag dropbox disable/enable settings. |
| 9687 | * |
| 9688 | * @hide |
| 9689 | */ |
| 9690 | public static final String DROPBOX_TAG_PREFIX = "dropbox:"; |
| 9691 | |
| 9692 | /** |
| 9693 | * Lines of logcat to include with system crash/ANR/etc. reports, as a |
| 9694 | * prefix of the dropbox tag of the report type. For example, |
| 9695 | * "logcat_for_system_server_anr" controls the lines of logcat captured |
| 9696 | * with system server ANR reports. 0 to disable. |
| 9697 | * |
| 9698 | * @hide |
| 9699 | */ |
| 9700 | public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; |
| 9701 | |
| 9702 | /** |
| 9703 | * The interval in minutes after which the amount of free storage left |
| 9704 | * on the device is logged to the event log |
| 9705 | * |
| 9706 | * @hide |
| 9707 | */ |
| 9708 | public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; |
| 9709 | |
| 9710 | /** |
| 9711 | * Threshold for the amount of change in disk free space required to |
| 9712 | * report the amount of free space. Used to prevent spamming the logs |
| 9713 | * when the disk free space isn't changing frequently. |
| 9714 | * |
| 9715 | * @hide |
| 9716 | */ |
| 9717 | public static final String |
| 9718 | DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; |
| 9719 | |
| 9720 | /** |
| 9721 | * Minimum percentage of free storage on the device that is used to |
| 9722 | * determine if the device is running low on storage. The default is 10. |
| 9723 | * <p> |
| 9724 | * Say this value is set to 10, the device is considered running low on |
| 9725 | * storage if 90% or more of the device storage is filled up. |
| 9726 | * |
| 9727 | * @hide |
| 9728 | */ |
| 9729 | public static final String |
| 9730 | SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; |
| 9731 | |
| 9732 | /** |
| 9733 | * Maximum byte size of the low storage threshold. This is to ensure |
| 9734 | * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an |
| 9735 | * overly large threshold for large storage devices. Currently this must |
| 9736 | * be less than 2GB. This default is 500MB. |
| 9737 | * |
| 9738 | * @hide |
| 9739 | */ |
| 9740 | public static final String |
| 9741 | SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; |
| 9742 | |
| 9743 | /** |
| 9744 | * Minimum bytes of free storage on the device before the data partition |
| 9745 | * is considered full. By default, 1 MB is reserved to avoid system-wide |
| 9746 | * SQLite disk full exceptions. |
| 9747 | * |
| 9748 | * @hide |
| 9749 | */ |
| 9750 | public static final String |
| 9751 | SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; |
| 9752 | |
| 9753 | /** |
Jeff Sharkey | d5d5e92 | 2017-02-21 10:51:23 -0700 | [diff] [blame] | 9754 | * Minimum percentage of storage on the device that is reserved for |
| 9755 | * cached data. |
| 9756 | * |
| 9757 | * @hide |
| 9758 | */ |
| 9759 | public static final String |
| 9760 | SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; |
| 9761 | |
| 9762 | /** |
| 9763 | * Maximum bytes of storage on the device that is reserved for cached |
| 9764 | * data. |
| 9765 | * |
| 9766 | * @hide |
| 9767 | */ |
| 9768 | public static final String |
| 9769 | SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; |
| 9770 | |
| 9771 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9772 | * The maximum reconnect delay for short network outages or when the |
| 9773 | * network is suspended due to phone use. |
| 9774 | * |
| 9775 | * @hide |
| 9776 | */ |
| 9777 | public static final String |
| 9778 | SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; |
| 9779 | |
| 9780 | /** |
| 9781 | * The number of milliseconds to delay before sending out |
Erik Kline | 8f29dcf | 2014-12-08 16:25:20 +0900 | [diff] [blame] | 9782 | * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9783 | * |
| 9784 | * @hide |
| 9785 | */ |
| 9786 | public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; |
| 9787 | |
Vinit Deshapnde | 1f12cb5 | 2013-08-21 13:09:01 -0700 | [diff] [blame] | 9788 | |
| 9789 | /** |
| 9790 | * Network sampling interval, in seconds. We'll generate link information |
| 9791 | * about bytes/packets sent and error rates based on data sampled in this interval |
| 9792 | * |
| 9793 | * @hide |
| 9794 | */ |
| 9795 | |
| 9796 | public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = |
| 9797 | "connectivity_sampling_interval_in_seconds"; |
| 9798 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9799 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 9800 | * The series of successively longer delays used in retrying to download PAC file. |
| 9801 | * Last delay is used between successful PAC downloads. |
| 9802 | * |
| 9803 | * @hide |
| 9804 | */ |
| 9805 | public static final String PAC_CHANGE_DELAY = "pac_change_delay"; |
| 9806 | |
| 9807 | /** |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 9808 | * Don't attempt to detect captive portals. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9809 | * |
| 9810 | * @hide |
| 9811 | */ |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 9812 | public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; |
| 9813 | |
| 9814 | /** |
| 9815 | * When detecting a captive portal, display a notification that |
| 9816 | * prompts the user to sign in. |
| 9817 | * |
| 9818 | * @hide |
| 9819 | */ |
| 9820 | public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; |
| 9821 | |
| 9822 | /** |
| 9823 | * When detecting a captive portal, immediately disconnect from the |
| 9824 | * network and do not reconnect to that network in the future. |
| 9825 | * |
| 9826 | * @hide |
| 9827 | */ |
| 9828 | public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; |
| 9829 | |
| 9830 | /** |
| 9831 | * What to do when connecting a network that presents a captive portal. |
| 9832 | * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. |
| 9833 | * |
| 9834 | * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. |
| 9835 | * @hide |
| 9836 | */ |
| 9837 | public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; |
| 9838 | |
| 9839 | /** |
| 9840 | * Setting to turn off captive portal detection. Feature is enabled by |
| 9841 | * default and the setting needs to be set to 0 to disable it. |
| 9842 | * |
| 9843 | * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection |
| 9844 | * @hide |
| 9845 | */ |
| 9846 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9847 | public static final String |
| 9848 | CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; |
| 9849 | |
| 9850 | /** |
| 9851 | * The server used for captive portal detection upon a new conection. A |
| 9852 | * 204 response code from the server is used for validation. |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9853 | * TODO: remove this deprecated symbol. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9854 | * |
| 9855 | * @hide |
| 9856 | */ |
| 9857 | public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; |
| 9858 | |
| 9859 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9860 | * The URL used for HTTPS captive portal detection upon a new connection. |
| 9861 | * A 204 response code from the server is used for validation. |
| 9862 | * |
| 9863 | * @hide |
| 9864 | */ |
| 9865 | public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; |
| 9866 | |
| 9867 | /** |
| 9868 | * The URL used for HTTP captive portal detection upon a new connection. |
| 9869 | * A 204 response code from the server is used for validation. |
| 9870 | * |
| 9871 | * @hide |
| 9872 | */ |
| 9873 | public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; |
| 9874 | |
| 9875 | /** |
| 9876 | * The URL used for fallback HTTP captive portal detection when previous HTTP |
| 9877 | * and HTTPS captive portal detection attemps did not return a conclusive answer. |
| 9878 | * |
| 9879 | * @hide |
| 9880 | */ |
| 9881 | public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; |
| 9882 | |
| 9883 | /** |
Hugo Benichi | eef918a | 2017-04-10 17:43:08 +0900 | [diff] [blame] | 9884 | * A comma separated list of URLs used for captive portal detection in addition to the |
| 9885 | * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. |
| 9886 | * |
| 9887 | * @hide |
| 9888 | */ |
| 9889 | public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = |
| 9890 | "captive_portal_other_fallback_urls"; |
| 9891 | |
| 9892 | /** |
Lorenzo Colitti | c5be12e | 2016-04-19 21:57:31 +0900 | [diff] [blame] | 9893 | * Whether to use HTTPS for network validation. This is enabled by default and the setting |
| 9894 | * needs to be set to 0 to disable it. This setting is a misnomer because captive portals |
| 9895 | * don't actually use HTTPS, but it's consistent with the other settings. |
| 9896 | * |
| 9897 | * @hide |
| 9898 | */ |
| 9899 | public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; |
| 9900 | |
| 9901 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9902 | * Which User-Agent string to use in the header of the captive portal detection probes. |
| 9903 | * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). |
| 9904 | * |
| 9905 | * @hide |
| 9906 | */ |
| 9907 | public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; |
| 9908 | |
| 9909 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9910 | * Whether network service discovery is enabled. |
| 9911 | * |
| 9912 | * @hide |
| 9913 | */ |
| 9914 | public static final String NSD_ON = "nsd_on"; |
| 9915 | |
| 9916 | /** |
| 9917 | * Let user pick default install location. |
| 9918 | * |
| 9919 | * @hide |
| 9920 | */ |
| 9921 | public static final String SET_INSTALL_LOCATION = "set_install_location"; |
| 9922 | |
| 9923 | /** |
| 9924 | * Default install location value. |
| 9925 | * 0 = auto, let system decide |
| 9926 | * 1 = internal |
| 9927 | * 2 = sdcard |
| 9928 | * @hide |
| 9929 | */ |
| 9930 | public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; |
| 9931 | |
| 9932 | /** |
| 9933 | * ms during which to consume extra events related to Inet connection |
| 9934 | * condition after a transtion to fully-connected |
| 9935 | * |
| 9936 | * @hide |
| 9937 | */ |
| 9938 | public static final String |
| 9939 | INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; |
| 9940 | |
| 9941 | /** |
| 9942 | * ms during which to consume extra events related to Inet connection |
| 9943 | * condtion after a transtion to partly-connected |
| 9944 | * |
| 9945 | * @hide |
| 9946 | */ |
| 9947 | public static final String |
| 9948 | INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; |
| 9949 | |
| 9950 | /** {@hide} */ |
| 9951 | public static final String |
| 9952 | READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; |
| 9953 | |
| 9954 | /** |
| 9955 | * Host name and port for global http proxy. Uses ':' seperator for |
| 9956 | * between host and port. |
| 9957 | */ |
| 9958 | public static final String HTTP_PROXY = "http_proxy"; |
| 9959 | |
| 9960 | /** |
| 9961 | * Host name for global http proxy. Set via ConnectivityManager. |
| 9962 | * |
| 9963 | * @hide |
| 9964 | */ |
| 9965 | public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; |
| 9966 | |
| 9967 | /** |
| 9968 | * Integer host port for global http proxy. Set via ConnectivityManager. |
| 9969 | * |
| 9970 | * @hide |
| 9971 | */ |
| 9972 | public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; |
| 9973 | |
| 9974 | /** |
| 9975 | * Exclusion list for global proxy. This string contains a list of |
| 9976 | * comma-separated domains where the global proxy does not apply. |
| 9977 | * Domains should be listed in a comma- separated list. Example of |
| 9978 | * acceptable formats: ".domain1.com,my.domain2.com" Use |
| 9979 | * ConnectivityManager to set/get. |
| 9980 | * |
| 9981 | * @hide |
| 9982 | */ |
| 9983 | public static final String |
| 9984 | GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; |
| 9985 | |
| 9986 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 9987 | * The location PAC File for the proxy. |
| 9988 | * @hide |
| 9989 | */ |
| 9990 | public static final String |
| 9991 | GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; |
| 9992 | |
| 9993 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9994 | * Enables the UI setting to allow the user to specify the global HTTP |
| 9995 | * proxy and associated exclusion list. |
| 9996 | * |
| 9997 | * @hide |
| 9998 | */ |
| 9999 | public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; |
| 10000 | |
| 10001 | /** |
| 10002 | * Setting for default DNS in case nobody suggests one |
| 10003 | * |
| 10004 | * @hide |
| 10005 | */ |
| 10006 | public static final String DEFAULT_DNS_SERVER = "default_dns_server"; |
| 10007 | |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10008 | /** |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10009 | * The requested Private DNS mode (string), and an accompanying specifier (string). |
| 10010 | * |
| 10011 | * Currently, the specifier holds the chosen provider name when the mode requests |
| 10012 | * a specific provider. It may be used to store the provider name even when the |
| 10013 | * mode changes so that temporarily disabling and re-enabling the specific |
| 10014 | * provider mode does not necessitate retyping the provider hostname. |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10015 | * |
| 10016 | * @hide |
| 10017 | */ |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10018 | public static final String PRIVATE_DNS_MODE = "private_dns_mode"; |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10019 | |
| 10020 | private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10021 | |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10022 | /** |
| 10023 | * @hide |
| 10024 | */ |
| 10025 | public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 10026 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10027 | private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR; |
| 10028 | |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10029 | /** {@hide} */ |
| 10030 | public static final String |
| 10031 | BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; |
| 10032 | /** {@hide} */ |
| 10033 | public static final String |
| 10034 | BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; |
| 10035 | /** {@hide} */ |
| 10036 | public static final String |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10037 | BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; |
| 10038 | /** {@hide} */ |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10039 | public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = |
| 10040 | "bluetooth_a2dp_supports_optional_codecs_"; |
| 10041 | /** {@hide} */ |
| 10042 | public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = |
| 10043 | "bluetooth_a2dp_optional_codecs_enabled_"; |
| 10044 | /** {@hide} */ |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10045 | public static final String |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10046 | BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10047 | /** {@hide} */ |
| 10048 | public static final String |
| 10049 | BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10050 | /** {@hide} */ |
| 10051 | public static final String |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10052 | BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; |
| 10053 | /** {@hide} */ |
| 10054 | public static final String |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 10055 | BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; |
| 10056 | /** {@hide} */ |
| 10057 | public static final String |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10058 | BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10059 | /** {@hide} */ |
| 10060 | public static final String |
| 10061 | BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10062 | /** {@hide} */ |
| 10063 | public static final String |
| 10064 | BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10065 | |
| 10066 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10067 | * Activity manager specific settings. |
| 10068 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10069 | * |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10070 | * "gc_timeout=5000,max_cached_processes=24" |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10071 | * |
| 10072 | * The following keys are supported: |
| 10073 | * |
| 10074 | * <pre> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10075 | * max_cached_processes (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10076 | * background_settle_time (long) |
Dianne Hackborn | cb01563 | 2017-06-14 17:30:15 -0700 | [diff] [blame] | 10077 | * fgservice_min_shown_time (long) |
| 10078 | * fgservice_min_report_time (long) |
| 10079 | * fgservice_screen_on_before_time (long) |
| 10080 | * fgservice_screen_on_after_time (long) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10081 | * content_provider_retain_time (long) |
| 10082 | * gc_timeout (long) |
| 10083 | * gc_min_interval (long) |
| 10084 | * full_pss_min_interval (long) |
| 10085 | * full_pss_lowered_interval (long) |
Dianne Hackborn | ffca58b | 2017-05-24 16:15:45 -0700 | [diff] [blame] | 10086 | * power_check_interval (long) |
| 10087 | * power_check_max_cpu_1 (int) |
| 10088 | * power_check_max_cpu_2 (int) |
| 10089 | * power_check_max_cpu_3 (int) |
| 10090 | * power_check_max_cpu_4 (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 10091 | * service_usage_interaction_time (long) |
| 10092 | * usage_stats_interaction_interval (long) |
| 10093 | * service_restart_duration (long) |
| 10094 | * service_reset_run_duration (long) |
| 10095 | * service_restart_duration_factor (int) |
| 10096 | * service_min_restart_time_between (long) |
| 10097 | * service_max_inactivity (long) |
| 10098 | * service_bg_start_timeout (long) |
Sudheer Shanka | f669010 | 2017-10-16 10:20:32 -0700 | [diff] [blame] | 10099 | * process_start_async (boolean) |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10100 | * </pre> |
| 10101 | * |
| 10102 | * <p> |
| 10103 | * Type: string |
| 10104 | * @hide |
| 10105 | * @see com.android.server.am.ActivityManagerConstants |
| 10106 | */ |
| 10107 | public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; |
| 10108 | |
| 10109 | /** |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10110 | * Device Idle (Doze) specific settings. |
| 10111 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10112 | * |
Henrik Baard | eac10ab | 2016-04-19 07:50:24 +0200 | [diff] [blame] | 10113 | * "inactive_to=60000,sensing_to=400000" |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10114 | * |
| 10115 | * The following keys are supported: |
| 10116 | * |
| 10117 | * <pre> |
| 10118 | * inactive_to (long) |
| 10119 | * sensing_to (long) |
| 10120 | * motion_inactive_to (long) |
| 10121 | * idle_after_inactive_to (long) |
| 10122 | * idle_pending_to (long) |
| 10123 | * max_idle_pending_to (long) |
| 10124 | * idle_pending_factor (float) |
| 10125 | * idle_to (long) |
| 10126 | * max_idle_to (long) |
| 10127 | * idle_factor (float) |
| 10128 | * min_time_to_alarm (long) |
| 10129 | * max_temp_app_whitelist_duration (long) |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 10130 | * notification_whitelist_duration (long) |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 10131 | * </pre> |
| 10132 | * |
| 10133 | * <p> |
| 10134 | * Type: string |
| 10135 | * @hide |
| 10136 | * @see com.android.server.DeviceIdleController.Constants |
| 10137 | */ |
| 10138 | public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; |
| 10139 | |
| 10140 | /** |
jackqdyulei | 455e90a | 2017-02-09 15:29:16 -0800 | [diff] [blame] | 10141 | * Battery Saver specific settings |
| 10142 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10143 | * |
| 10144 | * "vibration_disabled=true,adjust_brightness_factor=0.5" |
| 10145 | * |
| 10146 | * The following keys are supported: |
| 10147 | * |
| 10148 | * <pre> |
| 10149 | * vibration_disabled (boolean) |
| 10150 | * animation_disabled (boolean) |
| 10151 | * soundtrigger_disabled (boolean) |
| 10152 | * fullbackup_deferred (boolean) |
| 10153 | * keyvaluebackup_deferred (boolean) |
| 10154 | * firewall_disabled (boolean) |
| 10155 | * gps_mode (int) |
| 10156 | * adjust_brightness_disabled (boolean) |
| 10157 | * adjust_brightness_factor (float) |
| 10158 | * </pre> |
| 10159 | * @hide |
| 10160 | * @see com.android.server.power.BatterySaverPolicy |
| 10161 | */ |
| 10162 | public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; |
| 10163 | |
| 10164 | /** |
Makoto Onuki | 66a7812 | 2017-11-14 15:03:21 -0800 | [diff] [blame] | 10165 | * Battery Saver device specific settings |
| 10166 | * This is encoded as a key=value list, separated by commas. |
| 10167 | * See {@link com.android.server.power.BatterySaverPolicy} for the details. |
| 10168 | * |
| 10169 | * @hide |
| 10170 | */ |
| 10171 | public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = |
| 10172 | "battery_saver_device_specific_constants"; |
| 10173 | |
| 10174 | /** |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 10175 | * Battery anomaly detection specific settings |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 10176 | * This is encoded as a key=value list, separated by commas. |
| 10177 | * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via |
| 10178 | * {@link Uri#encode(String)}, separated by colons. Ex: |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 10179 | * |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 10180 | * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," |
| 10181 | * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 10182 | * |
| 10183 | * The following keys are supported: |
| 10184 | * |
| 10185 | * <pre> |
| 10186 | * anomaly_detection_enabled (boolean) |
| 10187 | * wakelock_enabled (boolean) |
| 10188 | * wakelock_threshold (long) |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 10189 | * wakeup_alarm_enabled (boolean) |
| 10190 | * wakeup_alarm_threshold (long) |
| 10191 | * wakeup_blacklisted_tags (string) |
| 10192 | * bluetooth_scan_enabled (boolean) |
| 10193 | * bluetooth_scan_threshold (long) |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 10194 | * </pre> |
| 10195 | * @hide |
| 10196 | */ |
| 10197 | public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; |
| 10198 | |
| 10199 | /** |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10200 | * Battery tip specific settings |
| 10201 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10202 | * |
| 10203 | * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10204 | * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," |
| 10205 | * "high_usage_battery_draining=25,high_usage_period_ms=3000" |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10206 | * |
| 10207 | * The following keys are supported: |
| 10208 | * |
| 10209 | * <pre> |
| 10210 | * battery_tip_enabled (boolean) |
| 10211 | * summary_enabled (boolean) |
| 10212 | * battery_saver_tip_enabled (boolean) |
| 10213 | * high_usage_enabled (boolean) |
| 10214 | * high_usage_app_count (int) |
jackqdyulei | 8732119 | 2018-01-19 14:24:54 -0800 | [diff] [blame] | 10215 | * high_usage_period_ms (long) |
| 10216 | * high_usage_battery_draining (int) |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 10217 | * app_restriction_enabled (boolean) |
| 10218 | * reduced_battery_enabled (boolean) |
| 10219 | * reduced_battery_percent (int) |
| 10220 | * low_battery_enabled (boolean) |
| 10221 | * low_battery_hour (int) |
| 10222 | * </pre> |
| 10223 | * @hide |
| 10224 | */ |
| 10225 | public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; |
| 10226 | |
| 10227 | /** |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10228 | * Always on display(AOD) specific settings |
| 10229 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10230 | * |
| 10231 | * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" |
| 10232 | * |
| 10233 | * The following keys are supported: |
| 10234 | * |
| 10235 | * <pre> |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 10236 | * screen_brightness_array (int[]) |
| 10237 | * dimming_scrim_array (int[]) |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 10238 | * prox_screen_off_delay (long) |
| 10239 | * prox_cooldown_trigger (long) |
| 10240 | * prox_cooldown_period (long) |
| 10241 | * </pre> |
| 10242 | * @hide |
| 10243 | */ |
| 10244 | public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; |
| 10245 | |
| 10246 | /** |
Shikhar Srivastav | 9a896a6c | 2018-01-09 16:58:36 -0800 | [diff] [blame] | 10247 | * System VDSO global setting. This links to the "sys.vdso" system property. |
| 10248 | * The following values are supported: |
| 10249 | * false -> both 32 and 64 bit vdso disabled |
| 10250 | * 32 -> 32 bit vdso enabled |
| 10251 | * 64 -> 64 bit vdso enabled |
| 10252 | * Any other value defaults to both 32 bit and 64 bit true. |
| 10253 | * @hide |
| 10254 | */ |
| 10255 | public static final String SYS_VDSO = "sys_vdso"; |
| 10256 | |
| 10257 | /** |
Makoto Onuki | 3c9c998 | 2018-01-17 10:46:48 -0800 | [diff] [blame] | 10258 | * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the |
| 10259 | * device for this setting to take full effect. |
| 10260 | * |
| 10261 | * @hide |
| 10262 | */ |
| 10263 | public static final String FPS_DEVISOR = "fps_divisor"; |
| 10264 | |
| 10265 | /** |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10266 | * App standby (app idle) specific settings. |
| 10267 | * This is encoded as a key=value list, separated by commas. Ex: |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10268 | * <p> |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10269 | * "idle_duration=5000,parole_interval=4500" |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10270 | * <p> |
| 10271 | * All durations are in millis. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10272 | * The following keys are supported: |
| 10273 | * |
| 10274 | * <pre> |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10275 | * idle_duration2 (long) |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10276 | * wallclock_threshold (long) |
| 10277 | * parole_interval (long) |
| 10278 | * parole_duration (long) |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 10279 | * |
| 10280 | * idle_duration (long) // This is deprecated and used to circumvent b/26355386. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 10281 | * </pre> |
| 10282 | * |
| 10283 | * <p> |
| 10284 | * Type: string |
| 10285 | * @hide |
| 10286 | * @see com.android.server.usage.UsageStatsService.SettingsObserver |
| 10287 | */ |
| 10288 | public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; |
| 10289 | |
| 10290 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10291 | * Power manager specific settings. |
| 10292 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10293 | * |
| 10294 | * "no_cached_wake_locks=1" |
| 10295 | * |
| 10296 | * The following keys are supported: |
| 10297 | * |
| 10298 | * <pre> |
| 10299 | * no_cached_wake_locks (boolean) |
| 10300 | * </pre> |
| 10301 | * |
| 10302 | * <p> |
| 10303 | * Type: string |
| 10304 | * @hide |
| 10305 | * @see com.android.server.power.PowerManagerConstants |
| 10306 | */ |
| 10307 | public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; |
| 10308 | |
| 10309 | /** |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 10310 | * Alarm manager specific settings. |
| 10311 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10312 | * |
| 10313 | * "min_futurity=5000,allow_while_idle_short_time=4500" |
| 10314 | * |
| 10315 | * The following keys are supported: |
| 10316 | * |
| 10317 | * <pre> |
| 10318 | * min_futurity (long) |
| 10319 | * min_interval (long) |
| 10320 | * allow_while_idle_short_time (long) |
| 10321 | * allow_while_idle_long_time (long) |
| 10322 | * allow_while_idle_whitelist_duration (long) |
| 10323 | * </pre> |
| 10324 | * |
| 10325 | * <p> |
| 10326 | * Type: string |
| 10327 | * @hide |
| 10328 | * @see com.android.server.AlarmManagerService.Constants |
| 10329 | */ |
| 10330 | public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; |
| 10331 | |
| 10332 | /** |
Dianne Hackborn | e9a988c | 2016-05-27 17:59:40 -0700 | [diff] [blame] | 10333 | * Job scheduler specific settings. |
| 10334 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10335 | * |
| 10336 | * "min_ready_jobs_count=2,moderate_use_factor=.5" |
| 10337 | * |
| 10338 | * The following keys are supported: |
| 10339 | * |
| 10340 | * <pre> |
| 10341 | * min_idle_count (int) |
| 10342 | * min_charging_count (int) |
| 10343 | * min_connectivity_count (int) |
| 10344 | * min_content_count (int) |
| 10345 | * min_ready_jobs_count (int) |
| 10346 | * heavy_use_factor (float) |
| 10347 | * moderate_use_factor (float) |
| 10348 | * fg_job_count (int) |
| 10349 | * bg_normal_job_count (int) |
| 10350 | * bg_moderate_job_count (int) |
| 10351 | * bg_low_job_count (int) |
| 10352 | * bg_critical_job_count (int) |
| 10353 | * </pre> |
| 10354 | * |
| 10355 | * <p> |
| 10356 | * Type: string |
| 10357 | * @hide |
| 10358 | * @see com.android.server.job.JobSchedulerService.Constants |
| 10359 | */ |
| 10360 | public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; |
| 10361 | |
| 10362 | /** |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10363 | * ShortcutManager specific settings. |
| 10364 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10365 | * |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10366 | * "reset_interval_sec=86400,max_updates_per_interval=1" |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10367 | * |
| 10368 | * The following keys are supported: |
| 10369 | * |
| 10370 | * <pre> |
| 10371 | * reset_interval_sec (long) |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 10372 | * max_updates_per_interval (int) |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 10373 | * max_icon_dimension_dp (int, DP) |
| 10374 | * max_icon_dimension_dp_lowram (int, DP) |
| 10375 | * max_shortcuts (int) |
| 10376 | * icon_quality (int, 0-100) |
| 10377 | * icon_format (String) |
| 10378 | * </pre> |
| 10379 | * |
| 10380 | * <p> |
| 10381 | * Type: string |
| 10382 | * @hide |
| 10383 | * @see com.android.server.pm.ShortcutService.ConfigConstants |
| 10384 | */ |
| 10385 | public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; |
| 10386 | |
| 10387 | /** |
Makoto Onuki | 09c529a | 2017-05-01 10:05:28 -0700 | [diff] [blame] | 10388 | * DevicePolicyManager specific settings. |
| 10389 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10390 | * |
| 10391 | * <pre> |
| 10392 | * das_died_service_reconnect_backoff_sec (long) |
| 10393 | * das_died_service_reconnect_backoff_increase (float) |
| 10394 | * das_died_service_reconnect_max_backoff_sec (long) |
| 10395 | * </pre> |
| 10396 | * |
| 10397 | * <p> |
| 10398 | * Type: string |
| 10399 | * @hide |
| 10400 | * see also com.android.server.devicepolicy.DevicePolicyConstants |
| 10401 | */ |
| 10402 | public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; |
| 10403 | |
| 10404 | /** |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 10405 | * TextClassifier specific settings. |
| 10406 | * This is encoded as a key=value list, separated by commas. Ex: |
| 10407 | * |
| 10408 | * <pre> |
| 10409 | * smart_selection_dark_launch (boolean) |
| 10410 | * smart_selection_enabled_for_edit_text (boolean) |
| 10411 | * </pre> |
| 10412 | * |
| 10413 | * <p> |
| 10414 | * Type: string |
| 10415 | * @hide |
| 10416 | * see also android.view.textclassifier.TextClassifierConstants |
| 10417 | */ |
| 10418 | public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; |
| 10419 | |
| 10420 | /** |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10421 | * BatteryStats specific settings. |
| 10422 | * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" |
| 10423 | * |
| 10424 | * The following keys are supported: |
| 10425 | * <pre> |
| 10426 | * track_cpu_times_by_proc_state (boolean) |
Mike Ma | fae87da | 2018-01-19 20:07:20 -0800 | [diff] [blame] | 10427 | * track_cpu_active_cluster_time (boolean) |
| 10428 | * read_binary_cpu_time (boolean) |
Sudheer Shanka | 5c19b89 | 2018-01-05 17:25:46 -0800 | [diff] [blame] | 10429 | * </pre> |
| 10430 | * |
| 10431 | * <p> |
| 10432 | * Type: string |
| 10433 | * @hide |
| 10434 | * see also com.android.internal.os.BatteryStatsImpl.Constants |
| 10435 | */ |
| 10436 | public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; |
| 10437 | |
| 10438 | /** |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 10439 | * Whether or not App Standby feature is enabled. This controls throttling of apps |
| 10440 | * based on usage patterns and predictions. |
| 10441 | * Type: int (0 for false, 1 for true) |
| 10442 | * Default: 1 |
| 10443 | * @hide |
| 10444 | */ |
| 10445 | public static final java.lang.String APP_STANDBY_ENABLED = "app_standby_enabled"; |
| 10446 | |
| 10447 | /** |
Suprabh Shukla | 4deb852 | 2018-01-08 16:27:10 -0800 | [diff] [blame] | 10448 | * Feature flag to enable or disable the Forced App Standby feature. |
| 10449 | * Type: int (0 for false, 1 for true) |
| 10450 | * Default: 1 |
| 10451 | * @hide |
| 10452 | */ |
| 10453 | public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; |
| 10454 | |
| 10455 | /** |
Nancy Zheng | 525aaa1 | 2018-01-12 11:45:37 -0800 | [diff] [blame] | 10456 | * Whether or not to enable Forced App Standby on small battery devices. |
| 10457 | * Type: int (0 for false, 1 for true) |
| 10458 | * Default: 0 |
| 10459 | * @hide |
| 10460 | */ |
| 10461 | public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED |
| 10462 | = "forced_app_standby_for_small_battery_enabled"; |
| 10463 | |
| 10464 | /** |
Ricky Wai | eef5065 | 2017-12-21 16:27:40 +0000 | [diff] [blame] | 10465 | * Whether or not Network Watchlist feature is enabled. |
| 10466 | * Type: int (0 for false, 1 for true) |
| 10467 | * Default: 0 |
| 10468 | * @hide |
| 10469 | */ |
| 10470 | public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; |
| 10471 | |
| 10472 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10473 | * Get the key that retrieves a bluetooth headset's priority. |
| 10474 | * @hide |
| 10475 | */ |
| 10476 | public static final String getBluetoothHeadsetPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10477 | return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10478 | } |
| 10479 | |
| 10480 | /** |
| 10481 | * Get the key that retrieves a bluetooth a2dp sink's priority. |
| 10482 | * @hide |
| 10483 | */ |
| 10484 | public static final String getBluetoothA2dpSinkPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10485 | return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10486 | } |
| 10487 | |
| 10488 | /** |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 10489 | * Get the key that retrieves a bluetooth a2dp src's priority. |
| 10490 | * @hide |
| 10491 | */ |
| 10492 | public static final String getBluetoothA2dpSrcPriorityKey(String address) { |
| 10493 | return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10494 | } |
| 10495 | |
| 10496 | /** |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 10497 | * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs. |
| 10498 | * @hide |
| 10499 | */ |
| 10500 | public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) { |
| 10501 | return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX + |
| 10502 | address.toUpperCase(Locale.ROOT); |
| 10503 | } |
| 10504 | |
| 10505 | /** |
| 10506 | * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs |
| 10507 | * enabled. |
| 10508 | * @hide |
| 10509 | */ |
| 10510 | public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) { |
| 10511 | return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX + |
| 10512 | address.toUpperCase(Locale.ROOT); |
| 10513 | } |
| 10514 | |
| 10515 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10516 | * Get the key that retrieves a bluetooth Input Device's priority. |
| 10517 | * @hide |
| 10518 | */ |
Hansong Zhang | c26c76c | 2017-10-20 15:55:59 -0700 | [diff] [blame] | 10519 | public static final String getBluetoothHidHostPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 10520 | return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 10521 | } |
| 10522 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10523 | /** |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 10524 | * Get the key that retrieves a bluetooth pan client priority. |
| 10525 | * @hide |
| 10526 | */ |
| 10527 | public static final String getBluetoothPanPriorityKey(String address) { |
| 10528 | return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10529 | } |
| 10530 | |
| 10531 | /** |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 10532 | * Get the key that retrieves a bluetooth hearing aid priority. |
| 10533 | * @hide |
| 10534 | */ |
| 10535 | public static final String getBluetoothHearingAidPriorityKey(String address) { |
| 10536 | return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10537 | } |
| 10538 | |
| 10539 | /** |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10540 | * Get the key that retrieves a bluetooth map priority. |
| 10541 | * @hide |
| 10542 | */ |
| 10543 | public static final String getBluetoothMapPriorityKey(String address) { |
| 10544 | return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10545 | } |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10546 | |
| 10547 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10548 | * Get the key that retrieves a bluetooth map client priority. |
| 10549 | * @hide |
| 10550 | */ |
| 10551 | public static final String getBluetoothMapClientPriorityKey(String address) { |
| 10552 | return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10553 | } |
| 10554 | |
| 10555 | /** |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 10556 | * Get the key that retrieves a bluetooth pbap client priority. |
| 10557 | * @hide |
| 10558 | */ |
| 10559 | public static final String getBluetoothPbapClientPriorityKey(String address) { |
| 10560 | return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10561 | } |
| 10562 | |
| 10563 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 10564 | * Get the key that retrieves a bluetooth sap priority. |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 10565 | * @hide |
| 10566 | */ |
| 10567 | public static final String getBluetoothSapPriorityKey(String address) { |
| 10568 | return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 10569 | } |
| 10570 | |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 10571 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10572 | * Scaling factor for normal window animations. Setting to 0 will |
| 10573 | * disable window animations. |
| 10574 | */ |
| 10575 | public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; |
| 10576 | |
| 10577 | /** |
| 10578 | * Scaling factor for activity transition animations. Setting to 0 will |
| 10579 | * disable window animations. |
| 10580 | */ |
| 10581 | public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; |
| 10582 | |
| 10583 | /** |
| 10584 | * Scaling factor for Animator-based animations. This affects both the |
| 10585 | * start delay and duration of all such animations. Setting to 0 will |
| 10586 | * cause animations to end immediately. The default value is 1. |
| 10587 | */ |
| 10588 | public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; |
| 10589 | |
| 10590 | /** |
| 10591 | * Scaling factor for normal window animations. Setting to 0 will |
| 10592 | * disable window animations. |
| 10593 | * |
| 10594 | * @hide |
| 10595 | */ |
| 10596 | public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; |
| 10597 | |
| 10598 | /** |
| 10599 | * If 0, the compatibility mode is off for all applications. |
| 10600 | * If 1, older applications run under compatibility mode. |
| 10601 | * TODO: remove this settings before code freeze (bug/1907571) |
| 10602 | * @hide |
| 10603 | */ |
| 10604 | public static final String COMPATIBILITY_MODE = "compatibility_mode"; |
| 10605 | |
| 10606 | /** |
| 10607 | * CDMA only settings |
| 10608 | * Emergency Tone 0 = Off |
| 10609 | * 1 = Alert |
| 10610 | * 2 = Vibrate |
| 10611 | * @hide |
| 10612 | */ |
| 10613 | public static final String EMERGENCY_TONE = "emergency_tone"; |
| 10614 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10615 | private static final Validator EMERGENCY_TONE_VALIDATOR = |
| 10616 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 10617 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10618 | /** |
| 10619 | * CDMA only settings |
| 10620 | * Whether the auto retry is enabled. The value is |
| 10621 | * boolean (1 or 0). |
| 10622 | * @hide |
| 10623 | */ |
| 10624 | public static final String CALL_AUTO_RETRY = "call_auto_retry"; |
| 10625 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10626 | private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR; |
| 10627 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10628 | /** |
Selim Cinek | 705442f | 2016-09-13 16:02:33 -0700 | [diff] [blame] | 10629 | * A setting that can be read whether the emergency affordance is currently needed. |
| 10630 | * The value is a boolean (1 or 0). |
| 10631 | * @hide |
| 10632 | */ |
| 10633 | public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; |
| 10634 | |
| 10635 | /** |
Sungmin Choi | e099ab1 | 2014-06-09 14:45:51 +0900 | [diff] [blame] | 10636 | * See RIL_PreferredNetworkType in ril.h |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10637 | * @hide |
| 10638 | */ |
| 10639 | public static final String PREFERRED_NETWORK_MODE = |
| 10640 | "preferred_network_mode"; |
| 10641 | |
| 10642 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10643 | * Name of an application package to be debugged. |
| 10644 | */ |
| 10645 | public static final String DEBUG_APP = "debug_app"; |
| 10646 | |
| 10647 | /** |
| 10648 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 10649 | * starting user code. If 0, it will run normally. |
| 10650 | */ |
| 10651 | public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; |
| 10652 | |
| 10653 | /** |
Cody Northrop | 86cedcb | 2017-10-20 09:03:13 -0600 | [diff] [blame] | 10654 | * Allow GPU debug layers? |
| 10655 | * 0 = no |
| 10656 | * 1 = yes |
| 10657 | * @hide |
| 10658 | */ |
| 10659 | public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; |
| 10660 | |
| 10661 | /** |
| 10662 | * App allowed to load GPU debug layers |
| 10663 | * @hide |
| 10664 | */ |
| 10665 | public static final String GPU_DEBUG_APP = "gpu_debug_app"; |
| 10666 | |
| 10667 | /** |
| 10668 | * Ordered GPU debug layer list |
| 10669 | * i.e. <layer1>:<layer2>:...:<layerN> |
| 10670 | * @hide |
| 10671 | */ |
| 10672 | public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; |
| 10673 | |
| 10674 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10675 | * Control whether the process CPU usage meter should be shown. |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 10676 | * |
| 10677 | * @deprecated This functionality is no longer available as of |
| 10678 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10679 | */ |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 10680 | @Deprecated |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10681 | public static final String SHOW_PROCESSES = "show_processes"; |
| 10682 | |
| 10683 | /** |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 10684 | * If 1 low power mode is enabled. |
| 10685 | * @hide |
| 10686 | */ |
Makoto Onuki | f9046a2 | 2018-01-12 10:32:32 -0800 | [diff] [blame] | 10687 | @TestApi |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 10688 | public static final String LOW_POWER_MODE = "low_power"; |
| 10689 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 10690 | /** |
| 10691 | * Battery level [1-99] at which low power mode automatically turns on. |
Dianne Hackborn | 1427230 | 2014-06-10 23:13:02 -0700 | [diff] [blame] | 10692 | * If 0, it will not automatically turn on. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 10693 | * @hide |
| 10694 | */ |
| 10695 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; |
| 10696 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10697 | private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = |
| 10698 | new SettingsValidators.InclusiveIntegerRangeValidator(0, 99); |
| 10699 | |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 10700 | /** |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 10701 | * If not 0, the activity manager will aggressively finish activities and |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10702 | * processes as soon as they are no longer needed. If 0, the normal |
| 10703 | * extended lifetime is used. |
| 10704 | */ |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 10705 | public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10706 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10707 | /** |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 10708 | * Use Dock audio output for media: |
| 10709 | * 0 = disabled |
| 10710 | * 1 = enabled |
| 10711 | * @hide |
| 10712 | */ |
| 10713 | public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; |
| 10714 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10715 | private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; |
| 10716 | |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 10717 | /** |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 10718 | * The surround sound formats AC3, DTS or IEC61937 are |
| 10719 | * available for use if they are detected. |
| 10720 | * This is the default mode. |
| 10721 | * |
| 10722 | * Note that AUTO is equivalent to ALWAYS for Android TVs and other |
| 10723 | * devices that have an S/PDIF output. This is because S/PDIF |
| 10724 | * is unidirectional and the TV cannot know if a decoder is |
| 10725 | * connected. So it assumes they are always available. |
| 10726 | * @hide |
| 10727 | */ |
| 10728 | public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; |
| 10729 | |
| 10730 | /** |
| 10731 | * AC3, DTS or IEC61937 are NEVER available, even if they |
| 10732 | * are detected by the hardware. Those formats will not be |
| 10733 | * reported. |
| 10734 | * |
| 10735 | * An example use case would be an AVR reports that it is capable of |
| 10736 | * surround sound decoding but is broken. If NEVER is chosen |
| 10737 | * then apps must use PCM output instead of encoded output. |
| 10738 | * @hide |
| 10739 | */ |
| 10740 | public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; |
| 10741 | |
| 10742 | /** |
| 10743 | * AC3, DTS or IEC61937 are ALWAYS available, even if they |
| 10744 | * are not detected by the hardware. Those formats will be |
| 10745 | * reported as part of the HDMI output capability. Applications |
| 10746 | * are then free to use either PCM or encoded output. |
| 10747 | * |
| 10748 | * An example use case would be a when TV was connected over |
| 10749 | * TOS-link to an AVR. But the TV could not see it because TOS-link |
| 10750 | * is unidirectional. |
| 10751 | * @hide |
| 10752 | */ |
| 10753 | public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; |
| 10754 | |
| 10755 | /** |
| 10756 | * Set to ENCODED_SURROUND_OUTPUT_AUTO, |
| 10757 | * ENCODED_SURROUND_OUTPUT_NEVER or |
| 10758 | * ENCODED_SURROUND_OUTPUT_ALWAYS |
| 10759 | * @hide |
| 10760 | */ |
| 10761 | public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; |
| 10762 | |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 10763 | private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR = |
| 10764 | new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); |
| 10765 | |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 10766 | /** |
Eric Laurent | 05274f3 | 2012-11-29 12:48:18 -0800 | [diff] [blame] | 10767 | * Persisted safe headphone volume management state by AudioService |
| 10768 | * @hide |
| 10769 | */ |
| 10770 | public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; |
| 10771 | |
| 10772 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10773 | * URL for tzinfo (time zone) updates |
| 10774 | * @hide |
| 10775 | */ |
| 10776 | public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; |
| 10777 | |
| 10778 | /** |
| 10779 | * URL for tzinfo (time zone) update metadata |
| 10780 | * @hide |
| 10781 | */ |
| 10782 | public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; |
| 10783 | |
| 10784 | /** |
| 10785 | * URL for selinux (mandatory access control) updates |
| 10786 | * @hide |
| 10787 | */ |
| 10788 | public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; |
| 10789 | |
| 10790 | /** |
| 10791 | * URL for selinux (mandatory access control) update metadata |
| 10792 | * @hide |
| 10793 | */ |
| 10794 | public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; |
| 10795 | |
| 10796 | /** |
| 10797 | * URL for sms short code updates |
| 10798 | * @hide |
| 10799 | */ |
| 10800 | public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = |
| 10801 | "sms_short_codes_content_url"; |
| 10802 | |
| 10803 | /** |
| 10804 | * URL for sms short code update metadata |
| 10805 | * @hide |
| 10806 | */ |
| 10807 | public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = |
| 10808 | "sms_short_codes_metadata_url"; |
| 10809 | |
| 10810 | /** |
Amit Mahajan | 9069fab | 2015-05-01 11:05:47 -0700 | [diff] [blame] | 10811 | * URL for apn_db updates |
| 10812 | * @hide |
| 10813 | */ |
| 10814 | public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; |
| 10815 | |
| 10816 | /** |
| 10817 | * URL for apn_db update metadata |
| 10818 | * @hide |
| 10819 | */ |
| 10820 | public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; |
| 10821 | |
| 10822 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10823 | * URL for cert pinlist updates |
| 10824 | * @hide |
| 10825 | */ |
| 10826 | public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; |
| 10827 | |
| 10828 | /** |
| 10829 | * URL for cert pinlist updates |
| 10830 | * @hide |
| 10831 | */ |
| 10832 | public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; |
| 10833 | |
Geremy Condra | 757ee52 | 2013-03-29 16:39:45 -0700 | [diff] [blame] | 10834 | /** |
Ben Gruver | 633dc9b | 2013-04-04 12:05:49 -0700 | [diff] [blame] | 10835 | * URL for intent firewall updates |
| 10836 | * @hide |
| 10837 | */ |
| 10838 | public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = |
| 10839 | "intent_firewall_content_url"; |
| 10840 | |
| 10841 | /** |
| 10842 | * URL for intent firewall update metadata |
| 10843 | * @hide |
| 10844 | */ |
| 10845 | public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = |
| 10846 | "intent_firewall_metadata_url"; |
| 10847 | |
| 10848 | /** |
Abodunrinwa Toki | 51c4203 | 2017-04-02 19:16:01 +0100 | [diff] [blame] | 10849 | * URL for lang id model updates |
| 10850 | * @hide |
| 10851 | */ |
| 10852 | public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; |
| 10853 | |
| 10854 | /** |
| 10855 | * URL for lang id model update metadata |
| 10856 | * @hide |
| 10857 | */ |
| 10858 | public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; |
| 10859 | |
| 10860 | /** |
Abodunrinwa Toki | bb957d1 | 2017-04-12 14:40:46 +0100 | [diff] [blame] | 10861 | * URL for smart selection model updates |
| 10862 | * @hide |
| 10863 | */ |
| 10864 | public static final String SMART_SELECTION_UPDATE_CONTENT_URL = |
| 10865 | "smart_selection_content_url"; |
| 10866 | |
| 10867 | /** |
| 10868 | * URL for smart selection model update metadata |
| 10869 | * @hide |
| 10870 | */ |
| 10871 | public static final String SMART_SELECTION_UPDATE_METADATA_URL = |
| 10872 | "smart_selection_metadata_url"; |
| 10873 | |
| 10874 | /** |
Geremy Condra | 4e7f7e8 | 2013-03-26 21:09:01 -0700 | [diff] [blame] | 10875 | * SELinux enforcement status. If 0, permissive; if 1, enforcing. |
| 10876 | * @hide |
| 10877 | */ |
| 10878 | public static final String SELINUX_STATUS = "selinux_status"; |
| 10879 | |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10880 | /** |
Amith Yamasani | d8415f4 | 2013-08-07 20:15:10 -0700 | [diff] [blame] | 10881 | * Developer setting to force RTL layout. |
| 10882 | * @hide |
| 10883 | */ |
| 10884 | public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; |
| 10885 | |
| 10886 | /** |
Daniel Sandler | dea6462 | 2013-09-23 16:05:57 -0400 | [diff] [blame] | 10887 | * Milliseconds after screen-off after which low battery sounds will be silenced. |
| 10888 | * |
| 10889 | * If zero, battery sounds will always play. |
| 10890 | * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. |
| 10891 | * |
| 10892 | * @hide |
| 10893 | */ |
| 10894 | public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; |
| 10895 | |
| 10896 | /** |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 10897 | * 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] | 10898 | * 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] | 10899 | * clean up any value that they may have written. |
| 10900 | * |
| 10901 | * @hide |
| 10902 | */ |
| 10903 | public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; |
| 10904 | |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 10905 | /** |
| 10906 | * Defines global runtime overrides to window policy. |
| 10907 | * |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 10908 | * See {@link com.android.server.policy.PolicyControl} for value format. |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 10909 | * |
| 10910 | * @hide |
| 10911 | */ |
| 10912 | public static final String POLICY_CONTROL = "policy_control"; |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 10913 | |
| 10914 | /** |
Adrian Roos | 000cf5e | 2017-11-10 15:55:18 +0100 | [diff] [blame] | 10915 | * {@link android.view.DisplayCutout DisplayCutout} emulation mode. |
| 10916 | * |
| 10917 | * @hide |
| 10918 | */ |
| 10919 | public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; |
| 10920 | |
| 10921 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; |
| 10922 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; |
| 10923 | |
| 10924 | /** |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10925 | * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, |
| 10926 | * or ZEN_MODE_NO_INTERRUPTIONS. |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10927 | * |
| 10928 | * @hide |
| 10929 | */ |
| 10930 | public static final String ZEN_MODE = "zen_mode"; |
| 10931 | |
| 10932 | /** @hide */ public static final int ZEN_MODE_OFF = 0; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10933 | /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; |
| 10934 | /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 10935 | /** @hide */ public static final int ZEN_MODE_ALARMS = 3; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10936 | |
| 10937 | /** @hide */ public static String zenModeToString(int mode) { |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10938 | if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 10939 | if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10940 | if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; |
| 10941 | return "ZEN_MODE_OFF"; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10942 | } |
| 10943 | |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 10944 | /** @hide */ public static boolean isValidZenMode(int value) { |
| 10945 | switch (value) { |
| 10946 | case Global.ZEN_MODE_OFF: |
| 10947 | case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: |
| 10948 | case Global.ZEN_MODE_ALARMS: |
| 10949 | case Global.ZEN_MODE_NO_INTERRUPTIONS: |
| 10950 | return true; |
| 10951 | default: |
| 10952 | return false; |
| 10953 | } |
| 10954 | } |
| 10955 | |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10956 | /** |
Julia Reynolds | 9b11fdb | 2015-07-31 09:49:55 -0400 | [diff] [blame] | 10957 | * Value of the ringer before entering zen mode. |
| 10958 | * |
| 10959 | * @hide |
| 10960 | */ |
| 10961 | public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; |
| 10962 | |
| 10963 | /** |
John Spurlock | 056c519 | 2014-04-20 21:52:01 -0400 | [diff] [blame] | 10964 | * Opaque value, changes when persisted zen mode configuration changes. |
| 10965 | * |
| 10966 | * @hide |
| 10967 | */ |
| 10968 | public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; |
| 10969 | |
| 10970 | /** |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 10971 | * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. |
| 10972 | * |
| 10973 | * @hide |
| 10974 | */ |
Chris Wren | 10d82df | 2014-03-01 10:34:51 -0500 | [diff] [blame] | 10975 | public static final String HEADS_UP_NOTIFICATIONS_ENABLED = |
| 10976 | "heads_up_notifications_enabled"; |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 10977 | |
| 10978 | /** @hide */ public static final int HEADS_UP_OFF = 0; |
| 10979 | /** @hide */ public static final int HEADS_UP_ON = 1; |
| 10980 | |
| 10981 | /** |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 10982 | * The name of the device |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 10983 | */ |
| 10984 | public static final String DEVICE_NAME = "device_name"; |
| 10985 | |
| 10986 | /** |
Jeff Davidson | 56f9f73 | 2014-08-14 16:47:23 -0700 | [diff] [blame] | 10987 | * Whether the NetworkScoringService has been first initialized. |
| 10988 | * <p> |
| 10989 | * Type: int (0 for false, 1 for true) |
| 10990 | * @hide |
| 10991 | */ |
| 10992 | public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; |
| 10993 | |
| 10994 | /** |
Jim Miller | 6848dc8 | 2014-10-13 18:51:53 -0700 | [diff] [blame] | 10995 | * Whether the user wants to be prompted for password to decrypt the device on boot. |
| 10996 | * This only matters if the storage is encrypted. |
| 10997 | * <p> |
| 10998 | * Type: int (0 for false, 1 for true) |
| 10999 | * @hide |
| 11000 | */ |
| 11001 | public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; |
| 11002 | |
| 11003 | /** |
manabu, shimoda | 14723e3 | 2017-10-06 14:39:01 +0900 | [diff] [blame] | 11004 | * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config |
| 11005 | * 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] | 11006 | * <p> |
| 11007 | * Type: int (0 for false, 1 for true) |
| 11008 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11009 | * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED} |
| 11010 | * instead. |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11011 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11012 | @Deprecated |
| 11013 | public static final String ENHANCED_4G_MODE_ENABLED = |
| 11014 | SubscriptionManager.ENHANCED_4G_MODE_ENABLED; |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 11015 | |
| 11016 | /** |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11017 | * Whether VT (Video Telephony over IMS) is enabled |
| 11018 | * <p> |
| 11019 | * Type: int (0 for false, 1 for true) |
| 11020 | * |
| 11021 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11022 | * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead. |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11023 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11024 | @Deprecated |
| 11025 | public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED; |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 11026 | |
| 11027 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11028 | * Whether WFC is enabled |
| 11029 | * <p> |
| 11030 | * Type: int (0 for false, 1 for true) |
| 11031 | * |
| 11032 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11033 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11034 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11035 | @Deprecated |
| 11036 | public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11037 | |
| 11038 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11039 | * WFC mode on home/non-roaming network. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11040 | * <p> |
| 11041 | * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only |
| 11042 | * |
| 11043 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11044 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11045 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11046 | @Deprecated |
| 11047 | public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11048 | |
| 11049 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11050 | * WFC mode on roaming network. |
| 11051 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 11052 | * Type: int - see {@link #WFC_IMS_MODE} for values |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11053 | * |
| 11054 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11055 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE} |
| 11056 | * instead. |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 11057 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11058 | @Deprecated |
| 11059 | 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] | 11060 | |
| 11061 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11062 | * Whether WFC roaming is enabled |
| 11063 | * <p> |
| 11064 | * Type: int (0 for false, 1 for true) |
| 11065 | * |
| 11066 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11067 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED} |
| 11068 | * instead |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11069 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 11070 | @Deprecated |
| 11071 | public static final String WFC_IMS_ROAMING_ENABLED = |
| 11072 | SubscriptionManager.WFC_IMS_ROAMING_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 11073 | |
| 11074 | /** |
Amit Mahajan | 4fea092 | 2014-11-18 12:56:28 -0800 | [diff] [blame] | 11075 | * Whether user can enable/disable LTE as a preferred network. A carrier might control |
| 11076 | * this via gservices, OMA-DM, carrier app, etc. |
| 11077 | * <p> |
| 11078 | * Type: int (0 for false, 1 for true) |
| 11079 | * @hide |
| 11080 | */ |
| 11081 | public static final String LTE_SERVICE_FORCED = "lte_service_forced"; |
| 11082 | |
| 11083 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11084 | * Ephemeral app cookie max size in bytes. |
| 11085 | * <p> |
| 11086 | * Type: int |
| 11087 | * @hide |
| 11088 | */ |
| 11089 | public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = |
| 11090 | "ephemeral_cookie_max_size_bytes"; |
| 11091 | |
| 11092 | /** |
Todd Kennedy | d15bb75 | 2016-09-13 16:38:31 -0700 | [diff] [blame] | 11093 | * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is |
| 11094 | * enabled. Set to zero to disable. |
| 11095 | * <p> |
| 11096 | * Type: int (0 for false, 1 for true) |
| 11097 | * |
| 11098 | * @hide |
| 11099 | */ |
| 11100 | public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; |
| 11101 | |
| 11102 | /** |
Todd Kennedy | 133c5da | 2017-06-15 09:44:34 -0700 | [diff] [blame] | 11103 | * Toggle to enable/disable dexopt for instant applications. The default is for dexopt |
| 11104 | * to be disabled. |
| 11105 | * <p> |
| 11106 | * Type: int (0 to disable, 1 to enable) |
| 11107 | * |
| 11108 | * @hide |
| 11109 | */ |
| 11110 | public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; |
| 11111 | |
| 11112 | /** |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11113 | * The min period for caching installed instant apps in milliseconds. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11114 | * <p> |
| 11115 | * Type: long |
| 11116 | * @hide |
| 11117 | */ |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 11118 | public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11119 | "installed_instant_app_min_cache_period"; |
| 11120 | |
| 11121 | /** |
| 11122 | * The max period for caching installed instant apps in milliseconds. |
| 11123 | * <p> |
| 11124 | * Type: long |
| 11125 | * @hide |
| 11126 | */ |
| 11127 | public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11128 | "installed_instant_app_max_cache_period"; |
| 11129 | |
| 11130 | /** |
| 11131 | * The min period for caching uninstalled instant apps in milliseconds. |
| 11132 | * <p> |
| 11133 | * Type: long |
| 11134 | * @hide |
| 11135 | */ |
| 11136 | public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 11137 | "uninstalled_instant_app_min_cache_period"; |
| 11138 | |
| 11139 | /** |
| 11140 | * The max period for caching uninstalled instant apps in milliseconds. |
| 11141 | * <p> |
| 11142 | * Type: long |
| 11143 | * @hide |
| 11144 | */ |
| 11145 | public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 11146 | "uninstalled_instant_app_max_cache_period"; |
| 11147 | |
| 11148 | /** |
| 11149 | * The min period for caching unused static shared libs in milliseconds. |
| 11150 | * <p> |
| 11151 | * Type: long |
| 11152 | * @hide |
| 11153 | */ |
| 11154 | public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = |
| 11155 | "unused_static_shared_lib_min_cache_period"; |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 11156 | |
| 11157 | /** |
Fyodor Kupolov | 07140f7 | 2016-02-17 10:46:11 -0800 | [diff] [blame] | 11158 | * Allows switching users when system user is locked. |
| 11159 | * <p> |
| 11160 | * Type: int |
| 11161 | * @hide |
| 11162 | */ |
| 11163 | public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = |
| 11164 | "allow_user_switching_when_system_user_locked"; |
| 11165 | |
| 11166 | /** |
Kenny Guy | c4db5ca | 2017-09-21 11:40:44 +0100 | [diff] [blame] | 11167 | * Boot count since the device starts running API level 24. |
Daichi Hirono | 82ab980 | 2016-03-02 13:23:29 +0900 | [diff] [blame] | 11168 | * <p> |
| 11169 | * Type: int |
| 11170 | */ |
| 11171 | public static final String BOOT_COUNT = "boot_count"; |
| 11172 | |
| 11173 | /** |
Lenka Trochtova | 6474f0e | 2016-03-24 16:43:10 +0100 | [diff] [blame] | 11174 | * Whether the safe boot is disallowed. |
| 11175 | * |
| 11176 | * <p>This setting should have the identical value as the corresponding user restriction. |
| 11177 | * The purpose of the setting is to make the restriction available in early boot stages |
| 11178 | * before the user restrictions are loaded. |
| 11179 | * @hide |
| 11180 | */ |
| 11181 | public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; |
| 11182 | |
| 11183 | /** |
Amith Yamasani | eb437d4 | 2016-04-29 09:31:25 -0700 | [diff] [blame] | 11184 | * Whether this device is currently in retail demo mode. If true, device |
| 11185 | * usage is severely limited. |
| 11186 | * <p> |
| 11187 | * Type: int (0 for false, 1 for true) |
| 11188 | * @hide |
| 11189 | */ |
| 11190 | public static final String DEVICE_DEMO_MODE = "device_demo_mode"; |
| 11191 | |
| 11192 | /** |
Sudheer Shanka | 5918c67 | 2017-03-21 19:31:37 -0700 | [diff] [blame] | 11193 | * Indicates the maximum time that an app is blocked for the network rules to get updated. |
| 11194 | * |
| 11195 | * Type: long |
| 11196 | * |
| 11197 | * @hide |
| 11198 | */ |
| 11199 | public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; |
| 11200 | |
| 11201 | /** |
Svetoslav Ganov | 264c7a9 | 2016-08-24 17:31:14 -0700 | [diff] [blame] | 11202 | * The reason for the settings database being downgraded. This is only for |
| 11203 | * troubleshooting purposes and its value should not be interpreted in any way. |
| 11204 | * |
| 11205 | * Type: string |
| 11206 | * |
| 11207 | * @hide |
| 11208 | */ |
| 11209 | public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; |
| 11210 | |
| 11211 | /** |
Amith Yamasani | 3945202 | 2017-03-21 15:23:47 -0700 | [diff] [blame] | 11212 | * The build id of when the settings database was first created (or re-created due it |
| 11213 | * being missing). |
| 11214 | * |
| 11215 | * Type: string |
| 11216 | * |
| 11217 | * @hide |
| 11218 | */ |
| 11219 | public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; |
| 11220 | |
| 11221 | /** |
Suprabh Shukla | 502fd88 | 2016-09-30 15:06:00 -0700 | [diff] [blame] | 11222 | * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by |
| 11223 | * default. Set to 0 to disable. |
| 11224 | * |
| 11225 | * @hide |
| 11226 | */ |
| 11227 | public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; |
| 11228 | |
| 11229 | /** |
songchenxi | 825f69a | 2017-01-19 14:18:41 -0800 | [diff] [blame] | 11230 | * Flag to enable the link to location permissions in location setting. Set to 0 to disable. |
| 11231 | * |
| 11232 | * @hide |
| 11233 | */ |
| 11234 | public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = |
| 11235 | "location_settings_link_to_permissions_enabled"; |
| 11236 | |
| 11237 | /** |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11238 | * Flag to set the waiting time for euicc factory reset inside System > Settings |
| 11239 | * Type: long |
| 11240 | * |
| 11241 | * @hide |
| 11242 | */ |
qingxi | 2f23151 | 2017-06-23 15:32:53 -0700 | [diff] [blame] | 11243 | public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = |
| 11244 | "euicc_factory_reset_timeout_millis"; |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 11245 | |
| 11246 | /** |
Daniel Nishi | 5782b5c | 2017-08-24 10:28:52 -0700 | [diff] [blame] | 11247 | * Flag to set the timeout for when to refresh the storage settings cached data. |
| 11248 | * Type: long |
| 11249 | * |
| 11250 | * @hide |
| 11251 | */ |
| 11252 | public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = |
| 11253 | "storage_settings_clobber_threshold"; |
| 11254 | |
| 11255 | /** |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11256 | * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} |
| 11257 | * temporarily for all users. |
| 11258 | * |
| 11259 | * @hide |
| 11260 | */ |
Makoto Onuki | 8e49825 | 2018-01-22 17:00:00 -0800 | [diff] [blame] | 11261 | @TestApi |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 11262 | public static final String LOCATION_GLOBAL_KILL_SWITCH = |
| 11263 | "location_global_kill_switch"; |
| 11264 | |
| 11265 | /** |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11266 | * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored |
| 11267 | * and restoring to lower version of platform API will be skipped. |
| 11268 | * |
| 11269 | * @hide |
| 11270 | */ |
| 11271 | public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = |
| 11272 | "override_settings_provider_restore_any_version"; |
Narayan Kamath | 8d82825 | 2018-01-11 15:22:37 +0000 | [diff] [blame] | 11273 | /** |
| 11274 | * Flag to toggle whether system services report attribution chains when they attribute |
| 11275 | * battery use via a {@code WorkSource}. |
| 11276 | * |
| 11277 | * Type: int (0 to disable, 1 to enable) |
| 11278 | * |
| 11279 | * @hide |
| 11280 | */ |
| 11281 | public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = |
| 11282 | "chained_battery_attribution_enabled"; |
Michal Karpinski | b52575c | 2018-01-19 17:38:45 +0000 | [diff] [blame] | 11283 | |
| 11284 | /** |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11285 | * Settings to backup. This is here so that it's in the same place as the settings |
| 11286 | * keys and easy to update. |
| 11287 | * |
| 11288 | * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System |
| 11289 | * and Secure as well. This is because those tables drive both backup and |
| 11290 | * restore, and restore needs to properly whitelist keys that used to live |
| 11291 | * in those namespaces. The keys will only actually be backed up / restored |
| 11292 | * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). |
| 11293 | * |
| 11294 | * NOTE: Settings are backed up and restored in the order they appear |
| 11295 | * in this array. If you have one setting depending on another, |
| 11296 | * make sure that they are ordered appropriately. |
| 11297 | * |
| 11298 | * @hide |
| 11299 | */ |
| 11300 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 11301 | BUGREPORT_IN_POWER_MENU, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11302 | STAY_ON_WHILE_PLUGGED_IN, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11303 | AUTO_TIME, |
| 11304 | AUTO_TIME_ZONE, |
| 11305 | POWER_SOUNDS_ENABLED, |
| 11306 | DOCK_SOUNDS_ENABLED, |
Ritesh Reddy | f8f1213 | 2015-11-20 16:43:28 +0000 | [diff] [blame] | 11307 | CHARGING_SOUNDS_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11308 | USB_MASS_STORAGE_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11309 | NETWORK_RECOMMENDATIONS_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 11310 | WIFI_WAKEUP_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11311 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11312 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 11313 | USE_OPEN_WIFI_PACKAGE, |
Christopher Tate | 16eb7cd | 2012-10-09 15:26:30 -0700 | [diff] [blame] | 11314 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11315 | EMERGENCY_TONE, |
| 11316 | CALL_AUTO_RETRY, |
Amith Yamasani | 9400524 | 2014-10-31 11:35:13 -0700 | [diff] [blame] | 11317 | DOCK_AUDIO_MEDIA_ENABLED, |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 11318 | ENCODED_SURROUND_OUTPUT, |
Stanley Tng | 767f05f | 2017-05-01 21:27:31 -0700 | [diff] [blame] | 11319 | LOW_POWER_MODE_TRIGGER_LEVEL, |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 11320 | BLUETOOTH_ON, |
| 11321 | PRIVATE_DNS_MODE, |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 11322 | PRIVATE_DNS_SPECIFIER, |
| 11323 | SOFT_AP_TIMEOUT_ENABLED |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 11324 | }; |
| 11325 | |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11326 | /** |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11327 | * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, |
| 11328 | * otherwise they won't be restored. |
| 11329 | * |
| 11330 | * @hide |
| 11331 | */ |
| 11332 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 11333 | static { |
| 11334 | VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); |
| 11335 | VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); |
| 11336 | VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); |
| 11337 | VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); |
| 11338 | VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); |
| 11339 | VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); |
| 11340 | VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR); |
| 11341 | VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); |
| 11342 | VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, |
| 11343 | NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR); |
| 11344 | VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR); |
| 11345 | VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11346 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
| 11347 | VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR); |
| 11348 | VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
| 11349 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR); |
| 11350 | VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); |
| 11351 | VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); |
| 11352 | VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); |
| 11353 | VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); |
| 11354 | VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); |
| 11355 | VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR); |
| 11356 | VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR); |
| 11357 | VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR); |
| 11358 | VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR); |
Glen Kuhne | 22ae9d5 | 2017-11-28 14:06:25 -0800 | [diff] [blame] | 11359 | VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
| 11360 | WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); |
Michal Karpinski | 5db1e43 | 2018-01-18 20:10:24 +0000 | [diff] [blame] | 11361 | } |
| 11362 | |
| 11363 | /** |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 11364 | * Global settings that shouldn't be persisted. |
| 11365 | * |
| 11366 | * @hide |
| 11367 | */ |
| 11368 | public static final String[] TRANSIENT_SETTINGS = { |
| 11369 | LOCATION_GLOBAL_KILL_SWITCH, |
| 11370 | }; |
| 11371 | |
Michal Karpinski | 964943a | 2018-01-19 16:28:26 +0000 | [diff] [blame] | 11372 | /** |
| 11373 | * Keys we no longer back up under the current schema, but want to continue to |
| 11374 | * process when restoring historical backup datasets. |
| 11375 | * |
| 11376 | * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, |
| 11377 | * otherwise they won't be restored. |
| 11378 | * |
| 11379 | * @hide |
| 11380 | */ |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 11381 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 11382 | }; |
| 11383 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11384 | private static final ContentProviderHolder sProviderHolder = |
| 11385 | new ContentProviderHolder(CONTENT_URI); |
| 11386 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11387 | // Populated lazily, guarded by class object: |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11388 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11389 | CONTENT_URI, |
| 11390 | CALL_METHOD_GET_GLOBAL, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11391 | CALL_METHOD_PUT_GLOBAL, |
| 11392 | sProviderHolder); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11393 | |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11394 | // Certain settings have been moved from global to the per-user secure namespace |
| 11395 | private static final HashSet<String> MOVED_TO_SECURE; |
| 11396 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 11397 | MOVED_TO_SECURE = new HashSet<>(1); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11398 | MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); |
| 11399 | } |
| 11400 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 11401 | /** @hide */ |
| 11402 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 11403 | outKeySet.addAll(MOVED_TO_SECURE); |
| 11404 | } |
| 11405 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 11406 | /** @hide */ |
| 11407 | public static void clearProviderForTest() { |
| 11408 | sProviderHolder.clearProviderForTest(); |
| 11409 | sNameValueCache.clearGenerationTrackerForTest(); |
| 11410 | } |
| 11411 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11412 | /** |
| 11413 | * Look up a name in the database. |
| 11414 | * @param resolver to access the database with |
| 11415 | * @param name to look up in the table |
| 11416 | * @return the corresponding value, or null if not present |
| 11417 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11418 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11419 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 11420 | } |
| 11421 | |
| 11422 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 11423 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11424 | int userHandle) { |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11425 | if (MOVED_TO_SECURE.contains(name)) { |
| 11426 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 11427 | + " to android.provider.Settings.Secure, returning read-only value."); |
| 11428 | return Secure.getStringForUser(resolver, name, userHandle); |
| 11429 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11430 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
| 11431 | } |
| 11432 | |
| 11433 | /** |
| 11434 | * Store a name/value pair into the database. |
| 11435 | * @param resolver to access the database with |
| 11436 | * @param name to store |
| 11437 | * @param value to associate with the name |
| 11438 | * @return true if the value was set, false on database errors |
| 11439 | */ |
| 11440 | public static boolean putString(ContentResolver resolver, |
| 11441 | String name, String value) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11442 | return putStringForUser(resolver, name, value, null, false, UserHandle.myUserId()); |
| 11443 | } |
| 11444 | |
| 11445 | /** |
| 11446 | * Store a name/value pair into the database. |
| 11447 | * <p> |
| 11448 | * The method takes an optional tag to associate with the setting |
| 11449 | * which can be used to clear only settings made by your package and |
| 11450 | * associated with this tag by passing the tag to {@link |
| 11451 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 11452 | * the current tag. Also if another package changes the setting |
| 11453 | * then the tag will be set to the one specified in the set call |
| 11454 | * which can be null. Also any of the settings setters that do not |
| 11455 | * take a tag as an argument effectively clears the tag. |
| 11456 | * </p><p> |
| 11457 | * For example, if you set settings A and B with tags T1 and T2 and |
| 11458 | * another app changes setting A (potentially to the same value), it |
| 11459 | * can assign to it a tag T3 (note that now the package that changed |
| 11460 | * the setting is not yours). Now if you reset your changes for T1 and |
| 11461 | * T2 only setting B will be reset and A not (as it was changed by |
| 11462 | * another package) but since A did not change you are in the desired |
| 11463 | * initial state. Now if the other app changes the value of A (assuming |
| 11464 | * you registered an observer in the beginning) you would detect that |
| 11465 | * the setting was changed by another app and handle this appropriately |
| 11466 | * (ignore, set back to some value, etc). |
| 11467 | * </p><p> |
| 11468 | * Also the method takes an argument whether to make the value the |
| 11469 | * default for this setting. If the system already specified a default |
| 11470 | * value, then the one passed in here will <strong>not</strong> |
| 11471 | * be set as the default. |
| 11472 | * </p> |
| 11473 | * |
| 11474 | * @param resolver to access the database with. |
| 11475 | * @param name to store. |
| 11476 | * @param value to associate with the name. |
| 11477 | * @param tag to associated with the setting. |
| 11478 | * @param makeDefault whether to make the value the default one. |
| 11479 | * @return true if the value was set, false on database errors. |
| 11480 | * |
| 11481 | * @see #resetToDefaults(ContentResolver, String) |
| 11482 | * |
| 11483 | * @hide |
| 11484 | */ |
| 11485 | @SystemApi |
| 11486 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 11487 | public static boolean putString(@NonNull ContentResolver resolver, |
| 11488 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 11489 | boolean makeDefault) { |
| 11490 | return putStringForUser(resolver, name, value, tag, makeDefault, |
| 11491 | UserHandle.myUserId()); |
| 11492 | } |
| 11493 | |
| 11494 | /** |
| 11495 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 11496 | * settings set by the caller's package. Think of it of a way to undo your own |
| 11497 | * changes to the secure settings. Passing in the optional tag will reset only |
| 11498 | * settings changed by your package and associated with this tag. |
| 11499 | * |
| 11500 | * @param resolver Handle to the content resolver. |
| 11501 | * @param tag Optional tag which should be associated with the settings to reset. |
| 11502 | * |
| 11503 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 11504 | * |
| 11505 | * @hide |
| 11506 | */ |
| 11507 | @SystemApi |
| 11508 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 11509 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 11510 | @Nullable String tag) { |
| 11511 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
| 11512 | UserHandle.myUserId()); |
| 11513 | } |
| 11514 | |
| 11515 | /** |
| 11516 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 11517 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 11518 | * allowing resetting the settings made by a package and associated with the tag. |
| 11519 | * |
| 11520 | * @param resolver Handle to the content resolver. |
| 11521 | * @param tag Optional tag which should be associated with the settings to reset. |
| 11522 | * @param mode The reset mode. |
| 11523 | * @param userHandle The user for which to reset to defaults. |
| 11524 | * |
| 11525 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 11526 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 11527 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 11528 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 11529 | * |
| 11530 | * @hide |
| 11531 | */ |
| 11532 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 11533 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 11534 | try { |
| 11535 | Bundle arg = new Bundle(); |
| 11536 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 11537 | if (tag != null) { |
| 11538 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 11539 | } |
| 11540 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 11541 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 11542 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); |
| 11543 | } catch (RemoteException e) { |
| 11544 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 11545 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11546 | } |
| 11547 | |
| 11548 | /** @hide */ |
| 11549 | public static boolean putStringForUser(ContentResolver resolver, |
| 11550 | String name, String value, int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11551 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 11552 | } |
| 11553 | |
| 11554 | /** @hide */ |
| 11555 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 11556 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 11557 | boolean makeDefault, @UserIdInt int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11558 | if (LOCAL_LOGV) { |
| 11559 | Log.v(TAG, "Global.putString(name=" + name + ", value=" + value |
| 11560 | + " for " + userHandle); |
| 11561 | } |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11562 | // Global and Secure have the same access policy so we can forward writes |
| 11563 | if (MOVED_TO_SECURE.contains(name)) { |
| 11564 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 11565 | + " to android.provider.Settings.Secure, value is unchanged."); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11566 | return Secure.putStringForUser(resolver, name, value, tag, |
| 11567 | makeDefault, userHandle); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 11568 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 11569 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 11570 | makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11571 | } |
| 11572 | |
| 11573 | /** |
| 11574 | * Construct the content URI for a particular name/value pair, |
| 11575 | * useful for monitoring changes with a ContentObserver. |
| 11576 | * @param name to look up in the table |
| 11577 | * @return the corresponding content URI, or null if not present |
| 11578 | */ |
| 11579 | public static Uri getUriFor(String name) { |
| 11580 | return getUriFor(CONTENT_URI, name); |
| 11581 | } |
| 11582 | |
| 11583 | /** |
| 11584 | * Convenience function for retrieving a single secure settings value |
| 11585 | * as an integer. Note that internally setting values are always |
| 11586 | * stored as strings; this function converts the string to an integer |
| 11587 | * for you. The default value will be returned if the setting is |
| 11588 | * not defined or not an integer. |
| 11589 | * |
| 11590 | * @param cr The ContentResolver to access. |
| 11591 | * @param name The name of the setting to retrieve. |
| 11592 | * @param def Value to return if the setting is not defined. |
| 11593 | * |
| 11594 | * @return The setting's current value, or 'def' if it is not defined |
| 11595 | * or not a valid integer. |
| 11596 | */ |
| 11597 | public static int getInt(ContentResolver cr, String name, int def) { |
| 11598 | String v = getString(cr, name); |
| 11599 | try { |
| 11600 | return v != null ? Integer.parseInt(v) : def; |
| 11601 | } catch (NumberFormatException e) { |
| 11602 | return def; |
| 11603 | } |
| 11604 | } |
| 11605 | |
| 11606 | /** |
| 11607 | * Convenience function for retrieving a single secure settings value |
| 11608 | * as an integer. Note that internally setting values are always |
| 11609 | * stored as strings; this function converts the string to an integer |
| 11610 | * for you. |
| 11611 | * <p> |
| 11612 | * This version does not take a default value. If the setting has not |
| 11613 | * been set, or the string value is not a number, |
| 11614 | * it throws {@link SettingNotFoundException}. |
| 11615 | * |
| 11616 | * @param cr The ContentResolver to access. |
| 11617 | * @param name The name of the setting to retrieve. |
| 11618 | * |
| 11619 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 11620 | * name can't be found or the setting value is not an integer. |
| 11621 | * |
| 11622 | * @return The setting's current value. |
| 11623 | */ |
| 11624 | public static int getInt(ContentResolver cr, String name) |
| 11625 | throws SettingNotFoundException { |
| 11626 | String v = getString(cr, name); |
| 11627 | try { |
| 11628 | return Integer.parseInt(v); |
| 11629 | } catch (NumberFormatException e) { |
| 11630 | throw new SettingNotFoundException(name); |
| 11631 | } |
| 11632 | } |
| 11633 | |
| 11634 | /** |
| 11635 | * Convenience function for updating a single settings value as an |
| 11636 | * integer. This will either create a new entry in the table if the |
| 11637 | * given name does not exist, or modify the value of the existing row |
| 11638 | * with that name. Note that internally setting values are always |
| 11639 | * stored as strings, so this function converts the given value to a |
| 11640 | * string before storing it. |
| 11641 | * |
| 11642 | * @param cr The ContentResolver to access. |
| 11643 | * @param name The name of the setting to modify. |
| 11644 | * @param value The new value for the setting. |
| 11645 | * @return true if the value was set, false on database errors |
| 11646 | */ |
| 11647 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 11648 | return putString(cr, name, Integer.toString(value)); |
| 11649 | } |
| 11650 | |
| 11651 | /** |
| 11652 | * Convenience function for retrieving a single secure settings value |
| 11653 | * as a {@code long}. Note that internally setting values are always |
| 11654 | * stored as strings; this function converts the string to a {@code long} |
| 11655 | * for you. The default value will be returned if the setting is |
| 11656 | * not defined or not a {@code long}. |
| 11657 | * |
| 11658 | * @param cr The ContentResolver to access. |
| 11659 | * @param name The name of the setting to retrieve. |
| 11660 | * @param def Value to return if the setting is not defined. |
| 11661 | * |
| 11662 | * @return The setting's current value, or 'def' if it is not defined |
| 11663 | * or not a valid {@code long}. |
| 11664 | */ |
| 11665 | public static long getLong(ContentResolver cr, String name, long def) { |
| 11666 | String valString = getString(cr, name); |
| 11667 | long value; |
| 11668 | try { |
| 11669 | value = valString != null ? Long.parseLong(valString) : def; |
| 11670 | } catch (NumberFormatException e) { |
| 11671 | value = def; |
| 11672 | } |
| 11673 | return value; |
| 11674 | } |
| 11675 | |
| 11676 | /** |
| 11677 | * Convenience function for retrieving a single secure settings value |
| 11678 | * as a {@code long}. Note that internally setting values are always |
| 11679 | * stored as strings; this function converts the string to a {@code long} |
| 11680 | * for you. |
| 11681 | * <p> |
| 11682 | * This version does not take a default value. If the setting has not |
| 11683 | * been set, or the string value is not a number, |
| 11684 | * it throws {@link SettingNotFoundException}. |
| 11685 | * |
| 11686 | * @param cr The ContentResolver to access. |
| 11687 | * @param name The name of the setting to retrieve. |
| 11688 | * |
| 11689 | * @return The setting's current value. |
| 11690 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 11691 | * name can't be found or the setting value is not an integer. |
| 11692 | */ |
| 11693 | public static long getLong(ContentResolver cr, String name) |
| 11694 | throws SettingNotFoundException { |
| 11695 | String valString = getString(cr, name); |
| 11696 | try { |
| 11697 | return Long.parseLong(valString); |
| 11698 | } catch (NumberFormatException e) { |
| 11699 | throw new SettingNotFoundException(name); |
| 11700 | } |
| 11701 | } |
| 11702 | |
| 11703 | /** |
| 11704 | * Convenience function for updating a secure settings value as a long |
| 11705 | * integer. This will either create a new entry in the table if the |
| 11706 | * given name does not exist, or modify the value of the existing row |
| 11707 | * with that name. Note that internally setting values are always |
| 11708 | * stored as strings, so this function converts the given value to a |
| 11709 | * string before storing it. |
| 11710 | * |
| 11711 | * @param cr The ContentResolver to access. |
| 11712 | * @param name The name of the setting to modify. |
| 11713 | * @param value The new value for the setting. |
| 11714 | * @return true if the value was set, false on database errors |
| 11715 | */ |
| 11716 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 11717 | return putString(cr, name, Long.toString(value)); |
| 11718 | } |
| 11719 | |
| 11720 | /** |
| 11721 | * Convenience function for retrieving a single secure settings value |
| 11722 | * as a floating point number. Note that internally setting values are |
| 11723 | * always stored as strings; this function converts the string to an |
| 11724 | * float for you. The default value will be returned if the setting |
| 11725 | * is not defined or not a valid float. |
| 11726 | * |
| 11727 | * @param cr The ContentResolver to access. |
| 11728 | * @param name The name of the setting to retrieve. |
| 11729 | * @param def Value to return if the setting is not defined. |
| 11730 | * |
| 11731 | * @return The setting's current value, or 'def' if it is not defined |
| 11732 | * or not a valid float. |
| 11733 | */ |
| 11734 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 11735 | String v = getString(cr, name); |
| 11736 | try { |
| 11737 | return v != null ? Float.parseFloat(v) : def; |
| 11738 | } catch (NumberFormatException e) { |
| 11739 | return def; |
| 11740 | } |
| 11741 | } |
| 11742 | |
| 11743 | /** |
| 11744 | * Convenience function for retrieving a single secure settings value |
| 11745 | * as a float. Note that internally setting values are always |
| 11746 | * stored as strings; this function converts the string to a float |
| 11747 | * for you. |
| 11748 | * <p> |
| 11749 | * This version does not take a default value. If the setting has not |
| 11750 | * been set, or the string value is not a number, |
| 11751 | * it throws {@link SettingNotFoundException}. |
| 11752 | * |
| 11753 | * @param cr The ContentResolver to access. |
| 11754 | * @param name The name of the setting to retrieve. |
| 11755 | * |
| 11756 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 11757 | * name can't be found or the setting value is not a float. |
| 11758 | * |
| 11759 | * @return The setting's current value. |
| 11760 | */ |
| 11761 | public static float getFloat(ContentResolver cr, String name) |
| 11762 | throws SettingNotFoundException { |
| 11763 | String v = getString(cr, name); |
| 11764 | if (v == null) { |
| 11765 | throw new SettingNotFoundException(name); |
| 11766 | } |
| 11767 | try { |
| 11768 | return Float.parseFloat(v); |
| 11769 | } catch (NumberFormatException e) { |
| 11770 | throw new SettingNotFoundException(name); |
| 11771 | } |
| 11772 | } |
| 11773 | |
| 11774 | /** |
| 11775 | * Convenience function for updating a single settings value as a |
| 11776 | * floating point number. This will either create a new entry in the |
| 11777 | * table if the given name does not exist, or modify the value of the |
| 11778 | * existing row with that name. Note that internally setting values |
| 11779 | * are always stored as strings, so this function converts the given |
| 11780 | * value to a string before storing it. |
| 11781 | * |
| 11782 | * @param cr The ContentResolver to access. |
| 11783 | * @param name The name of the setting to modify. |
| 11784 | * @param value The new value for the setting. |
| 11785 | * @return true if the value was set, false on database errors |
| 11786 | */ |
| 11787 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 11788 | return putString(cr, name, Float.toString(value)); |
| 11789 | } |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11790 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11791 | /** |
| 11792 | * Subscription to be used for voice call on a multi sim device. The supported values |
| 11793 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11794 | * @hide |
| 11795 | */ |
| 11796 | public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; |
| 11797 | |
| 11798 | /** |
| 11799 | * Used to provide option to user to select subscription during dial. |
| 11800 | * The supported values are 0 = disable or 1 = enable prompt. |
| 11801 | * @hide |
| 11802 | */ |
| 11803 | public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; |
| 11804 | |
| 11805 | /** |
| 11806 | * Subscription to be used for data call on a multi sim device. The supported values |
| 11807 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11808 | * @hide |
| 11809 | */ |
| 11810 | public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; |
| 11811 | |
| 11812 | /** |
| 11813 | * Subscription to be used for SMS on a multi sim device. The supported values |
| 11814 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11815 | * @hide |
| 11816 | */ |
| 11817 | public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; |
| 11818 | |
| 11819 | /** |
| 11820 | * Used to provide option to user to select subscription during send SMS. |
| 11821 | * The value 1 - enable, 0 - disable |
| 11822 | * @hide |
| 11823 | */ |
| 11824 | public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; |
| 11825 | |
| 11826 | |
| 11827 | |
| 11828 | /** User preferred subscriptions setting. |
| 11829 | * 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] | 11830 | * the activation status. Each settings string have the comma separated values |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11831 | * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index |
| 11832 | * @hide |
| 11833 | */ |
| 11834 | public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", |
| 11835 | "user_preferred_sub2","user_preferred_sub3"}; |
Zheng Fu | b218ff4 | 2015-04-13 16:31:16 -0700 | [diff] [blame] | 11836 | |
| 11837 | /** |
| 11838 | * Whether to enable new contacts aggregator or not. |
| 11839 | * The value 1 - enable, 0 - disable |
| 11840 | * @hide |
| 11841 | */ |
| 11842 | public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11843 | |
| 11844 | /** |
| 11845 | * Whether to enable contacts metadata syncing or not |
| 11846 | * The value 1 - enable, 0 - disable |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11847 | * |
| 11848 | * @removed |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11849 | */ |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11850 | @Deprecated |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11851 | public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 11852 | |
| 11853 | /** |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11854 | * Whether to enable contacts metadata syncing or not |
| 11855 | * The value 1 - enable, 0 - disable |
| 11856 | */ |
| 11857 | public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; |
| 11858 | |
| 11859 | /** |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 11860 | * Whether to enable cellular on boot. |
| 11861 | * The value 1 - enable, 0 - disable |
| 11862 | * @hide |
| 11863 | */ |
| 11864 | public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; |
Steven Ng | dc20ba6 | 2016-04-26 18:19:04 +0100 | [diff] [blame] | 11865 | |
| 11866 | /** |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 11867 | * The maximum allowed notification enqueue rate in Hertz. |
| 11868 | * |
Julia Reynolds | 76c096d | 2017-06-19 08:16:04 -0400 | [diff] [blame] | 11869 | * Should be a float, and includes updates only. |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 11870 | * @hide |
| 11871 | */ |
| 11872 | public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; |
Doris Ling | 628cea4 | 2016-06-09 10:35:02 -0700 | [diff] [blame] | 11873 | |
| 11874 | /** |
Geoffrey Pitsch | 4c6eef2 | 2017-04-19 10:26:45 -0400 | [diff] [blame] | 11875 | * Displays toasts when an app posts a notification that does not specify a valid channel. |
| 11876 | * |
| 11877 | * The value 1 - enable, 0 - disable |
| 11878 | * @hide |
| 11879 | */ |
| 11880 | public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = |
| 11881 | "show_notification_channel_warnings"; |
| 11882 | |
| 11883 | /** |
Chris Manton | 95a6c89 | 2016-03-15 13:26:11 -0700 | [diff] [blame] | 11884 | * Whether cell is enabled/disabled |
| 11885 | * @hide |
| 11886 | */ |
| 11887 | public static final String CELL_ON = "cell_on"; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11888 | |
| 11889 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11890 | * Global settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11891 | * @hide |
| 11892 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11893 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11894 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11895 | INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); |
| 11896 | INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); |
| 11897 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); |
| 11898 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); |
| 11899 | INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); |
Chad Brubaker | 1f6a266 | 2017-03-20 11:11:30 -0700 | [diff] [blame] | 11900 | INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); |
Chad Brubaker | 91d2e28 | 2017-04-03 14:34:50 -0700 | [diff] [blame] | 11901 | INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); |
| 11902 | INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); |
| 11903 | INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); |
| 11904 | INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 11905 | INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); |
Chad Brubaker | a6170b8 | 2017-09-01 14:48:46 -0700 | [diff] [blame] | 11906 | INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); |
Svet Ganov | 8f90bcc | 2017-12-22 23:29:24 -0800 | [diff] [blame] | 11907 | INSTANT_APP_SETTINGS.add(ZEN_MODE); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11908 | } |
| 11909 | |
Andrew Sapperstein | e335256 | 2017-01-20 15:41:03 -0800 | [diff] [blame] | 11910 | /** |
| 11911 | * Whether to show the high temperature warning notification. |
| 11912 | * @hide |
| 11913 | */ |
| 11914 | public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; |
| 11915 | |
| 11916 | /** |
| 11917 | * Temperature at which the high temperature warning notification should be shown. |
| 11918 | * @hide |
| 11919 | */ |
| 11920 | public static final String WARNING_TEMPERATURE = "warning_temperature"; |
Daniel Nishi | 88e45dc | 2017-01-25 11:43:55 -0800 | [diff] [blame] | 11921 | |
| 11922 | /** |
| 11923 | * Whether the diskstats logging task is enabled/disabled. |
| 11924 | * @hide |
| 11925 | */ |
| 11926 | public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; |
Daniel Nishi | 0f703e6 | 2017-02-21 15:19:27 -0800 | [diff] [blame] | 11927 | |
| 11928 | /** |
| 11929 | * Whether the cache quota calculation task is enabled/disabled. |
| 11930 | * @hide |
| 11931 | */ |
| 11932 | public static final String ENABLE_CACHE_QUOTA_CALCULATION = |
| 11933 | "enable_cache_quota_calculation"; |
Daniel Nishi | 4f5320e | 2017-06-13 17:51:21 -0700 | [diff] [blame] | 11934 | |
| 11935 | /** |
| 11936 | * Whether the Deletion Helper no threshold toggle is available. |
| 11937 | * @hide |
| 11938 | */ |
| 11939 | public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = |
| 11940 | "enable_deletion_helper_no_threshold_toggle"; |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 11941 | |
| 11942 | /** |
| 11943 | * The list of snooze options for notifications |
| 11944 | * This is encoded as a key=value list, separated by commas. Ex: |
| 11945 | * |
| 11946 | * "default=60,options_array=15:30:60:120" |
| 11947 | * |
| 11948 | * The following keys are supported: |
| 11949 | * |
| 11950 | * <pre> |
| 11951 | * default (int) |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 11952 | * options_array (int[]) |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 11953 | * </pre> |
| 11954 | * |
| 11955 | * All delays in integer minutes. Array order is respected. |
| 11956 | * Options will be used in order up to the maximum allowed by the UI. |
| 11957 | * @hide |
| 11958 | */ |
| 11959 | public static final String NOTIFICATION_SNOOZE_OPTIONS = |
| 11960 | "notification_snooze_options"; |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 11961 | |
| 11962 | /** |
Fyodor Kupolov | ee90c03 | 2017-12-12 11:52:57 -0800 | [diff] [blame] | 11963 | * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated |
| 11964 | * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF |
| 11965 | * |
| 11966 | * Supported keys: |
| 11967 | * compatibility_wal_supported (boolean) |
| 11968 | * wal_syncmode (String) |
| 11969 | * |
| 11970 | * @hide |
| 11971 | */ |
| 11972 | public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = |
| 11973 | "sqlite_compatibility_wal_flags"; |
| 11974 | |
| 11975 | /** |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 11976 | * Enable GNSS Raw Measurements Full Tracking? |
| 11977 | * 0 = no |
| 11978 | * 1 = yes |
| 11979 | * @hide |
| 11980 | */ |
| 11981 | public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = |
| 11982 | "enable_gnss_raw_meas_full_tracking"; |
Daniel Colascione | 766b632 | 2018-01-08 19:10:36 -0800 | [diff] [blame] | 11983 | |
| 11984 | /** |
| 11985 | * Whether we've enabled zram on this device. Takes effect on |
| 11986 | * reboot. The value "1" enables zram; "0" disables it, and |
| 11987 | * everything else is unspecified. |
| 11988 | * @hide |
| 11989 | */ |
| 11990 | public static final String ZRAM_ENABLED = |
| 11991 | "zram_enabled"; |
Petr Cermak | 9669e90 | 2018-01-16 16:37:22 +0000 | [diff] [blame] | 11992 | |
| 11993 | /** |
| 11994 | * Whether smart replies in notifications are enabled. |
| 11995 | * @hide |
| 11996 | */ |
| 11997 | public static final String ENABLE_SMART_REPLIES_IN_NOTIFICATIONS = |
| 11998 | "enable_smart_replies_in_notifications"; |
Andrew Sapperstein | 43643ae | 2017-12-20 15:17:33 -0800 | [diff] [blame] | 11999 | |
| 12000 | /** |
| 12001 | * If nonzero, crashes in foreground processes will bring up a dialog. |
| 12002 | * Otherwise, the process will be silently killed. |
| 12003 | * @hide |
| 12004 | */ |
| 12005 | public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; |
Andrew Sapperstein | 5b679c4 | 2018-01-16 11:13:40 -0800 | [diff] [blame] | 12006 | |
| 12007 | /** |
| 12008 | * If nonzero, crash dialogs will show an option to restart the app. |
| 12009 | * @hide |
| 12010 | */ |
| 12011 | public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; |
| 12012 | |
| 12013 | /** |
| 12014 | * If nonzero, crash dialogs will show an option to mute all future crash dialogs for |
| 12015 | * this app. |
| 12016 | * @hide |
| 12017 | */ |
| 12018 | public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 12019 | } |
| 12020 | |
| 12021 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12022 | * User-defined bookmarks and shortcuts. The target of each bookmark is an |
| 12023 | * Intent URL, allowing it to be either a web page or a particular |
| 12024 | * application activity. |
| 12025 | * |
| 12026 | * @hide |
| 12027 | */ |
| 12028 | public static final class Bookmarks implements BaseColumns |
| 12029 | { |
| 12030 | private static final String TAG = "Bookmarks"; |
| 12031 | |
| 12032 | /** |
| 12033 | * The content:// style URL for this table |
| 12034 | */ |
| 12035 | public static final Uri CONTENT_URI = |
| 12036 | Uri.parse("content://" + AUTHORITY + "/bookmarks"); |
| 12037 | |
| 12038 | /** |
| 12039 | * The row ID. |
| 12040 | * <p>Type: INTEGER</p> |
| 12041 | */ |
| 12042 | public static final String ID = "_id"; |
| 12043 | |
| 12044 | /** |
| 12045 | * Descriptive name of the bookmark that can be displayed to the user. |
| 12046 | * If this is empty, the title should be resolved at display time (use |
| 12047 | * {@link #getTitle(Context, Cursor)} any time you want to display the |
| 12048 | * title of a bookmark.) |
| 12049 | * <P> |
| 12050 | * Type: TEXT |
| 12051 | * </P> |
| 12052 | */ |
| 12053 | public static final String TITLE = "title"; |
| 12054 | |
| 12055 | /** |
| 12056 | * Arbitrary string (displayed to the user) that allows bookmarks to be |
| 12057 | * organized into categories. There are some special names for |
| 12058 | * standard folders, which all start with '@'. The label displayed for |
| 12059 | * the folder changes with the locale (via {@link #getLabelForFolder}) but |
| 12060 | * the folder name does not change so you can consistently query for |
| 12061 | * the folder regardless of the current locale. |
| 12062 | * |
| 12063 | * <P>Type: TEXT</P> |
| 12064 | * |
| 12065 | */ |
| 12066 | public static final String FOLDER = "folder"; |
| 12067 | |
| 12068 | /** |
| 12069 | * The Intent URL of the bookmark, describing what it points to. This |
| 12070 | * value is given to {@link android.content.Intent#getIntent} to create |
| 12071 | * an Intent that can be launched. |
| 12072 | * <P>Type: TEXT</P> |
| 12073 | */ |
| 12074 | public static final String INTENT = "intent"; |
| 12075 | |
| 12076 | /** |
| 12077 | * Optional shortcut character associated with this bookmark. |
| 12078 | * <P>Type: INTEGER</P> |
| 12079 | */ |
| 12080 | public static final String SHORTCUT = "shortcut"; |
| 12081 | |
| 12082 | /** |
| 12083 | * The order in which the bookmark should be displayed |
| 12084 | * <P>Type: INTEGER</P> |
| 12085 | */ |
| 12086 | public static final String ORDERING = "ordering"; |
| 12087 | |
| 12088 | private static final String[] sIntentProjection = { INTENT }; |
| 12089 | private static final String[] sShortcutProjection = { ID, SHORTCUT }; |
| 12090 | private static final String sShortcutSelection = SHORTCUT + "=?"; |
| 12091 | |
| 12092 | /** |
| 12093 | * Convenience function to retrieve the bookmarked Intent for a |
| 12094 | * particular shortcut key. |
| 12095 | * |
| 12096 | * @param cr The ContentResolver to query. |
| 12097 | * @param shortcut The shortcut key. |
| 12098 | * |
| 12099 | * @return Intent The bookmarked URL, or null if there is no bookmark |
| 12100 | * matching the given shortcut. |
| 12101 | */ |
| 12102 | public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) |
| 12103 | { |
| 12104 | Intent intent = null; |
| 12105 | |
| 12106 | Cursor c = cr.query(CONTENT_URI, |
| 12107 | sIntentProjection, sShortcutSelection, |
| 12108 | new String[] { String.valueOf((int) shortcut) }, ORDERING); |
| 12109 | // Keep trying until we find a valid shortcut |
| 12110 | try { |
| 12111 | while (intent == null && c.moveToNext()) { |
| 12112 | try { |
| 12113 | String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12114 | intent = Intent.parseUri(intentURI, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12115 | } catch (java.net.URISyntaxException e) { |
| 12116 | // The stored URL is bad... ignore it. |
| 12117 | } catch (IllegalArgumentException e) { |
| 12118 | // Column not found |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 12119 | Log.w(TAG, "Intent column not found", e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12120 | } |
| 12121 | } |
| 12122 | } finally { |
| 12123 | if (c != null) c.close(); |
| 12124 | } |
| 12125 | |
| 12126 | return intent; |
| 12127 | } |
| 12128 | |
| 12129 | /** |
| 12130 | * Add a new bookmark to the system. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12131 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12132 | * @param cr The ContentResolver to query. |
| 12133 | * @param intent The desired target of the bookmark. |
| 12134 | * @param title Bookmark title that is shown to the user; null if none |
| 12135 | * or it should be resolved to the intent's title. |
| 12136 | * @param folder Folder in which to place the bookmark; null if none. |
| 12137 | * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If |
| 12138 | * this is non-zero and there is an existing bookmark entry |
| 12139 | * with this same shortcut, then that existing shortcut is |
| 12140 | * cleared (the bookmark is not removed). |
| 12141 | * @return The unique content URL for the new bookmark entry. |
| 12142 | */ |
| 12143 | public static Uri add(ContentResolver cr, |
| 12144 | Intent intent, |
| 12145 | String title, |
| 12146 | String folder, |
| 12147 | char shortcut, |
| 12148 | int ordering) |
| 12149 | { |
| 12150 | // If a shortcut is supplied, and it is already defined for |
| 12151 | // another bookmark, then remove the old definition. |
| 12152 | if (shortcut != 0) { |
Jeff Hamilton | 7cd51ef | 2010-05-12 17:30:27 -0500 | [diff] [blame] | 12153 | cr.delete(CONTENT_URI, sShortcutSelection, |
| 12154 | new String[] { String.valueOf((int) shortcut) }); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12155 | } |
| 12156 | |
| 12157 | ContentValues values = new ContentValues(); |
| 12158 | if (title != null) values.put(TITLE, title); |
| 12159 | if (folder != null) values.put(FOLDER, folder); |
Jean-Baptiste Queru | 3b9f0a3 | 2010-06-21 13:46:59 -0700 | [diff] [blame] | 12160 | values.put(INTENT, intent.toUri(0)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12161 | if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); |
| 12162 | values.put(ORDERING, ordering); |
| 12163 | return cr.insert(CONTENT_URI, values); |
| 12164 | } |
| 12165 | |
| 12166 | /** |
| 12167 | * Return the folder name as it should be displayed to the user. This |
| 12168 | * takes care of localizing special folders. |
| 12169 | * |
| 12170 | * @param r Resources object for current locale; only need access to |
| 12171 | * system resources. |
| 12172 | * @param folder The value found in the {@link #FOLDER} column. |
| 12173 | * |
| 12174 | * @return CharSequence The label for this folder that should be shown |
| 12175 | * to the user. |
| 12176 | */ |
| 12177 | public static CharSequence getLabelForFolder(Resources r, String folder) { |
| 12178 | return folder; |
| 12179 | } |
| 12180 | |
| 12181 | /** |
| 12182 | * Return the title as it should be displayed to the user. This takes |
| 12183 | * care of localizing bookmarks that point to activities. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12184 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12185 | * @param context A context. |
| 12186 | * @param cursor A cursor pointing to the row whose title should be |
| 12187 | * returned. The cursor must contain at least the {@link #TITLE} |
| 12188 | * and {@link #INTENT} columns. |
| 12189 | * @return A title that is localized and can be displayed to the user, |
| 12190 | * or the empty string if one could not be found. |
| 12191 | */ |
| 12192 | public static CharSequence getTitle(Context context, Cursor cursor) { |
| 12193 | int titleColumn = cursor.getColumnIndex(TITLE); |
| 12194 | int intentColumn = cursor.getColumnIndex(INTENT); |
| 12195 | if (titleColumn == -1 || intentColumn == -1) { |
| 12196 | throw new IllegalArgumentException( |
| 12197 | "The cursor must contain the TITLE and INTENT columns."); |
| 12198 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12199 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12200 | String title = cursor.getString(titleColumn); |
| 12201 | if (!TextUtils.isEmpty(title)) { |
| 12202 | return title; |
| 12203 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12204 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12205 | String intentUri = cursor.getString(intentColumn); |
| 12206 | if (TextUtils.isEmpty(intentUri)) { |
| 12207 | return ""; |
| 12208 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12209 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12210 | Intent intent; |
| 12211 | try { |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 12212 | intent = Intent.parseUri(intentUri, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12213 | } catch (URISyntaxException e) { |
| 12214 | return ""; |
| 12215 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 12216 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12217 | PackageManager packageManager = context.getPackageManager(); |
| 12218 | ResolveInfo info = packageManager.resolveActivity(intent, 0); |
| 12219 | return info != null ? info.loadLabel(packageManager) : ""; |
| 12220 | } |
| 12221 | } |
| 12222 | |
| 12223 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12224 | * Returns the device ID that we should use when connecting to the mobile gtalk server. |
| 12225 | * This is a string like "android-0x1242", where the hex string is the Android ID obtained |
| 12226 | * from the GoogleLoginService. |
| 12227 | * |
| 12228 | * @param androidId The Android ID for this device. |
| 12229 | * @return The device ID that should be used when connecting to the mobile gtalk server. |
| 12230 | * @hide |
| 12231 | */ |
| 12232 | public static String getGTalkDeviceId(long androidId) { |
| 12233 | return "android-" + Long.toHexString(androidId); |
| 12234 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12235 | |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12236 | private static final String[] PM_WRITE_SETTINGS = { |
| 12237 | android.Manifest.permission.WRITE_SETTINGS |
| 12238 | }; |
| 12239 | private static final String[] PM_CHANGE_NETWORK_STATE = { |
| 12240 | android.Manifest.permission.CHANGE_NETWORK_STATE, |
| 12241 | android.Manifest.permission.WRITE_SETTINGS |
| 12242 | }; |
| 12243 | private static final String[] PM_SYSTEM_ALERT_WINDOW = { |
| 12244 | android.Manifest.permission.SYSTEM_ALERT_WINDOW |
| 12245 | }; |
| 12246 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12247 | /** |
| 12248 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12249 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12250 | * privileged/preinstalled apps. If the provided uid does not match the |
| 12251 | * callingPackage, a negative result will be returned. |
| 12252 | * @hide |
| 12253 | */ |
| 12254 | public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, |
| 12255 | String callingPackage, boolean throwException) { |
| 12256 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12257 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12258 | PM_WRITE_SETTINGS, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12259 | } |
| 12260 | |
| 12261 | /** |
| 12262 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12263 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 12264 | * privileged/preinstalled apps. If the provided uid does not match the |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12265 | * 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] | 12266 | * the WRITE_SETTINGS permission declared. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12267 | * |
| 12268 | * Note: if the check is successful, the operation of this app will be updated to the |
| 12269 | * current time. |
| 12270 | * @hide |
| 12271 | */ |
| 12272 | public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, |
| 12273 | String callingPackage, boolean throwException) { |
| 12274 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12275 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12276 | PM_WRITE_SETTINGS, true); |
| 12277 | } |
| 12278 | |
| 12279 | /** |
| 12280 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12281 | * 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] | 12282 | * privileged/preinstalled apps. The caller is expected to have either the |
| 12283 | * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these |
| 12284 | * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and |
| 12285 | * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal |
| 12286 | * permission and cannot be revoked. See http://b/23597341 |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12287 | * |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12288 | * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation |
| 12289 | * of this app will be updated to the current time. |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12290 | * @hide |
| 12291 | */ |
| 12292 | public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, |
| 12293 | String callingPackage, boolean throwException) { |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 12294 | if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) |
| 12295 | == PackageManager.PERMISSION_GRANTED) { |
| 12296 | return true; |
| 12297 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12298 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12299 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
| 12300 | PM_CHANGE_NETWORK_STATE, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12301 | } |
| 12302 | |
| 12303 | /** |
| 12304 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12305 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 12306 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 12307 | * a negative result will be returned. |
| 12308 | * @hide |
| 12309 | */ |
| 12310 | public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, |
| 12311 | String callingPackage, boolean throwException) { |
| 12312 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12313 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12314 | PM_SYSTEM_ALERT_WINDOW, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12315 | } |
| 12316 | |
| 12317 | /** |
| 12318 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 12319 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 12320 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 12321 | * a negative result will be returned. |
| 12322 | * |
| 12323 | * Note: if the check is successful, the operation of this app will be updated to the |
| 12324 | * current time. |
| 12325 | * @hide |
| 12326 | */ |
| 12327 | public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String |
| 12328 | callingPackage, boolean throwException) { |
| 12329 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 12330 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12331 | PM_SYSTEM_ALERT_WINDOW, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12332 | } |
| 12333 | |
| 12334 | /** |
| 12335 | * Helper method to perform a general and comprehensive check of whether an operation that is |
| 12336 | * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and |
| 12337 | * OP_WRITE_SETTINGS |
| 12338 | * @hide |
| 12339 | */ |
| 12340 | public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12341 | int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] |
| 12342 | permissions, boolean makeNote) { |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12343 | if (callingPackage == null) { |
| 12344 | return false; |
| 12345 | } |
| 12346 | |
| 12347 | AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); |
| 12348 | int mode = AppOpsManager.MODE_DEFAULT; |
| 12349 | if (makeNote) { |
| 12350 | mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 12351 | } else { |
| 12352 | mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 12353 | } |
| 12354 | |
| 12355 | switch (mode) { |
| 12356 | case AppOpsManager.MODE_ALLOWED: |
| 12357 | return true; |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12358 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12359 | case AppOpsManager.MODE_DEFAULT: |
| 12360 | // this is the default operating mode after an app's installation |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12361 | // In this case we will check all associated static permission to see |
| 12362 | // if it is granted during install time. |
| 12363 | for (String permission : permissions) { |
| 12364 | if (context.checkCallingOrSelfPermission(permission) == PackageManager |
| 12365 | .PERMISSION_GRANTED) { |
| 12366 | // if either of the permissions are granted, we will allow it |
| 12367 | return true; |
| 12368 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12369 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12370 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12371 | default: |
| 12372 | // this is for all other cases trickled down here... |
| 12373 | if (!throwException) { |
| 12374 | return false; |
| 12375 | } |
| 12376 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 12377 | |
| 12378 | // prepare string to throw SecurityException |
| 12379 | StringBuilder exceptionMessage = new StringBuilder(); |
| 12380 | exceptionMessage.append(callingPackage); |
| 12381 | exceptionMessage.append(" was not granted "); |
| 12382 | if (permissions.length > 1) { |
| 12383 | exceptionMessage.append(" either of these permissions: "); |
| 12384 | } else { |
| 12385 | exceptionMessage.append(" this permission: "); |
| 12386 | } |
| 12387 | for (int i = 0; i < permissions.length; i++) { |
| 12388 | exceptionMessage.append(permissions[i]); |
| 12389 | exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); |
| 12390 | } |
| 12391 | |
| 12392 | throw new SecurityException(exceptionMessage.toString()); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 12393 | } |
| 12394 | |
| 12395 | /** |
| 12396 | * Retrieves a correponding package name for a given uid. It will query all |
| 12397 | * packages that are associated with the given uid, but it will return only |
| 12398 | * the zeroth result. |
| 12399 | * Note: If package could not be found, a null is returned. |
| 12400 | * @hide |
| 12401 | */ |
| 12402 | public static String getPackageNameForUid(Context context, int uid) { |
| 12403 | String[] packages = context.getPackageManager().getPackagesForUid(uid); |
| 12404 | if (packages == null) { |
| 12405 | return null; |
| 12406 | } |
| 12407 | return packages[0]; |
| 12408 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 12409 | } |