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 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 19 | import android.Manifest; |
| 20 | import android.annotation.IntDef; |
| 21 | import android.annotation.IntRange; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 22 | import android.annotation.NonNull; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 23 | import android.annotation.Nullable; |
| 24 | import android.annotation.RequiresPermission; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.annotation.SdkConstant; |
| 26 | import android.annotation.SdkConstant.SdkConstantType; |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 27 | import android.annotation.SystemApi; |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 28 | import android.annotation.TestApi; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 29 | import android.annotation.UserIdInt; |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 30 | import android.app.ActivityThread; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 31 | import android.app.AppOpsManager; |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 32 | import android.app.Application; |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 33 | import android.app.NotificationChannel; |
Julia Reynolds | 005c8b9 | 2017-08-24 10:35:53 -0400 | [diff] [blame] | 34 | import android.app.NotificationChannelGroup; |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 35 | import android.app.NotificationManager; |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 36 | import android.app.SearchManager; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 37 | import android.app.WallpaperManager; |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 38 | import android.content.ComponentName; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import android.content.ContentResolver; |
| 40 | import android.content.ContentValues; |
| 41 | import android.content.Context; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 42 | import android.content.IContentProvider; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.content.Intent; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 44 | import android.content.pm.ActivityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.content.pm.PackageManager; |
| 46 | import android.content.pm.ResolveInfo; |
| 47 | import android.content.res.Configuration; |
| 48 | import android.content.res.Resources; |
| 49 | import android.database.Cursor; |
| 50 | import android.database.SQLException; |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 51 | import android.location.LocationManager; |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 52 | import android.net.ConnectivityManager; |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 53 | import android.net.NetworkScoreManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | import android.net.Uri; |
Irfan Sheriff | 36f7413 | 2010-11-04 16:57:37 -0700 | [diff] [blame] | 55 | import android.net.wifi.WifiManager; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 56 | import android.os.BatteryManager; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 57 | import android.os.Binder; |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 58 | import android.os.Build.VERSION_CODES; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 59 | import android.os.Bundle; |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 60 | import android.os.DropBoxManager; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 61 | import android.os.IBinder; |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 62 | import android.os.LocaleList; |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 63 | import android.os.Process; |
Svetoslav Ganov | 585f13f8d | 2010-08-10 07:59:15 -0700 | [diff] [blame] | 64 | import android.os.RemoteException; |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 65 | import android.os.ResultReceiver; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 66 | import android.os.ServiceManager; |
Dianne Hackborn | f02b60a | 2012-08-16 10:48:27 -0700 | [diff] [blame] | 67 | import android.os.UserHandle; |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 68 | import android.speech.tts.TextToSpeech; |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 69 | import android.telephony.SubscriptionManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | import android.text.TextUtils; |
| 71 | import android.util.AndroidException; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 72 | import android.util.ArrayMap; |
| 73 | import android.util.ArraySet; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | import android.util.Log; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 75 | import android.util.MemoryIntArray; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 76 | import android.util.StatsLog; |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 77 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 78 | import com.android.internal.annotations.GuardedBy; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 79 | import com.android.internal.util.ArrayUtils; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 80 | import com.android.internal.widget.ILockSettings; |
| 81 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 82 | import java.io.IOException; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 83 | import java.lang.annotation.Retention; |
| 84 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | import java.net.URISyntaxException; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 86 | import java.text.SimpleDateFormat; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | import java.util.HashMap; |
| 88 | import java.util.HashSet; |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 89 | import java.util.Locale; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 90 | import java.util.Map; |
| 91 | import java.util.Set; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 93 | /** |
| 94 | * The Settings provider contains global system-level device preferences. |
| 95 | */ |
| 96 | public final class Settings { |
| 97 | |
| 98 | // Intent actions for Settings |
| 99 | |
| 100 | /** |
| 101 | * Activity Action: Show system settings. |
| 102 | * <p> |
| 103 | * Input: Nothing. |
| 104 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 105 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 106 | */ |
| 107 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 108 | public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; |
| 109 | |
| 110 | /** |
| 111 | * Activity Action: Show settings to allow configuration of APNs. |
| 112 | * <p> |
| 113 | * Input: Nothing. |
| 114 | * <p> |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 115 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | */ |
| 117 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 118 | public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; |
| 119 | |
| 120 | /** |
| 121 | * Activity Action: Show settings to allow configuration of current location |
| 122 | * sources. |
| 123 | * <p> |
| 124 | * In some cases, a matching Activity may not exist, so ensure you |
| 125 | * safeguard against this. |
| 126 | * <p> |
| 127 | * Input: Nothing. |
| 128 | * <p> |
| 129 | * Output: Nothing. |
| 130 | */ |
| 131 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 132 | public static final String ACTION_LOCATION_SOURCE_SETTINGS = |
| 133 | "android.settings.LOCATION_SOURCE_SETTINGS"; |
| 134 | |
| 135 | /** |
Jason Monk | 76c67aa | 2016-02-19 14:49:42 -0500 | [diff] [blame] | 136 | * Activity Action: Show settings to allow configuration of users. |
| 137 | * <p> |
| 138 | * In some cases, a matching Activity may not exist, so ensure you |
| 139 | * safeguard against this. |
| 140 | * <p> |
| 141 | * Input: Nothing. |
| 142 | * <p> |
| 143 | * Output: Nothing. |
| 144 | * @hide |
| 145 | */ |
| 146 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 147 | public static final String ACTION_USER_SETTINGS = |
| 148 | "android.settings.USER_SETTINGS"; |
| 149 | |
| 150 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 151 | * Activity Action: Show settings to allow configuration of wireless controls |
| 152 | * such as Wi-Fi, Bluetooth and Mobile networks. |
| 153 | * <p> |
| 154 | * In some cases, a matching Activity may not exist, so ensure you |
| 155 | * safeguard against this. |
| 156 | * <p> |
| 157 | * Input: Nothing. |
| 158 | * <p> |
| 159 | * Output: Nothing. |
| 160 | */ |
| 161 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 162 | public static final String ACTION_WIRELESS_SETTINGS = |
| 163 | "android.settings.WIRELESS_SETTINGS"; |
| 164 | |
| 165 | /** |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 166 | * Activity Action: Show tether provisioning activity. |
| 167 | * |
| 168 | * <p> |
| 169 | * In some cases, a matching Activity may not exist, so ensure you |
| 170 | * safeguard against this. |
| 171 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 172 | * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type |
| 173 | * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 174 | * contain a {@link ResultReceiver} which will be called back with a tether result code. |
| 175 | * <p> |
| 176 | * Output: The result of the provisioning check. |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 177 | * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, |
| 178 | * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. |
Jeremy Klein | 15f3d21 | 2016-01-24 17:01:09 -0800 | [diff] [blame] | 179 | * |
| 180 | * @hide |
| 181 | */ |
| 182 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 183 | public static final String ACTION_TETHER_PROVISIONING = |
| 184 | "android.settings.TETHER_PROVISIONING_UI"; |
| 185 | |
| 186 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 187 | * Activity Action: Show settings to allow entering/exiting airplane mode. |
| 188 | * <p> |
| 189 | * In some cases, a matching Activity may not exist, so ensure you |
| 190 | * safeguard against this. |
| 191 | * <p> |
| 192 | * Input: Nothing. |
| 193 | * <p> |
| 194 | * Output: Nothing. |
| 195 | */ |
| 196 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 197 | public static final String ACTION_AIRPLANE_MODE_SETTINGS = |
| 198 | "android.settings.AIRPLANE_MODE_SETTINGS"; |
| 199 | |
| 200 | /** |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 201 | * Activity Action: Show mobile data usage list. |
| 202 | * <p> |
| 203 | * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify |
| 204 | * how and what mobile data statistics should be collected. |
| 205 | * <p> |
| 206 | * Output: Nothing |
| 207 | * @hide |
| 208 | */ |
| 209 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 210 | public static final String ACTION_MOBILE_DATA_USAGE = |
| 211 | "android.settings.MOBILE_DATA_USAGE"; |
| 212 | |
| 213 | /** @hide */ |
| 214 | public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 215 | |
| 216 | /** |
| 217 | * An int extra specifying a subscription ID. |
| 218 | * |
| 219 | * @see android.telephony.SubscriptionInfo#getSubscriptionId |
| 220 | */ |
| 221 | public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; |
Malcolm Chen | 2106254 | 2017-06-20 11:36:01 -0700 | [diff] [blame] | 222 | |
| 223 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 224 | * Activity Action: Modify Airplane mode settings using a voice command. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 225 | * <p> |
| 226 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 227 | * <p> |
| 228 | * This intent MUST be started using |
| 229 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 230 | * startVoiceActivity}. |
| 231 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 232 | * Note: The activity implementing this intent MUST verify that |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 233 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 234 | * modifying the setting. |
| 235 | * <p> |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 236 | * Input: To tell which state airplane mode should be set to, add the |
| 237 | * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. |
| 238 | * If the extra is not included, no changes will be made. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 239 | * <p> |
| 240 | * Output: Nothing. |
| 241 | */ |
| 242 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 243 | public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = |
| 244 | "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; |
| 245 | |
| 246 | /** |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 247 | * Activity Action: Show settings for accessibility modules. |
| 248 | * <p> |
| 249 | * In some cases, a matching Activity may not exist, so ensure you |
| 250 | * safeguard against this. |
| 251 | * <p> |
| 252 | * Input: Nothing. |
| 253 | * <p> |
| 254 | * Output: Nothing. |
| 255 | */ |
| 256 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 257 | public static final String ACTION_ACCESSIBILITY_SETTINGS = |
| 258 | "android.settings.ACCESSIBILITY_SETTINGS"; |
| 259 | |
| 260 | /** |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 261 | * Activity Action: Show settings to control access to usage information. |
| 262 | * <p> |
| 263 | * In some cases, a matching Activity may not exist, so ensure you |
| 264 | * safeguard against this. |
| 265 | * <p> |
| 266 | * Input: Nothing. |
| 267 | * <p> |
| 268 | * Output: Nothing. |
| 269 | */ |
| 270 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 271 | public static final String ACTION_USAGE_ACCESS_SETTINGS = |
| 272 | "android.settings.USAGE_ACCESS_SETTINGS"; |
| 273 | |
| 274 | /** |
Jason Monk | 6f90978 | 2015-04-17 14:30:25 -0400 | [diff] [blame] | 275 | * Activity Category: Show application settings related to usage access. |
| 276 | * <p> |
| 277 | * An activity that provides a user interface for adjusting usage access related |
| 278 | * preferences for its containing application. Optional but recommended for apps that |
| 279 | * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. |
| 280 | * <p> |
| 281 | * The activity may define meta-data to describe what usage access is |
| 282 | * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which |
| 283 | * will be displayed in Settings. |
| 284 | * <p> |
| 285 | * Input: Nothing. |
| 286 | * <p> |
| 287 | * Output: Nothing. |
| 288 | */ |
| 289 | @SdkConstant(SdkConstantType.INTENT_CATEGORY) |
| 290 | public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = |
| 291 | "android.intent.category.USAGE_ACCESS_CONFIG"; |
| 292 | |
| 293 | /** |
| 294 | * Metadata key: Reason for needing usage access. |
| 295 | * <p> |
| 296 | * A key for metadata attached to an activity that receives action |
| 297 | * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the |
| 298 | * user as description of how the app uses usage access. |
| 299 | * <p> |
| 300 | */ |
| 301 | public static final String METADATA_USAGE_ACCESS_REASON = |
| 302 | "android.settings.metadata.USAGE_ACCESS_REASON"; |
| 303 | |
| 304 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 305 | * Activity Action: Show settings to allow configuration of security and |
| 306 | * location privacy. |
| 307 | * <p> |
| 308 | * In some cases, a matching Activity may not exist, so ensure you |
| 309 | * safeguard against this. |
| 310 | * <p> |
| 311 | * Input: Nothing. |
| 312 | * <p> |
| 313 | * Output: Nothing. |
| 314 | */ |
| 315 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 316 | public static final String ACTION_SECURITY_SETTINGS = |
| 317 | "android.settings.SECURITY_SETTINGS"; |
| 318 | |
| 319 | /** |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 320 | * Activity Action: Show settings to allow configuration of trusted external sources |
Suprabh Shukla | 905df00 | 2017-05-25 14:21:59 -0700 | [diff] [blame] | 321 | * |
Suprabh Shukla | 84d11b4 | 2017-03-07 23:40:25 -0800 | [diff] [blame] | 322 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 323 | * directly invoke the management GUI specific to the package name. For example |
| 324 | * "package:com.my.app". |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 325 | * <p> |
| 326 | * Output: Nothing. |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 327 | */ |
| 328 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Suprabh Shukla | a1300c8 | 2017-04-06 17:52:32 -0700 | [diff] [blame] | 329 | public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = |
Suprabh Shukla | 89aae44 | 2017-04-20 16:04:26 -0700 | [diff] [blame] | 330 | "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; |
Suprabh Shukla | 2f34b1a | 2016-12-16 14:47:25 -0800 | [diff] [blame] | 331 | |
| 332 | /** |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 333 | * Activity Action: Show trusted credentials settings, opening to the user tab, |
| 334 | * to allow management of installed credentials. |
| 335 | * <p> |
| 336 | * In some cases, a matching Activity may not exist, so ensure you |
| 337 | * safeguard against this. |
| 338 | * <p> |
| 339 | * Input: Nothing. |
| 340 | * <p> |
| 341 | * Output: Nothing. |
| 342 | * @hide |
| 343 | */ |
| 344 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 345 | public static final String ACTION_TRUSTED_CREDENTIALS_USER = |
| 346 | "com.android.settings.TRUSTED_CREDENTIALS_USER"; |
| 347 | |
| 348 | /** |
| 349 | * Activity Action: Show dialog explaining that an installed CA cert may enable |
| 350 | * monitoring of encrypted network traffic. |
| 351 | * <p> |
| 352 | * In some cases, a matching Activity may not exist, so ensure you |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 353 | * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the |
| 354 | * number of certificates. |
Maggie Benthall | 0469f41 | 2013-09-05 15:30:26 -0400 | [diff] [blame] | 355 | * <p> |
| 356 | * Input: Nothing. |
| 357 | * <p> |
| 358 | * Output: Nothing. |
| 359 | * @hide |
| 360 | */ |
| 361 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 362 | public static final String ACTION_MONITORING_CERT_INFO = |
| 363 | "com.android.settings.MONITORING_CERT_INFO"; |
| 364 | |
| 365 | /** |
Amith Yamasani | c15255a | 2009-09-23 15:33:19 -0700 | [diff] [blame] | 366 | * Activity Action: Show settings to allow configuration of privacy options. |
| 367 | * <p> |
| 368 | * In some cases, a matching Activity may not exist, so ensure you |
| 369 | * safeguard against this. |
| 370 | * <p> |
| 371 | * Input: Nothing. |
| 372 | * <p> |
| 373 | * Output: Nothing. |
| 374 | */ |
| 375 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 376 | public static final String ACTION_PRIVACY_SETTINGS = |
| 377 | "android.settings.PRIVACY_SETTINGS"; |
| 378 | |
| 379 | /** |
Robin Lee | a249aee | 2016-02-03 13:42:56 +0000 | [diff] [blame] | 380 | * Activity Action: Show settings to allow configuration of VPN. |
| 381 | * <p> |
| 382 | * In some cases, a matching Activity may not exist, so ensure you |
| 383 | * safeguard against this. |
| 384 | * <p> |
| 385 | * Input: Nothing. |
| 386 | * <p> |
| 387 | * Output: Nothing. |
| 388 | */ |
| 389 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 390 | public static final String ACTION_VPN_SETTINGS = |
| 391 | "android.settings.VPN_SETTINGS"; |
| 392 | |
| 393 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 394 | * 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] | 395 | * <p> |
| 396 | * In some cases, a matching Activity may not exist, so ensure you |
| 397 | * safeguard against this. |
| 398 | * <p> |
| 399 | * Input: Nothing. |
| 400 | * <p> |
| 401 | * Output: Nothing. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 402 | */ |
| 403 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 404 | public static final String ACTION_WIFI_SETTINGS = |
| 405 | "android.settings.WIFI_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 406 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 407 | /** |
| 408 | * Activity Action: Show settings to allow configuration of a static IP |
| 409 | * address for Wi-Fi. |
| 410 | * <p> |
| 411 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 412 | * against this. |
| 413 | * <p> |
| 414 | * Input: Nothing. |
| 415 | * <p> |
| 416 | * Output: Nothing. |
| 417 | */ |
| 418 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 419 | public static final String ACTION_WIFI_IP_SETTINGS = |
| 420 | "android.settings.WIFI_IP_SETTINGS"; |
| 421 | |
| 422 | /** |
| 423 | * Activity Action: Show settings to allow configuration of Bluetooth. |
| 424 | * <p> |
| 425 | * In some cases, a matching Activity may not exist, so ensure you |
| 426 | * safeguard against this. |
| 427 | * <p> |
| 428 | * Input: Nothing. |
| 429 | * <p> |
| 430 | * Output: Nothing. |
| 431 | */ |
| 432 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 433 | public static final String ACTION_BLUETOOTH_SETTINGS = |
| 434 | "android.settings.BLUETOOTH_SETTINGS"; |
| 435 | |
| 436 | /** |
Kevin Chyn | 268a96c | 2017-06-17 17:32:49 -0700 | [diff] [blame] | 437 | * Activity Action: Show settings to allow configuration of Assist Gesture. |
| 438 | * <p> |
| 439 | * In some cases, a matching Activity may not exist, so ensure you |
| 440 | * safeguard against this. |
| 441 | * <p> |
| 442 | * Input: Nothing. |
| 443 | * <p> |
| 444 | * Output: Nothing. |
| 445 | * @hide |
| 446 | */ |
| 447 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 448 | public static final String ACTION_ASSIST_GESTURE_SETTINGS = |
| 449 | "android.settings.ASSIST_GESTURE_SETTINGS"; |
| 450 | |
| 451 | /** |
Kevin Chyn | 83ff28c | 2017-10-13 16:35:17 -0700 | [diff] [blame] | 452 | * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if |
| 453 | * necessary. |
| 454 | * <p> |
| 455 | * Input: Nothing. |
| 456 | * <p> |
| 457 | * Output: Nothing. |
| 458 | */ |
| 459 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 460 | public static final String ACTION_FINGERPRINT_ENROLL = |
| 461 | "android.settings.FINGERPRINT_ENROLL"; |
| 462 | |
| 463 | /** |
Jeff Brown | c05c1ae | 2015-05-05 13:46:30 -0700 | [diff] [blame] | 464 | * Activity Action: Show settings to allow configuration of cast endpoints. |
Jeff Brown | 1a937b0 | 2014-07-01 22:13:04 -0700 | [diff] [blame] | 465 | * <p> |
| 466 | * In some cases, a matching Activity may not exist, so ensure you |
| 467 | * safeguard against this. |
| 468 | * <p> |
| 469 | * Input: Nothing. |
| 470 | * <p> |
| 471 | * Output: Nothing. |
| 472 | */ |
| 473 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 474 | public static final String ACTION_CAST_SETTINGS = |
| 475 | "android.settings.CAST_SETTINGS"; |
| 476 | |
| 477 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 478 | * Activity Action: Show settings to allow configuration of date and time. |
| 479 | * <p> |
| 480 | * In some cases, a matching Activity may not exist, so ensure you |
| 481 | * safeguard against this. |
| 482 | * <p> |
| 483 | * Input: Nothing. |
| 484 | * <p> |
| 485 | * Output: Nothing. |
| 486 | */ |
| 487 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 488 | public static final String ACTION_DATE_SETTINGS = |
| 489 | "android.settings.DATE_SETTINGS"; |
| 490 | |
| 491 | /** |
| 492 | * Activity Action: Show settings to allow configuration of sound and volume. |
| 493 | * <p> |
| 494 | * In some cases, a matching Activity may not exist, so ensure you |
| 495 | * safeguard against this. |
| 496 | * <p> |
| 497 | * Input: Nothing. |
| 498 | * <p> |
| 499 | * Output: Nothing. |
| 500 | */ |
| 501 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 502 | public static final String ACTION_SOUND_SETTINGS = |
| 503 | "android.settings.SOUND_SETTINGS"; |
| 504 | |
| 505 | /** |
| 506 | * Activity Action: Show settings to allow configuration of display. |
| 507 | * <p> |
| 508 | * In some cases, a matching Activity may not exist, so ensure you |
| 509 | * safeguard against this. |
| 510 | * <p> |
| 511 | * Input: Nothing. |
| 512 | * <p> |
| 513 | * Output: Nothing. |
| 514 | */ |
| 515 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 516 | public static final String ACTION_DISPLAY_SETTINGS = |
| 517 | "android.settings.DISPLAY_SETTINGS"; |
| 518 | |
| 519 | /** |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 520 | * Activity Action: Show settings to allow configuration of Night display. |
| 521 | * <p> |
| 522 | * In some cases, a matching Activity may not exist, so ensure you |
| 523 | * safeguard against this. |
| 524 | * <p> |
| 525 | * Input: Nothing. |
| 526 | * <p> |
| 527 | * Output: Nothing. |
Justin Klaassen | 06c0cb7 | 2016-07-21 19:22:09 -0700 | [diff] [blame] | 528 | */ |
| 529 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 530 | public static final String ACTION_NIGHT_DISPLAY_SETTINGS = |
| 531 | "android.settings.NIGHT_DISPLAY_SETTINGS"; |
| 532 | |
| 533 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | * Activity Action: Show settings to allow configuration of locale. |
| 535 | * <p> |
| 536 | * In some cases, a matching Activity may not exist, so ensure you |
| 537 | * safeguard against this. |
| 538 | * <p> |
| 539 | * Input: Nothing. |
| 540 | * <p> |
| 541 | * Output: Nothing. |
| 542 | */ |
| 543 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 544 | public static final String ACTION_LOCALE_SETTINGS = |
| 545 | "android.settings.LOCALE_SETTINGS"; |
| 546 | |
| 547 | /** |
| 548 | * Activity Action: Show settings to configure input methods, in particular |
| 549 | * allowing the user to enable input methods. |
| 550 | * <p> |
| 551 | * In some cases, a matching Activity may not exist, so ensure you |
| 552 | * safeguard against this. |
| 553 | * <p> |
| 554 | * Input: Nothing. |
| 555 | * <p> |
| 556 | * Output: Nothing. |
| 557 | */ |
| 558 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | a3fb40d | 2014-08-12 15:06:50 -0700 | [diff] [blame] | 559 | public static final String ACTION_VOICE_INPUT_SETTINGS = |
| 560 | "android.settings.VOICE_INPUT_SETTINGS"; |
| 561 | |
| 562 | /** |
| 563 | * Activity Action: Show settings to configure input methods, in particular |
| 564 | * allowing the user to enable input methods. |
| 565 | * <p> |
| 566 | * In some cases, a matching Activity may not exist, so ensure you |
| 567 | * safeguard against this. |
| 568 | * <p> |
| 569 | * Input: Nothing. |
| 570 | * <p> |
| 571 | * Output: Nothing. |
| 572 | */ |
| 573 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 574 | public static final String ACTION_INPUT_METHOD_SETTINGS = |
| 575 | "android.settings.INPUT_METHOD_SETTINGS"; |
| 576 | |
| 577 | /** |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 578 | * Activity Action: Show settings to enable/disable input method subtypes. |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 579 | * <p> |
| 580 | * In some cases, a matching Activity may not exist, so ensure you |
| 581 | * safeguard against this. |
| 582 | * <p> |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 583 | * To tell which input method's subtypes are displayed in the settings, add |
| 584 | * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. |
| 585 | * If there is no extra in this Intent, subtypes from all installed input methods |
| 586 | * will be displayed in the settings. |
| 587 | * |
| 588 | * @see android.view.inputmethod.InputMethodInfo#getId |
| 589 | * <p> |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 590 | * Input: Nothing. |
| 591 | * <p> |
| 592 | * Output: Nothing. |
| 593 | */ |
| 594 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Tadashi G. Takaoka | f49688f | 2011-01-20 17:56:13 +0900 | [diff] [blame] | 595 | public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = |
| 596 | "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; |
satok | 86417ea | 2010-10-27 14:11:03 +0900 | [diff] [blame] | 597 | |
| 598 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 599 | * Activity Action: Show settings to manage the user input dictionary. |
| 600 | * <p> |
Chet Haase | e8222dd | 2013-09-05 07:44:18 -0700 | [diff] [blame] | 601 | * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, |
Satoshi Kataoka | 2aa2bc5 | 2013-07-30 14:25:11 +0900 | [diff] [blame] | 602 | * it is guaranteed there will always be an appropriate implementation for this Intent action. |
| 603 | * 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] | 604 | * <p> |
| 605 | * Input: Nothing. |
| 606 | * <p> |
| 607 | * Output: Nothing. |
| 608 | */ |
| 609 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 610 | public static final String ACTION_USER_DICTIONARY_SETTINGS = |
| 611 | "android.settings.USER_DICTIONARY_SETTINGS"; |
| 612 | |
| 613 | /** |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 614 | * Activity Action: Show settings to configure the hardware keyboard. |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 615 | * <p> |
| 616 | * In some cases, a matching Activity may not exist, so ensure you |
| 617 | * safeguard against this. |
| 618 | * <p> |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 619 | * Input: Nothing. |
| 620 | * <p> |
| 621 | * Output: Nothing. |
| 622 | */ |
| 623 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Abodunrinwa Toki | 0717714 | 2016-03-22 16:25:48 +0000 | [diff] [blame] | 624 | public static final String ACTION_HARD_KEYBOARD_SETTINGS = |
| 625 | "android.settings.HARD_KEYBOARD_SETTINGS"; |
Yohei Yukawa | d8701bf | 2016-01-27 16:15:01 -0800 | [diff] [blame] | 626 | |
| 627 | /** |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 628 | * Activity Action: Adds a word to the user dictionary. |
| 629 | * <p> |
| 630 | * In some cases, a matching Activity may not exist, so ensure you |
| 631 | * safeguard against this. |
| 632 | * <p> |
| 633 | * Input: An extra with key <code>word</code> that contains the word |
| 634 | * that should be added to the dictionary. |
| 635 | * <p> |
| 636 | * Output: Nothing. |
| 637 | * |
| 638 | * @hide |
| 639 | */ |
| 640 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 641 | public static final String ACTION_USER_DICTIONARY_INSERT = |
| 642 | "com.android.settings.USER_DICTIONARY_INSERT"; |
| 643 | |
| 644 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 645 | * Activity Action: Show settings to allow configuration of application-related settings. |
| 646 | * <p> |
| 647 | * In some cases, a matching Activity may not exist, so ensure you |
| 648 | * safeguard against this. |
| 649 | * <p> |
| 650 | * Input: Nothing. |
| 651 | * <p> |
| 652 | * Output: Nothing. |
| 653 | */ |
| 654 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 655 | public static final String ACTION_APPLICATION_SETTINGS = |
| 656 | "android.settings.APPLICATION_SETTINGS"; |
| 657 | |
| 658 | /** |
| 659 | * Activity Action: Show settings to allow configuration of application |
Dianne Hackborn | 8d866e5 | 2012-10-10 18:39:45 -0700 | [diff] [blame] | 660 | * development-related settings. As of |
| 661 | * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is |
| 662 | * a required part of the platform. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | * <p> |
| 664 | * Input: Nothing. |
| 665 | * <p> |
| 666 | * Output: Nothing. |
| 667 | */ |
| 668 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 669 | public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = |
| 670 | "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; |
| 671 | |
| 672 | /** |
| 673 | * Activity Action: Show settings to allow configuration of quick launch shortcuts. |
| 674 | * <p> |
| 675 | * In some cases, a matching Activity may not exist, so ensure you |
| 676 | * safeguard against this. |
| 677 | * <p> |
| 678 | * Input: Nothing. |
| 679 | * <p> |
| 680 | * Output: Nothing. |
| 681 | */ |
| 682 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 683 | public static final String ACTION_QUICK_LAUNCH_SETTINGS = |
| 684 | "android.settings.QUICK_LAUNCH_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 685 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | /** |
| 687 | * Activity Action: Show settings to manage installed applications. |
| 688 | * <p> |
| 689 | * In some cases, a matching Activity may not exist, so ensure you |
| 690 | * safeguard against this. |
| 691 | * <p> |
| 692 | * Input: Nothing. |
| 693 | * <p> |
| 694 | * Output: Nothing. |
| 695 | */ |
| 696 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 697 | public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = |
| 698 | "android.settings.MANAGE_APPLICATIONS_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 699 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 700 | /** |
Winson Chung | 44e8ff9 | 2010-09-27 14:36:52 -0700 | [diff] [blame] | 701 | * Activity Action: Show settings to manage all applications. |
| 702 | * <p> |
| 703 | * In some cases, a matching Activity may not exist, so ensure you |
| 704 | * safeguard against this. |
| 705 | * <p> |
| 706 | * Input: Nothing. |
| 707 | * <p> |
| 708 | * Output: Nothing. |
| 709 | */ |
| 710 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 711 | public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = |
| 712 | "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; |
| 713 | |
| 714 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 715 | * 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] | 716 | * <p> |
| 717 | * In some cases, a matching Activity may not exist, so ensure you |
| 718 | * safeguard against this. |
| 719 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 720 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 721 | * directly invoke the management GUI specific to the package name. For example |
| 722 | * "package:com.my.app". |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 723 | * <p> |
| 724 | * Output: Nothing. |
| 725 | */ |
| 726 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 727 | public static final String ACTION_MANAGE_OVERLAY_PERMISSION = |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 728 | "android.settings.action.MANAGE_OVERLAY_PERMISSION"; |
| 729 | |
| 730 | /** |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 731 | * Activity Action: Show screen for controlling which apps are allowed to write/modify |
| 732 | * system settings. |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 733 | * <p> |
| 734 | * In some cases, a matching Activity may not exist, so ensure you |
| 735 | * safeguard against this. |
| 736 | * <p> |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 737 | * Input: Optionally, the Intent's data URI can specify the application package name to |
| 738 | * directly invoke the management GUI specific to the package name. For example |
| 739 | * "package:com.my.app". |
Billy Lau | 22b3f4c | 2015-07-08 00:31:01 +0100 | [diff] [blame] | 740 | * <p> |
| 741 | * Output: Nothing. |
| 742 | */ |
| 743 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 744 | public static final String ACTION_MANAGE_WRITE_SETTINGS = |
| 745 | "android.settings.action.MANAGE_WRITE_SETTINGS"; |
Billy Lau | cbe540f | 2015-06-25 01:51:44 +0100 | [diff] [blame] | 746 | |
| 747 | /** |
Dianne Hackborn | b7bb3b3 | 2010-06-06 22:47:50 -0700 | [diff] [blame] | 748 | * Activity Action: Show screen of details about a particular application. |
| 749 | * <p> |
| 750 | * In some cases, a matching Activity may not exist, so ensure you |
| 751 | * safeguard against this. |
| 752 | * <p> |
| 753 | * Input: The Intent's data URI specifies the application package name |
| 754 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 755 | * <p> |
| 756 | * Output: Nothing. |
| 757 | */ |
| 758 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 759 | public static final String ACTION_APPLICATION_DETAILS_SETTINGS = |
| 760 | "android.settings.APPLICATION_DETAILS_SETTINGS"; |
| 761 | |
| 762 | /** |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 763 | * Activity Action: Show list of applications that have been running |
| 764 | * foreground services (to the user "running in the background"). |
| 765 | * <p> |
| 766 | * Input: Extras "packages" is a string array of package names. |
| 767 | * <p> |
| 768 | * Output: Nothing. |
| 769 | * @hide |
| 770 | */ |
| 771 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 772 | public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = |
| 773 | "android.settings.FOREGROUND_SERVICES_SETTINGS"; |
| 774 | |
| 775 | /** |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 776 | * Activity Action: Show screen for controlling which apps can ignore battery optimizations. |
| 777 | * <p> |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 778 | * Input: Nothing. |
| 779 | * <p> |
| 780 | * Output: Nothing. |
| 781 | * <p> |
| 782 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 783 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 784 | * already ignoring optimizations. You can use |
| 785 | * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you |
| 786 | * on this list. |
| 787 | */ |
| 788 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 789 | public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = |
| 790 | "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; |
| 791 | |
| 792 | /** |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 793 | * 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] | 794 | * put them on the whitelist of apps shown by |
| 795 | * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also |
| 796 | * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} |
| 797 | * permission. |
| 798 | * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities |
| 799 | * 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] | 800 | * 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] | 801 | * 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] | 802 | * 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] | 803 | * <p> |
| 804 | * Input: The Intent's data URI must specify the application package name |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 805 | * to be shown, with the "package" scheme. That is "package:com.my.app". |
| 806 | * <p> |
| 807 | * Output: Nothing. |
Dianne Hackborn | 1958e5e | 2015-06-12 18:11:41 -0700 | [diff] [blame] | 808 | * <p> |
| 809 | * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations |
| 810 | * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is |
| 811 | * already ignoring optimizations. |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 812 | */ |
| 813 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
Dianne Hackborn | c7b57b1 | 2015-08-10 14:52:52 -0700 | [diff] [blame] | 814 | public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = |
| 815 | "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; |
Jason Monk | 287b889 | 2015-06-10 10:39:23 -0400 | [diff] [blame] | 816 | |
| 817 | /** |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 818 | * Activity Action: Show screen for controlling background data |
| 819 | * restrictions for a particular application. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 820 | * <p> |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 821 | * Input: Intent's data URI set with an application name, using the |
| 822 | * "package" schema (like "package:com.my.app"). |
| 823 | * |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 824 | * <p> |
| 825 | * Output: Nothing. |
| 826 | * <p> |
| 827 | * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus |
Felipe Leme | 2850b56 | 2016-04-21 17:58:47 -0700 | [diff] [blame] | 828 | * ConnectivityManager#getRestrictBackgroundStatus()} to determine the |
| 829 | * status of the background data restrictions for them. |
Felipe Leme | 5f5d707 | 2016-01-27 10:41:22 -0800 | [diff] [blame] | 830 | */ |
| 831 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 832 | public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = |
| 833 | "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; |
| 834 | |
| 835 | /** |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 836 | * @hide |
| 837 | * Activity Action: Show the "app ops" settings screen. |
| 838 | * <p> |
| 839 | * Input: Nothing. |
| 840 | * <p> |
| 841 | * Output: Nothing. |
| 842 | */ |
| 843 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 844 | public static final String ACTION_APP_OPS_SETTINGS = |
| 845 | "android.settings.APP_OPS_SETTINGS"; |
| 846 | |
| 847 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 848 | * Activity Action: Show settings for system update functionality. |
| 849 | * <p> |
| 850 | * In some cases, a matching Activity may not exist, so ensure you |
| 851 | * safeguard against this. |
| 852 | * <p> |
| 853 | * Input: Nothing. |
| 854 | * <p> |
| 855 | * Output: Nothing. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 856 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 857 | * @hide |
| 858 | */ |
| 859 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 860 | public static final String ACTION_SYSTEM_UPDATE_SETTINGS = |
| 861 | "android.settings.SYSTEM_UPDATE_SETTINGS"; |
| 862 | |
| 863 | /** |
Ricky Wai | 38bb832 | 2017-02-01 15:23:50 +0000 | [diff] [blame] | 864 | * Activity Action: Show settings for managed profile settings. |
| 865 | * <p> |
| 866 | * In some cases, a matching Activity may not exist, so ensure you |
| 867 | * safeguard against this. |
| 868 | * <p> |
| 869 | * Input: Nothing. |
| 870 | * <p> |
| 871 | * Output: Nothing. |
| 872 | * |
| 873 | * @hide |
| 874 | */ |
| 875 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 876 | public static final String ACTION_MANAGED_PROFILE_SETTINGS = |
| 877 | "android.settings.MANAGED_PROFILE_SETTINGS"; |
| 878 | |
| 879 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 880 | * Activity Action: Show settings to allow configuration of sync settings. |
| 881 | * <p> |
| 882 | * In some cases, a matching Activity may not exist, so ensure you |
| 883 | * safeguard against this. |
| 884 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 885 | * The account types available to add via the add account button may be restricted by adding an |
| 886 | * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's |
| 887 | * authorities. Only account types which can sync with that content provider will be offered to |
| 888 | * the user. |
| 889 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 890 | * Input: Nothing. |
| 891 | * <p> |
| 892 | * Output: Nothing. |
| 893 | */ |
| 894 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 895 | public static final String ACTION_SYNC_SETTINGS = |
| 896 | "android.settings.SYNC_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 897 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 898 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 899 | * Activity Action: Show add account screen for creating a new account. |
| 900 | * <p> |
| 901 | * In some cases, a matching Activity may not exist, so ensure you |
| 902 | * safeguard against this. |
| 903 | * <p> |
| 904 | * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} |
| 905 | * extra to the Intent with one or more syncable content provider's authorities. Only account |
| 906 | * types which can sync with that content provider will be offered to the user. |
| 907 | * <p> |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 908 | * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the |
| 909 | * Intent with one or more account types. |
| 910 | * <p> |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 911 | * Input: Nothing. |
| 912 | * <p> |
| 913 | * Output: Nothing. |
| 914 | */ |
| 915 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 916 | public static final String ACTION_ADD_ACCOUNT = |
| 917 | "android.settings.ADD_ACCOUNT_SETTINGS"; |
| 918 | |
| 919 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 920 | * Activity Action: Show settings for selecting the network operator. |
| 921 | * <p> |
| 922 | * In some cases, a matching Activity may not exist, so ensure you |
| 923 | * safeguard against this. |
| 924 | * <p> |
Jeff Davidson | f32f7b4 | 2017-11-03 15:05:07 -0700 | [diff] [blame] | 925 | * The subscription ID of the subscription for which available network operators should be |
| 926 | * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. |
| 927 | * <p> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 928 | * Input: Nothing. |
| 929 | * <p> |
| 930 | * Output: Nothing. |
| 931 | */ |
| 932 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 933 | public static final String ACTION_NETWORK_OPERATOR_SETTINGS = |
| 934 | "android.settings.NETWORK_OPERATOR_SETTINGS"; |
| 935 | |
| 936 | /** |
| 937 | * Activity Action: Show settings for selection of 2G/3G. |
| 938 | * <p> |
| 939 | * In some cases, a matching Activity may not exist, so ensure you |
| 940 | * safeguard against this. |
| 941 | * <p> |
| 942 | * Input: Nothing. |
| 943 | * <p> |
| 944 | * Output: Nothing. |
| 945 | */ |
| 946 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 947 | public static final String ACTION_DATA_ROAMING_SETTINGS = |
| 948 | "android.settings.DATA_ROAMING_SETTINGS"; |
| 949 | |
| 950 | /** |
| 951 | * Activity Action: Show settings for internal storage. |
| 952 | * <p> |
| 953 | * In some cases, a matching Activity may not exist, so ensure you |
| 954 | * safeguard against this. |
| 955 | * <p> |
| 956 | * Input: Nothing. |
| 957 | * <p> |
| 958 | * Output: Nothing. |
| 959 | */ |
| 960 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 961 | public static final String ACTION_INTERNAL_STORAGE_SETTINGS = |
| 962 | "android.settings.INTERNAL_STORAGE_SETTINGS"; |
| 963 | /** |
| 964 | * Activity Action: Show settings for memory card storage. |
| 965 | * <p> |
| 966 | * In some cases, a matching Activity may not exist, so ensure you |
| 967 | * safeguard against this. |
| 968 | * <p> |
| 969 | * Input: Nothing. |
| 970 | * <p> |
| 971 | * Output: Nothing. |
| 972 | */ |
| 973 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 974 | public static final String ACTION_MEMORY_CARD_SETTINGS = |
| 975 | "android.settings.MEMORY_CARD_SETTINGS"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 976 | |
Justin Mattson | ef34035 | 2010-01-13 21:05:46 -0800 | [diff] [blame] | 977 | /** |
| 978 | * Activity Action: Show settings for global search. |
| 979 | * <p> |
| 980 | * In some cases, a matching Activity may not exist, so ensure you |
| 981 | * safeguard against this. |
| 982 | * <p> |
| 983 | * Input: Nothing. |
| 984 | * <p> |
| 985 | * Output: Nothing |
| 986 | */ |
| 987 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 988 | public static final String ACTION_SEARCH_SETTINGS = |
| 989 | "android.search.action.SEARCH_SETTINGS"; |
| 990 | |
Daniel Sandler | 9d8b876 | 2010-01-22 20:50:15 -0500 | [diff] [blame] | 991 | /** |
| 992 | * Activity Action: Show general device information settings (serial |
| 993 | * number, software version, phone number, etc.). |
| 994 | * <p> |
| 995 | * In some cases, a matching Activity may not exist, so ensure you |
| 996 | * safeguard against this. |
| 997 | * <p> |
| 998 | * Input: Nothing. |
| 999 | * <p> |
| 1000 | * Output: Nothing |
| 1001 | */ |
| 1002 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1003 | public static final String ACTION_DEVICE_INFO_SETTINGS = |
| 1004 | "android.settings.DEVICE_INFO_SETTINGS"; |
| 1005 | |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1006 | /** |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1007 | * Activity Action: Show NFC settings. |
| 1008 | * <p> |
| 1009 | * This shows UI that allows NFC to be turned on or off. |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1010 | * <p> |
| 1011 | * In some cases, a matching Activity may not exist, so ensure you |
| 1012 | * safeguard against this. |
| 1013 | * <p> |
| 1014 | * Input: Nothing. |
| 1015 | * <p> |
| 1016 | * Output: Nothing |
Nick Pelly | cccf01d | 2011-10-31 14:49:40 -0700 | [diff] [blame] | 1017 | * @see android.nfc.NfcAdapter#isEnabled() |
| 1018 | */ |
| 1019 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1020 | public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; |
| 1021 | |
| 1022 | /** |
| 1023 | * Activity Action: Show NFC Sharing settings. |
| 1024 | * <p> |
| 1025 | * This shows UI that allows NDEF Push (Android Beam) to be turned on or |
| 1026 | * off. |
| 1027 | * <p> |
| 1028 | * In some cases, a matching Activity may not exist, so ensure you |
| 1029 | * safeguard against this. |
| 1030 | * <p> |
| 1031 | * Input: Nothing. |
| 1032 | * <p> |
| 1033 | * Output: Nothing |
| 1034 | * @see android.nfc.NfcAdapter#isNdefPushEnabled() |
Martijn Coenen | 9b3c83f | 2011-07-28 11:21:39 -0500 | [diff] [blame] | 1035 | */ |
| 1036 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1037 | public static final String ACTION_NFCSHARING_SETTINGS = |
| 1038 | "android.settings.NFCSHARING_SETTINGS"; |
| 1039 | |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1040 | /** |
Martijn Coenen | 62c196a | 2013-08-09 13:43:34 -0700 | [diff] [blame] | 1041 | * Activity Action: Show NFC Tap & Pay settings |
| 1042 | * <p> |
| 1043 | * This shows UI that allows the user to configure Tap&Pay |
| 1044 | * settings. |
| 1045 | * <p> |
| 1046 | * In some cases, a matching Activity may not exist, so ensure you |
| 1047 | * safeguard against this. |
| 1048 | * <p> |
| 1049 | * Input: Nothing. |
| 1050 | * <p> |
| 1051 | * Output: Nothing |
| 1052 | */ |
| 1053 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1054 | public static final String ACTION_NFC_PAYMENT_SETTINGS = |
| 1055 | "android.settings.NFC_PAYMENT_SETTINGS"; |
| 1056 | |
| 1057 | /** |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1058 | * Activity Action: Show Daydream settings. |
| 1059 | * <p> |
| 1060 | * In some cases, a matching Activity may not exist, so ensure you |
| 1061 | * safeguard against this. |
| 1062 | * <p> |
| 1063 | * Input: Nothing. |
| 1064 | * <p> |
| 1065 | * Output: Nothing. |
| 1066 | * @see android.service.dreams.DreamService |
Daniel Sandler | c08cd02 | 2012-11-27 22:47:37 -0500 | [diff] [blame] | 1067 | */ |
| 1068 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1069 | public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; |
| 1070 | |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1071 | /** |
| 1072 | * Activity Action: Show Notification listener settings. |
| 1073 | * <p> |
| 1074 | * In some cases, a matching Activity may not exist, so ensure you |
| 1075 | * safeguard against this. |
| 1076 | * <p> |
| 1077 | * Input: Nothing. |
| 1078 | * <p> |
| 1079 | * Output: Nothing. |
| 1080 | * @see android.service.notification.NotificationListenerService |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1081 | */ |
| 1082 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1083 | public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS |
Chris Wren | 8326a8a | 2014-10-22 14:13:32 -0400 | [diff] [blame] | 1084 | = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; |
Daniel Sandler | 5feceeb | 2013-03-22 18:29:23 -0700 | [diff] [blame] | 1085 | |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1086 | /** |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1087 | * Activity Action: Show Do Not Disturb access settings. |
| 1088 | * <p> |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1089 | * Users can grant and deny access to Do Not Disturb configuration from here. |
| 1090 | * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more |
| 1091 | * details. |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1092 | * <p> |
| 1093 | * Input: Nothing. |
| 1094 | * <p> |
| 1095 | * Output: Nothing. |
| 1096 | */ |
| 1097 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 1098 | public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS |
| 1099 | = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; |
John Spurlock | 8077493 | 2015-05-07 17:38:50 -0400 | [diff] [blame] | 1100 | |
| 1101 | /** |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 1102 | * @hide |
| 1103 | */ |
| 1104 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1105 | public static final String ACTION_CONDITION_PROVIDER_SETTINGS |
| 1106 | = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; |
| 1107 | |
| 1108 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 1109 | * Activity Action: Show settings for video captioning. |
| 1110 | * <p> |
| 1111 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1112 | * against this. |
| 1113 | * <p> |
| 1114 | * Input: Nothing. |
| 1115 | * <p> |
| 1116 | * Output: Nothing. |
| 1117 | */ |
| 1118 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1119 | public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; |
| 1120 | |
Svetoslav | 773f54d | 2013-09-03 14:01:43 -0700 | [diff] [blame] | 1121 | /** |
| 1122 | * Activity Action: Show the top level print settings. |
| 1123 | * <p> |
| 1124 | * In some cases, a matching Activity may not exist, so ensure you |
| 1125 | * safeguard against this. |
| 1126 | * <p> |
| 1127 | * Input: Nothing. |
| 1128 | * <p> |
| 1129 | * Output: Nothing. |
| 1130 | */ |
| 1131 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1132 | public static final String ACTION_PRINT_SETTINGS = |
| 1133 | "android.settings.ACTION_PRINT_SETTINGS"; |
| 1134 | |
John Spurlock | de54700 | 2014-02-28 17:50:39 -0500 | [diff] [blame] | 1135 | /** |
| 1136 | * Activity Action: Show Zen Mode configuration settings. |
| 1137 | * |
| 1138 | * @hide |
| 1139 | */ |
| 1140 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1141 | public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; |
| 1142 | |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1143 | /** |
Julia Reynolds | a11d0b1 | 2017-02-16 15:01:36 -0500 | [diff] [blame] | 1144 | * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. |
John Spurlock | fc746f8 | 2015-04-03 13:47:14 -0400 | [diff] [blame] | 1145 | */ |
| 1146 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1147 | public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS |
| 1148 | = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; |
| 1149 | |
| 1150 | /** |
John Spurlock | 7af1018 | 2015-04-03 15:10:31 -0400 | [diff] [blame] | 1151 | * Activity Action: Show Zen Mode automation configuration settings. |
| 1152 | * |
| 1153 | * @hide |
| 1154 | */ |
| 1155 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1156 | public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS |
| 1157 | = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; |
| 1158 | |
| 1159 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1160 | * Activity Action: Modify do not disturb mode settings. |
| 1161 | * <p> |
| 1162 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1163 | * <p> |
| 1164 | * This intent MUST be started using |
| 1165 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1166 | * startVoiceActivity}. |
| 1167 | * <p> |
| 1168 | * Note: The Activity implementing this intent MUST verify that |
| 1169 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. |
| 1170 | * returns true before modifying the setting. |
| 1171 | * <p> |
| 1172 | * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate |
| 1173 | * how long the user wishes to avoid interruptions for. The optional |
| 1174 | * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is |
| 1175 | * enabling or disabling do not disturb mode. If either extra is not included, the |
| 1176 | * user maybe asked to provide the value. |
| 1177 | * <p> |
| 1178 | * Output: Nothing. |
| 1179 | */ |
| 1180 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1181 | public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = |
| 1182 | "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; |
| 1183 | |
| 1184 | /** |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 1185 | * Activity Action: Show Zen Mode schedule rule configuration settings. |
| 1186 | * |
| 1187 | * @hide |
| 1188 | */ |
| 1189 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1190 | public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS |
| 1191 | = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; |
| 1192 | |
| 1193 | /** |
John Spurlock | d60258f | 2015-04-30 09:30:52 -0400 | [diff] [blame] | 1194 | * Activity Action: Show Zen Mode event rule configuration settings. |
| 1195 | * |
| 1196 | * @hide |
| 1197 | */ |
| 1198 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1199 | public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS |
| 1200 | = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; |
| 1201 | |
| 1202 | /** |
John Spurlock | 39581cc | 2015-04-10 11:59:01 -0400 | [diff] [blame] | 1203 | * Activity Action: Show Zen Mode external rule configuration settings. |
| 1204 | * |
| 1205 | * @hide |
| 1206 | */ |
| 1207 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1208 | public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS |
| 1209 | = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; |
| 1210 | |
| 1211 | /** |
Santos Cordon | a4c7524 | 2014-07-09 12:07:51 -0700 | [diff] [blame] | 1212 | * Activity Action: Show the regulatory information screen for the device. |
| 1213 | * <p> |
| 1214 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1215 | * against this. |
| 1216 | * <p> |
| 1217 | * Input: Nothing. |
| 1218 | * <p> |
| 1219 | * Output: Nothing. |
| 1220 | */ |
Jeff Sharkey | dd77fda | 2014-04-16 17:23:08 -0700 | [diff] [blame] | 1221 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1222 | public static final String |
| 1223 | ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; |
| 1224 | |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1225 | /** |
| 1226 | * Activity Action: Show Device Name Settings. |
| 1227 | * <p> |
| 1228 | * 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] | 1229 | * against this. |
Jerome Poichet | 7974cb3 | 2014-05-14 12:04:43 -0700 | [diff] [blame] | 1230 | * |
| 1231 | * @hide |
| 1232 | */ |
| 1233 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1234 | public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; |
| 1235 | |
Tim Kilbourn | 87cd0dc | 2014-04-14 15:37:51 -0700 | [diff] [blame] | 1236 | /** |
| 1237 | * Activity Action: Show pairing settings. |
| 1238 | * <p> |
| 1239 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1240 | * against this. |
| 1241 | * |
| 1242 | * @hide |
| 1243 | */ |
| 1244 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1245 | public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; |
| 1246 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1247 | /** |
| 1248 | * Activity Action: Show battery saver settings. |
John Spurlock | 7346666 | 2014-10-30 13:42:05 -0400 | [diff] [blame] | 1249 | * <p> |
| 1250 | * In some cases, a matching Activity may not exist, so ensure you safeguard |
| 1251 | * against this. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 1252 | */ |
| 1253 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1254 | public static final String ACTION_BATTERY_SAVER_SETTINGS |
| 1255 | = "android.settings.BATTERY_SAVER_SETTINGS"; |
| 1256 | |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1257 | /** |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1258 | * Activity Action: Modify Battery Saver mode setting using a voice command. |
| 1259 | * <p> |
| 1260 | * In some cases, a matching Activity may not exist, so ensure you safeguard against this. |
| 1261 | * <p> |
| 1262 | * This intent MUST be started using |
| 1263 | * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity |
| 1264 | * startVoiceActivity}. |
| 1265 | * <p> |
| 1266 | * Note: The activity implementing this intent MUST verify that |
| 1267 | * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before |
| 1268 | * modifying the setting. |
| 1269 | * <p> |
| 1270 | * Input: To tell which state batter saver mode should be set to, add the |
| 1271 | * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. |
| 1272 | * If the extra is not included, no changes will be made. |
| 1273 | * <p> |
| 1274 | * Output: Nothing. |
| 1275 | */ |
| 1276 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1277 | public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = |
| 1278 | "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; |
| 1279 | |
| 1280 | /** |
Amith Yamasani | eb7b94a | 2014-07-14 18:02:08 -0700 | [diff] [blame] | 1281 | * Activity Action: Show Home selection settings. If there are multiple activities |
| 1282 | * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you |
| 1283 | * to pick your preferred activity. |
| 1284 | */ |
| 1285 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1286 | public static final String ACTION_HOME_SETTINGS |
| 1287 | = "android.settings.HOME_SETTINGS"; |
| 1288 | |
Julia Reynolds | 7eba593 | 2015-12-11 16:40:39 -0500 | [diff] [blame] | 1289 | /** |
| 1290 | * Activity Action: Show Default apps settings. |
| 1291 | * <p> |
| 1292 | * In some cases, a matching Activity may not exist, so ensure you |
| 1293 | * safeguard against this. |
| 1294 | * <p> |
| 1295 | * Input: Nothing. |
| 1296 | * <p> |
| 1297 | * Output: Nothing. |
| 1298 | */ |
| 1299 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1300 | public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS |
| 1301 | = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; |
| 1302 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1303 | /** |
| 1304 | * Activity Action: Show notification settings. |
| 1305 | * |
| 1306 | * @hide |
| 1307 | */ |
| 1308 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1309 | public static final String ACTION_NOTIFICATION_SETTINGS |
| 1310 | = "android.settings.NOTIFICATION_SETTINGS"; |
| 1311 | |
| 1312 | /** |
| 1313 | * Activity Action: Show notification settings for a single app. |
Jeff Schumacher | dc53009 | 2017-01-25 18:51:22 -0800 | [diff] [blame] | 1314 | * <p> |
| 1315 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1316 | * Input: Optionally, {@link #EXTRA_CHANNEL_ID}, to highlight that channel. |
| 1317 | * <p> |
| 1318 | * Output: Nothing. |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1319 | */ |
| 1320 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1321 | public static final String ACTION_APP_NOTIFICATION_SETTINGS |
| 1322 | = "android.settings.APP_NOTIFICATION_SETTINGS"; |
| 1323 | |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1324 | /** |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1325 | * Activity Action: Show notification settings for a single {@link NotificationChannel}. |
| 1326 | * <p> |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1327 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. |
| 1328 | * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. |
| 1329 | * <p> |
| 1330 | * Output: Nothing. |
| 1331 | */ |
| 1332 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1333 | public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS |
| 1334 | = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; |
| 1335 | |
| 1336 | /** |
Julia Reynolds | 005c8b9 | 2017-08-24 10:35:53 -0400 | [diff] [blame] | 1337 | * Activity Action: Show notification settings for a single {@link NotificationChannelGroup}. |
| 1338 | * <p> |
| 1339 | * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel group to display. |
| 1340 | * Input: {@link #EXTRA_CHANNEL_GROUP_ID}, the id of the channel group to display. |
| 1341 | * <p> |
| 1342 | * Output: Nothing. |
| 1343 | */ |
| 1344 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1345 | public static final String ACTION_CHANNEL_GROUP_NOTIFICATION_SETTINGS = |
| 1346 | "android.settings.CHANNEL_GROUP_NOTIFICATION_SETTINGS"; |
| 1347 | |
| 1348 | /** |
Julia Reynolds | 9ba0c61 | 2017-01-25 10:31:34 -0500 | [diff] [blame] | 1349 | * Activity Extra: The package owner of the notification channel settings to display. |
| 1350 | * <p> |
| 1351 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1352 | */ |
| 1353 | public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; |
| 1354 | |
| 1355 | /** |
| 1356 | * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings |
| 1357 | * to display. |
| 1358 | * <p> |
| 1359 | * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. |
| 1360 | */ |
| 1361 | public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; |
| 1362 | |
| 1363 | /** |
Julia Reynolds | 005c8b9 | 2017-08-24 10:35:53 -0400 | [diff] [blame] | 1364 | * Activity Extra: The {@link NotificationChannelGroup#getId()} of the notification channel |
| 1365 | * group settings to display. |
| 1366 | * <p> |
| 1367 | * This must be passed as an extra field to the |
| 1368 | * {@link #ACTION_CHANNEL_GROUP_NOTIFICATION_SETTINGS}. |
| 1369 | */ |
| 1370 | public static final String EXTRA_CHANNEL_GROUP_ID = "android.provider.extra.CHANNEL_GROUP_ID"; |
| 1371 | |
| 1372 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 1373 | * Activity Action: Show notification redaction settings. |
| 1374 | * |
| 1375 | * @hide |
| 1376 | */ |
| 1377 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1378 | public static final String ACTION_APP_NOTIFICATION_REDACTION |
| 1379 | = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; |
| 1380 | |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1381 | /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; |
John Spurlock | 2b0e09c | 2014-07-27 13:27:47 -0400 | [diff] [blame] | 1382 | |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1383 | /** |
| 1384 | * Activity Action: Show a dialog with disabled by policy message. |
| 1385 | * <p> If an user action is disabled by policy, this dialog can be triggered to let |
| 1386 | * the user know about this. |
| 1387 | * <p> |
| 1388 | * Input: Nothing. |
| 1389 | * <p> |
| 1390 | * Output: Nothing. |
Sudheer Shanka | aebd5dd | 2016-02-18 12:37:14 +0000 | [diff] [blame] | 1391 | * |
| 1392 | * @hide |
Sudheer Shanka | 410e6bd | 2015-12-31 15:29:50 +0000 | [diff] [blame] | 1393 | */ |
| 1394 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1395 | public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS |
| 1396 | = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; |
| 1397 | |
Michal Karpinski | ba24409 | 2016-02-25 17:28:24 +0000 | [diff] [blame] | 1398 | /** |
| 1399 | * Activity Action: Show a dialog for remote bugreport flow. |
| 1400 | * <p> |
| 1401 | * Input: Nothing. |
| 1402 | * <p> |
| 1403 | * Output: Nothing. |
| 1404 | * |
| 1405 | * @hide |
| 1406 | */ |
| 1407 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1408 | public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG |
| 1409 | = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; |
| 1410 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 1411 | /** |
| 1412 | * Activity Action: Show VR listener settings. |
| 1413 | * <p> |
| 1414 | * Input: Nothing. |
| 1415 | * <p> |
| 1416 | * Output: Nothing. |
| 1417 | * |
| 1418 | * @see android.service.vr.VrListenerService |
| 1419 | */ |
| 1420 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1421 | public static final String ACTION_VR_LISTENER_SETTINGS |
| 1422 | = "android.settings.VR_LISTENER_SETTINGS"; |
| 1423 | |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1424 | /** |
Winson Chung | 59fda9e | 2017-01-20 16:14:51 -0800 | [diff] [blame] | 1425 | * Activity Action: Show Picture-in-picture settings. |
| 1426 | * <p> |
| 1427 | * Input: Nothing. |
| 1428 | * <p> |
| 1429 | * Output: Nothing. |
| 1430 | * |
| 1431 | * @hide |
| 1432 | */ |
| 1433 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1434 | public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS |
| 1435 | = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; |
| 1436 | |
| 1437 | /** |
Daniel Nishi | e58d2a7 | 2016-09-20 16:42:19 -0700 | [diff] [blame] | 1438 | * Activity Action: Show Storage Manager settings. |
| 1439 | * <p> |
| 1440 | * Input: Nothing. |
| 1441 | * <p> |
| 1442 | * Output: Nothing. |
| 1443 | * |
| 1444 | * @hide |
| 1445 | */ |
| 1446 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1447 | public static final String ACTION_STORAGE_MANAGER_SETTINGS |
| 1448 | = "android.settings.STORAGE_MANAGER_SETTINGS"; |
| 1449 | |
| 1450 | /** |
Jason Monk | 42d0121 | 2016-05-03 14:16:56 -0400 | [diff] [blame] | 1451 | * Activity Action: Allows user to select current webview implementation. |
| 1452 | * <p> |
| 1453 | * Input: Nothing. |
| 1454 | * <p> |
| 1455 | * Output: Nothing. |
| 1456 | */ |
| 1457 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1458 | public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; |
| 1459 | |
Bartosz Fabianowski | 46bea2e | 2016-12-06 01:20:29 +0100 | [diff] [blame] | 1460 | /** |
| 1461 | * Activity Action: Show enterprise privacy section. |
| 1462 | * <p> |
| 1463 | * Input: Nothing. |
| 1464 | * <p> |
| 1465 | * Output: Nothing. |
| 1466 | * @hide |
| 1467 | */ |
| 1468 | @SystemApi |
| 1469 | @TestApi |
| 1470 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1471 | public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS |
| 1472 | = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; |
| 1473 | |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1474 | /** |
| 1475 | * Activity Action: Show screen that let user select its Autofill Service. |
| 1476 | * <p> |
| 1477 | * Input: Intent's data URI set with an application name, using the |
| 1478 | * "package" schema (like "package:com.my.app"). |
| 1479 | * |
| 1480 | * <p> |
| 1481 | * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging |
| 1482 | * to the caller package. |
| 1483 | * |
| 1484 | * <p> |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1485 | * <b>NOTE: </b> Applications should call |
Felipe Leme | db04118 | 2017-04-21 17:33:38 -0700 | [diff] [blame] | 1486 | * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and |
Ricardo Loo | aec98da | 2017-07-01 11:19:03 -0700 | [diff] [blame] | 1487 | * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action |
| 1488 | * 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] | 1489 | */ |
| 1490 | @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) |
| 1491 | public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = |
| 1492 | "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; |
| 1493 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1494 | // End of Intent actions for Settings |
| 1495 | |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1496 | /** |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1497 | * @hide - Private call() method on SettingsProvider to read from 'system' table. |
| 1498 | */ |
| 1499 | public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; |
| 1500 | |
| 1501 | /** |
| 1502 | * @hide - Private call() method on SettingsProvider to read from 'secure' table. |
| 1503 | */ |
| 1504 | public static final String CALL_METHOD_GET_SECURE = "GET_secure"; |
| 1505 | |
| 1506 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1507 | * @hide - Private call() method on SettingsProvider to read from 'global' table. |
| 1508 | */ |
| 1509 | public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; |
| 1510 | |
| 1511 | /** |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1512 | * @hide - Specifies that the caller of the fast-path call()-based flow tracks |
| 1513 | * the settings generation in order to cache values locally. If this key is |
| 1514 | * mapped to a <code>null</code> string extra in the request bundle, the response |
| 1515 | * bundle will contain the same key mapped to a parcelable extra which would be |
| 1516 | * an {@link android.util.MemoryIntArray}. The response will also contain an |
| 1517 | * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the |
| 1518 | * index in the array clients should use to lookup the generation. For efficiency |
| 1519 | * the caller should request the generation tracking memory array only if it |
| 1520 | * doesn't already have it. |
| 1521 | * |
| 1522 | * @see #CALL_METHOD_GENERATION_INDEX_KEY |
| 1523 | */ |
| 1524 | public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; |
| 1525 | |
| 1526 | /** |
| 1527 | * @hide Key with the location in the {@link android.util.MemoryIntArray} where |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1528 | * 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] | 1529 | * |
| 1530 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1531 | */ |
| 1532 | public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; |
| 1533 | |
| 1534 | /** |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1535 | * @hide Key with the settings table generation. The value is an integer. |
| 1536 | * |
| 1537 | * @see #CALL_METHOD_TRACK_GENERATION_KEY |
| 1538 | */ |
| 1539 | public static final String CALL_METHOD_GENERATION_KEY = "_generation"; |
| 1540 | |
| 1541 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1542 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1543 | */ |
| 1544 | public static final String CALL_METHOD_USER_KEY = "_user"; |
| 1545 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1546 | /** |
| 1547 | * @hide - Boolean argument extra to the fast-path call()-based requests |
| 1548 | */ |
| 1549 | public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; |
| 1550 | |
| 1551 | /** |
| 1552 | * @hide - User handle argument extra to the fast-path call()-based requests |
| 1553 | */ |
| 1554 | public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; |
| 1555 | |
| 1556 | /** |
| 1557 | * @hide - String argument extra to the fast-path call()-based requests |
| 1558 | */ |
| 1559 | public static final String CALL_METHOD_TAG_KEY = "_tag"; |
| 1560 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1561 | /** @hide - Private call() method to write to 'system' table */ |
| 1562 | public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; |
| 1563 | |
| 1564 | /** @hide - Private call() method to write to 'secure' table */ |
| 1565 | public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; |
| 1566 | |
| 1567 | /** @hide - Private call() method to write to 'global' table */ |
| 1568 | public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; |
| 1569 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1570 | /** @hide - Private call() method to reset to defaults the 'global' table */ |
| 1571 | public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; |
| 1572 | |
| 1573 | /** @hide - Private call() method to reset to defaults the 'secure' table */ |
| 1574 | public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; |
| 1575 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1576 | /** |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1577 | * Activity Extra: Limit available options in launched activity based on the given authority. |
| 1578 | * <p> |
| 1579 | * This can be passed as an extra field in an Activity Intent with one or more syncable content |
| 1580 | * provider's authorities as a String[]. This field is used by some intents to alter the |
| 1581 | * behavior of the called activity. |
| 1582 | * <p> |
| 1583 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based |
| 1584 | * on the authority given. |
| 1585 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1586 | public static final String EXTRA_AUTHORITIES = "authorities"; |
| 1587 | |
Alon Albert | d35bf1f | 2013-04-18 14:26:51 -0700 | [diff] [blame] | 1588 | /** |
| 1589 | * Activity Extra: Limit available options in launched activity based on the given account |
| 1590 | * types. |
| 1591 | * <p> |
| 1592 | * This can be passed as an extra field in an Activity Intent with one or more account types |
| 1593 | * as a String[]. This field is used by some intents to alter the behavior of the called |
| 1594 | * activity. |
| 1595 | * <p> |
| 1596 | * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified |
| 1597 | * list. |
| 1598 | */ |
Alon Albert | 50359c2 | 2013-02-26 14:47:48 -0800 | [diff] [blame] | 1599 | public static final String EXTRA_ACCOUNT_TYPES = "account_types"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 1600 | |
Tadashi G. Takaoka | 2548020 | 2011-01-20 23:13:02 +0900 | [diff] [blame] | 1601 | public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; |
| 1602 | |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1603 | /** |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1604 | * Activity Extra: The device identifier to act upon. |
| 1605 | * <p> |
| 1606 | * This can be passed as an extra field in an Activity Intent with a single |
| 1607 | * InputDeviceIdentifier. This field is used by some activities to jump straight into the |
| 1608 | * settings for the given device. |
| 1609 | * <p> |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 1610 | * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout |
| 1611 | * dialog for the given device. |
Michael Wright | c93fbd1 | 2014-09-22 20:07:59 -0700 | [diff] [blame] | 1612 | * @hide |
| 1613 | */ |
| 1614 | public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; |
| 1615 | |
| 1616 | /** |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1617 | * Activity Extra: Enable or disable Airplane Mode. |
| 1618 | * <p> |
| 1619 | * 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] | 1620 | * intent as a boolean to indicate if it should be enabled. |
Barnaby James | 48f3552 | 2014-07-16 14:27:39 -0700 | [diff] [blame] | 1621 | */ |
| 1622 | public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; |
| 1623 | |
Barnaby James | b3006d3 | 2015-04-02 17:49:54 -0700 | [diff] [blame] | 1624 | /** |
| 1625 | * Activity Extra: Enable or disable Battery saver mode. |
| 1626 | * <p> |
| 1627 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} |
| 1628 | * intent as a boolean to indicate if it should be enabled. |
| 1629 | */ |
| 1630 | public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = |
| 1631 | "android.settings.extra.battery_saver_mode_enabled"; |
| 1632 | |
| 1633 | /** |
| 1634 | * Activity Extra: Enable or disable Do Not Disturb mode. |
| 1635 | * <p> |
| 1636 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1637 | * intent as a boolean to indicate if it should be enabled. |
| 1638 | */ |
| 1639 | public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = |
| 1640 | "android.settings.extra.do_not_disturb_mode_enabled"; |
| 1641 | |
| 1642 | /** |
| 1643 | * Activity Extra: How many minutes to enable do not disturb mode for. |
| 1644 | * <p> |
| 1645 | * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} |
| 1646 | * intent to indicate how long do not disturb mode should be enabled for. |
| 1647 | */ |
| 1648 | public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = |
| 1649 | "android.settings.extra.do_not_disturb_mode_minutes"; |
| 1650 | |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1651 | /** |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1652 | * Reset mode: reset to defaults only settings changed by the |
| 1653 | * calling package. If there is a default set the setting |
| 1654 | * will be set to it, otherwise the setting will be deleted. |
| 1655 | * This is the only type of reset available to non-system clients. |
| 1656 | * @hide |
| 1657 | */ |
| 1658 | public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; |
| 1659 | |
| 1660 | /** |
| 1661 | * Reset mode: reset all settings set by untrusted packages, which is |
| 1662 | * packages that aren't a part of the system, to the current defaults. |
| 1663 | * If there is a default set the setting will be set to it, otherwise |
| 1664 | * the setting will be deleted. This mode is only available to the system. |
| 1665 | * @hide |
| 1666 | */ |
| 1667 | public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; |
| 1668 | |
| 1669 | /** |
| 1670 | * Reset mode: delete all settings set by untrusted packages, which is |
| 1671 | * packages that aren't a part of the system. If a setting is set by an |
| 1672 | * untrusted package it will be deleted if its default is not provided |
| 1673 | * by the system, otherwise the setting will be set to its default. |
| 1674 | * This mode is only available to the system. |
| 1675 | * @hide |
| 1676 | */ |
| 1677 | public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; |
| 1678 | |
| 1679 | /** |
| 1680 | * Reset mode: reset all settings to defaults specified by trusted |
| 1681 | * packages, which is packages that are a part of the system, and |
| 1682 | * delete all settings set by untrusted packages. If a setting has |
| 1683 | * a default set by a system package it will be set to the default, |
| 1684 | * otherwise the setting will be deleted. This mode is only available |
| 1685 | * to the system. |
| 1686 | * @hide |
| 1687 | */ |
| 1688 | public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; |
| 1689 | |
| 1690 | /** @hide */ |
| 1691 | @Retention(RetentionPolicy.SOURCE) |
Jeff Sharkey | ce8db99 | 2017-12-13 20:05:05 -0700 | [diff] [blame] | 1692 | @IntDef(prefix = { "RESET_MODE_" }, value = { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1693 | RESET_MODE_PACKAGE_DEFAULTS, |
| 1694 | RESET_MODE_UNTRUSTED_DEFAULTS, |
| 1695 | RESET_MODE_UNTRUSTED_CHANGES, |
| 1696 | RESET_MODE_TRUSTED_DEFAULTS |
| 1697 | }) |
| 1698 | public @interface ResetMode{} |
| 1699 | |
| 1700 | /** |
Victor Chang | 355d476 | 2016-04-07 21:23:15 +0100 | [diff] [blame] | 1701 | * Activity Extra: Number of certificates |
| 1702 | * <p> |
| 1703 | * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} |
| 1704 | * intent to indicate the number of certificates |
| 1705 | * @hide |
| 1706 | */ |
| 1707 | public static final String EXTRA_NUMBER_OF_CERTIFICATES = |
| 1708 | "android.settings.extra.number_of_certificates"; |
| 1709 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1710 | private static final String JID_RESOURCE_PREFIX = "android"; |
| 1711 | |
| 1712 | public static final String AUTHORITY = "settings"; |
| 1713 | |
| 1714 | private static final String TAG = "Settings"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1715 | private static final boolean LOCAL_LOGV = false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1716 | |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 1717 | // Lock ensures that when enabling/disabling the master location switch, we don't end up |
| 1718 | // with a partial enable/disable state in multi-threaded situations. |
| 1719 | private static final Object mLocationSettingsLock = new Object(); |
| 1720 | |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1721 | // Used in system server calling uid workaround in call() |
| 1722 | private static boolean sInSystemServer = false; |
| 1723 | private static final Object sInSystemServerLock = new Object(); |
| 1724 | |
| 1725 | /** @hide */ |
| 1726 | public static void setInSystemServer() { |
| 1727 | synchronized (sInSystemServerLock) { |
| 1728 | sInSystemServer = true; |
| 1729 | } |
| 1730 | } |
| 1731 | |
| 1732 | /** @hide */ |
| 1733 | public static boolean isInSystemServer() { |
| 1734 | synchronized (sInSystemServerLock) { |
| 1735 | return sInSystemServer; |
| 1736 | } |
| 1737 | } |
| 1738 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1739 | public static class SettingNotFoundException extends AndroidException { |
| 1740 | public SettingNotFoundException(String msg) { |
| 1741 | super(msg); |
| 1742 | } |
| 1743 | } |
| 1744 | |
| 1745 | /** |
| 1746 | * Common base for tables of name/value settings. |
| 1747 | */ |
| 1748 | public static class NameValueTable implements BaseColumns { |
| 1749 | public static final String NAME = "name"; |
| 1750 | public static final String VALUE = "value"; |
| 1751 | |
| 1752 | protected static boolean putString(ContentResolver resolver, Uri uri, |
| 1753 | String name, String value) { |
| 1754 | // The database will take care of replacing duplicates. |
| 1755 | try { |
| 1756 | ContentValues values = new ContentValues(); |
| 1757 | values.put(NAME, name); |
| 1758 | values.put(VALUE, value); |
| 1759 | resolver.insert(uri, values); |
| 1760 | return true; |
| 1761 | } catch (SQLException e) { |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 1762 | 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] | 1763 | return false; |
| 1764 | } |
| 1765 | } |
| 1766 | |
| 1767 | public static Uri getUriFor(Uri uri, String name) { |
| 1768 | return Uri.withAppendedPath(uri, name); |
| 1769 | } |
| 1770 | } |
| 1771 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1772 | private static final class GenerationTracker { |
| 1773 | private final MemoryIntArray mArray; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1774 | private final Runnable mErrorHandler; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1775 | private final int mIndex; |
| 1776 | private int mCurrentGeneration; |
| 1777 | |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1778 | public GenerationTracker(@NonNull MemoryIntArray array, int index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1779 | int generation, Runnable errorHandler) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1780 | mArray = array; |
| 1781 | mIndex = index; |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1782 | mErrorHandler = errorHandler; |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1783 | mCurrentGeneration = generation; |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1784 | } |
| 1785 | |
| 1786 | public boolean isGenerationChanged() { |
| 1787 | final int currentGeneration = readCurrentGeneration(); |
| 1788 | if (currentGeneration >= 0) { |
| 1789 | if (currentGeneration == mCurrentGeneration) { |
| 1790 | return false; |
| 1791 | } |
| 1792 | mCurrentGeneration = currentGeneration; |
| 1793 | } |
| 1794 | return true; |
| 1795 | } |
| 1796 | |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1797 | public int getCurrentGeneration() { |
| 1798 | return mCurrentGeneration; |
| 1799 | } |
| 1800 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1801 | private int readCurrentGeneration() { |
| 1802 | try { |
| 1803 | return mArray.get(mIndex); |
| 1804 | } catch (IOException e) { |
| 1805 | Log.e(TAG, "Error getting current generation", e); |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1806 | if (mErrorHandler != null) { |
| 1807 | mErrorHandler.run(); |
| 1808 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1809 | } |
| 1810 | return -1; |
| 1811 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 1812 | |
| 1813 | public void destroy() { |
| 1814 | try { |
| 1815 | mArray.close(); |
| 1816 | } catch (IOException e) { |
| 1817 | Log.e(TAG, "Error closing backing array", e); |
| 1818 | if (mErrorHandler != null) { |
| 1819 | mErrorHandler.run(); |
| 1820 | } |
| 1821 | } |
| 1822 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1823 | } |
| 1824 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1825 | private static final class ContentProviderHolder { |
| 1826 | private final Object mLock = new Object(); |
| 1827 | |
| 1828 | @GuardedBy("mLock") |
| 1829 | private final Uri mUri; |
| 1830 | @GuardedBy("mLock") |
| 1831 | private IContentProvider mContentProvider; |
| 1832 | |
| 1833 | public ContentProviderHolder(Uri uri) { |
| 1834 | mUri = uri; |
| 1835 | } |
| 1836 | |
| 1837 | public IContentProvider getProvider(ContentResolver contentResolver) { |
| 1838 | synchronized (mLock) { |
| 1839 | if (mContentProvider == null) { |
| 1840 | mContentProvider = contentResolver |
| 1841 | .acquireProvider(mUri.getAuthority()); |
| 1842 | } |
| 1843 | return mContentProvider; |
| 1844 | } |
| 1845 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 1846 | |
| 1847 | public void clearProviderForTest() { |
| 1848 | synchronized (mLock) { |
| 1849 | mContentProvider = null; |
| 1850 | } |
| 1851 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1852 | } |
| 1853 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1854 | // Thread-safe. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1855 | private static class NameValueCache { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1856 | private static final boolean DEBUG = false; |
| 1857 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1858 | private static final String[] SELECT_VALUE_PROJECTION = new String[] { |
| 1859 | Settings.NameValueTable.VALUE |
| 1860 | }; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1861 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1862 | private static final String NAME_EQ_PLACEHOLDER = "name=?"; |
| 1863 | |
| 1864 | // Must synchronize on 'this' to access mValues and mValuesVersion. |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 1865 | private final HashMap<String, String> mValues = new HashMap<>(); |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1866 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1867 | private final Uri mUri; |
| 1868 | private final ContentProviderHolder mProviderHolder; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1869 | |
| 1870 | // The method we'll call (or null, to not use) on the provider |
| 1871 | // for the fast path of retrieving settings. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1872 | private final String mCallGetCommand; |
| 1873 | private final String mCallSetCommand; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1874 | |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1875 | @GuardedBy("this") |
| 1876 | private GenerationTracker mGenerationTracker; |
| 1877 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1878 | public NameValueCache(Uri uri, String getCommand, String setCommand, |
| 1879 | ContentProviderHolder providerHolder) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1880 | mUri = uri; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1881 | mCallGetCommand = getCommand; |
| 1882 | mCallSetCommand = setCommand; |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1883 | mProviderHolder = providerHolder; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1884 | } |
| 1885 | |
| 1886 | public boolean putStringForUser(ContentResolver cr, String name, String value, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1887 | String tag, boolean makeDefault, final int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1888 | try { |
| 1889 | Bundle arg = new Bundle(); |
| 1890 | arg.putString(Settings.NameValueTable.VALUE, value); |
Christopher Tate | d5fe147 | 2012-09-10 15:48:38 -0700 | [diff] [blame] | 1891 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1892 | if (tag != null) { |
| 1893 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 1894 | } |
| 1895 | if (makeDefault) { |
| 1896 | arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); |
| 1897 | } |
| 1898 | IContentProvider cp = mProviderHolder.getProvider(cr); |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1899 | String prevValue = getStringForUser(cr, name, userHandle); |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 1900 | cp.call(cr.getPackageName(), mCallSetCommand, name, arg); |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1901 | String newValue = getStringForUser(cr, name, userHandle); |
| 1902 | StatsLog.write(StatsLog.SETTING_CHANGED, name, value, newValue, prevValue, tag, |
| 1903 | makeDefault ? 1 : 0, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1904 | } catch (RemoteException e) { |
| 1905 | Log.w(TAG, "Can't set key " + name + " in " + mUri, e); |
| 1906 | return false; |
| 1907 | } |
| 1908 | return true; |
| 1909 | } |
| 1910 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1911 | public String getStringForUser(ContentResolver cr, String name, final int userHandle) { |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1912 | final boolean isSelf = (userHandle == UserHandle.myUserId()); |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1913 | int currentGeneration = -1; |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1914 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1915 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1916 | if (mGenerationTracker != null) { |
| 1917 | if (mGenerationTracker.isGenerationChanged()) { |
| 1918 | if (DEBUG) { |
| 1919 | Log.i(TAG, "Generation changed for type:" |
| 1920 | + mUri.getPath() + " in package:" |
| 1921 | + cr.getPackageName() +" and user:" + userHandle); |
| 1922 | } |
| 1923 | mValues.clear(); |
| 1924 | } else if (mValues.containsKey(name)) { |
| 1925 | return mValues.get(name); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1926 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 1927 | if (mGenerationTracker != null) { |
| 1928 | currentGeneration = mGenerationTracker.getCurrentGeneration(); |
| 1929 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1930 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1931 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1932 | } else { |
| 1933 | if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle |
| 1934 | + " by user " + UserHandle.myUserId() + " so skipping cache"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1935 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 1936 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 1937 | IContentProvider cp = mProviderHolder.getProvider(cr); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1938 | |
| 1939 | // Try the fast path first, not using query(). If this |
| 1940 | // fails (alternate Settings provider that doesn't support |
| 1941 | // this interface?) then we fall back to the query/table |
| 1942 | // interface. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1943 | if (mCallGetCommand != null) { |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1944 | try { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1945 | Bundle args = null; |
Christopher Tate | 5e08af0 | 2012-09-21 17:17:22 -0700 | [diff] [blame] | 1946 | if (!isSelf) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 1947 | args = new Bundle(); |
| 1948 | args.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 1949 | } |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1950 | boolean needsGenerationTracker = false; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1951 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1952 | if (isSelf && mGenerationTracker == null) { |
| 1953 | needsGenerationTracker = true; |
| 1954 | if (args == null) { |
| 1955 | args = new Bundle(); |
| 1956 | } |
| 1957 | args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); |
| 1958 | if (DEBUG) { |
| 1959 | Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() |
| 1960 | + " in package:" + cr.getPackageName() +" and user:" |
| 1961 | + userHandle); |
| 1962 | } |
| 1963 | } |
| 1964 | } |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 1965 | Bundle b; |
| 1966 | // If we're in system server and in a binder transaction we need to clear the |
| 1967 | // calling uid. This works around code in system server that did not call |
| 1968 | // clearCallingIdentity, previously this wasn't needed because reading settings |
| 1969 | // did not do permission checking but thats no longer the case. |
| 1970 | // Long term this should be removed and callers should properly call |
| 1971 | // clearCallingIdentity or use a ContentResolver from the caller as needed. |
| 1972 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 1973 | final long token = Binder.clearCallingIdentity(); |
| 1974 | try { |
| 1975 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 1976 | } finally { |
| 1977 | Binder.restoreCallingIdentity(token); |
| 1978 | } |
| 1979 | } else { |
| 1980 | b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); |
| 1981 | } |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 1982 | if (b != null) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1983 | String value = b.getString(Settings.NameValueTable.VALUE); |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 1984 | // Don't update our cache for reads of other users' data |
| 1985 | if (isSelf) { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 1986 | synchronized (NameValueCache.this) { |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1987 | if (needsGenerationTracker) { |
| 1988 | MemoryIntArray array = b.getParcelable( |
| 1989 | CALL_METHOD_TRACK_GENERATION_KEY); |
| 1990 | final int index = b.getInt( |
| 1991 | CALL_METHOD_GENERATION_INDEX_KEY, -1); |
| 1992 | if (array != null && index >= 0) { |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 1993 | final int generation = b.getInt( |
| 1994 | CALL_METHOD_GENERATION_KEY, 0); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 1995 | if (DEBUG) { |
| 1996 | Log.i(TAG, "Received generation tracker for type:" |
| 1997 | + mUri.getPath() + " in package:" |
| 1998 | + cr.getPackageName() + " and user:" |
| 1999 | + userHandle + " with index:" + index); |
| 2000 | } |
Svet Ganov | 9d723d3 | 2016-08-27 11:05:56 -0700 | [diff] [blame] | 2001 | if (mGenerationTracker != null) { |
| 2002 | mGenerationTracker.destroy(); |
| 2003 | } |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2004 | mGenerationTracker = new GenerationTracker(array, index, |
Svetoslav Ganov | 8c35dcc | 2016-06-17 15:27:43 -0700 | [diff] [blame] | 2005 | generation, () -> { |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2006 | synchronized (NameValueCache.this) { |
Svetoslav Ganov | 04df738 | 2016-05-10 18:55:47 -0700 | [diff] [blame] | 2007 | Log.e(TAG, "Error accessing generation" |
| 2008 | + " tracker - removing"); |
| 2009 | if (mGenerationTracker != null) { |
| 2010 | GenerationTracker generationTracker = |
| 2011 | mGenerationTracker; |
| 2012 | mGenerationTracker = null; |
| 2013 | generationTracker.destroy(); |
| 2014 | mValues.clear(); |
| 2015 | } |
| 2016 | } |
| 2017 | }); |
Svet Ganov | 53a441c | 2016-04-19 19:38:00 -0700 | [diff] [blame] | 2018 | } |
| 2019 | } |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2020 | if (mGenerationTracker != null && currentGeneration == |
| 2021 | mGenerationTracker.getCurrentGeneration()) { |
| 2022 | mValues.put(name, value); |
| 2023 | } |
Christopher Tate | 78d2a66 | 2012-09-13 16:19:44 -0700 | [diff] [blame] | 2024 | } |
| 2025 | } else { |
| 2026 | if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle |
| 2027 | + " by " + UserHandle.myUserId() |
| 2028 | + " so not updating cache"); |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2029 | } |
| 2030 | return value; |
| 2031 | } |
| 2032 | // If the response Bundle is null, we fall through |
| 2033 | // to the query interface below. |
| 2034 | } catch (RemoteException e) { |
| 2035 | // Not supported by the remote side? Fall through |
| 2036 | // to query(). |
| 2037 | } |
| 2038 | } |
| 2039 | |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2040 | Cursor c = null; |
| 2041 | try { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2042 | Bundle queryArgs = ContentResolver.createSqlQueryBundle( |
| 2043 | NAME_EQ_PLACEHOLDER, new String[]{name}, null); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 2044 | // Same workaround as above. |
| 2045 | if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { |
| 2046 | final long token = Binder.clearCallingIdentity(); |
| 2047 | try { |
| 2048 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2049 | null); |
| 2050 | } finally { |
| 2051 | Binder.restoreCallingIdentity(token); |
| 2052 | } |
| 2053 | } else { |
| 2054 | c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, |
| 2055 | null); |
| 2056 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2057 | if (c == null) { |
| 2058 | Log.w(TAG, "Can't get key " + name + " from " + mUri); |
| 2059 | return null; |
| 2060 | } |
| 2061 | |
| 2062 | String value = c.moveToNext() ? c.getString(0) : null; |
Svet Ganov | 51b8395 | 2016-07-06 12:16:53 -0700 | [diff] [blame] | 2063 | synchronized (NameValueCache.this) { |
xulicheng | a5db9b4 | 2017-08-24 11:29:03 +0800 | [diff] [blame] | 2064 | if(mGenerationTracker != null && |
| 2065 | currentGeneration == mGenerationTracker.getCurrentGeneration()) { |
| 2066 | mValues.put(name, value); |
| 2067 | } |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2068 | } |
| 2069 | if (LOCAL_LOGV) { |
| 2070 | Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + |
| 2071 | name + " = " + (value == null ? "(null)" : value)); |
| 2072 | } |
| 2073 | return value; |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 2074 | } catch (RemoteException e) { |
Dan Egnor | 799f721 | 2009-11-24 16:24:44 -0800 | [diff] [blame] | 2075 | Log.w(TAG, "Can't get key " + name + " from " + mUri, e); |
| 2076 | return null; // Return null, but don't cache it. |
| 2077 | } finally { |
| 2078 | if (c != null) c.close(); |
| 2079 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2080 | } |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2081 | |
| 2082 | public void clearGenerationTrackerForTest() { |
| 2083 | synchronized (NameValueCache.this) { |
| 2084 | if (mGenerationTracker != null) { |
| 2085 | mGenerationTracker.destroy(); |
| 2086 | } |
| 2087 | mValues.clear(); |
| 2088 | mGenerationTracker = null; |
| 2089 | } |
| 2090 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2091 | } |
| 2092 | |
| 2093 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2094 | * Checks if the specified context can draw on top of other apps. As of API |
| 2095 | * level 23, an app cannot draw on top of other apps unless it declares the |
| 2096 | * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its |
| 2097 | * manifest, <em>and</em> the user specifically grants the app this |
| 2098 | * capability. To prompt the user to grant this approval, the app must send an |
| 2099 | * intent with the action |
| 2100 | * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which |
| 2101 | * causes the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2102 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2103 | * @param context App context. |
| 2104 | * @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] | 2105 | */ |
| 2106 | public static boolean canDrawOverlays(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 2107 | return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), |
| 2108 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 2109 | } |
| 2110 | |
| 2111 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2112 | * System settings, containing miscellaneous system preferences. This |
| 2113 | * table holds simple name/value pairs. There are convenience |
| 2114 | * functions for accessing individual settings entries. |
| 2115 | */ |
| 2116 | public static final class System extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 2117 | // NOTE: If you add new settings here, be sure to add them to |
| 2118 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. |
| 2119 | |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2120 | private static final float DEFAULT_FONT_SCALE = 1.0f; |
| 2121 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2122 | /** @hide */ |
| 2123 | public static interface Validator { |
| 2124 | public boolean validate(String value); |
| 2125 | } |
| 2126 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2127 | /** |
| 2128 | * The content:// style URL for this table |
| 2129 | */ |
| 2130 | public static final Uri CONTENT_URI = |
| 2131 | Uri.parse("content://" + AUTHORITY + "/system"); |
| 2132 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2133 | private static final ContentProviderHolder sProviderHolder = |
| 2134 | new ContentProviderHolder(CONTENT_URI); |
| 2135 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2136 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2137 | CONTENT_URI, |
| 2138 | CALL_METHOD_GET_SYSTEM, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2139 | CALL_METHOD_PUT_SYSTEM, |
| 2140 | sProviderHolder); |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2141 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2142 | private static final HashSet<String> MOVED_TO_SECURE; |
| 2143 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2144 | MOVED_TO_SECURE = new HashSet<>(30); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2145 | MOVED_TO_SECURE.add(Secure.ANDROID_ID); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2146 | MOVED_TO_SECURE.add(Secure.HTTP_PROXY); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2147 | MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 2148 | MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 2149 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); |
| 2150 | MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); |
| 2151 | 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] | 2152 | MOVED_TO_SECURE.add(Secure.LOGGING_ID); |
| 2153 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); |
| 2154 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); |
| 2155 | MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); |
| 2156 | MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2157 | MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); |
| 2158 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 2159 | MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 2160 | MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 2161 | MOVED_TO_SECURE.add(Secure.WIFI_ON); |
| 2162 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); |
| 2163 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); |
| 2164 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); |
| 2165 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); |
| 2166 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); |
| 2167 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); |
| 2168 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); |
| 2169 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); |
| 2170 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); |
| 2171 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); |
| 2172 | MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 2173 | |
| 2174 | // At one time in System, then Global, but now back in Secure |
| 2175 | MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2176 | } |
| 2177 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2178 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2179 | private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2180 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 2181 | MOVED_TO_GLOBAL = new HashSet<>(); |
| 2182 | MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2183 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2184 | // these were originally in system but migrated to secure in the past, |
| 2185 | // so are duplicated in the Secure.* namespace |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2186 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); |
| 2187 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); |
| 2188 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); |
| 2189 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2190 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); |
| 2191 | MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2192 | |
Christopher Tate | 9219874 | 2012-09-07 12:00:13 -0700 | [diff] [blame] | 2193 | // these are moving directly from system to global |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2194 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); |
| 2195 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); |
| 2196 | MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); |
| 2197 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); |
| 2198 | MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); |
| 2199 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); |
| 2200 | MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); |
| 2201 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); |
| 2202 | MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); |
| 2203 | MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); |
| 2204 | MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); |
| 2205 | MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); |
| 2206 | MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); |
| 2207 | MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); |
| 2208 | MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); |
| 2209 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2210 | MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2211 | MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); |
| 2212 | MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); |
| 2213 | MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); |
| 2214 | MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); |
| 2215 | MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); |
| 2216 | MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); |
| 2217 | MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); |
| 2218 | MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); |
| 2219 | MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 2220 | MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 2221 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); |
| 2222 | MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); |
| 2223 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); |
| 2224 | MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); |
| 2225 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); |
| 2226 | MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); |
| 2227 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); |
| 2228 | MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2229 | } |
| 2230 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2231 | private static final Validator sBooleanValidator = |
| 2232 | new DiscreteValueValidator(new String[] {"0", "1"}); |
| 2233 | |
| 2234 | private static final Validator sNonNegativeIntegerValidator = new Validator() { |
| 2235 | @Override |
| 2236 | public boolean validate(String value) { |
| 2237 | try { |
| 2238 | return Integer.parseInt(value) >= 0; |
| 2239 | } catch (NumberFormatException e) { |
| 2240 | return false; |
| 2241 | } |
| 2242 | } |
| 2243 | }; |
| 2244 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2245 | private static final Validator sUriValidator = new Validator() { |
| 2246 | @Override |
| 2247 | public boolean validate(String value) { |
| 2248 | try { |
| 2249 | Uri.decode(value); |
| 2250 | return true; |
| 2251 | } catch (IllegalArgumentException e) { |
| 2252 | return false; |
| 2253 | } |
| 2254 | } |
| 2255 | }; |
| 2256 | |
| 2257 | private static final Validator sLenientIpAddressValidator = new Validator() { |
| 2258 | private static final int MAX_IPV6_LENGTH = 45; |
| 2259 | |
| 2260 | @Override |
| 2261 | public boolean validate(String value) { |
| 2262 | return value.length() <= MAX_IPV6_LENGTH; |
| 2263 | } |
| 2264 | }; |
| 2265 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2266 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2267 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2268 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2269 | outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); |
| 2270 | } |
| 2271 | |
| 2272 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2273 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 2274 | outKeySet.addAll(MOVED_TO_SECURE); |
| 2275 | } |
| 2276 | |
| 2277 | /** @hide */ |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2278 | public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { |
| 2279 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 2280 | } |
| 2281 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 2282 | /** @hide */ |
| 2283 | public static void clearProviderForTest() { |
| 2284 | sProviderHolder.clearProviderForTest(); |
| 2285 | sNameValueCache.clearGenerationTrackerForTest(); |
| 2286 | } |
| 2287 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2288 | /** |
| 2289 | * Look up a name in the database. |
| 2290 | * @param resolver to access the database with |
| 2291 | * @param name to look up in the table |
| 2292 | * @return the corresponding value, or null if not present |
| 2293 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2294 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2295 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 2296 | } |
| 2297 | |
| 2298 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 2299 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2300 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2301 | if (MOVED_TO_SECURE.contains(name)) { |
| 2302 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2303 | + " to android.provider.Settings.Secure, returning read-only value."); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2304 | return Secure.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2305 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2306 | 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] | 2307 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2308 | + " to android.provider.Settings.Global, returning read-only value."); |
| 2309 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2310 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2311 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2312 | } |
| 2313 | |
| 2314 | /** |
| 2315 | * Store a name/value pair into the database. |
| 2316 | * @param resolver to access the database with |
| 2317 | * @param name to store |
| 2318 | * @param value to associate with the name |
| 2319 | * @return true if the value was set, false on database errors |
| 2320 | */ |
| 2321 | public static boolean putString(ContentResolver resolver, String name, String value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2322 | return putStringForUser(resolver, name, value, UserHandle.myUserId()); |
| 2323 | } |
| 2324 | |
| 2325 | /** @hide */ |
| 2326 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 2327 | int userHandle) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2328 | if (MOVED_TO_SECURE.contains(name)) { |
| 2329 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2330 | + " to android.provider.Settings.Secure, value is unchanged."); |
| 2331 | return false; |
| 2332 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2333 | 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] | 2334 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2335 | + " to android.provider.Settings.Global, value is unchanged."); |
| 2336 | return false; |
| 2337 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 2338 | return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2339 | } |
| 2340 | |
| 2341 | /** |
| 2342 | * Construct the content URI for a particular name/value pair, |
| 2343 | * useful for monitoring changes with a ContentObserver. |
| 2344 | * @param name to look up in the table |
| 2345 | * @return the corresponding content URI, or null if not present |
| 2346 | */ |
| 2347 | public static Uri getUriFor(String name) { |
| 2348 | if (MOVED_TO_SECURE.contains(name)) { |
| 2349 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2350 | + " to android.provider.Settings.Secure, returning Secure URI."); |
| 2351 | return Secure.getUriFor(Secure.CONTENT_URI, name); |
| 2352 | } |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 2353 | 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] | 2354 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" |
| 2355 | + " to android.provider.Settings.Global, returning read-only global URI."); |
| 2356 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 2357 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2358 | return getUriFor(CONTENT_URI, name); |
| 2359 | } |
| 2360 | |
| 2361 | /** |
| 2362 | * Convenience function for retrieving a single system settings value |
| 2363 | * as an integer. Note that internally setting values are always |
| 2364 | * stored as strings; this function converts the string to an integer |
| 2365 | * for you. The default value will be returned if the setting is |
| 2366 | * not defined or not an integer. |
| 2367 | * |
| 2368 | * @param cr The ContentResolver to access. |
| 2369 | * @param name The name of the setting to retrieve. |
| 2370 | * @param def Value to return if the setting is not defined. |
| 2371 | * |
| 2372 | * @return The setting's current value, or 'def' if it is not defined |
| 2373 | * or not a valid integer. |
| 2374 | */ |
| 2375 | public static int getInt(ContentResolver cr, String name, int def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2376 | return getIntForUser(cr, name, def, UserHandle.myUserId()); |
| 2377 | } |
| 2378 | |
| 2379 | /** @hide */ |
| 2380 | public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { |
| 2381 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2382 | try { |
| 2383 | return v != null ? Integer.parseInt(v) : def; |
| 2384 | } catch (NumberFormatException e) { |
| 2385 | return def; |
| 2386 | } |
| 2387 | } |
| 2388 | |
| 2389 | /** |
| 2390 | * Convenience function for retrieving a single system settings value |
| 2391 | * as an integer. Note that internally setting values are always |
| 2392 | * stored as strings; this function converts the string to an integer |
| 2393 | * for you. |
| 2394 | * <p> |
| 2395 | * This version does not take a default value. If the setting has not |
| 2396 | * been set, or the string value is not a number, |
| 2397 | * it throws {@link SettingNotFoundException}. |
| 2398 | * |
| 2399 | * @param cr The ContentResolver to access. |
| 2400 | * @param name The name of the setting to retrieve. |
| 2401 | * |
| 2402 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2403 | * name can't be found or the setting value is not an integer. |
| 2404 | * |
| 2405 | * @return The setting's current value. |
| 2406 | */ |
| 2407 | public static int getInt(ContentResolver cr, String name) |
| 2408 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2409 | return getIntForUser(cr, name, UserHandle.myUserId()); |
| 2410 | } |
| 2411 | |
| 2412 | /** @hide */ |
| 2413 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 2414 | throws SettingNotFoundException { |
| 2415 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2416 | try { |
| 2417 | return Integer.parseInt(v); |
| 2418 | } catch (NumberFormatException e) { |
| 2419 | throw new SettingNotFoundException(name); |
| 2420 | } |
| 2421 | } |
| 2422 | |
| 2423 | /** |
| 2424 | * Convenience function for updating a single settings value as an |
| 2425 | * integer. This will either create a new entry in the table if the |
| 2426 | * given name does not exist, or modify the value of the existing row |
| 2427 | * with that name. Note that internally setting values are always |
| 2428 | * stored as strings, so this function converts the given value to a |
| 2429 | * string before storing it. |
| 2430 | * |
| 2431 | * @param cr The ContentResolver to access. |
| 2432 | * @param name The name of the setting to modify. |
| 2433 | * @param value The new value for the setting. |
| 2434 | * @return true if the value was set, false on database errors |
| 2435 | */ |
| 2436 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2437 | return putIntForUser(cr, name, value, UserHandle.myUserId()); |
| 2438 | } |
| 2439 | |
| 2440 | /** @hide */ |
| 2441 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 2442 | int userHandle) { |
| 2443 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2444 | } |
| 2445 | |
| 2446 | /** |
| 2447 | * Convenience function for retrieving a single system settings value |
| 2448 | * as a {@code long}. Note that internally setting values are always |
| 2449 | * stored as strings; this function converts the string to a {@code long} |
| 2450 | * for you. The default value will be returned if the setting is |
| 2451 | * not defined or not a {@code long}. |
| 2452 | * |
| 2453 | * @param cr The ContentResolver to access. |
| 2454 | * @param name The name of the setting to retrieve. |
| 2455 | * @param def Value to return if the setting is not defined. |
| 2456 | * |
| 2457 | * @return The setting's current value, or 'def' if it is not defined |
| 2458 | * or not a valid {@code long}. |
| 2459 | */ |
| 2460 | public static long getLong(ContentResolver cr, String name, long def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2461 | return getLongForUser(cr, name, def, UserHandle.myUserId()); |
| 2462 | } |
| 2463 | |
| 2464 | /** @hide */ |
| 2465 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 2466 | int userHandle) { |
| 2467 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2468 | long value; |
| 2469 | try { |
| 2470 | value = valString != null ? Long.parseLong(valString) : def; |
| 2471 | } catch (NumberFormatException e) { |
| 2472 | value = def; |
| 2473 | } |
| 2474 | return value; |
| 2475 | } |
| 2476 | |
| 2477 | /** |
| 2478 | * Convenience function for retrieving a single system settings value |
| 2479 | * as a {@code long}. Note that internally setting values are always |
| 2480 | * stored as strings; this function converts the string to a {@code long} |
| 2481 | * for you. |
| 2482 | * <p> |
| 2483 | * This version does not take a default value. If the setting has not |
| 2484 | * been set, or the string value is not a number, |
| 2485 | * it throws {@link SettingNotFoundException}. |
| 2486 | * |
| 2487 | * @param cr The ContentResolver to access. |
| 2488 | * @param name The name of the setting to retrieve. |
| 2489 | * |
| 2490 | * @return The setting's current value. |
| 2491 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2492 | * name can't be found or the setting value is not an integer. |
| 2493 | */ |
| 2494 | public static long getLong(ContentResolver cr, String name) |
| 2495 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2496 | return getLongForUser(cr, name, UserHandle.myUserId()); |
| 2497 | } |
| 2498 | |
| 2499 | /** @hide */ |
| 2500 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 2501 | throws SettingNotFoundException { |
| 2502 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2503 | try { |
| 2504 | return Long.parseLong(valString); |
| 2505 | } catch (NumberFormatException e) { |
| 2506 | throw new SettingNotFoundException(name); |
| 2507 | } |
| 2508 | } |
| 2509 | |
| 2510 | /** |
| 2511 | * Convenience function for updating a single settings value as a long |
| 2512 | * integer. This will either create a new entry in the table if the |
| 2513 | * given name does not exist, or modify the value of the existing row |
| 2514 | * with that name. Note that internally setting values are always |
| 2515 | * stored as strings, so this function converts the given value to a |
| 2516 | * string before storing it. |
| 2517 | * |
| 2518 | * @param cr The ContentResolver to access. |
| 2519 | * @param name The name of the setting to modify. |
| 2520 | * @param value The new value for the setting. |
| 2521 | * @return true if the value was set, false on database errors |
| 2522 | */ |
| 2523 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2524 | return putLongForUser(cr, name, value, UserHandle.myUserId()); |
| 2525 | } |
| 2526 | |
| 2527 | /** @hide */ |
| 2528 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 2529 | int userHandle) { |
| 2530 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2531 | } |
| 2532 | |
| 2533 | /** |
| 2534 | * Convenience function for retrieving a single system settings value |
| 2535 | * as a floating point number. Note that internally setting values are |
| 2536 | * always stored as strings; this function converts the string to an |
| 2537 | * float for you. The default value will be returned if the setting |
| 2538 | * is not defined or not a valid float. |
| 2539 | * |
| 2540 | * @param cr The ContentResolver to access. |
| 2541 | * @param name The name of the setting to retrieve. |
| 2542 | * @param def Value to return if the setting is not defined. |
| 2543 | * |
| 2544 | * @return The setting's current value, or 'def' if it is not defined |
| 2545 | * or not a valid float. |
| 2546 | */ |
| 2547 | public static float getFloat(ContentResolver cr, String name, float def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2548 | return getFloatForUser(cr, name, def, UserHandle.myUserId()); |
| 2549 | } |
| 2550 | |
| 2551 | /** @hide */ |
| 2552 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 2553 | int userHandle) { |
| 2554 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2555 | try { |
| 2556 | return v != null ? Float.parseFloat(v) : def; |
| 2557 | } catch (NumberFormatException e) { |
| 2558 | return def; |
| 2559 | } |
| 2560 | } |
| 2561 | |
| 2562 | /** |
| 2563 | * Convenience function for retrieving a single system settings value |
| 2564 | * as a float. Note that internally setting values are always |
| 2565 | * stored as strings; this function converts the string to a float |
| 2566 | * for you. |
| 2567 | * <p> |
| 2568 | * This version does not take a default value. If the setting has not |
| 2569 | * been set, or the string value is not a number, |
| 2570 | * it throws {@link SettingNotFoundException}. |
| 2571 | * |
| 2572 | * @param cr The ContentResolver to access. |
| 2573 | * @param name The name of the setting to retrieve. |
| 2574 | * |
| 2575 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 2576 | * name can't be found or the setting value is not a float. |
| 2577 | * |
| 2578 | * @return The setting's current value. |
| 2579 | */ |
| 2580 | public static float getFloat(ContentResolver cr, String name) |
| 2581 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2582 | return getFloatForUser(cr, name, UserHandle.myUserId()); |
| 2583 | } |
| 2584 | |
| 2585 | /** @hide */ |
| 2586 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 2587 | throws SettingNotFoundException { |
| 2588 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 2589 | if (v == null) { |
| 2590 | throw new SettingNotFoundException(name); |
| 2591 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2592 | try { |
| 2593 | return Float.parseFloat(v); |
| 2594 | } catch (NumberFormatException e) { |
| 2595 | throw new SettingNotFoundException(name); |
| 2596 | } |
| 2597 | } |
| 2598 | |
| 2599 | /** |
| 2600 | * Convenience function for updating a single settings value as a |
| 2601 | * floating point number. This will either create a new entry in the |
| 2602 | * table if the given name does not exist, or modify the value of the |
| 2603 | * existing row with that name. Note that internally setting values |
| 2604 | * are always stored as strings, so this function converts the given |
| 2605 | * value to a string before storing it. |
| 2606 | * |
| 2607 | * @param cr The ContentResolver to access. |
| 2608 | * @param name The name of the setting to modify. |
| 2609 | * @param value The new value for the setting. |
| 2610 | * @return true if the value was set, false on database errors |
| 2611 | */ |
| 2612 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2613 | return putFloatForUser(cr, name, value, UserHandle.myUserId()); |
| 2614 | } |
| 2615 | |
| 2616 | /** @hide */ |
| 2617 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 2618 | int userHandle) { |
| 2619 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2620 | } |
| 2621 | |
| 2622 | /** |
| 2623 | * Convenience function to read all of the current |
| 2624 | * configuration-related settings into a |
| 2625 | * {@link Configuration} object. |
| 2626 | * |
| 2627 | * @param cr The ContentResolver to access. |
| 2628 | * @param outConfig Where to place the configuration settings. |
| 2629 | */ |
| 2630 | public static void getConfiguration(ContentResolver cr, Configuration outConfig) { |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2631 | adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(), |
| 2632 | false /* updateSettingsIfEmpty */); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2633 | } |
| 2634 | |
| 2635 | /** @hide */ |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2636 | public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, |
| 2637 | int userHandle, boolean updateSettingsIfEmpty) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2638 | outConfig.fontScale = Settings.System.getFloatForUser( |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2639 | cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2640 | if (outConfig.fontScale < 0) { |
Alan Viverette | 04fd67c | 2016-04-12 10:54:04 -0400 | [diff] [blame] | 2641 | outConfig.fontScale = DEFAULT_FONT_SCALE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2642 | } |
Seigo Nonaka | ea906b3 | 2016-05-18 17:33:04 +0900 | [diff] [blame] | 2643 | |
| 2644 | final String localeValue = |
| 2645 | Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); |
| 2646 | if (localeValue != null) { |
| 2647 | outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); |
| 2648 | } else { |
| 2649 | // Do not update configuration with emtpy settings since we need to take over the |
| 2650 | // locale list of previous user if the settings value is empty. This happens when a |
| 2651 | // new user is created. |
| 2652 | |
| 2653 | if (updateSettingsIfEmpty) { |
| 2654 | // Make current configuration persistent. This is necessary the first time a |
| 2655 | // user log in. At the first login, the configuration settings are empty, so we |
| 2656 | // need to store the adjusted configuration as the initial settings. |
| 2657 | Settings.System.putStringForUser( |
| 2658 | cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), |
| 2659 | userHandle); |
| 2660 | } |
| 2661 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2662 | } |
| 2663 | |
| 2664 | /** |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2665 | * @hide Erase the fields in the Configuration that should be applied |
| 2666 | * by the settings. |
| 2667 | */ |
| 2668 | public static void clearConfiguration(Configuration inoutConfig) { |
| 2669 | inoutConfig.fontScale = 0; |
Seigo Nonaka | d403151 | 2016-03-17 21:18:53 +0900 | [diff] [blame] | 2670 | if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { |
Seigo Nonaka | bd5cac6 | 2016-05-13 15:11:37 +0900 | [diff] [blame] | 2671 | inoutConfig.clearLocales(); |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2672 | } |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2673 | } |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 2674 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2675 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2676 | * Convenience function to write a batch of configuration-related |
| 2677 | * settings from a {@link Configuration} object. |
| 2678 | * |
| 2679 | * @param cr The ContentResolver to access. |
| 2680 | * @param config The settings to write. |
| 2681 | * @return true if the values were set, false on database errors |
| 2682 | */ |
| 2683 | public static boolean putConfiguration(ContentResolver cr, Configuration config) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2684 | return putConfigurationForUser(cr, config, UserHandle.myUserId()); |
| 2685 | } |
| 2686 | |
| 2687 | /** @hide */ |
| 2688 | public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, |
| 2689 | int userHandle) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2690 | return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && |
| 2691 | Settings.System.putStringForUser( |
| 2692 | cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2693 | } |
| 2694 | |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2695 | /** @hide */ |
| 2696 | public static boolean hasInterestingConfigurationChanges(int changes) { |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 2697 | return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || |
| 2698 | (changes & ActivityInfo.CONFIG_LOCALE) != 0; |
Dianne Hackborn | b8b11a0 | 2010-03-10 15:53:11 -0800 | [diff] [blame] | 2699 | } |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 2700 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2701 | /** @deprecated - Do not use */ |
| 2702 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2703 | public static boolean getShowGTalkServiceStatus(ContentResolver cr) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2704 | return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2705 | } |
| 2706 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2707 | /** |
| 2708 | * @hide |
| 2709 | * @deprecated - Do not use |
| 2710 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 2711 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2712 | public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, |
| 2713 | int userHandle) { |
| 2714 | return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; |
| 2715 | } |
| 2716 | |
| 2717 | /** @deprecated - Do not use */ |
| 2718 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2719 | public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { |
Christopher Tate | c8c0838 | 2012-09-19 17:18:18 -0700 | [diff] [blame] | 2720 | setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId()); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2721 | } |
| 2722 | |
| 2723 | /** |
| 2724 | * @hide |
| 2725 | * @deprecated - Do not use |
| 2726 | */ |
| 2727 | @Deprecated |
| 2728 | public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, |
| 2729 | int userHandle) { |
| 2730 | 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] | 2731 | } |
| 2732 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2733 | private static final class DiscreteValueValidator implements Validator { |
| 2734 | private final String[] mValues; |
| 2735 | |
| 2736 | public DiscreteValueValidator(String[] values) { |
| 2737 | mValues = values; |
| 2738 | } |
| 2739 | |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 2740 | @Override |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2741 | public boolean validate(String value) { |
| 2742 | return ArrayUtils.contains(mValues, value); |
| 2743 | } |
| 2744 | } |
| 2745 | |
| 2746 | private static final class InclusiveIntegerRangeValidator implements Validator { |
| 2747 | private final int mMin; |
| 2748 | private final int mMax; |
| 2749 | |
| 2750 | public InclusiveIntegerRangeValidator(int min, int max) { |
| 2751 | mMin = min; |
| 2752 | mMax = max; |
| 2753 | } |
| 2754 | |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 2755 | @Override |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2756 | public boolean validate(String value) { |
| 2757 | try { |
| 2758 | final int intValue = Integer.parseInt(value); |
| 2759 | return intValue >= mMin && intValue <= mMax; |
| 2760 | } catch (NumberFormatException e) { |
| 2761 | return false; |
| 2762 | } |
| 2763 | } |
| 2764 | } |
| 2765 | |
| 2766 | private static final class InclusiveFloatRangeValidator implements Validator { |
| 2767 | private final float mMin; |
| 2768 | private final float mMax; |
| 2769 | |
| 2770 | public InclusiveFloatRangeValidator(float min, float max) { |
| 2771 | mMin = min; |
| 2772 | mMax = max; |
| 2773 | } |
| 2774 | |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 2775 | @Override |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2776 | public boolean validate(String value) { |
| 2777 | try { |
| 2778 | final float floatValue = Float.parseFloat(value); |
| 2779 | return floatValue >= mMin && floatValue <= mMax; |
| 2780 | } catch (NumberFormatException e) { |
| 2781 | return false; |
| 2782 | } |
| 2783 | } |
| 2784 | } |
| 2785 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2786 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2787 | * @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] | 2788 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2789 | @Deprecated |
| 2790 | 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] | 2791 | |
| 2792 | /** |
| 2793 | * What happens when the user presses the end call button if they're not |
| 2794 | * on a call.<br/> |
| 2795 | * <b>Values:</b><br/> |
| 2796 | * 0 - The end button does nothing.<br/> |
| 2797 | * 1 - The end button goes to the home screen.<br/> |
| 2798 | * 2 - The end button puts the device to sleep and locks the keyguard.<br/> |
| 2799 | * 3 - The end button goes to the home screen. If the user is already on the |
| 2800 | * home screen, it puts the device to sleep. |
| 2801 | */ |
| 2802 | public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; |
| 2803 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2804 | private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = |
| 2805 | new InclusiveIntegerRangeValidator(0, 3); |
| 2806 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2807 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 2808 | * END_BUTTON_BEHAVIOR value for "go home". |
| 2809 | * @hide |
| 2810 | */ |
| 2811 | public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; |
| 2812 | |
| 2813 | /** |
| 2814 | * END_BUTTON_BEHAVIOR value for "go to sleep". |
| 2815 | * @hide |
| 2816 | */ |
| 2817 | public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; |
| 2818 | |
| 2819 | /** |
| 2820 | * END_BUTTON_BEHAVIOR default value. |
| 2821 | * @hide |
| 2822 | */ |
| 2823 | public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; |
| 2824 | |
| 2825 | /** |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2826 | * Is advanced settings mode turned on. 0 == no, 1 == yes |
| 2827 | * @hide |
| 2828 | */ |
| 2829 | public static final String ADVANCED_SETTINGS = "advanced_settings"; |
| 2830 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2831 | private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator; |
| 2832 | |
Joe Onorato | 9cdffa1 | 2011-04-06 18:27:27 -0700 | [diff] [blame] | 2833 | /** |
| 2834 | * ADVANCED_SETTINGS default value. |
| 2835 | * @hide |
| 2836 | */ |
| 2837 | public static final int ADVANCED_SETTINGS_DEFAULT = 0; |
| 2838 | |
| 2839 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2840 | * @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] | 2841 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2842 | @Deprecated |
| 2843 | 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] | 2844 | |
| 2845 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2846 | * @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] | 2847 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2848 | @Deprecated |
| 2849 | public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2850 | |
| 2851 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2852 | * @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] | 2853 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2854 | @Deprecated |
| 2855 | public static final String RADIO_WIFI = Global.RADIO_WIFI; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2856 | |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2857 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2858 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead |
Robert Greenwalt | 8588e47 | 2011-11-08 10:12:25 -0800 | [diff] [blame] | 2859 | * {@hide} |
| 2860 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2861 | @Deprecated |
| 2862 | public static final String RADIO_WIMAX = Global.RADIO_WIMAX; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2863 | |
| 2864 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2865 | * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2866 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2867 | @Deprecated |
| 2868 | public static final String RADIO_CELL = Global.RADIO_CELL; |
Nick Pelly | 8d32a01 | 2011-08-09 07:03:49 -0700 | [diff] [blame] | 2869 | |
| 2870 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2871 | * @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] | 2872 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2873 | @Deprecated |
| 2874 | public static final String RADIO_NFC = Global.RADIO_NFC; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2875 | |
| 2876 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2877 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead |
| 2878 | */ |
| 2879 | @Deprecated |
| 2880 | public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; |
| 2881 | |
| 2882 | /** |
| 2883 | * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2884 | * |
| 2885 | * {@hide} |
| 2886 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2887 | @Deprecated |
| 2888 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = |
| 2889 | Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; |
Mike Lockwood | bd5ddf0 | 2009-07-29 21:37:14 -0700 | [diff] [blame] | 2890 | |
| 2891 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2892 | * @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] | 2893 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2894 | @Deprecated |
| 2895 | 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] | 2896 | |
| 2897 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2898 | * @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] | 2899 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2900 | @Deprecated |
| 2901 | 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] | 2902 | |
| 2903 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2904 | * @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] | 2905 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2906 | @Deprecated |
| 2907 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = |
| 2908 | Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 2909 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2910 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2911 | * @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] | 2912 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 2913 | @Deprecated |
| 2914 | 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] | 2915 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 2916 | /** |
| 2917 | * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead |
| 2918 | */ |
| 2919 | @Deprecated |
| 2920 | public static final String MODE_RINGER = Global.MODE_RINGER; |
| 2921 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2922 | /** |
| 2923 | * Whether to use static IP and other static network attributes. |
| 2924 | * <p> |
| 2925 | * Set to 1 for true and 0 for false. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2926 | * |
| 2927 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2928 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2929 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2930 | public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; |
| 2931 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2932 | private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator; |
| 2933 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2934 | /** |
| 2935 | * The static IP address. |
| 2936 | * <p> |
| 2937 | * Example: "192.168.1.51" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2938 | * |
| 2939 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2940 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2941 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2942 | public static final String WIFI_STATIC_IP = "wifi_static_ip"; |
| 2943 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2944 | private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator; |
| 2945 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2946 | /** |
| 2947 | * If using static IP, the gateway's IP address. |
| 2948 | * <p> |
| 2949 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2950 | * |
| 2951 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2952 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2953 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2954 | public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; |
| 2955 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2956 | private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator; |
| 2957 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2958 | /** |
| 2959 | * If using static IP, the net mask. |
| 2960 | * <p> |
| 2961 | * Example: "255.255.255.0" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2962 | * |
| 2963 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2964 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2965 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2966 | public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; |
| 2967 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2968 | private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator; |
| 2969 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2970 | /** |
| 2971 | * If using static IP, the primary DNS's IP address. |
| 2972 | * <p> |
| 2973 | * Example: "192.168.1.1" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2974 | * |
| 2975 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2976 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2977 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2978 | public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; |
| 2979 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2980 | private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator; |
| 2981 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2982 | /** |
| 2983 | * If using static IP, the secondary DNS's IP address. |
| 2984 | * <p> |
| 2985 | * Example: "192.168.1.2" |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2986 | * |
| 2987 | * @deprecated Use {@link WifiManager} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2988 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 2989 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2990 | public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; |
| 2991 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 2992 | private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2993 | |
| 2994 | /** |
| 2995 | * Determines whether remote devices may discover and/or connect to |
| 2996 | * this device. |
| 2997 | * <P>Type: INT</P> |
| 2998 | * 2 -- discoverable and connectable |
| 2999 | * 1 -- connectable but not discoverable |
| 3000 | * 0 -- neither connectable nor discoverable |
| 3001 | */ |
| 3002 | public static final String BLUETOOTH_DISCOVERABILITY = |
| 3003 | "bluetooth_discoverability"; |
| 3004 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3005 | private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = |
| 3006 | new InclusiveIntegerRangeValidator(0, 2); |
| 3007 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3008 | /** |
| 3009 | * Bluetooth discoverability timeout. If this value is nonzero, then |
| 3010 | * Bluetooth becomes discoverable for a certain number of seconds, |
| 3011 | * after which is becomes simply connectable. The value is in seconds. |
| 3012 | */ |
| 3013 | public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = |
| 3014 | "bluetooth_discoverability_timeout"; |
| 3015 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3016 | private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = |
| 3017 | sNonNegativeIntegerValidator; |
| 3018 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3019 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3020 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} |
| 3021 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3022 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3023 | @Deprecated |
| 3024 | 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] | 3025 | |
| 3026 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3027 | * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} |
| 3028 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3029 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3030 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3031 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 3032 | |
| 3033 | /** |
Jaikumar Ganesh | 545e670 | 2010-06-04 10:23:03 -0700 | [diff] [blame] | 3034 | * @deprecated Use |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3035 | * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} |
| 3036 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3037 | */ |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 3038 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3039 | public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = |
| 3040 | "lock_pattern_tactile_feedback_enabled"; |
| 3041 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3042 | /** |
| 3043 | * A formatted string of the next alarm that is set, or the empty string |
| 3044 | * if there is no alarm set. |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3045 | * |
| 3046 | * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3047 | */ |
Adrian Roos | c42a1e1 | 2014-07-07 23:35:53 +0200 | [diff] [blame] | 3048 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3049 | public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; |
| 3050 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3051 | private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { |
| 3052 | private static final int MAX_LENGTH = 1000; |
Svetoslav | 1b71ea9 | 2015-02-17 18:20:29 -0800 | [diff] [blame] | 3053 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3054 | @Override |
| 3055 | public boolean validate(String value) { |
| 3056 | // TODO: No idea what the correct format is. |
Svetoslav | 64d6e9c | 2015-02-12 11:30:36 -0800 | [diff] [blame] | 3057 | return value == null || value.length() < MAX_LENGTH; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3058 | } |
| 3059 | }; |
| 3060 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3061 | /** |
| 3062 | * Scaling factor for fonts, float. |
| 3063 | */ |
| 3064 | public static final String FONT_SCALE = "font_scale"; |
| 3065 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3066 | private static final Validator FONT_SCALE_VALIDATOR = new Validator() { |
| 3067 | @Override |
| 3068 | public boolean validate(String value) { |
| 3069 | try { |
| 3070 | return Float.parseFloat(value) >= 0; |
| 3071 | } catch (NumberFormatException e) { |
| 3072 | return false; |
| 3073 | } |
| 3074 | } |
| 3075 | }; |
| 3076 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3077 | /** |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3078 | * The serialized system locale value. |
| 3079 | * |
| 3080 | * Do not use this value directory. |
Yohei Yukawa | 23cbe85 | 2016-05-17 16:42:58 -0700 | [diff] [blame] | 3081 | * To get system locale, use {@link LocaleList#getDefault} instead. |
Seigo Nonaka | bd5cbdd | 2016-01-25 19:40:28 +0900 | [diff] [blame] | 3082 | * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} |
| 3083 | * instead. |
| 3084 | * @hide |
| 3085 | */ |
| 3086 | public static final String SYSTEM_LOCALES = "system_locales"; |
| 3087 | |
| 3088 | |
| 3089 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3090 | * Name of an application package to be debugged. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3091 | * |
| 3092 | * @deprecated Use {@link Global#DEBUG_APP} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3093 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3094 | @Deprecated |
| 3095 | public static final String DEBUG_APP = Global.DEBUG_APP; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3096 | |
| 3097 | /** |
| 3098 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 3099 | * starting user code. If 0, it will run normally. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3100 | * |
| 3101 | * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3102 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3103 | @Deprecated |
| 3104 | 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] | 3105 | |
| 3106 | /** |
| 3107 | * Whether or not to dim the screen. 0=no 1=yes |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3108 | * @deprecated This setting is no longer used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3109 | */ |
Jeff Brown | 9630704 | 2012-07-27 15:51:34 -0700 | [diff] [blame] | 3110 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3111 | public static final String DIM_SCREEN = "dim_screen"; |
| 3112 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3113 | private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator; |
| 3114 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3115 | /** |
Christine Franks | 8ad7149 | 2017-10-24 19:04:22 -0700 | [diff] [blame] | 3116 | * The display color mode. |
| 3117 | * @hide |
| 3118 | */ |
| 3119 | public static final String DISPLAY_COLOR_MODE = "display_color_mode"; |
| 3120 | |
| 3121 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 3122 | * The amount of time in milliseconds before the device goes to sleep or begins |
| 3123 | * to dream after a period of inactivity. This value is also known as the |
| 3124 | * user activity timeout period since the screen isn't necessarily turned off |
| 3125 | * when it expires. |
yuemingw | 0de748d | 2017-11-15 19:22:27 +0000 | [diff] [blame] | 3126 | * |
| 3127 | * <p> |
| 3128 | * This value is bounded by maximum timeout set by |
| 3129 | * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3130 | */ |
| 3131 | public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; |
| 3132 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3133 | private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator; |
| 3134 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3135 | /** |
| 3136 | * The screen backlight brightness between 0 and 255. |
| 3137 | */ |
| 3138 | public static final String SCREEN_BRIGHTNESS = "screen_brightness"; |
| 3139 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3140 | private static final Validator SCREEN_BRIGHTNESS_VALIDATOR = |
| 3141 | new InclusiveIntegerRangeValidator(0, 255); |
| 3142 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3143 | /** |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 3144 | * The screen backlight brightness between 0 and 255. |
| 3145 | * @hide |
| 3146 | */ |
| 3147 | public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; |
| 3148 | |
| 3149 | private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = |
| 3150 | new InclusiveIntegerRangeValidator(0, 255); |
| 3151 | |
| 3152 | /** |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3153 | * Control whether to enable automatic brightness mode. |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3154 | */ |
| 3155 | public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; |
| 3156 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3157 | private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator; |
| 3158 | |
Dan Murphy | 951764b | 2009-08-27 14:59:03 -0500 | [diff] [blame] | 3159 | /** |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3160 | * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) |
| 3161 | * or less (<0.0 >-1.0) bright. |
Dianne Hackborn | 518a3d8 | 2012-05-09 16:30:49 -0700 | [diff] [blame] | 3162 | * @hide |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3163 | */ |
| 3164 | public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; |
| 3165 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3166 | private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = |
| 3167 | new InclusiveFloatRangeValidator(-1, 1); |
| 3168 | |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 3169 | /** |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3170 | * SCREEN_BRIGHTNESS_MODE value for manual mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3171 | */ |
| 3172 | public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; |
| 3173 | |
| 3174 | /** |
Scott Main | 52bfc24 | 2012-02-09 10:09:14 -0800 | [diff] [blame] | 3175 | * SCREEN_BRIGHTNESS_MODE value for automatic mode. |
Mike Lockwood | dc3494e | 2009-10-14 21:17:09 -0700 | [diff] [blame] | 3176 | */ |
| 3177 | public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; |
| 3178 | |
| 3179 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | * Control whether the process CPU usage meter should be shown. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3181 | * |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 3182 | * @deprecated This functionality is no longer available as of |
| 3183 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3184 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3185 | @Deprecated |
| 3186 | public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3187 | |
| 3188 | /** |
| 3189 | * If 1, the activity manager will aggressively finish activities and |
| 3190 | * processes as soon as they are no longer needed. If 0, the normal |
| 3191 | * extended lifetime is used. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3192 | * |
| 3193 | * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3194 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3195 | @Deprecated |
| 3196 | 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] | 3197 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3198 | /** |
| 3199 | * Determines which streams are affected by ringer mode changes. The |
| 3200 | * stream type's bit should be set to 1 if it should be muted when going |
| 3201 | * into an inaudible ringer mode. |
| 3202 | */ |
| 3203 | public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; |
| 3204 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3205 | private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = |
| 3206 | sNonNegativeIntegerValidator; |
| 3207 | |
| 3208 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | * Determines which streams are affected by mute. The |
| 3210 | * stream type's bit should be set to 1 if it should be muted when a mute request |
| 3211 | * is received. |
| 3212 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3213 | public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; |
| 3214 | |
| 3215 | private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = |
| 3216 | sNonNegativeIntegerValidator; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3217 | |
| 3218 | /** |
| 3219 | * Whether vibrate is on for different events. This is used internally, |
| 3220 | * changing this value will not change the vibrate. See AudioManager. |
| 3221 | */ |
| 3222 | public static final String VIBRATE_ON = "vibrate_on"; |
| 3223 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3224 | private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator; |
| 3225 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3226 | /** |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3227 | * If 1, redirects the system vibrator to all currently attached input devices |
| 3228 | * that support vibration. If there are no such input devices, then the system |
| 3229 | * vibrator is used instead. |
| 3230 | * If 0, does not register the system vibrator. |
| 3231 | * |
| 3232 | * This setting is mainly intended to provide a compatibility mechanism for |
| 3233 | * applications that only know about the system vibrator and do not use the |
| 3234 | * input device vibrator API. |
| 3235 | * |
| 3236 | * @hide |
| 3237 | */ |
| 3238 | public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; |
| 3239 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3240 | private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator; |
| 3241 | |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 3242 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3243 | * Ringer volume. This is used internally, changing this value will not |
| 3244 | * change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3245 | * |
| 3246 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3247 | */ |
| 3248 | public static final String VOLUME_RING = "volume_ring"; |
| 3249 | |
| 3250 | /** |
| 3251 | * System/notifications volume. This is used internally, changing this |
| 3252 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3253 | * |
| 3254 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3255 | */ |
| 3256 | public static final String VOLUME_SYSTEM = "volume_system"; |
| 3257 | |
| 3258 | /** |
| 3259 | * Voice call volume. This is used internally, changing this value will |
| 3260 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3261 | * |
| 3262 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3263 | */ |
| 3264 | public static final String VOLUME_VOICE = "volume_voice"; |
| 3265 | |
| 3266 | /** |
| 3267 | * Music/media/gaming volume. This is used internally, changing this |
| 3268 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3269 | * |
| 3270 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3271 | */ |
| 3272 | public static final String VOLUME_MUSIC = "volume_music"; |
| 3273 | |
| 3274 | /** |
| 3275 | * Alarm volume. This is used internally, changing this |
| 3276 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3277 | * |
| 3278 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3279 | */ |
| 3280 | public static final String VOLUME_ALARM = "volume_alarm"; |
| 3281 | |
| 3282 | /** |
| 3283 | * Notification volume. This is used internally, changing this |
| 3284 | * value will not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3285 | * |
| 3286 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3287 | */ |
| 3288 | public static final String VOLUME_NOTIFICATION = "volume_notification"; |
| 3289 | |
| 3290 | /** |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3291 | * Bluetooth Headset volume. This is used internally, changing this value will |
| 3292 | * not change the volume. See AudioManager. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3293 | * |
| 3294 | * @removed Not used by anything since API 2. |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3295 | */ |
| 3296 | public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; |
| 3297 | |
| 3298 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3299 | * @hide |
| 3300 | * Acessibility volume. This is used internally, changing this |
| 3301 | * value will not change the volume. |
| 3302 | */ |
| 3303 | public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; |
| 3304 | |
| 3305 | /** |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3306 | * Master volume (float in the range 0.0f to 1.0f). |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3307 | * |
Mike Lockwood | 8517e46 | 2011-10-25 14:47:19 -0400 | [diff] [blame] | 3308 | * @hide |
| 3309 | */ |
| 3310 | public static final String VOLUME_MASTER = "volume_master"; |
| 3311 | |
| 3312 | /** |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 3313 | * Master mono (int 1 = mono, 0 = normal). |
| 3314 | * |
| 3315 | * @hide |
| 3316 | */ |
| 3317 | public static final String MASTER_MONO = "master_mono"; |
| 3318 | |
| 3319 | private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator; |
| 3320 | |
| 3321 | /** |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3322 | * Whether the notifications should use the ring volume (value of 1) or |
| 3323 | * a separate notification volume (value of 0). In most cases, users |
| 3324 | * will have this enabled so the notification and ringer volumes will be |
| 3325 | * the same. However, power users can disable this and use the separate |
| 3326 | * notification volume control. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3327 | * <p> |
Justin Koh | 57978ed | 2012-04-03 17:37:58 -0700 | [diff] [blame] | 3328 | * Note: This is a one-off setting that will be removed in the future |
| 3329 | * when there is profile support. For this reason, it is kept hidden |
| 3330 | * from the public APIs. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3331 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3332 | * @hide |
Amith Yamasani | 42722bf | 2011-07-22 10:34:27 -0700 | [diff] [blame] | 3333 | * @deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3334 | */ |
Gilles Debunne | e90bed1 | 2011-08-30 14:28:27 -0700 | [diff] [blame] | 3335 | @Deprecated |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3336 | public static final String NOTIFICATIONS_USE_RING_VOLUME = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3337 | "notifications_use_ring_volume"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3338 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3339 | private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator; |
| 3340 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3341 | /** |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3342 | * Whether silent mode should allow vibration feedback. This is used |
| 3343 | * internally in AudioService and the Sound settings activity to |
| 3344 | * coordinate decoupling of vibrate and silent modes. This setting |
| 3345 | * will likely be removed in a future release with support for |
| 3346 | * audio/vibe feedback profiles. |
| 3347 | * |
Eric Laurent | bffc3d1 | 2012-05-07 17:43:49 -0700 | [diff] [blame] | 3348 | * Not used anymore. On devices with vibrator, the user explicitly selects |
| 3349 | * silent or vibrate mode. |
| 3350 | * Kept for use by legacy database upgrade code in DatabaseHelper. |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3351 | * @hide |
| 3352 | */ |
| 3353 | public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; |
| 3354 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3355 | private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator; |
| 3356 | |
Daniel Sandler | 6329bf7 | 2010-02-26 15:17:44 -0500 | [diff] [blame] | 3357 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3358 | * The mapping of stream type (integer) to its setting. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3359 | * |
| 3360 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3361 | */ |
| 3362 | public static final String[] VOLUME_SETTINGS = { |
| 3363 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
Eric Laurent | 484d288 | 2009-12-08 09:05:45 -0800 | [diff] [blame] | 3364 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3365 | }; |
| 3366 | |
| 3367 | /** |
Jean-Michel Trivi | a53b705 | 2017-04-12 18:27:01 -0700 | [diff] [blame] | 3368 | * @hide |
| 3369 | * The mapping of stream type (integer) to its setting. |
| 3370 | * Unlike the VOLUME_SETTINGS array, this one contains as many entries as |
| 3371 | * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes |
| 3372 | * are never persisted. |
| 3373 | */ |
| 3374 | public static final String[] VOLUME_SETTINGS_INT = { |
| 3375 | VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, |
| 3376 | VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, |
| 3377 | "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, |
| 3378 | "" /*STREAM_DTMF, no setting for this stream*/, |
| 3379 | "" /*STREAM_TTS, no setting for this stream*/, |
| 3380 | VOLUME_ACCESSIBILITY |
| 3381 | }; |
| 3382 | |
| 3383 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3384 | * Appended to various volume related settings to record the previous |
| 3385 | * values before they the settings were affected by a silent/vibrate |
| 3386 | * ringer mode change. |
Svetoslav | dbbeeb3 | 2015-02-18 19:16:25 -0800 | [diff] [blame] | 3387 | * |
| 3388 | * @removed Not used by anything since API 2. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3389 | */ |
| 3390 | public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; |
| 3391 | |
| 3392 | /** |
| 3393 | * Persistent store for the system-wide default ringtone URI. |
| 3394 | * <p> |
| 3395 | * If you need to play the default ringtone at any given time, it is recommended |
| 3396 | * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve |
| 3397 | * to the set default ringtone at the time of playing. |
| 3398 | * |
| 3399 | * @see #DEFAULT_RINGTONE_URI |
| 3400 | */ |
| 3401 | public static final String RINGTONE = "ringtone"; |
| 3402 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3403 | private static final Validator RINGTONE_VALIDATOR = sUriValidator; |
| 3404 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3405 | /** |
| 3406 | * A {@link Uri} that will point to the current default ringtone at any |
| 3407 | * given time. |
| 3408 | * <p> |
| 3409 | * If the current default ringtone is in the DRM provider and the caller |
| 3410 | * does not have permission, the exception will be a |
| 3411 | * FileNotFoundException. |
| 3412 | */ |
| 3413 | public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); |
| 3414 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3415 | /** {@hide} */ |
| 3416 | public static final String RINGTONE_CACHE = "ringtone_cache"; |
| 3417 | /** {@hide} */ |
| 3418 | public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); |
| 3419 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3420 | /** |
| 3421 | * Persistent store for the system-wide default notification sound. |
| 3422 | * |
| 3423 | * @see #RINGTONE |
| 3424 | * @see #DEFAULT_NOTIFICATION_URI |
| 3425 | */ |
| 3426 | public static final String NOTIFICATION_SOUND = "notification_sound"; |
| 3427 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3428 | private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator; |
| 3429 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3430 | /** |
| 3431 | * A {@link Uri} that will point to the current default notification |
| 3432 | * sound at any given time. |
| 3433 | * |
| 3434 | * @see #DEFAULT_RINGTONE_URI |
| 3435 | */ |
| 3436 | public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); |
| 3437 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3438 | /** {@hide} */ |
| 3439 | public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; |
| 3440 | /** {@hide} */ |
| 3441 | public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); |
| 3442 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3443 | /** |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3444 | * Persistent store for the system-wide default alarm alert. |
| 3445 | * |
| 3446 | * @see #RINGTONE |
| 3447 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3448 | */ |
| 3449 | public static final String ALARM_ALERT = "alarm_alert"; |
| 3450 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3451 | private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator; |
| 3452 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3453 | /** |
| 3454 | * A {@link Uri} that will point to the current default alarm alert at |
| 3455 | * any given time. |
| 3456 | * |
| 3457 | * @see #DEFAULT_ALARM_ALERT_URI |
| 3458 | */ |
| 3459 | public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); |
| 3460 | |
Jeff Sharkey | 413573a | 2016-02-22 17:52:45 -0700 | [diff] [blame] | 3461 | /** {@hide} */ |
| 3462 | public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; |
| 3463 | /** {@hide} */ |
| 3464 | public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); |
| 3465 | |
Patrick Scott | 3156bb00 | 2009-04-13 09:57:38 -0700 | [diff] [blame] | 3466 | /** |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3467 | * Persistent store for the system default media button event receiver. |
| 3468 | * |
| 3469 | * @hide |
| 3470 | */ |
| 3471 | public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; |
| 3472 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3473 | private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() { |
| 3474 | @Override |
| 3475 | public boolean validate(String value) { |
| 3476 | try { |
| 3477 | ComponentName.unflattenFromString(value); |
| 3478 | return true; |
| 3479 | } catch (NullPointerException e) { |
| 3480 | return false; |
| 3481 | } |
| 3482 | } |
| 3483 | }; |
| 3484 | |
Jean-Michel Trivi | d589fea | 2011-04-15 11:28:10 -0700 | [diff] [blame] | 3485 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3486 | * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off |
| 3487 | */ |
| 3488 | public static final String TEXT_AUTO_REPLACE = "auto_replace"; |
| 3489 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3490 | private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator; |
| 3491 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3492 | /** |
| 3493 | * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off |
| 3494 | */ |
| 3495 | public static final String TEXT_AUTO_CAPS = "auto_caps"; |
| 3496 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3497 | private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator; |
| 3498 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3499 | /** |
| 3500 | * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This |
| 3501 | * feature converts two spaces to a "." and space. |
| 3502 | */ |
| 3503 | public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3504 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3505 | private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator; |
| 3506 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3507 | /** |
| 3508 | * Setting to showing password characters in text editors. 1 = On, 0 = Off |
| 3509 | */ |
| 3510 | public static final String TEXT_SHOW_PASSWORD = "show_password"; |
| 3511 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3512 | private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator; |
| 3513 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3514 | public static final String SHOW_GTALK_SERVICE_STATUS = |
| 3515 | "SHOW_GTALK_SERVICE_STATUS"; |
| 3516 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3517 | private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator; |
| 3518 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3519 | /** |
| 3520 | * Name of activity to use for wallpaper on the home screen. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3521 | * |
| 3522 | * @deprecated Use {@link WallpaperManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3523 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3524 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3525 | public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; |
| 3526 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3527 | private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { |
| 3528 | private static final int MAX_LENGTH = 1000; |
| 3529 | |
| 3530 | @Override |
| 3531 | public boolean validate(String value) { |
| 3532 | if (value != null && value.length() > MAX_LENGTH) { |
| 3533 | return false; |
| 3534 | } |
| 3535 | return ComponentName.unflattenFromString(value) != null; |
| 3536 | } |
| 3537 | }; |
| 3538 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3539 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3540 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} |
| 3541 | * instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3542 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3543 | @Deprecated |
| 3544 | public static final String AUTO_TIME = Global.AUTO_TIME; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3545 | |
| 3546 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3547 | * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} |
| 3548 | * instead |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3549 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3550 | @Deprecated |
| 3551 | public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; |
Amith Yamasani | ad450be | 2010-09-16 16:47:00 -0700 | [diff] [blame] | 3552 | |
| 3553 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3554 | * Display times as 12 or 24 hours |
| 3555 | * 12 |
| 3556 | * 24 |
| 3557 | */ |
| 3558 | public static final String TIME_12_24 = "time_12_24"; |
| 3559 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3560 | /** @hide */ |
| 3561 | public static final Validator TIME_12_24_VALIDATOR = |
Joachim Sauer | 2164608 | 2017-06-01 11:17:58 +0100 | [diff] [blame] | 3562 | new DiscreteValueValidator(new String[] {"12", "24", null}); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3563 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3564 | /** |
| 3565 | * Date format string |
| 3566 | * mm/dd/yyyy |
| 3567 | * dd/mm/yyyy |
| 3568 | * yyyy/mm/dd |
| 3569 | */ |
| 3570 | public static final String DATE_FORMAT = "date_format"; |
| 3571 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3572 | /** @hide */ |
| 3573 | public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { |
| 3574 | @Override |
| 3575 | public boolean validate(String value) { |
| 3576 | try { |
| 3577 | new SimpleDateFormat(value); |
| 3578 | return true; |
| 3579 | } catch (IllegalArgumentException e) { |
| 3580 | return false; |
| 3581 | } |
| 3582 | } |
| 3583 | }; |
| 3584 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3585 | /** |
| 3586 | * Whether the setup wizard has been run before (on first boot), or if |
| 3587 | * it still needs to be run. |
| 3588 | * |
| 3589 | * nonzero = it has been run in the past |
| 3590 | * 0 = it has not been run in the past |
| 3591 | */ |
| 3592 | public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; |
| 3593 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3594 | /** @hide */ |
| 3595 | public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator; |
| 3596 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3597 | /** |
| 3598 | * Scaling factor for normal window animations. Setting to 0 will disable window |
| 3599 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3600 | * |
| 3601 | * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3602 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3603 | @Deprecated |
| 3604 | 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] | 3605 | |
| 3606 | /** |
| 3607 | * Scaling factor for activity transition animations. Setting to 0 will disable window |
| 3608 | * animations. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3609 | * |
| 3610 | * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3611 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3612 | @Deprecated |
| 3613 | 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] | 3614 | |
| 3615 | /** |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3616 | * Scaling factor for Animator-based animations. This affects both the start delay and |
| 3617 | * duration of all such animations. Setting to 0 will cause animations to end immediately. |
| 3618 | * The default value is 1. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3619 | * |
| 3620 | * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead |
Chet Haase | c38fa1f | 2012-02-01 16:37:46 -0800 | [diff] [blame] | 3621 | */ |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 3622 | @Deprecated |
| 3623 | 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] | 3624 | |
| 3625 | /** |
| 3626 | * Control whether the accelerometer will be used to change screen |
| 3627 | * orientation. If 0, it will not be used unless explicitly requested |
| 3628 | * by the application; if 1, it will be used by default unless explicitly |
| 3629 | * disabled by the application. |
| 3630 | */ |
| 3631 | public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; |
| 3632 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3633 | /** @hide */ |
| 3634 | public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator; |
| 3635 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3636 | /** |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3637 | * Default screen rotation when no other policy applies. |
| 3638 | * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a |
| 3639 | * preference, this rotation value will be used. Must be one of the |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 3640 | * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3641 | * |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3642 | * @see android.view.Display#getRotation |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3643 | */ |
| 3644 | public static final String USER_ROTATION = "user_rotation"; |
| 3645 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3646 | /** @hide */ |
| 3647 | public static final Validator USER_ROTATION_VALIDATOR = |
| 3648 | new InclusiveIntegerRangeValidator(0, 3); |
| 3649 | |
Daniel Sandler | b73617d | 2010-08-17 00:41:00 -0400 | [diff] [blame] | 3650 | /** |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3651 | * Control whether the rotation lock toggle in the System UI should be hidden. |
| 3652 | * Typically this is done for accessibility purposes to make it harder for |
| 3653 | * the user to accidentally toggle the rotation lock while the display rotation |
| 3654 | * has been locked for accessibility. |
| 3655 | * |
| 3656 | * If 0, then rotation lock toggle is not hidden for accessibility (although it may be |
| 3657 | * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. |
| 3658 | * |
| 3659 | * @hide |
| 3660 | */ |
| 3661 | public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = |
| 3662 | "hide_rotation_lock_toggle_for_accessibility"; |
| 3663 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3664 | /** @hide */ |
| 3665 | public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = |
| 3666 | sBooleanValidator; |
| 3667 | |
Jeff Brown | 207673cd | 2012-06-05 17:47:11 -0700 | [diff] [blame] | 3668 | /** |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3669 | * Whether the phone vibrates when it is ringing due to an incoming call. This will |
| 3670 | * be used by Phone and Setting apps; it shouldn't affect other apps. |
| 3671 | * The value is boolean (1 or 0). |
| 3672 | * |
| 3673 | * Note: this is not same as "vibrate on ring", which had been available until ICS. |
| 3674 | * It was about AudioManager's setting and thus affected all the applications which |
| 3675 | * relied on the setting, while this is purely about the vibration setting for incoming |
| 3676 | * calls. |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3677 | */ |
| 3678 | public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; |
| 3679 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3680 | /** @hide */ |
| 3681 | public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator; |
| 3682 | |
Daisuke Miyakawa | 3c60eeb | 2012-05-08 12:08:25 -0700 | [diff] [blame] | 3683 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3684 | * Whether the audible DTMF tones are played by the dialer when dialing. The value is |
| 3685 | * boolean (1 or 0). |
| 3686 | */ |
| 3687 | public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; |
| 3688 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3689 | /** @hide */ |
| 3690 | public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator; |
| 3691 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3693 | * CDMA only settings |
| 3694 | * DTMF tone type played by the dialer when dialing. |
| 3695 | * 0 = Normal |
| 3696 | * 1 = Long |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3697 | */ |
| 3698 | public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; |
| 3699 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3700 | /** @hide */ |
| 3701 | public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator; |
| 3702 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3703 | /** |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3704 | * Whether the hearing aid is enabled. The value is |
| 3705 | * boolean (1 or 0). |
| 3706 | * @hide |
| 3707 | */ |
| 3708 | public static final String HEARING_AID = "hearing_aid"; |
| 3709 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3710 | /** @hide */ |
| 3711 | public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator; |
| 3712 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3713 | /** |
| 3714 | * CDMA only settings |
| 3715 | * TTY Mode |
| 3716 | * 0 = OFF |
| 3717 | * 1 = FULL |
| 3718 | * 2 = VCO |
| 3719 | * 3 = HCO |
| 3720 | * @hide |
| 3721 | */ |
| 3722 | public static final String TTY_MODE = "tty_mode"; |
| 3723 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3724 | /** @hide */ |
| 3725 | public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3); |
| 3726 | |
David Krause | d0f6715 | 2009-06-13 18:01:13 -0500 | [diff] [blame] | 3727 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3728 | * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is |
| 3729 | * boolean (1 or 0). |
| 3730 | */ |
| 3731 | public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3732 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3733 | /** @hide */ |
| 3734 | public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator; |
| 3735 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3736 | /** |
| 3737 | * Whether the haptic feedback (long presses, ...) are enabled. The value is |
| 3738 | * boolean (1 or 0). |
| 3739 | */ |
| 3740 | public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 3741 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3742 | /** @hide */ |
| 3743 | public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator; |
| 3744 | |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3745 | /** |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3746 | * @deprecated Each application that shows web suggestions should have its own |
| 3747 | * setting for this. |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3748 | */ |
Bjorn Bringert | 24abb66 | 2010-09-21 12:21:18 +0100 | [diff] [blame] | 3749 | @Deprecated |
Mike LeBeau | 48603e7 | 2009-06-05 00:27:00 +0100 | [diff] [blame] | 3750 | public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 3751 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3752 | /** @hide */ |
| 3753 | public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator; |
| 3754 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 3755 | /** |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3756 | * Whether the notification LED should repeatedly flash when a notification is |
| 3757 | * pending. The value is boolean (1 or 0). |
| 3758 | * @hide |
| 3759 | */ |
| 3760 | public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; |
| 3761 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3762 | /** @hide */ |
| 3763 | public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator; |
| 3764 | |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 3765 | /** |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3766 | * Show pointer location on screen? |
| 3767 | * 0 = no |
| 3768 | * 1 = yes |
| 3769 | * @hide |
| 3770 | */ |
| 3771 | public static final String POINTER_LOCATION = "pointer_location"; |
| 3772 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3773 | /** @hide */ |
| 3774 | public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator; |
| 3775 | |
Dianne Hackborn | 90d2db3 | 2010-02-11 22:19:06 -0800 | [diff] [blame] | 3776 | /** |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3777 | * Show touch positions on screen? |
| 3778 | * 0 = no |
| 3779 | * 1 = yes |
| 3780 | * @hide |
| 3781 | */ |
| 3782 | public static final String SHOW_TOUCHES = "show_touches"; |
| 3783 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3784 | /** @hide */ |
| 3785 | public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator; |
| 3786 | |
Jeff Brown | daf4a12 | 2011-08-26 17:14:14 -0700 | [diff] [blame] | 3787 | /** |
Dianne Hackborn | 16ec080 | 2014-08-15 18:32:33 -0700 | [diff] [blame] | 3788 | * Log raw orientation data from |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 3789 | * {@link com.android.server.policy.WindowOrientationListener} for use with the |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3790 | * orientationplot.py tool. |
| 3791 | * 0 = no |
| 3792 | * 1 = yes |
| 3793 | * @hide |
| 3794 | */ |
| 3795 | public static final String WINDOW_ORIENTATION_LISTENER_LOG = |
| 3796 | "window_orientation_listener_log"; |
| 3797 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3798 | /** @hide */ |
| 3799 | public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator; |
| 3800 | |
Jeff Brown | 4519f07 | 2011-01-23 13:16:01 -0800 | [diff] [blame] | 3801 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3802 | * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} |
| 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 POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; |
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#DOCK_SOUNDS_ENABLED} |
| 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 DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3816 | |
| 3817 | /** |
| 3818 | * Whether to play sounds when the keyguard is shown and dismissed. |
| 3819 | * @hide |
| 3820 | */ |
| 3821 | public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; |
| 3822 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3823 | /** @hide */ |
| 3824 | public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator; |
| 3825 | |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3826 | /** |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3827 | * Whether the lockscreen should be completely disabled. |
| 3828 | * @hide |
| 3829 | */ |
| 3830 | public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; |
| 3831 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3832 | /** @hide */ |
| 3833 | public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator; |
| 3834 | |
Mike Lockwood | 7bef739 | 2011-10-20 16:51:53 -0400 | [diff] [blame] | 3835 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3836 | * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} |
| 3837 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3838 | * @hide |
| 3839 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3840 | @Deprecated |
| 3841 | public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3842 | |
| 3843 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3844 | * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} |
| 3845 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3846 | * @hide |
| 3847 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3848 | @Deprecated |
| 3849 | public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3850 | |
| 3851 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3852 | * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} |
| 3853 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3854 | * @hide |
| 3855 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3856 | @Deprecated |
| 3857 | public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3858 | |
| 3859 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3860 | * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} |
| 3861 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3862 | * @hide |
| 3863 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3864 | @Deprecated |
| 3865 | public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3866 | |
| 3867 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3868 | * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} |
| 3869 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3870 | * @hide |
| 3871 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3872 | @Deprecated |
| 3873 | public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3874 | |
| 3875 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3876 | * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} |
| 3877 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3878 | * @hide |
| 3879 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3880 | @Deprecated |
| 3881 | public static final String LOCK_SOUND = Global.LOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3882 | |
| 3883 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3884 | * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} |
| 3885 | * instead |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3886 | * @hide |
| 3887 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 3888 | @Deprecated |
| 3889 | public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; |
Daniel Sandler | 0e9d2af | 2010-01-25 11:33:03 -0500 | [diff] [blame] | 3890 | |
| 3891 | /** |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3892 | * Receive incoming SIP calls? |
| 3893 | * 0 = no |
| 3894 | * 1 = yes |
| 3895 | * @hide |
| 3896 | */ |
| 3897 | public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; |
| 3898 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3899 | /** @hide */ |
| 3900 | public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator; |
| 3901 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3902 | /** |
| 3903 | * Call Preference String. |
| 3904 | * "SIP_ALWAYS" : Always use SIP with network access |
| 3905 | * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3906 | * @hide |
| 3907 | */ |
| 3908 | public static final String SIP_CALL_OPTIONS = "sip_call_options"; |
| 3909 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3910 | /** @hide */ |
| 3911 | public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator( |
| 3912 | new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); |
| 3913 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3914 | /** |
| 3915 | * One of the sip call options: Always use SIP with network access. |
| 3916 | * @hide |
| 3917 | */ |
| 3918 | public static final String SIP_ALWAYS = "SIP_ALWAYS"; |
| 3919 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3920 | /** @hide */ |
| 3921 | public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator; |
| 3922 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3923 | /** |
| 3924 | * One of the sip call options: Only if destination is a SIP address. |
| 3925 | * @hide |
| 3926 | */ |
| 3927 | public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; |
| 3928 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3929 | /** @hide */ |
| 3930 | public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator; |
| 3931 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3932 | /** |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3933 | * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that |
| 3934 | * the user should be prompted each time a call is made whether it should be placed using |
| 3935 | * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with |
| 3936 | * SIP_ADDRESS_ONLY. |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3937 | * @hide |
| 3938 | */ |
Tyler Gunn | 2c830a2 | 2014-09-02 08:39:35 -0700 | [diff] [blame] | 3939 | @Deprecated |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3940 | public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; |
| 3941 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3942 | /** @hide */ |
| 3943 | public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator; |
| 3944 | |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 3945 | /** |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3946 | * Pointer speed setting. |
| 3947 | * This is an integer value in a range between -7 and +7, so there are 15 possible values. |
| 3948 | * -7 = slowest |
| 3949 | * 0 = default speed |
| 3950 | * +7 = fastest |
| 3951 | * @hide |
| 3952 | */ |
| 3953 | public static final String POINTER_SPEED = "pointer_speed"; |
| 3954 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3955 | /** @hide */ |
| 3956 | public static final Validator POINTER_SPEED_VALIDATOR = |
| 3957 | new InclusiveFloatRangeValidator(-7, 7); |
| 3958 | |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 3959 | /** |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 3960 | * Whether lock-to-app will be triggered by long-press on recents. |
| 3961 | * @hide |
| 3962 | */ |
| 3963 | public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; |
| 3964 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3965 | /** @hide */ |
| 3966 | public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator; |
| 3967 | |
Jason Monk | 56e09b4 | 2014-07-18 10:29:14 -0400 | [diff] [blame] | 3968 | /** |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 3969 | * I am the lolrus. |
| 3970 | * <p> |
| 3971 | * Nonzero values indicate that the user has a bukkit. |
| 3972 | * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. |
| 3973 | * @hide |
| 3974 | */ |
| 3975 | public static final String EGG_MODE = "egg_mode"; |
| 3976 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3977 | /** @hide */ |
Svet Ganov | b1918a0 | 2015-05-15 09:32:55 -0700 | [diff] [blame] | 3978 | public static final Validator EGG_MODE_VALIDATOR = new Validator() { |
| 3979 | @Override |
| 3980 | public boolean validate(String value) { |
| 3981 | try { |
| 3982 | return Long.parseLong(value) >= 0; |
| 3983 | } catch (NumberFormatException e) { |
| 3984 | return false; |
| 3985 | } |
| 3986 | } |
| 3987 | }; |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 3988 | |
| 3989 | /** |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 3990 | * Setting to determine whether or not to show the battery percentage in the status bar. |
| 3991 | * 0 - Don't show percentage |
| 3992 | * 1 - Show percentage |
| 3993 | * @hide |
| 3994 | */ |
| 3995 | public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; |
| 3996 | |
| 3997 | /** @hide */ |
| 3998 | private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = sBooleanValidator; |
| 3999 | |
| 4000 | /** |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4001 | * IMPORTANT: If you add a new public settings you also have to add it to |
| 4002 | * PUBLIC_SETTINGS below. If the new setting is hidden you have to add |
| 4003 | * it to PRIVATE_SETTINGS below. Also add a validator that can validate |
| 4004 | * the setting value. See an example above. |
| 4005 | */ |
| 4006 | |
Daniel Sandler | 2fdb68b | 2013-10-03 00:12:11 -0400 | [diff] [blame] | 4007 | /** |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4008 | * Settings to backup. This is here so that it's in the same place as the settings |
| 4009 | * keys and easy to update. |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 4010 | * |
| 4011 | * NOTE: Settings are backed up and restored in the order they appear |
| 4012 | * in this array. If you have one setting depending on another, |
| 4013 | * make sure that they are ordered appropriately. |
| 4014 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4015 | * @hide |
| 4016 | */ |
| 4017 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4018 | STAY_ON_WHILE_PLUGGED_IN, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4019 | WIFI_USE_STATIC_IP, |
| 4020 | WIFI_STATIC_IP, |
| 4021 | WIFI_STATIC_GATEWAY, |
| 4022 | WIFI_STATIC_NETMASK, |
| 4023 | WIFI_STATIC_DNS1, |
| 4024 | WIFI_STATIC_DNS2, |
| 4025 | BLUETOOTH_DISCOVERABILITY, |
| 4026 | BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
Casey Burkhardt | 86b867f | 2015-12-29 18:03:36 -0800 | [diff] [blame] | 4027 | FONT_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4028 | DIM_SCREEN, |
| 4029 | SCREEN_OFF_TIMEOUT, |
| 4030 | SCREEN_BRIGHTNESS, |
Christopher Tate | 362aca6 | 2009-09-25 15:58:03 -0700 | [diff] [blame] | 4031 | SCREEN_BRIGHTNESS_MODE, |
Dianne Hackborn | d9ea468 | 2012-01-20 18:36:40 -0800 | [diff] [blame] | 4032 | SCREEN_AUTO_BRIGHTNESS_ADJ, |
Santos Cordon | bd9dd55 | 2017-02-13 13:37:45 -0800 | [diff] [blame] | 4033 | SCREEN_BRIGHTNESS_FOR_VR, |
Jeff Brown | 7f6c231 | 2012-04-13 20:38:38 -0700 | [diff] [blame] | 4034 | VIBRATE_INPUT_DEVICES, |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 4035 | MODE_RINGER_STREAMS_AFFECTED, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4036 | TEXT_AUTO_REPLACE, |
| 4037 | TEXT_AUTO_CAPS, |
| 4038 | TEXT_AUTO_PUNCTUATE, |
| 4039 | TEXT_SHOW_PASSWORD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4040 | AUTO_TIME, // moved to global |
| 4041 | AUTO_TIME_ZONE, // moved to global |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4042 | TIME_12_24, |
| 4043 | DATE_FORMAT, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4044 | DTMF_TONE_WHEN_DIALING, |
| 4045 | DTMF_TONE_TYPE_WHEN_DIALING, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4046 | HEARING_AID, |
| 4047 | TTY_MODE, |
Christopher Tate | ea2d6e8 | 2016-05-19 16:55:49 -0700 | [diff] [blame] | 4048 | MASTER_MONO, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4049 | SOUND_EFFECTS_ENABLED, |
| 4050 | HAPTIC_FEEDBACK_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4051 | POWER_SOUNDS_ENABLED, // moved to global |
| 4052 | DOCK_SOUNDS_ENABLED, // moved to global |
Christopher Tate | 14c2d79 | 2010-02-25 16:49:44 -0800 | [diff] [blame] | 4053 | LOCKSCREEN_SOUNDS_ENABLED, |
Amith Yamasani | ae3ed70 | 2009-12-01 19:02:05 -0800 | [diff] [blame] | 4054 | SHOW_WEB_SUGGESTIONS, |
Chung-yih Wang | 042e9bd | 2010-08-31 17:43:39 +0800 | [diff] [blame] | 4055 | SIP_CALL_OPTIONS, |
Nick Pelly | 038cabe | 2010-09-23 16:12:11 -0700 | [diff] [blame] | 4056 | SIP_RECEIVE_CALLS, |
Jeff Brown | 1a84fd1 | 2011-06-02 01:26:32 -0700 | [diff] [blame] | 4057 | POINTER_SPEED, |
Amith Yamasani | 622bf222 | 2013-09-06 13:54:28 -0700 | [diff] [blame] | 4058 | VIBRATE_WHEN_RINGING, |
| 4059 | RINGTONE, |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 4060 | LOCK_TO_APP_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 4061 | NOTIFICATION_SOUND, |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4062 | ACCELEROMETER_ROTATION, |
| 4063 | SHOW_BATTERY_PERCENT |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 4064 | }; |
| 4065 | |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4066 | /** |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 4067 | * Keys we no longer back up under the current schema, but want to continue to |
| 4068 | * process when restoring historical backup datasets. |
| 4069 | * |
| 4070 | * @hide |
| 4071 | */ |
| 4072 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 4073 | }; |
| 4074 | |
| 4075 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4076 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4077 | * |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4078 | * @hide |
| 4079 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4080 | public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); |
| 4081 | static { |
| 4082 | PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4083 | PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4084 | PUBLIC_SETTINGS.add(WIFI_STATIC_IP); |
| 4085 | PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); |
| 4086 | PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); |
| 4087 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); |
| 4088 | PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); |
| 4089 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); |
| 4090 | PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); |
| 4091 | PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); |
| 4092 | PUBLIC_SETTINGS.add(FONT_SCALE); |
| 4093 | PUBLIC_SETTINGS.add(DIM_SCREEN); |
| 4094 | PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); |
| 4095 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); |
| 4096 | PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); |
| 4097 | PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); |
| 4098 | PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); |
| 4099 | PUBLIC_SETTINGS.add(VIBRATE_ON); |
| 4100 | PUBLIC_SETTINGS.add(VOLUME_RING); |
| 4101 | PUBLIC_SETTINGS.add(VOLUME_SYSTEM); |
| 4102 | PUBLIC_SETTINGS.add(VOLUME_VOICE); |
| 4103 | PUBLIC_SETTINGS.add(VOLUME_MUSIC); |
| 4104 | PUBLIC_SETTINGS.add(VOLUME_ALARM); |
| 4105 | PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); |
| 4106 | PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); |
| 4107 | PUBLIC_SETTINGS.add(RINGTONE); |
| 4108 | PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); |
| 4109 | PUBLIC_SETTINGS.add(ALARM_ALERT); |
| 4110 | PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4111 | PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4112 | PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4113 | PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4114 | PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); |
| 4115 | PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); |
| 4116 | PUBLIC_SETTINGS.add(TIME_12_24); |
| 4117 | PUBLIC_SETTINGS.add(DATE_FORMAT); |
| 4118 | PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); |
| 4119 | PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); |
| 4120 | PUBLIC_SETTINGS.add(USER_ROTATION); |
| 4121 | PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); |
| 4122 | PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
| 4123 | PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4124 | PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); |
Svetoslav Ganov | d263163 | 2015-12-09 16:29:22 -0800 | [diff] [blame] | 4125 | PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4126 | } |
| 4127 | |
| 4128 | /** |
| 4129 | * These are all hidden system settings. |
| 4130 | * |
| 4131 | * @hide |
| 4132 | */ |
| 4133 | public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); |
| 4134 | static { |
| 4135 | PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); |
| 4136 | PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); |
| 4137 | PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); |
| 4138 | PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); |
| 4139 | PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); |
| 4140 | PRIVATE_SETTINGS.add(VOLUME_MASTER); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4141 | PRIVATE_SETTINGS.add(MASTER_MONO); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4142 | PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); |
| 4143 | PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); |
| 4144 | PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); |
| 4145 | PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4146 | PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); |
| 4147 | PRIVATE_SETTINGS.add(HEARING_AID); |
| 4148 | PRIVATE_SETTINGS.add(TTY_MODE); |
| 4149 | PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); |
| 4150 | PRIVATE_SETTINGS.add(POINTER_LOCATION); |
| 4151 | PRIVATE_SETTINGS.add(SHOW_TOUCHES); |
| 4152 | PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); |
| 4153 | PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); |
| 4154 | PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); |
| 4155 | PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); |
| 4156 | PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); |
| 4157 | PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); |
| 4158 | PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); |
| 4159 | PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); |
| 4160 | PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); |
| 4161 | PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); |
| 4162 | PRIVATE_SETTINGS.add(LOCK_SOUND); |
| 4163 | PRIVATE_SETTINGS.add(UNLOCK_SOUND); |
| 4164 | PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); |
| 4165 | PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); |
| 4166 | PRIVATE_SETTINGS.add(SIP_ALWAYS); |
| 4167 | PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); |
| 4168 | PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); |
| 4169 | PRIVATE_SETTINGS.add(POINTER_SPEED); |
| 4170 | PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); |
| 4171 | PRIVATE_SETTINGS.add(EGG_MODE); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4172 | PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4173 | } |
| 4174 | |
| 4175 | /** |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 4176 | * These are all public system settings |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4177 | * |
| 4178 | * @hide |
| 4179 | */ |
| 4180 | public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); |
| 4181 | static { |
| 4182 | VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR); |
| 4183 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4184 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); |
| 4185 | VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, |
| 4186 | BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); |
| 4187 | VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); |
| 4188 | VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); |
| 4189 | VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); |
| 4190 | VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); |
| 4191 | VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR); |
Santos Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 4192 | VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4193 | VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); |
| 4194 | VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); |
| 4195 | VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); |
| 4196 | VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4197 | VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); |
| 4198 | VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); |
| 4199 | VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); |
| 4200 | VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); |
| 4201 | VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); |
| 4202 | VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); |
| 4203 | VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); |
| 4204 | VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); |
| 4205 | VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); |
| 4206 | VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); |
| 4207 | VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); |
| 4208 | VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); |
| 4209 | VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); |
| 4210 | VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); |
| 4211 | VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); |
| 4212 | VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); |
| 4213 | VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); |
| 4214 | VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); |
| 4215 | VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); |
| 4216 | VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); |
| 4217 | VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); |
| 4218 | VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); |
| 4219 | VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); |
Andy Hung | f04b84d | 2015-12-18 17:33:27 -0800 | [diff] [blame] | 4220 | VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4221 | VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); |
| 4222 | VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); |
| 4223 | VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); |
| 4224 | VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, |
| 4225 | HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); |
| 4226 | VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); |
| 4227 | VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); |
| 4228 | VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); |
| 4229 | VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); |
| 4230 | VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); |
| 4231 | VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); |
| 4232 | VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); |
| 4233 | VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, |
| 4234 | WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); |
| 4235 | VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); |
| 4236 | VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); |
| 4237 | VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); |
| 4238 | VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); |
| 4239 | VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); |
| 4240 | VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); |
| 4241 | VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); |
| 4242 | VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); |
| 4243 | VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); |
| 4244 | VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); |
| 4245 | VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); |
| 4246 | VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); |
| 4247 | VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); |
| 4248 | VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); |
| 4249 | VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); |
Evan Laird | bcf631d | 2017-03-10 10:56:45 -0500 | [diff] [blame] | 4250 | VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4251 | } |
| 4252 | |
| 4253 | /** |
| 4254 | * These entries are considered common between the personal and the managed profile, |
| 4255 | * since the managed profile doesn't get to change them. |
| 4256 | */ |
| 4257 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
| 4258 | static { |
| 4259 | CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); |
| 4260 | CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); |
| 4261 | CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); |
| 4262 | CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); |
| 4263 | CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); |
| 4264 | } |
| 4265 | |
| 4266 | /** @hide */ |
| 4267 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 4268 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 4269 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 4270 | |
| 4271 | /** |
Andre Lago | 3fa139c | 2016-08-04 13:53:44 +0100 | [diff] [blame] | 4272 | * These entries should be cloned from this profile's parent only if the dependency's |
| 4273 | * value is true ("1") |
| 4274 | * |
| 4275 | * Note: the dependencies must be Secure settings |
| 4276 | * |
| 4277 | * @hide |
| 4278 | */ |
| 4279 | public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); |
| 4280 | static { |
| 4281 | CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); |
| 4282 | CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); |
| 4283 | CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); |
| 4284 | } |
| 4285 | |
| 4286 | /** @hide */ |
| 4287 | public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { |
| 4288 | outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); |
| 4289 | } |
| 4290 | |
| 4291 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4292 | * System settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4293 | * @hide |
| 4294 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4295 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4296 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 4297 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); |
| 4298 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); |
| 4299 | INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); |
| 4300 | INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); |
| 4301 | INSTANT_APP_SETTINGS.add(DATE_FORMAT); |
| 4302 | INSTANT_APP_SETTINGS.add(FONT_SCALE); |
| 4303 | INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); |
| 4304 | INSTANT_APP_SETTINGS.add(TIME_12_24); |
| 4305 | INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 4306 | INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 4307 | } |
| 4308 | |
| 4309 | /** |
Sailesh Nepal | 1bd7876 | 2014-02-11 22:32:21 -0800 | [diff] [blame] | 4310 | * When to use Wi-Fi calling |
| 4311 | * |
| 4312 | * @see android.telephony.TelephonyManager.WifiCallingChoices |
| 4313 | * @hide |
| 4314 | */ |
| 4315 | public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; |
| 4316 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4317 | // Settings moved to Settings.Secure |
| 4318 | |
| 4319 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4320 | * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4321 | * instead |
| 4322 | */ |
| 4323 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4324 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4325 | |
| 4326 | /** |
| 4327 | * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead |
| 4328 | */ |
| 4329 | @Deprecated |
| 4330 | public static final String ANDROID_ID = Secure.ANDROID_ID; |
| 4331 | |
| 4332 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4333 | * @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] | 4334 | */ |
| 4335 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4336 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4337 | |
| 4338 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4339 | * @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] | 4340 | */ |
| 4341 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4342 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4343 | |
| 4344 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4345 | * @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] | 4346 | */ |
| 4347 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4348 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4349 | |
| 4350 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4351 | * @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] | 4352 | */ |
| 4353 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4354 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4355 | |
| 4356 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4357 | * @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] | 4358 | */ |
| 4359 | @Deprecated |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 4360 | 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] | 4361 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4362 | /** |
| 4363 | * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} |
| 4364 | * instead |
| 4365 | */ |
| 4366 | @Deprecated |
| 4367 | public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; |
| 4368 | |
| 4369 | /** |
| 4370 | * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead |
| 4371 | */ |
| 4372 | @Deprecated |
| 4373 | public static final String LOGGING_ID = Secure.LOGGING_ID; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4374 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4375 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4376 | * @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] | 4377 | */ |
| 4378 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4379 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4380 | |
| 4381 | /** |
| 4382 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} |
| 4383 | * instead |
| 4384 | */ |
| 4385 | @Deprecated |
| 4386 | public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; |
| 4387 | |
| 4388 | /** |
| 4389 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} |
| 4390 | * instead |
| 4391 | */ |
| 4392 | @Deprecated |
| 4393 | public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; |
| 4394 | |
| 4395 | /** |
| 4396 | * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} |
| 4397 | * instead |
| 4398 | */ |
| 4399 | @Deprecated |
| 4400 | public static final String PARENTAL_CONTROL_REDIRECT_URL = |
| 4401 | Secure.PARENTAL_CONTROL_REDIRECT_URL; |
| 4402 | |
| 4403 | /** |
| 4404 | * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead |
| 4405 | */ |
| 4406 | @Deprecated |
| 4407 | public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; |
| 4408 | |
| 4409 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4410 | * @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] | 4411 | */ |
| 4412 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4413 | 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] | 4414 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4415 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4416 | * @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] | 4417 | */ |
| 4418 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4419 | 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] | 4420 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4421 | /** |
| 4422 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4423 | * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4424 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4425 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4426 | 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] | 4427 | |
Dianne Hackborn | 4a51c20 | 2009-08-21 15:14:02 -0700 | [diff] [blame] | 4428 | /** |
| 4429 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4430 | * {@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] | 4431 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | @Deprecated |
| 4433 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4434 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4435 | |
| 4436 | /** |
| 4437 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4438 | * {@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] | 4439 | */ |
| 4440 | @Deprecated |
| 4441 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4442 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4443 | |
| 4444 | /** |
| 4445 | * @deprecated Use |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4446 | * {@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] | 4447 | */ |
| 4448 | @Deprecated |
| 4449 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4450 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4451 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4452 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4453 | * @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] | 4454 | * instead |
| 4455 | */ |
| 4456 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4457 | 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] | 4458 | |
| 4459 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4460 | * @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] | 4461 | */ |
| 4462 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4463 | public static final String WIFI_ON = Global.WIFI_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4464 | |
| 4465 | /** |
| 4466 | * @deprecated Use |
| 4467 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} |
| 4468 | * instead |
| 4469 | */ |
| 4470 | @Deprecated |
| 4471 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 4472 | Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; |
| 4473 | |
| 4474 | /** |
| 4475 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead |
| 4476 | */ |
| 4477 | @Deprecated |
| 4478 | public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; |
| 4479 | |
| 4480 | /** |
| 4481 | * @deprecated Use |
| 4482 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead |
| 4483 | */ |
| 4484 | @Deprecated |
| 4485 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 4486 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 4487 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4488 | /** |
| 4489 | * @deprecated Use |
| 4490 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead |
| 4491 | */ |
| 4492 | @Deprecated |
| 4493 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 4494 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; |
| 4495 | |
| 4496 | /** |
| 4497 | * @deprecated Use |
| 4498 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} |
| 4499 | * instead |
| 4500 | */ |
| 4501 | @Deprecated |
| 4502 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 4503 | Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; |
| 4504 | |
| 4505 | /** |
| 4506 | * @deprecated Use |
| 4507 | * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead |
| 4508 | */ |
| 4509 | @Deprecated |
| 4510 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 4511 | Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; |
| 4512 | |
| 4513 | /** |
| 4514 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} |
| 4515 | * instead |
| 4516 | */ |
| 4517 | @Deprecated |
| 4518 | public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; |
| 4519 | |
| 4520 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4521 | * @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] | 4522 | */ |
| 4523 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4524 | 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] | 4525 | |
| 4526 | /** |
| 4527 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead |
| 4528 | */ |
| 4529 | @Deprecated |
| 4530 | public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; |
| 4531 | |
| 4532 | /** |
| 4533 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} |
| 4534 | * instead |
| 4535 | */ |
| 4536 | @Deprecated |
| 4537 | public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; |
| 4538 | |
| 4539 | /** |
| 4540 | * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} |
| 4541 | * instead |
| 4542 | */ |
| 4543 | @Deprecated |
| 4544 | public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = |
| 4545 | Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4546 | |
| 4547 | /** |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4548 | * Checks if the specified app can modify system settings. As of API |
| 4549 | * level 23, an app cannot modify system settings unless it declares the |
| 4550 | * {@link android.Manifest.permission#WRITE_SETTINGS} |
| 4551 | * permission in its manifest, <em>and</em> the user specifically grants |
| 4552 | * the app this capability. To prompt the user to grant this approval, |
| 4553 | * the app must send an intent with the action {@link |
| 4554 | * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes |
| 4555 | * the system to display a permission management screen. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4556 | * |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 4557 | * @param context App context. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4558 | * @return true if the calling app can write to system settings, false otherwise |
| 4559 | */ |
| 4560 | public static boolean canWrite(Context context) { |
Svet Ganov | 94ba4017 | 2016-04-03 22:04:22 -0700 | [diff] [blame] | 4561 | return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), |
| 4562 | context.getOpPackageName(), false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 4563 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4564 | } |
| 4565 | |
| 4566 | /** |
| 4567 | * Secure system settings, containing system preferences that applications |
| 4568 | * can read but are not allowed to write. These are for preferences that |
| 4569 | * the user must explicitly modify through the system UI or specialized |
| 4570 | * APIs for those values, not modified directly by applications. |
| 4571 | */ |
| 4572 | public static final class Secure extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 4573 | // NOTE: If you add new settings here, be sure to add them to |
| 4574 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. |
| 4575 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4576 | /** |
| 4577 | * The content:// style URL for this table |
| 4578 | */ |
| 4579 | public static final Uri CONTENT_URI = |
| 4580 | Uri.parse("content://" + AUTHORITY + "/secure"); |
| 4581 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4582 | private static final ContentProviderHolder sProviderHolder = |
| 4583 | new ContentProviderHolder(CONTENT_URI); |
| 4584 | |
Brad Fitzpatrick | 1877d01 | 2010-03-04 17:48:13 -0800 | [diff] [blame] | 4585 | // Populated lazily, guarded by class object: |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4586 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4587 | CONTENT_URI, |
| 4588 | CALL_METHOD_GET_SECURE, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4589 | CALL_METHOD_PUT_SECURE, |
| 4590 | sProviderHolder); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4591 | |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4592 | private static ILockSettings sLockSettings = null; |
| 4593 | |
Amith Yamasani | 7ab8c4a | 2012-04-06 09:27:12 -0700 | [diff] [blame] | 4594 | private static boolean sIsSystemProcess; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4595 | private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4596 | private static final HashSet<String> MOVED_TO_GLOBAL; |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4597 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4598 | MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4599 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); |
| 4600 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); |
| 4601 | MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4602 | |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 4603 | MOVED_TO_GLOBAL = new HashSet<>(); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4604 | MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); |
| 4605 | MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); |
| 4606 | MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 4607 | MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4608 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); |
| 4609 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); |
| 4610 | MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); |
| 4611 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); |
| 4612 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); |
| 4613 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); |
| 4614 | MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); |
| 4615 | MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4616 | MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); |
| 4617 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); |
| 4618 | MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4619 | MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); |
| 4620 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); |
| 4621 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); |
| 4622 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); |
| 4623 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); |
| 4624 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); |
| 4625 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); |
| 4626 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4627 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); |
| 4628 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); |
| 4629 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); |
| 4630 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); |
| 4631 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); |
| 4632 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); |
| 4633 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); |
| 4634 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); |
| 4635 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); |
| 4636 | MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); |
| 4637 | MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); |
| 4638 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); |
| 4639 | MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); |
| 4640 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); |
| 4641 | MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); |
| 4642 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); |
| 4643 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); |
| 4644 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); |
| 4645 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); |
| 4646 | MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4647 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); |
| 4648 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); |
| 4649 | MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); |
| 4650 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); |
| 4651 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); |
| 4652 | MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4653 | MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); |
| 4654 | MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 4655 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4656 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); |
| 4657 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); |
| 4658 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); |
| 4659 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); |
| 4660 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); |
| 4661 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
| 4662 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); |
| 4663 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); |
| 4664 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); |
| 4665 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); |
| 4666 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); |
| 4667 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); |
| 4668 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 4669 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 4670 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); |
| 4671 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4672 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); |
| 4673 | MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4674 | MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 4675 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); |
| 4676 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); |
| 4677 | MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); |
| 4678 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); |
| 4679 | MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); |
| 4680 | MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4681 | MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 4682 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); |
| 4683 | MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); |
| 4684 | MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); |
| 4685 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); |
| 4686 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); |
| 4687 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); |
| 4688 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); |
| 4689 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); |
| 4690 | MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); |
| 4691 | MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); |
| 4692 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); |
| 4693 | MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); |
| 4694 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); |
| 4695 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); |
| 4696 | MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); |
| 4697 | MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); |
| 4698 | MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); |
| 4699 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); |
| 4700 | MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); |
| 4701 | MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); |
| 4702 | MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); |
| 4703 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); |
| 4704 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); |
| 4705 | MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); |
| 4706 | MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); |
| 4707 | MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); |
| 4708 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); |
| 4709 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); |
| 4710 | MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); |
| 4711 | MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); |
| 4712 | MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 4713 | MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 4714 | MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4715 | } |
| 4716 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4717 | /** @hide */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 4718 | public static void getMovedToGlobalSettings(Set<String> outKeySet) { |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 4719 | outKeySet.addAll(MOVED_TO_GLOBAL); |
| 4720 | } |
| 4721 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 4722 | /** @hide */ |
| 4723 | public static void clearProviderForTest() { |
| 4724 | sProviderHolder.clearProviderForTest(); |
| 4725 | sNameValueCache.clearGenerationTrackerForTest(); |
| 4726 | } |
| 4727 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4728 | /** |
| 4729 | * Look up a name in the database. |
| 4730 | * @param resolver to access the database with |
| 4731 | * @param name to look up in the table |
| 4732 | * @return the corresponding value, or null if not present |
| 4733 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4734 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4735 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 4736 | } |
| 4737 | |
| 4738 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4739 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4740 | int userHandle) { |
| 4741 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4742 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4743 | + " to android.provider.Settings.Global."); |
| 4744 | return Global.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4745 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4746 | |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4747 | if (MOVED_TO_LOCK_SETTINGS.contains(name)) { |
| 4748 | synchronized (Secure.class) { |
| 4749 | if (sLockSettings == null) { |
| 4750 | sLockSettings = ILockSettings.Stub.asInterface( |
| 4751 | (IBinder) ServiceManager.getService("lock_settings")); |
| 4752 | sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; |
| 4753 | } |
| 4754 | } |
| 4755 | if (sLockSettings != null && !sIsSystemProcess) { |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 4756 | // No context; use the ActivityThread's context as an approximation for |
| 4757 | // determining the target API level. |
| 4758 | Application application = ActivityThread.currentApplication(); |
| 4759 | |
| 4760 | boolean isPreMnc = application != null |
| 4761 | && application.getApplicationInfo() != null |
| 4762 | && application.getApplicationInfo().targetSdkVersion |
| 4763 | <= VERSION_CODES.LOLLIPOP_MR1; |
| 4764 | if (isPreMnc) { |
| 4765 | try { |
| 4766 | return sLockSettings.getString(name, "0", userHandle); |
| 4767 | } catch (RemoteException re) { |
| 4768 | // Fall through |
| 4769 | } |
| 4770 | } else { |
| 4771 | throw new SecurityException("Settings.Secure." + name |
| 4772 | + " is deprecated and no longer accessible." |
| 4773 | + " See API documentation for potential replacements."); |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 4774 | } |
Amith Yamasani | 52c489c | 2012-03-28 11:42:42 -0700 | [diff] [blame] | 4775 | } |
| 4776 | } |
| 4777 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4778 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4779 | } |
| 4780 | |
| 4781 | /** |
| 4782 | * Store a name/value pair into the database. |
| 4783 | * @param resolver to access the database with |
| 4784 | * @param name to store |
| 4785 | * @param value to associate with the name |
| 4786 | * @return true if the value was set, false on database errors |
| 4787 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4788 | public static boolean putString(ContentResolver resolver, String name, String value) { |
| 4789 | return putStringForUser(resolver, name, value, UserHandle.myUserId()); |
| 4790 | } |
| 4791 | |
| 4792 | /** @hide */ |
| 4793 | public static boolean putStringForUser(ContentResolver resolver, String name, String value, |
| 4794 | int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4795 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 4796 | } |
| 4797 | |
| 4798 | /** @hide */ |
| 4799 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 4800 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4801 | boolean makeDefault, @UserIdInt int userHandle) { |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4802 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4803 | // Map LOCATION_MODE to underlying location provider storage API |
Julia Reynolds | 82735bc | 2014-09-04 16:43:30 -0400 | [diff] [blame] | 4804 | return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); |
| 4805 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4806 | if (MOVED_TO_GLOBAL.contains(name)) { |
Robin Lee | 7af9a74 | 2017-02-20 14:47:30 +0000 | [diff] [blame] | 4807 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4808 | + " to android.provider.Settings.Global"); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4809 | return Global.putStringForUser(resolver, name, value, |
| 4810 | tag, makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4811 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 4812 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 4813 | makeDefault, userHandle); |
| 4814 | } |
| 4815 | |
| 4816 | /** |
| 4817 | * Store a name/value pair into the database. |
| 4818 | * <p> |
| 4819 | * The method takes an optional tag to associate with the setting |
| 4820 | * which can be used to clear only settings made by your package and |
| 4821 | * associated with this tag by passing the tag to {@link |
| 4822 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 4823 | * the current tag. Also if another package changes the setting |
| 4824 | * then the tag will be set to the one specified in the set call |
| 4825 | * which can be null. Also any of the settings setters that do not |
| 4826 | * take a tag as an argument effectively clears the tag. |
| 4827 | * </p><p> |
| 4828 | * For example, if you set settings A and B with tags T1 and T2 and |
| 4829 | * another app changes setting A (potentially to the same value), it |
| 4830 | * can assign to it a tag T3 (note that now the package that changed |
| 4831 | * the setting is not yours). Now if you reset your changes for T1 and |
| 4832 | * T2 only setting B will be reset and A not (as it was changed by |
| 4833 | * another package) but since A did not change you are in the desired |
| 4834 | * initial state. Now if the other app changes the value of A (assuming |
| 4835 | * you registered an observer in the beginning) you would detect that |
| 4836 | * the setting was changed by another app and handle this appropriately |
| 4837 | * (ignore, set back to some value, etc). |
| 4838 | * </p><p> |
| 4839 | * Also the method takes an argument whether to make the value the |
| 4840 | * default for this setting. If the system already specified a default |
| 4841 | * value, then the one passed in here will <strong>not</strong> |
| 4842 | * be set as the default. |
| 4843 | * </p> |
| 4844 | * |
| 4845 | * @param resolver to access the database with. |
| 4846 | * @param name to store. |
| 4847 | * @param value to associate with the name. |
| 4848 | * @param tag to associate with the setting. |
| 4849 | * @param makeDefault whether to make the value the default one. |
| 4850 | * @return true if the value was set, false on database errors. |
| 4851 | * |
| 4852 | * @see #resetToDefaults(ContentResolver, String) |
| 4853 | * |
| 4854 | * @hide |
| 4855 | */ |
| 4856 | @SystemApi |
| 4857 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4858 | public static boolean putString(@NonNull ContentResolver resolver, |
| 4859 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 4860 | boolean makeDefault) { |
| 4861 | return putStringForUser(resolver, name, value, tag, makeDefault, |
| 4862 | UserHandle.myUserId()); |
| 4863 | } |
| 4864 | |
| 4865 | /** |
| 4866 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 4867 | * settings set by the caller's package. Think of it of a way to undo your own |
| 4868 | * changes to the global settings. Passing in the optional tag will reset only |
| 4869 | * settings changed by your package and associated with this tag. |
| 4870 | * |
| 4871 | * @param resolver Handle to the content resolver. |
| 4872 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4873 | * |
| 4874 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 4875 | * |
| 4876 | * @hide |
| 4877 | */ |
| 4878 | @SystemApi |
| 4879 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 4880 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 4881 | @Nullable String tag) { |
| 4882 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
| 4883 | UserHandle.myUserId()); |
| 4884 | } |
| 4885 | |
| 4886 | /** |
| 4887 | * |
| 4888 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 4889 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 4890 | * allowing resetting the settings made by a package and associated with the tag. |
| 4891 | * |
| 4892 | * @param resolver Handle to the content resolver. |
| 4893 | * @param tag Optional tag which should be associated with the settings to reset. |
| 4894 | * @param mode The reset mode. |
| 4895 | * @param userHandle The user for which to reset to defaults. |
| 4896 | * |
| 4897 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 4898 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 4899 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 4900 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 4901 | * |
| 4902 | * @hide |
| 4903 | */ |
| 4904 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 4905 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 4906 | try { |
| 4907 | Bundle arg = new Bundle(); |
| 4908 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 4909 | if (tag != null) { |
| 4910 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 4911 | } |
| 4912 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 4913 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 4914 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); |
| 4915 | } catch (RemoteException e) { |
| 4916 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 4917 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4918 | } |
| 4919 | |
| 4920 | /** |
| 4921 | * Construct the content URI for a particular name/value pair, |
| 4922 | * useful for monitoring changes with a ContentObserver. |
| 4923 | * @param name to look up in the table |
| 4924 | * @return the corresponding content URI, or null if not present |
| 4925 | */ |
| 4926 | public static Uri getUriFor(String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4927 | if (MOVED_TO_GLOBAL.contains(name)) { |
| 4928 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" |
| 4929 | + " to android.provider.Settings.Global, returning global URI."); |
| 4930 | return Global.getUriFor(Global.CONTENT_URI, name); |
| 4931 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4932 | return getUriFor(CONTENT_URI, name); |
| 4933 | } |
| 4934 | |
| 4935 | /** |
| 4936 | * Convenience function for retrieving a single secure settings value |
| 4937 | * as an integer. Note that internally setting values are always |
| 4938 | * stored as strings; this function converts the string to an integer |
| 4939 | * for you. The default value will be returned if the setting is |
| 4940 | * not defined or not an integer. |
| 4941 | * |
| 4942 | * @param cr The ContentResolver to access. |
| 4943 | * @param name The name of the setting to retrieve. |
| 4944 | * @param def Value to return if the setting is not defined. |
| 4945 | * |
| 4946 | * @return The setting's current value, or 'def' if it is not defined |
| 4947 | * or not a valid integer. |
| 4948 | */ |
| 4949 | public static int getInt(ContentResolver cr, String name, int def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4950 | return getIntForUser(cr, name, def, UserHandle.myUserId()); |
| 4951 | } |
| 4952 | |
| 4953 | /** @hide */ |
| 4954 | 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] | 4955 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4956 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4957 | return getLocationModeForUser(cr, userHandle); |
| 4958 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4959 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4960 | try { |
| 4961 | return v != null ? Integer.parseInt(v) : def; |
| 4962 | } catch (NumberFormatException e) { |
| 4963 | return def; |
| 4964 | } |
| 4965 | } |
| 4966 | |
| 4967 | /** |
| 4968 | * Convenience function for retrieving a single secure settings value |
| 4969 | * as an integer. Note that internally setting values are always |
| 4970 | * stored as strings; this function converts the string to an integer |
| 4971 | * for you. |
| 4972 | * <p> |
| 4973 | * This version does not take a default value. If the setting has not |
| 4974 | * been set, or the string value is not a number, |
| 4975 | * it throws {@link SettingNotFoundException}. |
| 4976 | * |
| 4977 | * @param cr The ContentResolver to access. |
| 4978 | * @param name The name of the setting to retrieve. |
| 4979 | * |
| 4980 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 4981 | * name can't be found or the setting value is not an integer. |
| 4982 | * |
| 4983 | * @return The setting's current value. |
| 4984 | */ |
| 4985 | public static int getInt(ContentResolver cr, String name) |
| 4986 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4987 | return getIntForUser(cr, name, UserHandle.myUserId()); |
| 4988 | } |
| 4989 | |
| 4990 | /** @hide */ |
| 4991 | public static int getIntForUser(ContentResolver cr, String name, int userHandle) |
| 4992 | throws SettingNotFoundException { |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4993 | if (LOCATION_MODE.equals(name)) { |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 4994 | // Map from to underlying location provider storage API to location mode |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 4995 | return getLocationModeForUser(cr, userHandle); |
| 4996 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 4997 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4998 | try { |
| 4999 | return Integer.parseInt(v); |
| 5000 | } catch (NumberFormatException e) { |
| 5001 | throw new SettingNotFoundException(name); |
| 5002 | } |
| 5003 | } |
| 5004 | |
| 5005 | /** |
| 5006 | * Convenience function for updating a single settings value as an |
| 5007 | * integer. This will either create a new entry in the table if the |
| 5008 | * given name does not exist, or modify the value of the existing row |
| 5009 | * with that name. Note that internally setting values are always |
| 5010 | * stored as strings, so this function converts the given value to a |
| 5011 | * string before storing it. |
| 5012 | * |
| 5013 | * @param cr The ContentResolver to access. |
| 5014 | * @param name The name of the setting to modify. |
| 5015 | * @param value The new value for the setting. |
| 5016 | * @return true if the value was set, false on database errors |
| 5017 | */ |
| 5018 | public static boolean putInt(ContentResolver cr, String name, int value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5019 | return putIntForUser(cr, name, value, UserHandle.myUserId()); |
| 5020 | } |
| 5021 | |
| 5022 | /** @hide */ |
| 5023 | public static boolean putIntForUser(ContentResolver cr, String name, int value, |
| 5024 | int userHandle) { |
| 5025 | return putStringForUser(cr, name, Integer.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5026 | } |
| 5027 | |
| 5028 | /** |
| 5029 | * Convenience function for retrieving a single secure settings value |
| 5030 | * as a {@code long}. Note that internally setting values are always |
| 5031 | * stored as strings; this function converts the string to a {@code long} |
| 5032 | * for you. The default value will be returned if the setting is |
| 5033 | * not defined or not a {@code long}. |
| 5034 | * |
| 5035 | * @param cr The ContentResolver to access. |
| 5036 | * @param name The name of the setting to retrieve. |
| 5037 | * @param def Value to return if the setting is not defined. |
| 5038 | * |
| 5039 | * @return The setting's current value, or 'def' if it is not defined |
| 5040 | * or not a valid {@code long}. |
| 5041 | */ |
| 5042 | public static long getLong(ContentResolver cr, String name, long def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5043 | return getLongForUser(cr, name, def, UserHandle.myUserId()); |
| 5044 | } |
| 5045 | |
| 5046 | /** @hide */ |
| 5047 | public static long getLongForUser(ContentResolver cr, String name, long def, |
| 5048 | int userHandle) { |
| 5049 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5050 | long value; |
| 5051 | try { |
| 5052 | value = valString != null ? Long.parseLong(valString) : def; |
| 5053 | } catch (NumberFormatException e) { |
| 5054 | value = def; |
| 5055 | } |
| 5056 | return value; |
| 5057 | } |
| 5058 | |
| 5059 | /** |
| 5060 | * Convenience function for retrieving a single secure settings value |
| 5061 | * as a {@code long}. Note that internally setting values are always |
| 5062 | * stored as strings; this function converts the string to a {@code long} |
| 5063 | * for you. |
| 5064 | * <p> |
| 5065 | * This version does not take a default value. If the setting has not |
| 5066 | * been set, or the string value is not a number, |
| 5067 | * it throws {@link SettingNotFoundException}. |
| 5068 | * |
| 5069 | * @param cr The ContentResolver to access. |
| 5070 | * @param name The name of the setting to retrieve. |
| 5071 | * |
| 5072 | * @return The setting's current value. |
| 5073 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5074 | * name can't be found or the setting value is not an integer. |
| 5075 | */ |
| 5076 | public static long getLong(ContentResolver cr, String name) |
| 5077 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5078 | return getLongForUser(cr, name, UserHandle.myUserId()); |
| 5079 | } |
| 5080 | |
| 5081 | /** @hide */ |
| 5082 | public static long getLongForUser(ContentResolver cr, String name, int userHandle) |
| 5083 | throws SettingNotFoundException { |
| 5084 | String valString = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5085 | try { |
| 5086 | return Long.parseLong(valString); |
| 5087 | } catch (NumberFormatException e) { |
| 5088 | throw new SettingNotFoundException(name); |
| 5089 | } |
| 5090 | } |
| 5091 | |
| 5092 | /** |
| 5093 | * Convenience function for updating a secure settings value as a long |
| 5094 | * integer. This will either create a new entry in the table if the |
| 5095 | * given name does not exist, or modify the value of the existing row |
| 5096 | * with that name. Note that internally setting values are always |
| 5097 | * stored as strings, so this function converts the given value to a |
| 5098 | * string before storing it. |
| 5099 | * |
| 5100 | * @param cr The ContentResolver to access. |
| 5101 | * @param name The name of the setting to modify. |
| 5102 | * @param value The new value for the setting. |
| 5103 | * @return true if the value was set, false on database errors |
| 5104 | */ |
| 5105 | public static boolean putLong(ContentResolver cr, String name, long value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5106 | return putLongForUser(cr, name, value, UserHandle.myUserId()); |
| 5107 | } |
| 5108 | |
| 5109 | /** @hide */ |
| 5110 | public static boolean putLongForUser(ContentResolver cr, String name, long value, |
| 5111 | int userHandle) { |
| 5112 | return putStringForUser(cr, name, Long.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5113 | } |
| 5114 | |
| 5115 | /** |
| 5116 | * Convenience function for retrieving a single secure settings value |
| 5117 | * as a floating point number. Note that internally setting values are |
| 5118 | * always stored as strings; this function converts the string to an |
| 5119 | * float for you. The default value will be returned if the setting |
| 5120 | * is not defined or not a valid float. |
| 5121 | * |
| 5122 | * @param cr The ContentResolver to access. |
| 5123 | * @param name The name of the setting to retrieve. |
| 5124 | * @param def Value to return if the setting is not defined. |
| 5125 | * |
| 5126 | * @return The setting's current value, or 'def' if it is not defined |
| 5127 | * or not a valid float. |
| 5128 | */ |
| 5129 | public static float getFloat(ContentResolver cr, String name, float def) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5130 | return getFloatForUser(cr, name, def, UserHandle.myUserId()); |
| 5131 | } |
| 5132 | |
| 5133 | /** @hide */ |
| 5134 | public static float getFloatForUser(ContentResolver cr, String name, float def, |
| 5135 | int userHandle) { |
| 5136 | String v = getStringForUser(cr, name, userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5137 | try { |
| 5138 | return v != null ? Float.parseFloat(v) : def; |
| 5139 | } catch (NumberFormatException e) { |
| 5140 | return def; |
| 5141 | } |
| 5142 | } |
| 5143 | |
| 5144 | /** |
| 5145 | * Convenience function for retrieving a single secure settings value |
| 5146 | * as a float. Note that internally setting values are always |
| 5147 | * stored as strings; this function converts the string to a float |
| 5148 | * for you. |
| 5149 | * <p> |
| 5150 | * This version does not take a default value. If the setting has not |
| 5151 | * been set, or the string value is not a number, |
| 5152 | * it throws {@link SettingNotFoundException}. |
| 5153 | * |
| 5154 | * @param cr The ContentResolver to access. |
| 5155 | * @param name The name of the setting to retrieve. |
| 5156 | * |
| 5157 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 5158 | * name can't be found or the setting value is not a float. |
| 5159 | * |
| 5160 | * @return The setting's current value. |
| 5161 | */ |
| 5162 | public static float getFloat(ContentResolver cr, String name) |
| 5163 | throws SettingNotFoundException { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5164 | return getFloatForUser(cr, name, UserHandle.myUserId()); |
| 5165 | } |
| 5166 | |
| 5167 | /** @hide */ |
| 5168 | public static float getFloatForUser(ContentResolver cr, String name, int userHandle) |
| 5169 | throws SettingNotFoundException { |
| 5170 | String v = getStringForUser(cr, name, userHandle); |
Brian Muramatsu | e1d4698 | 2010-12-06 17:34:20 -0800 | [diff] [blame] | 5171 | if (v == null) { |
| 5172 | throw new SettingNotFoundException(name); |
| 5173 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5174 | try { |
| 5175 | return Float.parseFloat(v); |
| 5176 | } catch (NumberFormatException e) { |
| 5177 | throw new SettingNotFoundException(name); |
| 5178 | } |
| 5179 | } |
| 5180 | |
| 5181 | /** |
| 5182 | * Convenience function for updating a single settings value as a |
| 5183 | * floating point number. This will either create a new entry in the |
| 5184 | * table if the given name does not exist, or modify the value of the |
| 5185 | * existing row with that name. Note that internally setting values |
| 5186 | * are always stored as strings, so this function converts the given |
| 5187 | * value to a string before storing it. |
| 5188 | * |
| 5189 | * @param cr The ContentResolver to access. |
| 5190 | * @param name The name of the setting to modify. |
| 5191 | * @param value The new value for the setting. |
| 5192 | * @return true if the value was set, false on database errors |
| 5193 | */ |
| 5194 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5195 | return putFloatForUser(cr, name, value, UserHandle.myUserId()); |
| 5196 | } |
| 5197 | |
| 5198 | /** @hide */ |
| 5199 | public static boolean putFloatForUser(ContentResolver cr, String name, float value, |
| 5200 | int userHandle) { |
| 5201 | return putStringForUser(cr, name, Float.toString(value), userHandle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5202 | } |
| 5203 | |
| 5204 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5205 | * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} |
| 5206 | * instead |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5207 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5208 | @Deprecated |
| 5209 | public static final String DEVELOPMENT_SETTINGS_ENABLED = |
| 5210 | Global.DEVELOPMENT_SETTINGS_ENABLED; |
Dianne Hackborn | 895f99e | 2012-02-02 11:49:12 -0800 | [diff] [blame] | 5211 | |
| 5212 | /** |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5213 | * When the user has enable the option to have a "bug report" command |
| 5214 | * in the power menu. |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5215 | * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5216 | * @hide |
| 5217 | */ |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 5218 | @Deprecated |
Dianne Hackborn | 5773bfdb | 2012-07-13 13:24:15 -0700 | [diff] [blame] | 5219 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 5220 | |
| 5221 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5222 | * @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] | 5223 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5224 | @Deprecated |
| 5225 | public static final String ADB_ENABLED = Global.ADB_ENABLED; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5226 | |
| 5227 | /** |
| 5228 | * Setting to allow mock locations and location provider status to be injected into the |
| 5229 | * LocationManager service for testing purposes during application development. These |
| 5230 | * locations and status values override actual location and status information generated |
| 5231 | * by network, gps, or other location providers. |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5232 | * |
| 5233 | * @deprecated This settings is not used anymore. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5234 | */ |
Svet Ganov | f7e9cf4 | 2015-05-13 10:40:31 -0700 | [diff] [blame] | 5235 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5236 | public static final String ALLOW_MOCK_LOCATION = "mock_location"; |
| 5237 | |
| 5238 | /** |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5239 | * On Android 8.0 (API level 26) and higher versions of the platform, |
| 5240 | * a 64-bit number (expressed as a hexadecimal string), unique to |
| 5241 | * each combination of app-signing key, user, and device. |
| 5242 | * Values of {@code ANDROID_ID} are scoped by signing key and user. |
| 5243 | * The value may change if a factory reset is performed on the |
| 5244 | * device or if an APK signing key changes. |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5245 | * |
Dave Friedman | 4b3a4b5 | 2017-06-14 18:45:58 -0700 | [diff] [blame] | 5246 | * For more information about how the platform handles {@code ANDROID_ID} |
| 5247 | * in Android 8.0 (API level 26) and higher, see <a |
| 5248 | * href="{@docRoot}preview/behavior-changes.html#privacy-all"> |
| 5249 | * Android 8.0 Behavior Changes</a>. |
| 5250 | * |
| 5251 | * <p class="note"><strong>Note:</strong> For apps that were installed |
| 5252 | * prior to updating the device to a version of Android 8.0 |
| 5253 | * (API level 26) or higher, the value of {@code ANDROID_ID} changes |
| 5254 | * if the app is uninstalled and then reinstalled after the OTA. |
| 5255 | * To preserve values across uninstalls after an OTA to Android 8.0 |
| 5256 | * or higher, developers can use |
| 5257 | * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> |
| 5258 | * Key/Value Backup</a>.</p> |
| 5259 | * |
| 5260 | * <p>In versions of the platform lower than Android 8.0 (API level 26), |
| 5261 | * a 64-bit number (expressed as a hexadecimal string) that is randomly |
| 5262 | * generated when the user first sets up the device and should remain |
| 5263 | * constant for the lifetime of the user's device. |
| 5264 | * |
| 5265 | * On devices that have |
| 5266 | * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> |
| 5267 | * multiple users</a>, each user appears as a |
| 5268 | * completely separate device, so the {@code ANDROID_ID} value is |
| 5269 | * unique to each user.</p> |
| 5270 | * |
| 5271 | * <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] | 5272 | * to the Instant App, it is generated when the Instant App is first installed and reset if |
| 5273 | * the user clears the Instant App. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5274 | */ |
| 5275 | public static final String ANDROID_ID = "android_id"; |
| 5276 | |
| 5277 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5278 | * @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] | 5279 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5280 | @Deprecated |
| 5281 | public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5282 | |
| 5283 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5284 | * @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] | 5285 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 5286 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5287 | public static final String DATA_ROAMING = Global.DATA_ROAMING; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5288 | |
| 5289 | /** |
| 5290 | * Setting to record the input method used by default, holding the ID |
| 5291 | * of the desired method. |
| 5292 | */ |
| 5293 | public static final String DEFAULT_INPUT_METHOD = "default_input_method"; |
| 5294 | |
| 5295 | /** |
satok | ab751aa | 2010-09-14 19:17:36 +0900 | [diff] [blame] | 5296 | * Setting to record the input method subtype used by default, holding the ID |
| 5297 | * of the desired method. |
| 5298 | */ |
| 5299 | public static final String SELECTED_INPUT_METHOD_SUBTYPE = |
| 5300 | "selected_input_method_subtype"; |
| 5301 | |
| 5302 | /** |
satok | 723a27e | 2010-11-11 14:58:11 +0900 | [diff] [blame] | 5303 | * Setting to record the history of input method subtype, holding the pair of ID of IME |
| 5304 | * and its last used subtype. |
| 5305 | * @hide |
| 5306 | */ |
| 5307 | public static final String INPUT_METHODS_SUBTYPE_HISTORY = |
| 5308 | "input_methods_subtype_history"; |
| 5309 | |
| 5310 | /** |
satok | 5c58dfc | 2010-12-14 21:54:47 +0900 | [diff] [blame] | 5311 | * Setting to record the visibility of input method selector |
| 5312 | */ |
| 5313 | public static final String INPUT_METHOD_SELECTOR_VISIBILITY = |
| 5314 | "input_method_selector_visibility"; |
| 5315 | |
| 5316 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5317 | * The currently selected voice interaction service flattened ComponentName. |
| 5318 | * @hide |
| 5319 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 5320 | @TestApi |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 5321 | public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; |
| 5322 | |
| 5323 | /** |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5324 | * The currently selected autofill service flattened ComponentName. |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5325 | * @hide |
| 5326 | */ |
| 5327 | @TestApi |
Felipe Leme | 640f30a | 2017-03-06 15:44:06 -0800 | [diff] [blame] | 5328 | public static final String AUTOFILL_SERVICE = "autofill_service"; |
Felipe Leme | 5381aa4 | 2016-10-13 09:02:32 -0700 | [diff] [blame] | 5329 | |
| 5330 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5331 | * Boolean indicating if Autofill supports field classification. |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5332 | * |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5333 | * @see android.service.autofill.AutofillService |
| 5334 | * |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5335 | * @hide |
| 5336 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5337 | @SystemApi |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5338 | @TestApi |
Felipe Leme | 329d040 | 2017-12-06 09:22:43 -0800 | [diff] [blame] | 5339 | public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = |
| 5340 | "autofill_field_classification"; |
Felipe Leme | 24d7173 | 2017-10-20 10:32:57 -0700 | [diff] [blame] | 5341 | |
| 5342 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5343 | * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5344 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5345 | * @hide |
| 5346 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5347 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5348 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5349 | public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = |
| 5350 | "autofill_user_data_max_user_data_size"; |
| 5351 | |
| 5352 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5353 | * Defines value returned by |
| 5354 | * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5355 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5356 | * @hide |
| 5357 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5358 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5359 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5360 | public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = |
| 5361 | "autofill_user_data_max_field_classification_size"; |
| 5362 | |
| 5363 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5364 | * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5365 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5366 | * @hide |
| 5367 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5368 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5369 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5370 | public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = |
| 5371 | "autofill_user_data_max_value_length"; |
| 5372 | |
| 5373 | /** |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5374 | * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5375 | * |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5376 | * @hide |
| 5377 | */ |
Felipe Leme | 78172e7 | 2017-12-08 17:01:15 -0800 | [diff] [blame] | 5378 | @SystemApi |
Felipe Leme | bbfed90 | 2017-12-20 15:54:33 -0800 | [diff] [blame] | 5379 | @TestApi |
Felipe Leme | 452886a | 2017-11-27 13:09:13 -0800 | [diff] [blame] | 5380 | public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = |
| 5381 | "autofill_user_data_min_value_length"; |
| 5382 | |
| 5383 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5384 | * @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] | 5385 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5386 | @Deprecated |
| 5387 | public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5388 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5389 | /** |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5390 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5391 | * @hide |
| 5392 | */ |
Felipe Leme | 9923012 | 2017-06-12 14:33:02 -0700 | [diff] [blame] | 5393 | @TestApi |
Russell Brenner | de6ae44 | 2012-09-26 20:53:10 -0700 | [diff] [blame] | 5394 | public static final String USER_SETUP_COMPLETE = "user_setup_complete"; |
| 5395 | |
| 5396 | /** |
Sujith Ramakrishnan | 314df16 | 2017-06-16 18:03:18 -0700 | [diff] [blame] | 5397 | * Whether the current user has been set up via setup wizard (0 = false, 1 = true) |
| 5398 | * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 |
| 5399 | * in case SetupWizard has been re-enabled on TV devices. |
| 5400 | * |
| 5401 | * @hide |
| 5402 | */ |
| 5403 | public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; |
| 5404 | |
| 5405 | /** |
Ido Ofir | d193c67 | 2016-03-01 13:27:54 -0800 | [diff] [blame] | 5406 | * Prefix for category name that marks whether a suggested action from that category was |
| 5407 | * completed. |
| 5408 | * @hide |
| 5409 | */ |
| 5410 | public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; |
| 5411 | |
| 5412 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5413 | * List of input methods that are currently enabled. This is a string |
| 5414 | * containing the IDs of all enabled input methods, each ID separated |
| 5415 | * by ':'. |
| 5416 | */ |
| 5417 | public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5418 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5419 | /** |
Amith Yamasani | e861ec1 | 2010-03-24 21:39:27 -0700 | [diff] [blame] | 5420 | * List of system input methods that are currently disabled. This is a string |
| 5421 | * containing the IDs of all disabled input methods, each ID separated |
| 5422 | * by ':'. |
| 5423 | * @hide |
| 5424 | */ |
| 5425 | public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; |
| 5426 | |
| 5427 | /** |
Michael Wright | 7b5a96b | 2014-08-09 19:28:42 -0700 | [diff] [blame] | 5428 | * Whether to show the IME when a hard keyboard is connected. This is a boolean that |
| 5429 | * determines if the IME should be shown when a hard keyboard is attached. |
| 5430 | * @hide |
| 5431 | */ |
| 5432 | public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; |
| 5433 | |
| 5434 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5435 | * Host name and port for global http proxy. Uses ':' seperator for |
| 5436 | * between host and port. |
| 5437 | * |
| 5438 | * @deprecated Use {@link Global#HTTP_PROXY} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5439 | */ |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 5440 | @Deprecated |
| 5441 | public static final String HTTP_PROXY = Global.HTTP_PROXY; |
Robert Greenwalt | e90aa5e | 2010-09-01 11:34:05 -0700 | [diff] [blame] | 5442 | |
| 5443 | /** |
Robin Lee | 244ce8e | 2016-01-05 18:03:46 +0000 | [diff] [blame] | 5444 | * Package designated as always-on VPN provider. |
| 5445 | * |
| 5446 | * @hide |
| 5447 | */ |
| 5448 | public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; |
| 5449 | |
| 5450 | /** |
Robin Lee | 17e6183 | 2016-05-09 13:46:28 +0100 | [diff] [blame] | 5451 | * Whether to block networking outside of VPN connections while always-on is set. |
| 5452 | * @see #ALWAYS_ON_VPN_APP |
| 5453 | * |
| 5454 | * @hide |
| 5455 | */ |
| 5456 | public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; |
| 5457 | |
| 5458 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5459 | * Whether applications can be installed for this user via the system's |
| 5460 | * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. |
| 5461 | * |
| 5462 | * <p>1 = permit app installation via the system package installer intent |
| 5463 | * <p>0 = do not allow use of the package installer |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5464 | * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use |
| 5465 | * {@link PackageManager#canRequestPackageInstalls()} |
| 5466 | * @see PackageManager#canRequestPackageInstalls() |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5467 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 5468 | public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5469 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5470 | /** |
Suprabh Shukla | 0b1356f | 2017-02-21 14:33:50 -0800 | [diff] [blame] | 5471 | * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that |
| 5472 | * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it |
| 5473 | * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} |
| 5474 | * on behalf of the profile owner if needed to make the change transparent for profile |
| 5475 | * owners. |
| 5476 | * |
| 5477 | * @hide |
| 5478 | */ |
| 5479 | public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = |
| 5480 | "unknown_sources_default_reversed"; |
| 5481 | |
| 5482 | /** |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5483 | * Comma-separated list of location providers that activities may access. Do not rely on |
| 5484 | * this value being present in settings.db or on ContentObserver notifications on the |
| 5485 | * corresponding Uri. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5486 | * |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5487 | * @deprecated use {@link #LOCATION_MODE} and |
| 5488 | * {@link LocationManager#MODE_CHANGED_ACTION} (or |
| 5489 | * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5490 | */ |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5491 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5492 | public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5493 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5494 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5495 | * The degree of location access enabled by the user. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5496 | * <p> |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5497 | * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link |
| 5498 | * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link |
| 5499 | * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link |
| 5500 | * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location |
| 5501 | * modes that might be added in the future. |
Tom O'Neill | 923c0dc | 2014-03-03 11:07:55 -0800 | [diff] [blame] | 5502 | * <p> |
| 5503 | * Note: do not rely on this value being present in settings.db or on ContentObserver |
| 5504 | * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} |
| 5505 | * to receive changes in this value. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5506 | */ |
| 5507 | public static final String LOCATION_MODE = "location_mode"; |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 5508 | /** |
| 5509 | * Stores the previous location mode when {@link #LOCATION_MODE} is set to |
| 5510 | * {@link #LOCATION_MODE_OFF} |
| 5511 | * @hide |
| 5512 | */ |
| 5513 | public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode"; |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 5514 | |
| 5515 | /** |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 5516 | * Sets all location providers to the previous states before location was turned off. |
| 5517 | * @hide |
| 5518 | */ |
| 5519 | public static final int LOCATION_MODE_PREVIOUS = -1; |
| 5520 | /** |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 5521 | * Location access disabled. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5522 | */ |
| 5523 | public static final int LOCATION_MODE_OFF = 0; |
| 5524 | /** |
| 5525 | * Network Location Provider disabled, but GPS and other sensors enabled. |
| 5526 | */ |
| 5527 | public static final int LOCATION_MODE_SENSORS_ONLY = 1; |
| 5528 | /** |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 5529 | * Reduced power usage, such as limiting the number of GPS updates per hour. Requests |
| 5530 | * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to |
| 5531 | * {@link android.location.Criteria#POWER_MEDIUM}. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 5532 | */ |
| 5533 | public static final int LOCATION_MODE_BATTERY_SAVING = 2; |
| 5534 | /** |
| 5535 | * Best-effort location computation allowed. |
| 5536 | */ |
| 5537 | public static final int LOCATION_MODE_HIGH_ACCURACY = 3; |
| 5538 | |
| 5539 | /** |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5540 | * A flag containing settings used for biometric weak |
| 5541 | * @hide |
| 5542 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5543 | @Deprecated |
Danielle Millett | 925a7d8 | 2012-03-19 18:02:20 -0400 | [diff] [blame] | 5544 | public static final String LOCK_BIOMETRIC_WEAK_FLAGS = |
| 5545 | "lock_biometric_weak_flags"; |
| 5546 | |
| 5547 | /** |
Jason Monk | 94cfd9d | 2014-10-31 13:18:21 -0400 | [diff] [blame] | 5548 | * Whether lock-to-app will lock the keyguard when exiting. |
| 5549 | * @hide |
| 5550 | */ |
| 5551 | public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; |
| 5552 | |
| 5553 | /** |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5554 | * Whether autolock is enabled (0 = false, 1 = true) |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5555 | * |
| 5556 | * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5557 | * 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] | 5558 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5559 | */ |
Adrian Roos | 9dd16eb | 2015-01-08 16:20:49 +0100 | [diff] [blame] | 5560 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5561 | public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; |
| 5562 | |
| 5563 | /** |
| 5564 | * Whether lock pattern is visible as user enters (0 = false, 1 = true) |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5565 | * |
| 5566 | * @deprecated Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5567 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5568 | */ |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5569 | @Deprecated |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5570 | public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; |
| 5571 | |
| 5572 | /** |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5573 | * Whether lock pattern will vibrate as user enters (0 = false, 1 = |
| 5574 | * true) |
| 5575 | * |
| 5576 | * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the |
| 5577 | * lockscreen uses |
| 5578 | * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. |
Adrian Roos | 7811d9f | 2015-07-27 15:10:13 -0700 | [diff] [blame] | 5579 | * Accessing this setting from an app that is targeting |
Deepanshu Gupta | e836a22 | 2015-07-31 12:11:07 -0700 | [diff] [blame] | 5580 | * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5581 | */ |
Jeff Sharkey | 5ed9d68 | 2012-10-10 14:28:27 -0700 | [diff] [blame] | 5582 | @Deprecated |
| 5583 | public static final String |
| 5584 | LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; |
Amith Yamasani | 156c435 | 2010-03-05 17:10:03 -0800 | [diff] [blame] | 5585 | |
| 5586 | /** |
Jim Miller | bc4603b | 2010-08-30 21:21:34 -0700 | [diff] [blame] | 5587 | * This preference allows the device to be locked given time after screen goes off, |
| 5588 | * subject to current DeviceAdmin policy limits. |
| 5589 | * @hide |
| 5590 | */ |
| 5591 | public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; |
| 5592 | |
| 5593 | |
| 5594 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5595 | * This preference contains the string that shows for owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5596 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5597 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5598 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5599 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5600 | public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; |
| 5601 | |
| 5602 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5603 | * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5604 | * @hide |
| 5605 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5606 | @Deprecated |
Michael Jurka | aa2859a | 2012-10-24 12:46:49 -0700 | [diff] [blame] | 5607 | public static final String LOCK_SCREEN_APPWIDGET_IDS = |
| 5608 | "lock_screen_appwidget_ids"; |
Jim Miller | f229e4d | 2012-09-12 20:32:50 -0700 | [diff] [blame] | 5609 | |
| 5610 | /** |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5611 | * Id of the appwidget shown on the lock screen when appwidgets are disabled. |
| 5612 | * @hide |
| 5613 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5614 | @Deprecated |
Jim Miller | 5111726 | 2012-11-04 17:58:09 -0800 | [diff] [blame] | 5615 | public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = |
| 5616 | "lock_screen_fallback_appwidget_id"; |
| 5617 | |
| 5618 | /** |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5619 | * Index of the lockscreen appwidget to restore, -1 if none. |
| 5620 | * @hide |
| 5621 | */ |
Adrian Roos | 230635e | 2015-01-07 20:50:29 +0100 | [diff] [blame] | 5622 | @Deprecated |
John Spurlock | 5f050e5 | 2012-10-27 10:44:19 -0400 | [diff] [blame] | 5623 | public static final String LOCK_SCREEN_STICKY_APPWIDGET = |
| 5624 | "lock_screen_sticky_appwidget"; |
| 5625 | |
| 5626 | /** |
| 5627 | * This preference enables showing the owner info on LockScreen. |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5628 | * @hide |
Jim Miller | 187ec58 | 2013-04-15 18:27:54 -0700 | [diff] [blame] | 5629 | * @deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5630 | */ |
Aurimas Liutikas | 514c5ef | 2016-05-24 15:22:55 -0700 | [diff] [blame] | 5631 | @Deprecated |
Jim Miller | 253a5ef | 2010-10-13 20:57:29 -0700 | [diff] [blame] | 5632 | public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = |
| 5633 | "lock_screen_owner_info_enabled"; |
| 5634 | |
| 5635 | /** |
Dan Sandler | 5d7c3cc | 2014-02-18 17:35:15 -0500 | [diff] [blame] | 5636 | * When set by a user, allows notifications to be shown atop a securely locked screen |
| 5637 | * in their full "private" form (same as when the device is unlocked). |
Dan Sandler | fd16d56 | 2014-02-13 18:43:31 -0800 | [diff] [blame] | 5638 | * @hide |
| 5639 | */ |
| 5640 | public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = |
| 5641 | "lock_screen_allow_private_notifications"; |
| 5642 | |
| 5643 | /** |
Adrian Roos | 3aec638 | 2016-02-05 14:19:01 -0800 | [diff] [blame] | 5644 | * When set by a user, allows notification remote input atop a securely locked screen |
| 5645 | * without having to unlock |
| 5646 | * @hide |
| 5647 | */ |
| 5648 | public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = |
| 5649 | "lock_screen_allow_remote_input"; |
| 5650 | |
| 5651 | /** |
Chris Wren | cd8f4f7 | 2014-08-27 18:48:13 -0400 | [diff] [blame] | 5652 | * Set by the system to track if the user needs to see the call to action for |
| 5653 | * the lockscreen notification policy. |
| 5654 | * @hide |
| 5655 | */ |
| 5656 | public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = |
| 5657 | "show_note_about_notification_hiding"; |
| 5658 | |
| 5659 | /** |
Adrian Roos | 3870d45 | 2014-09-05 18:22:28 +0200 | [diff] [blame] | 5660 | * Set to 1 by the system after trust agents have been initialized. |
| 5661 | * @hide |
| 5662 | */ |
| 5663 | public static final String TRUST_AGENTS_INITIALIZED = |
| 5664 | "trust_agents_initialized"; |
| 5665 | |
| 5666 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5667 | * The Logging ID (a unique 64-bit value) as a hex string. |
| 5668 | * Used as a pseudonymous identifier for logging. |
| 5669 | * @deprecated This identifier is poorly initialized and has |
| 5670 | * many collisions. It should not be used. |
| 5671 | */ |
| 5672 | @Deprecated |
| 5673 | public static final String LOGGING_ID = "logging_id"; |
| 5674 | |
| 5675 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5676 | * @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] | 5677 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5678 | @Deprecated |
| 5679 | public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5680 | |
| 5681 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5682 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5683 | */ |
| 5684 | public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5685 | |
| 5686 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5687 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5688 | */ |
| 5689 | public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5690 | |
| 5691 | /** |
Dan Egnor | 1c9131c | 2010-02-13 10:38:55 -0800 | [diff] [blame] | 5692 | * No longer supported. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5693 | */ |
| 5694 | public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5695 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5696 | /** |
| 5697 | * Settings classname to launch when Settings is clicked from All |
| 5698 | * Applications. Needed because of user testing between the old |
| 5699 | * and new Settings apps. |
| 5700 | */ |
| 5701 | // TODO: 881807 |
| 5702 | public static final String SETTINGS_CLASSNAME = "settings_classname"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5703 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5704 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5705 | * @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] | 5706 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5707 | @Deprecated |
| 5708 | 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] | 5709 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5710 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5711 | * @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] | 5712 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 5713 | @Deprecated |
| 5714 | public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 5715 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5716 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5717 | * If accessibility is enabled. |
| 5718 | */ |
| 5719 | public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; |
| 5720 | |
| 5721 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5722 | * Setting specifying if the accessibility shortcut is enabled. |
| 5723 | * @hide |
| 5724 | */ |
| 5725 | public static final String ACCESSIBILITY_SHORTCUT_ENABLED = |
| 5726 | "accessibility_shortcut_enabled"; |
| 5727 | |
| 5728 | /** |
| 5729 | * Setting specifying if the accessibility shortcut is enabled. |
| 5730 | * @hide |
| 5731 | */ |
| 5732 | public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = |
| 5733 | "accessibility_shortcut_on_lock_screen"; |
| 5734 | |
| 5735 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5736 | * Setting specifying if the accessibility shortcut dialog has been shown to this user. |
| 5737 | * @hide |
| 5738 | */ |
| 5739 | public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = |
| 5740 | "accessibility_shortcut_dialog_shown"; |
| 5741 | |
| 5742 | /** |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 5743 | * Setting specifying the accessibility service to be toggled via the accessibility |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 5744 | * shortcut. Must be its flattened {@link ComponentName}. |
| 5745 | * @hide |
| 5746 | */ |
| 5747 | public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = |
| 5748 | "accessibility_shortcut_target_service"; |
| 5749 | |
| 5750 | /** |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 5751 | * Setting specifying the accessibility service or feature to be toggled via the |
| 5752 | * accessibility button in the navigation bar. This is either a flattened |
| 5753 | * {@link ComponentName} or the class name of a system class implementing a supported |
| 5754 | * accessibility feature. |
| 5755 | * @hide |
| 5756 | */ |
| 5757 | public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = |
| 5758 | "accessibility_button_target_component"; |
| 5759 | |
| 5760 | /** |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5761 | * If touch exploration is enabled. |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5762 | */ |
Svetoslav Ganov | 00aabf7 | 2011-07-21 11:35:03 -0700 | [diff] [blame] | 5763 | public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; |
Svetoslav Ganov | 35bfede | 2011-07-14 17:57:06 -0700 | [diff] [blame] | 5764 | |
| 5765 | /** |
svetoslavganov | 75986cf | 2009-05-14 22:28:01 -0700 | [diff] [blame] | 5766 | * List of the enabled accessibility providers. |
| 5767 | */ |
| 5768 | public static final String ENABLED_ACCESSIBILITY_SERVICES = |
| 5769 | "enabled_accessibility_services"; |
| 5770 | |
| 5771 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 5772 | * List of the accessibility services to which the user has granted |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 5773 | * permission to put the device into touch exploration mode. |
| 5774 | * |
| 5775 | * @hide |
| 5776 | */ |
| 5777 | public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = |
| 5778 | "touch_exploration_granted_accessibility_services"; |
| 5779 | |
| 5780 | /** |
Lucas Dupin | 6bd8601 | 2017-12-05 17:58:57 -0800 | [diff] [blame] | 5781 | * Uri of the slice that's presented on the keyguard. |
| 5782 | * Defaults to a slice with the date and next alarm. |
| 5783 | * |
| 5784 | * @hide |
| 5785 | */ |
| 5786 | public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; |
| 5787 | |
| 5788 | /** |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5789 | * Whether to speak passwords while in accessibility mode. |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5790 | * |
| 5791 | * @deprecated The speaking of passwords is controlled by individual accessibility services. |
| 5792 | * Apps should ignore this setting and provide complete information to accessibility |
| 5793 | * 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] | 5794 | */ |
Phil Weaver | 385912e | 2017-02-10 10:06:56 -0800 | [diff] [blame] | 5795 | @Deprecated |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 5796 | public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; |
| 5797 | |
| 5798 | /** |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 5799 | * Whether to draw text with high contrast while in accessibility mode. |
| 5800 | * |
| 5801 | * @hide |
| 5802 | */ |
| 5803 | public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = |
| 5804 | "high_text_contrast_enabled"; |
| 5805 | |
| 5806 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5807 | * Setting that specifies whether the display magnification is enabled via a system-wide |
| 5808 | * triple tap gesture. Display magnifications allows the user to zoom in the display content |
| 5809 | * and is targeted to low vision users. The current magnification scale is controlled by |
| 5810 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5811 | * |
| 5812 | * @hide |
| 5813 | */ |
Eugene Susla | a55f74e | 2017-09-21 13:48:50 -0700 | [diff] [blame] | 5814 | @TestApi |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5815 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = |
| 5816 | "accessibility_display_magnification_enabled"; |
| 5817 | |
| 5818 | /** |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5819 | * Setting that specifies whether the display magnification is enabled via a shortcut |
| 5820 | * affordance within the system's navigation area. Display magnifications allows the user to |
| 5821 | * zoom in the display content and is targeted to low vision users. The current |
| 5822 | * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. |
| 5823 | * |
| 5824 | * @hide |
| 5825 | */ |
| 5826 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = |
| 5827 | "accessibility_display_magnification_navbar_enabled"; |
| 5828 | |
| 5829 | /** |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5830 | * Setting that specifies what the display magnification scale is. |
| 5831 | * Display magnifications allows the user to zoom in the display |
| 5832 | * content and is targeted to low vision users. Whether a display |
| 5833 | * magnification is performed is controlled by |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 5834 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and |
| 5835 | * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5836 | * |
| 5837 | * @hide |
| 5838 | */ |
| 5839 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = |
| 5840 | "accessibility_display_magnification_scale"; |
| 5841 | |
| 5842 | /** |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 5843 | * Unused mangnification setting |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5844 | * |
| 5845 | * @hide |
Phil Weaver | 89e3ffc | 2016-09-19 13:51:10 -0700 | [diff] [blame] | 5846 | * @deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5847 | */ |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 5848 | @Deprecated |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 5849 | public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = |
| 5850 | "accessibility_display_magnification_auto_update"; |
| 5851 | |
| 5852 | /** |
Anna Galusza | 9b27811 | 2016-01-04 11:37:37 -0800 | [diff] [blame] | 5853 | * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be |
| 5854 | * modified from an AccessibilityService using the SoftKeyboardController. |
| 5855 | * |
| 5856 | * @hide |
| 5857 | */ |
| 5858 | public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = |
| 5859 | "accessibility_soft_keyboard_mode"; |
| 5860 | |
| 5861 | /** |
| 5862 | * Default soft keyboard behavior. |
| 5863 | * |
| 5864 | * @hide |
| 5865 | */ |
| 5866 | public static final int SHOW_MODE_AUTO = 0; |
| 5867 | |
| 5868 | /** |
| 5869 | * Soft keyboard is never shown. |
| 5870 | * |
| 5871 | * @hide |
| 5872 | */ |
| 5873 | public static final int SHOW_MODE_HIDDEN = 1; |
| 5874 | |
| 5875 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5876 | * Setting that specifies whether timed text (captions) should be |
| 5877 | * displayed in video content. Text display properties are controlled by |
| 5878 | * the following settings: |
| 5879 | * <ul> |
| 5880 | * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} |
| 5881 | * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} |
| 5882 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} |
| 5883 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} |
| 5884 | * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} |
| 5885 | * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5886 | * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5887 | * </ul> |
| 5888 | * |
| 5889 | * @hide |
| 5890 | */ |
| 5891 | public static final String ACCESSIBILITY_CAPTIONING_ENABLED = |
| 5892 | "accessibility_captioning_enabled"; |
| 5893 | |
| 5894 | /** |
| 5895 | * Setting that specifies the language for captions as a locale string, |
| 5896 | * e.g. en_US. |
| 5897 | * |
| 5898 | * @see java.util.Locale#toString |
| 5899 | * @hide |
| 5900 | */ |
| 5901 | public static final String ACCESSIBILITY_CAPTIONING_LOCALE = |
| 5902 | "accessibility_captioning_locale"; |
| 5903 | |
| 5904 | /** |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 5905 | * Integer property that specifies the preset style for captions, one |
| 5906 | * of: |
| 5907 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5908 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} |
| 5909 | * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} |
Alan Viverette | 43a1e3d | 2013-08-02 16:45:03 -0700 | [diff] [blame] | 5910 | * </ul> |
| 5911 | * |
| 5912 | * @see java.util.Locale#toString |
| 5913 | * @hide |
| 5914 | */ |
| 5915 | public static final String ACCESSIBILITY_CAPTIONING_PRESET = |
| 5916 | "accessibility_captioning_preset"; |
| 5917 | |
| 5918 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5919 | * Integer property that specifes the background color for captions as a |
| 5920 | * packed 32-bit color. |
| 5921 | * |
| 5922 | * @see android.graphics.Color#argb |
| 5923 | * @hide |
| 5924 | */ |
| 5925 | public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = |
| 5926 | "accessibility_captioning_background_color"; |
| 5927 | |
| 5928 | /** |
| 5929 | * Integer property that specifes the foreground color for captions as a |
| 5930 | * packed 32-bit color. |
| 5931 | * |
| 5932 | * @see android.graphics.Color#argb |
| 5933 | * @hide |
| 5934 | */ |
| 5935 | public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = |
| 5936 | "accessibility_captioning_foreground_color"; |
| 5937 | |
| 5938 | /** |
| 5939 | * Integer property that specifes the edge type for captions, one of: |
| 5940 | * <ul> |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5941 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} |
| 5942 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} |
| 5943 | * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5944 | * </ul> |
| 5945 | * |
| 5946 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR |
| 5947 | * @hide |
| 5948 | */ |
| 5949 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = |
| 5950 | "accessibility_captioning_edge_type"; |
| 5951 | |
| 5952 | /** |
| 5953 | * Integer property that specifes the edge color for captions as a |
| 5954 | * packed 32-bit color. |
| 5955 | * |
| 5956 | * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE |
| 5957 | * @see android.graphics.Color#argb |
| 5958 | * @hide |
| 5959 | */ |
| 5960 | public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = |
| 5961 | "accessibility_captioning_edge_color"; |
| 5962 | |
| 5963 | /** |
Alan Viverette | 55d7062 | 2013-12-11 15:22:14 -0800 | [diff] [blame] | 5964 | * Integer property that specifes the window color for captions as a |
| 5965 | * packed 32-bit color. |
| 5966 | * |
| 5967 | * @see android.graphics.Color#argb |
| 5968 | * @hide |
| 5969 | */ |
| 5970 | public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = |
| 5971 | "accessibility_captioning_window_color"; |
| 5972 | |
| 5973 | /** |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5974 | * String property that specifies the typeface for captions, one of: |
| 5975 | * <ul> |
| 5976 | * <li>DEFAULT |
| 5977 | * <li>MONOSPACE |
| 5978 | * <li>SANS_SERIF |
| 5979 | * <li>SERIF |
| 5980 | * </ul> |
| 5981 | * |
| 5982 | * @see android.graphics.Typeface |
| 5983 | * @hide |
| 5984 | */ |
| 5985 | public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = |
| 5986 | "accessibility_captioning_typeface"; |
| 5987 | |
| 5988 | /** |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5989 | * Floating point property that specifies font scaling for captions. |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5990 | * |
| 5991 | * @hide |
| 5992 | */ |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 5993 | public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = |
| 5994 | "accessibility_captioning_font_scale"; |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 5995 | |
| 5996 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 5997 | * Setting that specifies whether display color inversion is enabled. |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 5998 | */ |
| 5999 | public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = |
| 6000 | "accessibility_display_inversion_enabled"; |
| 6001 | |
| 6002 | /** |
Alan Viverette | 410d4e3 | 2013-09-30 15:37:38 -0700 | [diff] [blame] | 6003 | * Setting that specifies whether display color space adjustment is |
| 6004 | * enabled. |
| 6005 | * |
| 6006 | * @hide |
| 6007 | */ |
| 6008 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = |
| 6009 | "accessibility_display_daltonizer_enabled"; |
| 6010 | |
| 6011 | /** |
| 6012 | * Integer property that specifies the type of color space adjustment to |
| 6013 | * perform. Valid values are defined in AccessibilityManager. |
| 6014 | * |
| 6015 | * @hide |
| 6016 | */ |
| 6017 | public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = |
| 6018 | "accessibility_display_daltonizer"; |
| 6019 | |
| 6020 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6021 | * Setting that specifies whether automatic click when the mouse pointer stops moving is |
| 6022 | * enabled. |
| 6023 | * |
| 6024 | * @hide |
| 6025 | */ |
| 6026 | public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = |
| 6027 | "accessibility_autoclick_enabled"; |
| 6028 | |
| 6029 | /** |
| 6030 | * Integer setting specifying amount of time in ms the mouse pointer has to stay still |
| 6031 | * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. |
| 6032 | * |
| 6033 | * @see #ACCESSIBILITY_AUTOCLICK_ENABLED |
| 6034 | * @hide |
| 6035 | */ |
| 6036 | public static final String ACCESSIBILITY_AUTOCLICK_DELAY = |
| 6037 | "accessibility_autoclick_delay"; |
| 6038 | |
| 6039 | /** |
Jun Mukai | 19a5601 | 2015-11-24 11:25:52 -0800 | [diff] [blame] | 6040 | * Whether or not larger size icons are used for the pointer of mouse/trackpad for |
| 6041 | * accessibility. |
| 6042 | * (0 = false, 1 = true) |
| 6043 | * @hide |
| 6044 | */ |
| 6045 | public static final String ACCESSIBILITY_LARGE_POINTER_ICON = |
| 6046 | "accessibility_large_pointer_icon"; |
| 6047 | |
| 6048 | /** |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 6049 | * 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] | 6050 | * @hide |
| 6051 | */ |
| 6052 | public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; |
| 6053 | |
| 6054 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 6055 | * The duration in milliseconds between the first tap's up event and the second tap's |
| 6056 | * down event for an interaction to be considered part of the same multi-press. |
| 6057 | * @hide |
| 6058 | */ |
| 6059 | public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; |
| 6060 | |
| 6061 | /** |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6062 | * List of the enabled print services. |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6063 | * |
| 6064 | * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade |
| 6065 | * from pre-N. |
| 6066 | * |
Svetoslav Ganov | 4b9a4d1 | 2013-06-11 15:20:06 -0700 | [diff] [blame] | 6067 | * @hide |
| 6068 | */ |
| 6069 | public static final String ENABLED_PRINT_SERVICES = |
| 6070 | "enabled_print_services"; |
| 6071 | |
| 6072 | /** |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6073 | * List of the disabled print services. |
| 6074 | * |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6075 | * @hide |
| 6076 | */ |
Svetoslav Ganov | 2dcedc12 | 2017-06-07 18:50:02 -0700 | [diff] [blame] | 6077 | @TestApi |
Philip P. Moltmann | 8141bdf | 2015-12-21 17:03:05 -0800 | [diff] [blame] | 6078 | public static final String DISABLED_PRINT_SERVICES = |
| 6079 | "disabled_print_services"; |
Svetoslav Ganov | 6bd20bc | 2013-09-02 15:24:45 -0700 | [diff] [blame] | 6080 | |
| 6081 | /** |
Alan Viverette | 5e8d837 | 2016-02-03 15:38:59 -0500 | [diff] [blame] | 6082 | * The saved value for WindowManagerService.setForcedDisplayDensity() |
| 6083 | * formatted as a single integer representing DPI. If unset, then use |
| 6084 | * the real display density. |
| 6085 | * |
| 6086 | * @hide |
| 6087 | */ |
| 6088 | public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; |
| 6089 | |
| 6090 | /** |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6091 | * Setting to always use the default text-to-speech settings regardless |
| 6092 | * of the application settings. |
| 6093 | * 1 = override application settings, |
| 6094 | * 0 = use application settings (if specified). |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6095 | * |
| 6096 | * @deprecated The value of this setting is no longer respected by |
| 6097 | * 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] | 6098 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6099 | @Deprecated |
Jean-Michel Trivi | f62ba45 | 2009-06-04 14:55:24 -0700 | [diff] [blame] | 6100 | public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; |
| 6101 | |
| 6102 | /** |
| 6103 | * Default text-to-speech engine speech rate. 100 = 1x |
| 6104 | */ |
| 6105 | public static final String TTS_DEFAULT_RATE = "tts_default_rate"; |
| 6106 | |
| 6107 | /** |
| 6108 | * Default text-to-speech engine pitch. 100 = 1x |
| 6109 | */ |
| 6110 | public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; |
| 6111 | |
| 6112 | /** |
| 6113 | * Default text-to-speech engine. |
| 6114 | */ |
| 6115 | public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; |
| 6116 | |
| 6117 | /** |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6118 | * Default text-to-speech language. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6119 | * |
| 6120 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6121 | * Sandwich release. Apps should never need to read this setting directly, |
| 6122 | * instead can query the TextToSpeech framework classes for the default |
| 6123 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6124 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6125 | @Deprecated |
Jean-Michel Trivi | f478267 | 2009-06-09 16:22:48 -0700 | [diff] [blame] | 6126 | public static final String TTS_DEFAULT_LANG = "tts_default_lang"; |
| 6127 | |
| 6128 | /** |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6129 | * Default text-to-speech country. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6130 | * |
| 6131 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6132 | * Sandwich release. Apps should never need to read this setting directly, |
| 6133 | * instead can query the TextToSpeech framework classes for the default |
| 6134 | * locale. {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6135 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6136 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6137 | public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; |
| 6138 | |
| 6139 | /** |
| 6140 | * Default text-to-speech locale variant. |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6141 | * |
| 6142 | * @deprecated this setting is no longer in use, as of the Ice Cream |
| 6143 | * Sandwich release. Apps should never need to read this setting directly, |
| 6144 | * instead can query the TextToSpeech framework classes for the |
| 6145 | * locale that is in use {@link TextToSpeech#getLanguage()}. |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6146 | */ |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6147 | @Deprecated |
Jean-Michel Trivi | a6fcc95 | 2009-06-19 14:06:01 -0700 | [diff] [blame] | 6148 | public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; |
| 6149 | |
| 6150 | /** |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6151 | * Stores the default tts locales on a per engine basis. Stored as |
| 6152 | * a comma seperated list of values, each value being of the form |
| 6153 | * {@code engine_name:locale} for example, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 6154 | * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This |
| 6155 | * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and |
| 6156 | * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this |
| 6157 | * setting directly, and can query the TextToSpeech framework classes |
| 6158 | * for the locale that is in use. |
Narayan Kamath | e5b8c4d | 2011-08-22 15:37:47 +0100 | [diff] [blame] | 6159 | * |
| 6160 | * @hide |
| 6161 | */ |
| 6162 | public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; |
| 6163 | |
| 6164 | /** |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 6165 | * Space delimited list of plugin packages that are enabled. |
| 6166 | */ |
| 6167 | public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; |
| 6168 | |
| 6169 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6170 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} |
| 6171 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6172 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6173 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6174 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6175 | Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6176 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6177 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6178 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} |
| 6179 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6180 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6181 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6182 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6183 | Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6184 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6185 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6186 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} |
| 6187 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6188 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6189 | @Deprecated |
| 6190 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = |
| 6191 | Global.WIFI_NUM_OPEN_NETWORKS_KEPT; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6192 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6193 | /** |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6194 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} |
| 6195 | * instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6196 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6197 | @Deprecated |
| 6198 | public static final String WIFI_ON = Global.WIFI_ON; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6199 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6200 | /** |
| 6201 | * The acceptable packet loss percentage (range 0 - 100) before trying |
| 6202 | * another AP on the same network. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6203 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6204 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6205 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6206 | public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = |
| 6207 | "wifi_watchdog_acceptable_packet_loss_percentage"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6208 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6209 | /** |
| 6210 | * The number of access points required for a network in order for the |
| 6211 | * watchdog to monitor it. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6212 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6213 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6214 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6215 | public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6216 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6217 | /** |
| 6218 | * The delay between background checks. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6219 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6220 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6221 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6222 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = |
| 6223 | "wifi_watchdog_background_check_delay_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6224 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6225 | /** |
| 6226 | * Whether the Wi-Fi watchdog is enabled for background checking even |
| 6227 | * after it thinks the user has connected to a good access point. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6228 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6229 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6230 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6231 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = |
| 6232 | "wifi_watchdog_background_check_enabled"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6233 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6234 | /** |
| 6235 | * The timeout for a background ping |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6236 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6237 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6238 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6239 | public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = |
| 6240 | "wifi_watchdog_background_check_timeout_ms"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6241 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6242 | /** |
| 6243 | * The number of initial pings to perform that *may* be ignored if they |
| 6244 | * fail. Again, if these fail, they will *not* be used in packet loss |
| 6245 | * calculation. For example, one network always seemed to time out for |
| 6246 | * the first couple pings, so this is set to 3 by default. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6247 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6248 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6249 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6250 | public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = |
| 6251 | "wifi_watchdog_initial_ignored_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6252 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6253 | /** |
| 6254 | * The maximum number of access points (per network) to attempt to test. |
| 6255 | * If this number is reached, the watchdog will no longer monitor the |
| 6256 | * initial connection state for the network. This is a safeguard for |
| 6257 | * networks containing multiple APs whose DNS does not respond to pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6258 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6259 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6260 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6261 | 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] | 6262 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6263 | /** |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6264 | * @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] | 6265 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6266 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6267 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 6268 | |
| 6269 | /** |
| 6270 | * 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] | 6271 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6272 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6273 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6274 | public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; |
| 6275 | |
| 6276 | /** |
| 6277 | * 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] | 6278 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6279 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6280 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6281 | public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 6282 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6283 | /** |
| 6284 | * The delay between pings. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6285 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6286 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6287 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6288 | 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] | 6289 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6290 | /** |
| 6291 | * The timeout per ping. |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6292 | * @deprecated This setting is not used. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6293 | */ |
Isaac Levy | d7b3e6a | 2011-07-20 18:15:30 -0700 | [diff] [blame] | 6294 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6295 | 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] | 6296 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6297 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6298 | * @deprecated Use |
| 6299 | * {@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] | 6300 | */ |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 6301 | @Deprecated |
| 6302 | 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] | 6303 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6304 | /** |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6305 | * @deprecated Use |
| 6306 | * {@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] | 6307 | */ |
Jeff Sharkey | bdfce2e | 2012-09-26 15:54:06 -0700 | [diff] [blame] | 6308 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6309 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6310 | Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6311 | |
| 6312 | /** |
Jeremy Joslin | 7929484 | 2014-12-03 17:15:28 -0800 | [diff] [blame] | 6313 | * The number of milliseconds to hold on to a PendingIntent based request. This delay gives |
| 6314 | * the receivers of the PendingIntent an opportunity to make a new network request before |
| 6315 | * the Network satisfying the request is potentially removed. |
| 6316 | * |
| 6317 | * @hide |
| 6318 | */ |
| 6319 | public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = |
| 6320 | "connectivity_release_pending_intent_delay_ms"; |
| 6321 | |
| 6322 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 6323 | * Whether background data usage is allowed. |
| 6324 | * |
| 6325 | * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, |
| 6326 | * availability of background data depends on several |
| 6327 | * combined factors. When background data is unavailable, |
| 6328 | * {@link ConnectivityManager#getActiveNetworkInfo()} will |
| 6329 | * now appear disconnected. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6330 | */ |
Jeff Sharkey | 3a844fc | 2011-08-16 14:37:57 -0700 | [diff] [blame] | 6331 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6332 | public static final String BACKGROUND_DATA = "background_data"; |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6333 | |
| 6334 | /** |
Bjorn Bringert | 98bfa39 | 2010-03-24 10:59:48 +0000 | [diff] [blame] | 6335 | * Origins for which browsers should allow geolocation by default. |
| 6336 | * The value is a space-separated list of origins. |
| 6337 | */ |
| 6338 | public static final String ALLOWED_GEOLOCATION_ORIGINS |
| 6339 | = "allowed_geolocation_origins"; |
| 6340 | |
| 6341 | /** |
Wink Saville | e9b06d7 | 2009-05-18 21:47:50 -0700 | [diff] [blame] | 6342 | * The preferred TTY mode 0 = TTy Off, CDMA default |
| 6343 | * 1 = TTY Full |
| 6344 | * 2 = TTY HCO |
| 6345 | * 3 = TTY VCO |
| 6346 | * @hide |
| 6347 | */ |
| 6348 | public static final String PREFERRED_TTY_MODE = |
| 6349 | "preferred_tty_mode"; |
| 6350 | |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6351 | /** |
Wink Saville | 04e71b3 | 2009-04-02 11:00:54 -0700 | [diff] [blame] | 6352 | * Whether the enhanced voice privacy mode is enabled. |
| 6353 | * 0 = normal voice privacy |
| 6354 | * 1 = enhanced voice privacy |
| 6355 | * @hide |
| 6356 | */ |
| 6357 | public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; |
| 6358 | |
| 6359 | /** |
| 6360 | * Whether the TTY mode mode is enabled. |
| 6361 | * 0 = disabled |
| 6362 | * 1 = enabled |
| 6363 | * @hide |
| 6364 | */ |
| 6365 | public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 6366 | |
| 6367 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6368 | * Controls whether settings backup is enabled. |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6369 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6370 | * @hide |
| 6371 | */ |
| 6372 | public static final String BACKUP_ENABLED = "backup_enabled"; |
| 6373 | |
| 6374 | /** |
Christopher Tate | cce9da5 | 2010-02-03 15:11:15 -0800 | [diff] [blame] | 6375 | * Controls whether application data is automatically restored from backup |
| 6376 | * at install time. |
| 6377 | * Type: int ( 0 = disabled, 1 = enabled ) |
| 6378 | * @hide |
| 6379 | */ |
| 6380 | public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; |
| 6381 | |
| 6382 | /** |
Christopher Tate | 8031a3d | 2009-07-06 16:36:05 -0700 | [diff] [blame] | 6383 | * Indicates whether settings backup has been fully provisioned. |
| 6384 | * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) |
| 6385 | * @hide |
| 6386 | */ |
| 6387 | public static final String BACKUP_PROVISIONED = "backup_provisioned"; |
| 6388 | |
| 6389 | /** |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6390 | * Component of the transport to use for backup/restore. |
| 6391 | * @hide |
| 6392 | */ |
| 6393 | public static final String BACKUP_TRANSPORT = "backup_transport"; |
Sanjay Jeyakumar | 21bf241 | 2009-07-09 13:31:48 -0700 | [diff] [blame] | 6394 | |
Dianne Hackborn | d7cd29d | 2009-07-01 11:22:45 -0700 | [diff] [blame] | 6395 | /** |
| 6396 | * Version for which the setup wizard was last shown. Bumped for |
| 6397 | * each release when there is new setup information to show. |
| 6398 | * @hide |
| 6399 | */ |
| 6400 | public static final String LAST_SETUP_SHOWN = "last_setup_shown"; |
Dianne Hackborn | cf09829 | 2009-07-01 19:55:20 -0700 | [diff] [blame] | 6401 | |
| 6402 | /** |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6403 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 6404 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 6405 | * the mobile data network. |
| 6406 | * @hide |
Jeff Brown | bf6f6f9 | 2012-09-25 15:03:20 -0700 | [diff] [blame] | 6407 | * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} |
| 6408 | * instead. |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6409 | */ |
Christopher Tate | 6f5a9a9 | 2012-09-14 17:24:28 -0700 | [diff] [blame] | 6410 | @Deprecated |
| 6411 | public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; |
Doug Zongker | 43866e0 | 2010-01-07 12:09:54 -0800 | [diff] [blame] | 6412 | |
| 6413 | /** |
Narayan Kamath | ee69ff4 | 2011-06-28 12:07:18 +0100 | [diff] [blame] | 6414 | * The global search provider chosen by the user (if multiple global |
| 6415 | * search providers are installed). This will be the provider returned |
| 6416 | * by {@link SearchManager#getGlobalSearchActivity()} if it's still |
| 6417 | * installed. This setting is stored as a flattened component name as |
| 6418 | * per {@link ComponentName#flattenToString()}. |
| 6419 | * |
| 6420 | * @hide |
| 6421 | */ |
| 6422 | public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = |
| 6423 | "search_global_search_activity"; |
| 6424 | |
| 6425 | /** |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6426 | * The number of promoted sources in GlobalSearch. |
| 6427 | * @hide |
| 6428 | */ |
| 6429 | public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; |
| 6430 | /** |
| 6431 | * The maximum number of suggestions returned by GlobalSearch. |
| 6432 | * @hide |
| 6433 | */ |
| 6434 | public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; |
| 6435 | /** |
| 6436 | * The number of suggestions GlobalSearch will ask each non-web search source for. |
| 6437 | * @hide |
| 6438 | */ |
| 6439 | public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; |
| 6440 | /** |
| 6441 | * The number of suggestions the GlobalSearch will ask the web search source for. |
| 6442 | * @hide |
| 6443 | */ |
| 6444 | public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = |
| 6445 | "search_web_results_override_limit"; |
| 6446 | /** |
| 6447 | * The number of milliseconds that GlobalSearch will wait for suggestions from |
| 6448 | * promoted sources before continuing with all other sources. |
| 6449 | * @hide |
| 6450 | */ |
| 6451 | public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = |
| 6452 | "search_promoted_source_deadline_millis"; |
| 6453 | /** |
| 6454 | * The number of milliseconds before GlobalSearch aborts search suggesiton queries. |
| 6455 | * @hide |
| 6456 | */ |
| 6457 | public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; |
| 6458 | /** |
| 6459 | * The maximum number of milliseconds that GlobalSearch shows the previous results |
| 6460 | * after receiving a new query. |
| 6461 | * @hide |
| 6462 | */ |
| 6463 | public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; |
| 6464 | /** |
| 6465 | * The maximum age of log data used for shortcuts in GlobalSearch. |
| 6466 | * @hide |
| 6467 | */ |
| 6468 | public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; |
| 6469 | /** |
| 6470 | * The maximum age of log data used for source ranking in GlobalSearch. |
| 6471 | * @hide |
| 6472 | */ |
| 6473 | public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = |
| 6474 | "search_max_source_event_age_millis"; |
| 6475 | /** |
| 6476 | * The minimum number of impressions needed to rank a source in GlobalSearch. |
| 6477 | * @hide |
| 6478 | */ |
| 6479 | public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = |
| 6480 | "search_min_impressions_for_source_ranking"; |
| 6481 | /** |
| 6482 | * The minimum number of clicks needed to rank a source in GlobalSearch. |
| 6483 | * @hide |
| 6484 | */ |
| 6485 | public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = |
| 6486 | "search_min_clicks_for_source_ranking"; |
| 6487 | /** |
| 6488 | * The maximum number of shortcuts shown by GlobalSearch. |
| 6489 | * @hide |
| 6490 | */ |
| 6491 | public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; |
| 6492 | /** |
| 6493 | * The size of the core thread pool for suggestion queries in GlobalSearch. |
| 6494 | * @hide |
| 6495 | */ |
| 6496 | public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = |
| 6497 | "search_query_thread_core_pool_size"; |
| 6498 | /** |
| 6499 | * The maximum size of the thread pool for suggestion queries in GlobalSearch. |
| 6500 | * @hide |
| 6501 | */ |
| 6502 | public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = |
| 6503 | "search_query_thread_max_pool_size"; |
| 6504 | /** |
| 6505 | * The size of the core thread pool for shortcut refreshing in GlobalSearch. |
| 6506 | * @hide |
| 6507 | */ |
| 6508 | public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = |
| 6509 | "search_shortcut_refresh_core_pool_size"; |
| 6510 | /** |
| 6511 | * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. |
| 6512 | * @hide |
| 6513 | */ |
| 6514 | public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = |
| 6515 | "search_shortcut_refresh_max_pool_size"; |
| 6516 | /** |
| 6517 | * The maximun time that excess threads in the GlobalSeach thread pools will |
| 6518 | * wait before terminating. |
| 6519 | * @hide |
| 6520 | */ |
| 6521 | public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = |
| 6522 | "search_thread_keepalive_seconds"; |
| 6523 | /** |
| 6524 | * The maximum number of concurrent suggestion queries to each source. |
| 6525 | * @hide |
| 6526 | */ |
| 6527 | public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = |
| 6528 | "search_per_source_concurrent_query_limit"; |
| 6529 | |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6530 | /** |
Sudheer Shanka | 2250d56 | 2016-11-07 15:41:02 -0800 | [diff] [blame] | 6531 | * Whether or not alert sounds are played on StorageManagerService events. |
| 6532 | * (0 = false, 1 = true) |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 6533 | * @hide |
| 6534 | */ |
| 6535 | public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; |
| 6536 | |
| 6537 | /** |
| 6538 | * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) |
| 6539 | * @hide |
| 6540 | */ |
| 6541 | public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; |
| 6542 | |
| 6543 | /** |
| 6544 | * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) |
| 6545 | * @hide |
| 6546 | */ |
| 6547 | public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; |
| 6548 | |
| 6549 | /** |
| 6550 | * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) |
| 6551 | * @hide |
| 6552 | */ |
| 6553 | public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6554 | |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6555 | /** |
| 6556 | * If nonzero, ANRs in invisible background processes bring up a dialog. |
| 6557 | * Otherwise, the process will be silently killed. |
Adrian Roos | 6a7e089 | 2016-08-23 14:26:39 +0200 | [diff] [blame] | 6558 | * |
| 6559 | * Also prevents ANRs and crash dialogs from being suppressed. |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6560 | * @hide |
| 6561 | */ |
| 6562 | public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6563 | |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6564 | /** |
| 6565 | * The {@link ComponentName} string of the service to be used as the voice recognition |
| 6566 | * service. |
Erik | eebc8e2 | 2010-02-18 13:27:19 -0800 | [diff] [blame] | 6567 | * |
Mike LeBeau | 5d34e9b | 2010-02-10 19:34:56 -0800 | [diff] [blame] | 6568 | * @hide |
| 6569 | */ |
| 6570 | public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; |
Dan Egnor | 42471dd | 2010-01-07 17:25:22 -0800 | [diff] [blame] | 6571 | |
William Luh | 623a428 | 2013-06-24 12:14:18 -0700 | [diff] [blame] | 6572 | /** |
| 6573 | * Stores whether an user has consented to have apps verified through PAM. |
| 6574 | * The value is boolean (1 or 0). |
| 6575 | * |
| 6576 | * @hide |
| 6577 | */ |
| 6578 | public static final String PACKAGE_VERIFIER_USER_CONSENT = |
| 6579 | "package_verifier_user_consent"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6580 | |
| 6581 | /** |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6582 | * The {@link ComponentName} string of the selected spell checker service which is |
| 6583 | * one of the services managed by the text service manager. |
| 6584 | * |
| 6585 | * @hide |
| 6586 | */ |
| 6587 | public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; |
| 6588 | |
| 6589 | /** |
| 6590 | * The {@link ComponentName} string of the selected subtype of the selected spell checker |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6591 | * service which is one of the services managed by the text service manager. |
| 6592 | * |
| 6593 | * @hide |
| 6594 | */ |
satok | ada8c4e | 2011-08-23 14:56:56 +0900 | [diff] [blame] | 6595 | public static final String SELECTED_SPELL_CHECKER_SUBTYPE = |
| 6596 | "selected_spell_checker_subtype"; |
satok | 988323c | 2011-06-22 16:38:13 +0900 | [diff] [blame] | 6597 | |
Doug Zongker | aed8f8e | 2010-01-07 18:07:50 -0800 | [diff] [blame] | 6598 | /** |
satok | a33c4fc | 2011-08-25 16:50:11 +0900 | [diff] [blame] | 6599 | * The {@link ComponentName} string whether spell checker is enabled or not. |
| 6600 | * |
| 6601 | * @hide |
| 6602 | */ |
| 6603 | public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; |
| 6604 | |
| 6605 | /** |
David Brown | 458e806 | 2010-03-08 21:52:11 -0800 | [diff] [blame] | 6606 | * What happens when the user presses the Power button while in-call |
| 6607 | * and the screen is on.<br/> |
| 6608 | * <b>Values:</b><br/> |
| 6609 | * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> |
| 6610 | * 2 - The Power button hangs up the current call.<br/> |
| 6611 | * |
| 6612 | * @hide |
| 6613 | */ |
| 6614 | public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; |
| 6615 | |
| 6616 | /** |
| 6617 | * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". |
| 6618 | * @hide |
| 6619 | */ |
| 6620 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; |
| 6621 | |
| 6622 | /** |
| 6623 | * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". |
| 6624 | * @hide |
| 6625 | */ |
| 6626 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; |
| 6627 | |
| 6628 | /** |
| 6629 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6630 | * @hide |
| 6631 | */ |
| 6632 | public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = |
| 6633 | INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; |
| 6634 | |
| 6635 | /** |
Bryce Lee | db776ce | 2016-09-03 15:02:00 -0700 | [diff] [blame] | 6636 | * What happens when the user presses the Back button while in-call |
| 6637 | * and the screen is on.<br/> |
| 6638 | * <b>Values:</b><br/> |
| 6639 | * 0 - The Back buttons does nothing different.<br/> |
| 6640 | * 1 - The Back button hangs up the current call.<br/> |
| 6641 | * |
| 6642 | * @hide |
| 6643 | */ |
| 6644 | public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; |
| 6645 | |
| 6646 | /** |
| 6647 | * INCALL_BACK_BUTTON_BEHAVIOR value for no action. |
| 6648 | * @hide |
| 6649 | */ |
| 6650 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; |
| 6651 | |
| 6652 | /** |
| 6653 | * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". |
| 6654 | * @hide |
| 6655 | */ |
| 6656 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; |
| 6657 | |
| 6658 | /** |
| 6659 | * INCALL_POWER_BUTTON_BEHAVIOR default value. |
| 6660 | * @hide |
| 6661 | */ |
| 6662 | public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = |
| 6663 | INCALL_BACK_BUTTON_BEHAVIOR_NONE; |
| 6664 | |
| 6665 | /** |
Jeff Brown | a20dda4 | 2014-05-27 20:57:24 -0700 | [diff] [blame] | 6666 | * Whether the device should wake when the wake gesture sensor detects motion. |
| 6667 | * @hide |
| 6668 | */ |
| 6669 | public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; |
| 6670 | |
| 6671 | /** |
John Spurlock | a4215ce | 2014-08-04 14:50:38 -0400 | [diff] [blame] | 6672 | * Whether the device should doze if configured. |
| 6673 | * @hide |
| 6674 | */ |
| 6675 | public static final String DOZE_ENABLED = "doze_enabled"; |
| 6676 | |
| 6677 | /** |
Adrian Roos | ebea7a7 | 2016-10-26 12:51:26 -0700 | [diff] [blame] | 6678 | * Whether doze should be always on. |
| 6679 | * @hide |
| 6680 | */ |
| 6681 | public static final String DOZE_ALWAYS_ON = "doze_always_on"; |
| 6682 | |
| 6683 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6684 | * Whether the device should pulse on pick up gesture. |
| 6685 | * @hide |
| 6686 | */ |
| 6687 | public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; |
| 6688 | |
| 6689 | /** |
Adrian Roos | d0963a0 | 2017-05-15 14:33:37 -0700 | [diff] [blame] | 6690 | * Whether the device should pulse on long press gesture. |
| 6691 | * @hide |
| 6692 | */ |
| 6693 | public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; |
| 6694 | |
| 6695 | /** |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 6696 | * Whether the device should pulse on double tap gesture. |
| 6697 | * @hide |
| 6698 | */ |
| 6699 | public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; |
| 6700 | |
| 6701 | /** |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 6702 | * The current night mode that has been selected by the user. Owned |
| 6703 | * and controlled by UiModeManagerService. Constants are as per |
| 6704 | * UiModeManager. |
| 6705 | * @hide |
| 6706 | */ |
| 6707 | public static final String UI_NIGHT_MODE = "ui_night_mode"; |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 6708 | |
| 6709 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6710 | * Whether screensavers are enabled. |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6711 | * @hide |
| 6712 | */ |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6713 | public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6714 | |
| 6715 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6716 | * The user's chosen screensaver components. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6717 | * |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6718 | * 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] | 6719 | * 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] | 6720 | * @hide |
| 6721 | */ |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6722 | public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6723 | |
| 6724 | /** |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6725 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 6726 | * when the device is inserted into a (desk) dock. |
Daniel Sandler | 2d54536 | 2011-11-17 10:38:37 -0800 | [diff] [blame] | 6727 | * @hide |
| 6728 | */ |
| 6729 | public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6730 | |
John Spurlock | 1a868b7 | 2012-08-22 09:56:51 -0400 | [diff] [blame] | 6731 | /** |
| 6732 | * If screensavers are enabled, whether the screensaver should be automatically launched |
| 6733 | * when the screen times out when not on battery. |
| 6734 | * @hide |
| 6735 | */ |
| 6736 | public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; |
| 6737 | |
| 6738 | /** |
| 6739 | * If screensavers are enabled, the default screensaver component. |
| 6740 | * @hide |
| 6741 | */ |
| 6742 | public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; |
| 6743 | |
Daniel Sandler | 0601eb7 | 2011-04-13 01:01:32 -0400 | [diff] [blame] | 6744 | /** |
Martijn Coenen | a739788 | 2013-07-30 20:07:47 -0700 | [diff] [blame] | 6745 | * The default NFC payment component |
| 6746 | * @hide |
| 6747 | */ |
| 6748 | public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; |
| 6749 | |
| 6750 | /** |
Martijn Coenen | 2f6f3a01 | 2014-04-25 17:00:21 -0700 | [diff] [blame] | 6751 | * Whether NFC payment is handled by the foreground application or a default. |
| 6752 | * @hide |
| 6753 | */ |
| 6754 | public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; |
| 6755 | |
| 6756 | /** |
David Braun | f5d8319 | 2013-09-16 13:43:51 -0700 | [diff] [blame] | 6757 | * Specifies the package name currently configured to be the primary sms application |
| 6758 | * @hide |
| 6759 | */ |
| 6760 | public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; |
| 6761 | |
| 6762 | /** |
Yorke Lee | 014de02 | 2015-04-21 17:15:47 -0700 | [diff] [blame] | 6763 | * Specifies the package name currently configured to be the default dialer application |
| 6764 | * @hide |
| 6765 | */ |
| 6766 | public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; |
| 6767 | |
| 6768 | /** |
Adrian Roos | 943eb86 | 2015-03-26 12:31:16 -0700 | [diff] [blame] | 6769 | * Specifies the package name currently configured to be the emergency assistance application |
| 6770 | * |
| 6771 | * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE |
| 6772 | * |
| 6773 | * @hide |
| 6774 | */ |
| 6775 | public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; |
| 6776 | |
| 6777 | /** |
Jorim Jaggi | 9d91083 | 2015-05-18 17:35:26 -0700 | [diff] [blame] | 6778 | * Specifies whether the current app context on scren (assist data) will be sent to the |
| 6779 | * assist application (active voice interaction service). |
| 6780 | * |
| 6781 | * @hide |
| 6782 | */ |
| 6783 | public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; |
| 6784 | |
| 6785 | /** |
Jorim Jaggi | a133f0b | 2015-06-26 16:40:00 -0700 | [diff] [blame] | 6786 | * Specifies whether a screenshot of the screen contents will be sent to the assist |
| 6787 | * application (active voice interaction service). |
| 6788 | * |
| 6789 | * @hide |
| 6790 | */ |
| 6791 | public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; |
| 6792 | |
| 6793 | /** |
Adrian Roos | 2335bd6 | 2016-08-11 15:42:40 -0700 | [diff] [blame] | 6794 | * Specifies whether the screen will show an animation if screen contents are sent to the |
| 6795 | * assist application (active voice interaction service). |
| 6796 | * |
| 6797 | * Note that the disclosure will be forced for third-party assistants or if the device |
| 6798 | * does not support disabling it. |
| 6799 | * |
| 6800 | * @hide |
| 6801 | */ |
| 6802 | public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; |
| 6803 | |
| 6804 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6805 | * 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] | 6806 | * see and assist with all of the user's notifications. |
| 6807 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6808 | * @deprecated Use |
| 6809 | * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 6810 | * @hide |
| 6811 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6812 | @Deprecated |
Julia Reynolds | 77b2cc9 | 2016-11-08 14:41:09 -0500 | [diff] [blame] | 6813 | public static final String ENABLED_NOTIFICATION_ASSISTANT = |
| 6814 | "enabled_notification_assistant"; |
| 6815 | |
| 6816 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6817 | * 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] | 6818 | * see all of the user's notifications, separated by ':'. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 6819 | * |
| 6820 | * @hide |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6821 | * @deprecated Use |
| 6822 | * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 6823 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6824 | @Deprecated |
Daniel Sandler | 4b749ef | 2013-03-18 21:53:04 -0400 | [diff] [blame] | 6825 | public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; |
| 6826 | |
John Spurlock | 7340fc8 | 2014-04-24 18:50:12 -0400 | [diff] [blame] | 6827 | /** |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6828 | * Read only list of the packages that the current user has explicitly allowed to |
| 6829 | * manage do not disturb, separated by ':'. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 6830 | * |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6831 | * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 6832 | * @hide |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 6833 | */ |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 6834 | @Deprecated |
Julia Reynolds | 0aa7d61 | 2016-04-25 14:57:33 -0400 | [diff] [blame] | 6835 | @TestApi |
John Spurlock | 7c74f78 | 2015-06-04 13:01:42 -0400 | [diff] [blame] | 6836 | public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = |
| 6837 | "enabled_notification_policy_access_packages"; |
| 6838 | |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 6839 | /** |
| 6840 | * Defines whether managed profile ringtones should be synced from it's parent profile |
| 6841 | * <p> |
| 6842 | * 0 = ringtones are not synced |
| 6843 | * 1 = ringtones are synced from the profile's parent (default) |
| 6844 | * <p> |
| 6845 | * This value is only used for managed profiles. |
| 6846 | * @hide |
| 6847 | */ |
Robin Lee | c74d85f | 2017-03-16 17:19:42 +0000 | [diff] [blame] | 6848 | @TestApi |
| 6849 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
Andre Lago | ea35e07 | 2016-08-04 13:41:13 +0100 | [diff] [blame] | 6850 | public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; |
| 6851 | |
John Spurlock | cdb57ae | 2015-02-11 19:04:11 -0500 | [diff] [blame] | 6852 | /** @hide */ |
John Spurlock | f1a3664 | 2013-10-12 17:50:42 -0400 | [diff] [blame] | 6853 | public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; |
John Spurlock | d67ec25 | 2013-09-05 11:31:54 -0400 | [diff] [blame] | 6854 | |
Yorke Lee | 647f8f3 | 2013-05-07 10:49:44 -0700 | [diff] [blame] | 6855 | /** |
Svetoslav | f43e851 | 2013-09-30 17:33:05 -0700 | [diff] [blame] | 6856 | * This is the query URI for finding a print service to install. |
| 6857 | * |
| 6858 | * @hide |
| 6859 | */ |
| 6860 | public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; |
| 6861 | |
| 6862 | /** |
| 6863 | * This is the query URI for finding a NFC payment service to install. |
| 6864 | * |
| 6865 | * @hide |
| 6866 | */ |
| 6867 | public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; |
| 6868 | |
| 6869 | /** |
Philip P. Moltmann | a30d6e0 | 2017-04-27 15:40:02 -0700 | [diff] [blame] | 6870 | * This is the query URI for finding a auto fill service to install. |
| 6871 | * |
| 6872 | * @hide |
| 6873 | */ |
| 6874 | public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; |
| 6875 | |
| 6876 | /** |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 6877 | * 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] | 6878 | * 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] | 6879 | * <p> |
| 6880 | * Type : int (0 to show hints, 1 to skip showing hints) |
Amith Yamasani | 1e9c218 | 2014-06-11 17:25:51 -0700 | [diff] [blame] | 6881 | */ |
| 6882 | public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; |
| 6883 | |
| 6884 | /** |
John Spurlock | aa5ee4d | 2014-07-25 13:05:12 -0400 | [diff] [blame] | 6885 | * Persisted playback time after a user confirmation of an unsafe volume level. |
| 6886 | * |
| 6887 | * @hide |
| 6888 | */ |
| 6889 | public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; |
| 6890 | |
| 6891 | /** |
Dan Sandler | 52e5701e | 2014-07-22 23:14:54 -0400 | [diff] [blame] | 6892 | * This preference enables notification display on the lockscreen. |
| 6893 | * @hide |
| 6894 | */ |
| 6895 | public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = |
| 6896 | "lock_screen_show_notifications"; |
| 6897 | |
| 6898 | /** |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 6899 | * List of TV inputs that are currently hidden. This is a string |
Jaewan Kim | f0e530e | 2014-08-22 00:43:31 +0900 | [diff] [blame] | 6900 | * containing the IDs of all hidden TV inputs. Each ID is encoded by |
| 6901 | * {@link android.net.Uri#encode(String)} and separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 6902 | * @hide |
| 6903 | */ |
| 6904 | public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; |
| 6905 | |
| 6906 | /** |
| 6907 | * 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] | 6908 | * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} |
| 6909 | * and separated by ','. Each pair is separated by ':'. |
Dongwon Kang | 4d933a0 | 2014-08-07 22:51:47 -0700 | [diff] [blame] | 6910 | * @hide |
| 6911 | */ |
| 6912 | public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; |
| 6913 | |
| 6914 | /** |
Glenn Kasten | 34cc4db | 2014-08-13 10:56:38 -0700 | [diff] [blame] | 6915 | * Whether automatic routing of system audio to USB audio peripheral is disabled. |
| 6916 | * The value is boolean (1 or 0), where 1 means automatic routing is disabled, |
| 6917 | * and 0 means automatic routing is enabled. |
| 6918 | * |
| 6919 | * @hide |
| 6920 | */ |
| 6921 | public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = |
| 6922 | "usb_audio_automatic_routing_disabled"; |
| 6923 | |
| 6924 | /** |
Jeff Brown | 05af6ad | 2014-09-30 20:54:30 -0700 | [diff] [blame] | 6925 | * The timeout in milliseconds before the device fully goes to sleep after |
| 6926 | * a period of inactivity. This value sets an upper bound on how long the device |
| 6927 | * will stay awake or dreaming without user activity. It should generally |
Dianne Hackborn | ad6a99b | 2014-11-18 10:11:10 -0800 | [diff] [blame] | 6928 | * 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] | 6929 | * will sleep before it ever has a chance to dream. |
| 6930 | * <p> |
| 6931 | * Use -1 to disable this timeout. |
| 6932 | * </p> |
| 6933 | * |
| 6934 | * @hide |
| 6935 | */ |
| 6936 | public static final String SLEEP_TIMEOUT = "sleep_timeout"; |
| 6937 | |
| 6938 | /** |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 6939 | * Controls whether double tap to wake is enabled. |
| 6940 | * @hide |
| 6941 | */ |
| 6942 | public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; |
| 6943 | |
| 6944 | /** |
Xiyuan Xia | e6de8b9 | 2015-06-06 22:18:05 -0700 | [diff] [blame] | 6945 | * The current assistant component. It could be a voice interaction service, |
| 6946 | * or an activity that handles ACTION_ASSIST, or empty which means using the default |
| 6947 | * handling. |
| 6948 | * |
| 6949 | * @hide |
| 6950 | */ |
| 6951 | public static final String ASSISTANT = "assistant"; |
| 6952 | |
| 6953 | /** |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 6954 | * Whether the camera launch gesture should be disabled. |
| 6955 | * |
| 6956 | * @hide |
| 6957 | */ |
| 6958 | public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; |
| 6959 | |
| 6960 | /** |
Adrian Roos | 5941c98 | 2015-09-03 15:59:49 -0700 | [diff] [blame] | 6961 | * Whether the camera launch gesture to double tap the power button when the screen is off |
| 6962 | * should be disabled. |
| 6963 | * |
| 6964 | * @hide |
| 6965 | */ |
| 6966 | public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = |
| 6967 | "camera_double_tap_power_gesture_disabled"; |
| 6968 | |
| 6969 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 6970 | * Whether the camera double twist gesture to flip between front and back mode should be |
| 6971 | * enabled. |
| 6972 | * |
| 6973 | * @hide |
| 6974 | */ |
| 6975 | public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = |
| 6976 | "camera_double_twist_to_flip_enabled"; |
| 6977 | |
| 6978 | /** |
Daniel Sheng | 45e0d34 | 2017-04-17 17:27:22 -0700 | [diff] [blame] | 6979 | * Whether or not the smart camera lift trigger that launches the camera when the user moves |
| 6980 | * the phone into a position for taking photos should be enabled. |
| 6981 | * |
| 6982 | * @hide |
| 6983 | */ |
| 6984 | public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; |
| 6985 | |
| 6986 | /** |
Daniel Sheng | 834e572 | 2017-05-30 09:28:52 -0700 | [diff] [blame] | 6987 | * The default enable state of the camera lift trigger. |
| 6988 | * |
| 6989 | * @hide |
| 6990 | */ |
| 6991 | public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; |
| 6992 | |
| 6993 | /** |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 6994 | * Whether the assist gesture should be enabled. |
| 6995 | * |
| 6996 | * @hide |
| 6997 | */ |
| 6998 | public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; |
| 6999 | |
| 7000 | /** |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7001 | * Sensitivity control for the assist gesture. |
| 7002 | * |
| 7003 | * @hide |
| 7004 | */ |
| 7005 | public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; |
| 7006 | |
| 7007 | /** |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7008 | * Whether the assist gesture should silence alerts. |
| 7009 | * |
| 7010 | * @hide |
| 7011 | */ |
| 7012 | public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = |
| 7013 | "assist_gesture_silence_alerts_enabled"; |
| 7014 | |
| 7015 | /** |
| 7016 | * Whether the assist gesture should wake the phone. |
| 7017 | * |
| 7018 | * @hide |
| 7019 | */ |
| 7020 | public static final String ASSIST_GESTURE_WAKE_ENABLED = |
| 7021 | "assist_gesture_wake_enabled"; |
| 7022 | |
| 7023 | /** |
Kevin Chyn | cfd641e | 2017-06-05 11:28:09 -0700 | [diff] [blame] | 7024 | * Whether Assist Gesture Deferred Setup has been completed |
| 7025 | * |
| 7026 | * @hide |
| 7027 | */ |
| 7028 | public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; |
| 7029 | |
| 7030 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7031 | * Control whether Night display is currently activated. |
| 7032 | * @hide |
| 7033 | */ |
| 7034 | public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; |
| 7035 | |
| 7036 | /** |
| 7037 | * Control whether Night display will automatically activate/deactivate. |
| 7038 | * @hide |
| 7039 | */ |
| 7040 | public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; |
| 7041 | |
| 7042 | /** |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7043 | * Control the color temperature of Night Display, represented in Kelvin. |
| 7044 | * @hide |
| 7045 | */ |
| 7046 | public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = |
| 7047 | "night_display_color_temperature"; |
| 7048 | |
| 7049 | /** |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7050 | * Custom time when Night display is scheduled to activate. |
| 7051 | * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). |
| 7052 | * @hide |
| 7053 | */ |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7054 | public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = |
| 7055 | "night_display_custom_start_time"; |
Justin Klaassen | 911e889 | 2016-06-21 18:24:24 -0700 | [diff] [blame] | 7056 | |
| 7057 | /** |
| 7058 | * Custom time when Night display is scheduled to deactivate. |
| 7059 | * Represented as milliseconds from midnight (e.g. 21600000 == 6am). |
| 7060 | * @hide |
| 7061 | */ |
| 7062 | 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] | 7063 | |
| 7064 | /** |
Christine Franks | 0321346 | 2017-08-25 13:57:26 -0700 | [diff] [blame] | 7065 | * A String representing the LocalDateTime when Night display was last activated. Use to |
| 7066 | * decide whether to apply the current activated state after a reboot or user change. In |
| 7067 | * legacy cases, this is represented by the time in milliseconds (since epoch). |
Christine Franks | e5bb03e | 2017-02-10 17:36:10 -0800 | [diff] [blame] | 7068 | * @hide |
| 7069 | */ |
| 7070 | public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = |
| 7071 | "night_display_last_activated_time"; |
| 7072 | |
| 7073 | /** |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7074 | * Names of the service components that the current user has explicitly allowed to |
| 7075 | * be a VR mode listener, separated by ':'. |
| 7076 | * |
| 7077 | * @hide |
| 7078 | */ |
| 7079 | public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; |
| 7080 | |
| 7081 | /** |
Ruben Brunk | 49506e0 | 2016-04-18 18:10:47 -0700 | [diff] [blame] | 7082 | * Behavior of the display while in VR mode. |
| 7083 | * |
| 7084 | * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. |
| 7085 | * |
| 7086 | * @hide |
| 7087 | */ |
| 7088 | public static final String VR_DISPLAY_MODE = "vr_display_mode"; |
| 7089 | |
| 7090 | /** |
| 7091 | * Lower the display persistence while the system is in VR mode. |
| 7092 | * |
| 7093 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7094 | * |
| 7095 | * @hide. |
| 7096 | */ |
| 7097 | public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; |
| 7098 | |
| 7099 | /** |
| 7100 | * Do not alter the display persistence while the system is in VR mode. |
| 7101 | * |
| 7102 | * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 7103 | * |
| 7104 | * @hide. |
| 7105 | */ |
| 7106 | public static final int VR_DISPLAY_MODE_OFF = 1; |
| 7107 | |
| 7108 | /** |
Jeff Davidson | 24b9d96 | 2016-07-21 12:35:10 -0700 | [diff] [blame] | 7109 | * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least |
| 7110 | * once. |
| 7111 | * |
| 7112 | * <p>This is used to ensure that we only take one pass which will disable apps that are not |
| 7113 | * privileged (if any). From then on, we only want to enable apps (when a matching SIM is |
| 7114 | * inserted), to avoid disabling an app that the user might actively be using. |
| 7115 | * |
| 7116 | * <p>Will be set to 1 once executed. |
| 7117 | * |
| 7118 | * @hide |
| 7119 | */ |
| 7120 | public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; |
| 7121 | |
| 7122 | /** |
Tony Mak | c820cc5 | 2016-05-03 18:58:28 +0100 | [diff] [blame] | 7123 | * Whether parent user can access remote contact in managed profile. |
| 7124 | * |
| 7125 | * @hide |
| 7126 | */ |
| 7127 | public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = |
| 7128 | "managed_profile_contact_remote_search"; |
| 7129 | |
| 7130 | /** |
Daniel Nishi | 395d387 | 2016-05-23 13:25:21 -0700 | [diff] [blame] | 7131 | * Whether or not the automatic storage manager is enabled and should run on the device. |
| 7132 | * |
| 7133 | * @hide |
| 7134 | */ |
| 7135 | public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = |
| 7136 | "automatic_storage_manager_enabled"; |
| 7137 | |
| 7138 | /** |
Daniel Nishi | c535be1 | 2016-06-10 13:51:36 -0700 | [diff] [blame] | 7139 | * How many days of information for the automatic storage manager to retain on the device. |
| 7140 | * |
| 7141 | * @hide |
| 7142 | */ |
| 7143 | public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = |
| 7144 | "automatic_storage_manager_days_to_retain"; |
| 7145 | |
| 7146 | /** |
| 7147 | * Default number of days of information for the automatic storage manager to retain. |
| 7148 | * |
| 7149 | * @hide |
| 7150 | */ |
| 7151 | public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; |
| 7152 | |
| 7153 | /** |
Daniel Nishi | f678cc9 | 2016-06-24 15:49:25 -0700 | [diff] [blame] | 7154 | * How many bytes the automatic storage manager has cleared out. |
| 7155 | * |
| 7156 | * @hide |
| 7157 | */ |
| 7158 | public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = |
| 7159 | "automatic_storage_manager_bytes_cleared"; |
| 7160 | |
| 7161 | |
| 7162 | /** |
| 7163 | * Last run time for the automatic storage manager. |
| 7164 | * |
| 7165 | * @hide |
| 7166 | */ |
| 7167 | public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = |
| 7168 | "automatic_storage_manager_last_run"; |
| 7169 | |
Jorge Gil | 6825a77 | 2016-06-30 11:07:18 -0700 | [diff] [blame] | 7170 | /** |
Daniel Nishi | da7332c | 2017-06-12 10:17:33 -0700 | [diff] [blame] | 7171 | * If the automatic storage manager has been disabled by policy. Note that this doesn't |
| 7172 | * mean that the automatic storage manager is prevented from being re-enabled -- this only |
| 7173 | * means that it was turned off by policy at least once. |
| 7174 | * |
| 7175 | * @hide |
| 7176 | */ |
| 7177 | public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = |
| 7178 | "automatic_storage_manager_turned_off_by_policy"; |
| 7179 | |
| 7180 | /** |
Doris Ling | a60d31d | 2016-07-06 13:39:05 -0700 | [diff] [blame] | 7181 | * Whether SystemUI navigation keys is enabled. |
| 7182 | * @hide |
| 7183 | */ |
| 7184 | public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = |
| 7185 | "system_navigation_keys_enabled"; |
| 7186 | |
Allison Babick | f0bc866 | 2016-07-11 15:39:16 -0700 | [diff] [blame] | 7187 | /** |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7188 | * Holds comma separated list of ordering of QS tiles. |
| 7189 | * @hide |
| 7190 | */ |
| 7191 | public static final String QS_TILES = "sysui_qs_tiles"; |
| 7192 | |
| 7193 | /** |
Fyodor Kupolov | 539d36f | 2016-07-27 17:45:12 -0700 | [diff] [blame] | 7194 | * Whether preloaded APKs have been installed for the user. |
| 7195 | * @hide |
| 7196 | */ |
| 7197 | public static final String DEMO_USER_SETUP_COMPLETE |
| 7198 | = "demo_user_setup_complete"; |
| 7199 | |
| 7200 | /** |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7201 | * Specifies whether the web action API is enabled. |
| 7202 | * |
| 7203 | * @hide |
| 7204 | */ |
Jesse Evans | fc1bfc4 | 2017-04-07 16:11:26 -0700 | [diff] [blame] | 7205 | @SystemApi |
| 7206 | public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; |
Todd Kennedy | efc1c4d | 2016-07-21 07:44:33 -0700 | [diff] [blame] | 7207 | |
| 7208 | /** |
Greg Plesur | 3514404 | 2016-10-10 16:23:49 -0400 | [diff] [blame] | 7209 | * Has this pairable device been paired or upgraded from a previously paired system. |
| 7210 | * @hide |
| 7211 | */ |
| 7212 | public static final String DEVICE_PAIRED = "device_paired"; |
| 7213 | |
| 7214 | /** |
Shahriyar Amini | 9343f57 | 2017-01-12 12:03:24 -0800 | [diff] [blame] | 7215 | * Integer state indicating whether package verifier is enabled. |
| 7216 | * TODO(b/34259924): Remove this setting. |
| 7217 | * |
| 7218 | * @hide |
| 7219 | */ |
| 7220 | public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; |
| 7221 | |
| 7222 | /** |
Jack Yu | 3902857 | 2017-02-23 09:49:25 -0800 | [diff] [blame] | 7223 | * Specifies additional package name for broadcasting the CMAS messages. |
| 7224 | * @hide |
| 7225 | */ |
| 7226 | public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; |
| 7227 | |
| 7228 | /** |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7229 | * Whether the launcher should show any notification badges. |
| 7230 | * The value is boolean (1 or 0). |
| 7231 | * @hide |
| 7232 | */ |
| 7233 | public static final String NOTIFICATION_BADGING = "notification_badging"; |
| 7234 | |
| 7235 | /** |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7236 | * Comma separated list of QS tiles that have been auto-added already. |
| 7237 | * @hide |
| 7238 | */ |
| 7239 | public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; |
| 7240 | |
| 7241 | /** |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7242 | * Whether the Lockdown button should be shown in the power menu. |
| 7243 | * @hide |
| 7244 | */ |
| 7245 | public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7246 | |
| 7247 | /** |
| 7248 | * Backup manager behavioral parameters. |
| 7249 | * This is encoded as a key=value list, separated by commas. Ex: |
| 7250 | * |
| 7251 | * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" |
| 7252 | * |
| 7253 | * The following keys are supported: |
| 7254 | * |
| 7255 | * <pre> |
| 7256 | * key_value_backup_interval_milliseconds (long) |
| 7257 | * key_value_backup_fuzz_milliseconds (long) |
| 7258 | * key_value_backup_require_charging (boolean) |
| 7259 | * key_value_backup_required_network_type (int) |
| 7260 | * full_backup_interval_milliseconds (long) |
| 7261 | * full_backup_require_charging (boolean) |
| 7262 | * full_backup_required_network_type (int) |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7263 | * backup_finished_notification_receivers (String[]) |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7264 | * </pre> |
| 7265 | * |
Denis Kuznetsov | 02a1c08 | 2017-12-27 16:21:22 +0100 | [diff] [blame] | 7266 | * backup_finished_notification_receivers uses ":" as delimeter for values. |
| 7267 | * |
Tim Zheng | cc1e76a | 2017-08-30 17:46:19 -0700 | [diff] [blame] | 7268 | * <p> |
| 7269 | * Type: string |
| 7270 | * @hide |
| 7271 | */ |
| 7272 | public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; |
| 7273 | |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7274 | /** |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7275 | * This are the settings to be backed up. |
| 7276 | * |
| 7277 | * NOTE: Settings are backed up and restored in the order they appear |
| 7278 | * in this array. If you have one setting depending on another, |
| 7279 | * make sure that they are ordered appropriately. |
| 7280 | * |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7281 | * @hide |
| 7282 | */ |
| 7283 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 7284 | BUGREPORT_IN_POWER_MENU, // moved to global |
Amith Yamasani | 8823c0a8 | 2009-07-07 14:30:17 -0700 | [diff] [blame] | 7285 | ALLOW_MOCK_LOCATION, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7286 | PARENTAL_CONTROL_ENABLED, |
| 7287 | PARENTAL_CONTROL_REDIRECT_URL, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7288 | USB_MASS_STORAGE_ENABLED, // moved to global |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7289 | ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, |
| 7290 | ACCESSIBILITY_DISPLAY_DALTONIZER, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7291 | ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7292 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, |
Casey Burkhardt | 74922c6 | 2017-02-13 12:43:16 -0800 | [diff] [blame] | 7293 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, |
Svetoslav Ganov | d8561a2 | 2017-04-25 15:26:03 -0700 | [diff] [blame] | 7294 | AUTOFILL_SERVICE, |
Svetoslav Ganov | 1cf70bb | 2012-08-06 10:53:34 -0700 | [diff] [blame] | 7295 | ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7296 | ENABLED_ACCESSIBILITY_SERVICES, |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 7297 | ENABLED_VR_LISTENERS, |
Christopher Tate | 7b9a28c | 2015-03-18 13:06:16 -0700 | [diff] [blame] | 7298 | ENABLED_INPUT_METHODS, |
Svetoslav Ganov | 9a4c5cd | 2012-05-30 14:06:32 -0700 | [diff] [blame] | 7299 | TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, |
Svetoslav Ganov | a28a16d | 2011-07-28 11:24:21 -0700 | [diff] [blame] | 7300 | TOUCH_EXPLORATION_ENABLED, |
Svetoslav Ganov | a571a58 | 2011-09-20 18:32:20 -0700 | [diff] [blame] | 7301 | ACCESSIBILITY_ENABLED, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7302 | ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, |
Casey Burkhardt | 5e8b980 | 2017-03-24 10:07:20 -0700 | [diff] [blame] | 7303 | ACCESSIBILITY_BUTTON_TARGET_COMPONENT, |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7304 | ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, |
Phil Weaver | ce687c5 | 2017-03-15 08:51:52 -0700 | [diff] [blame] | 7305 | ACCESSIBILITY_SHORTCUT_ENABLED, |
| 7306 | ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, |
Svetoslav Ganov | 55f937a | 2011-12-05 11:42:07 -0800 | [diff] [blame] | 7307 | ACCESSIBILITY_SPEAK_PASSWORD, |
Chris Craik | cce47eb | 2014-07-16 15:12:15 -0700 | [diff] [blame] | 7308 | ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7309 | ACCESSIBILITY_CAPTIONING_PRESET, |
Alan Viverette | ef79380 | 2013-07-23 14:15:28 -0700 | [diff] [blame] | 7310 | ACCESSIBILITY_CAPTIONING_ENABLED, |
| 7311 | ACCESSIBILITY_CAPTIONING_LOCALE, |
| 7312 | ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, |
| 7313 | ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, |
| 7314 | ACCESSIBILITY_CAPTIONING_EDGE_TYPE, |
| 7315 | ACCESSIBILITY_CAPTIONING_EDGE_COLOR, |
| 7316 | ACCESSIBILITY_CAPTIONING_TYPEFACE, |
Alan Viverette | 69ce69b | 2013-08-29 12:23:48 -0700 | [diff] [blame] | 7317 | ACCESSIBILITY_CAPTIONING_FONT_SCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7318 | ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7319 | TTS_USE_DEFAULTS, |
| 7320 | TTS_DEFAULT_RATE, |
| 7321 | TTS_DEFAULT_PITCH, |
| 7322 | TTS_DEFAULT_SYNTH, |
| 7323 | TTS_DEFAULT_LANG, |
| 7324 | TTS_DEFAULT_COUNTRY, |
Charles Chen | ceffa15 | 2010-03-16 21:18:10 -0700 | [diff] [blame] | 7325 | TTS_ENABLED_PLUGINS, |
Narayan Kamath | 6d63296 | 2011-08-24 11:51:37 +0100 | [diff] [blame] | 7326 | TTS_DEFAULT_LOCALE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7327 | SHOW_IME_WITH_HARD_KEYBOARD, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 7328 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global |
| 7329 | WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global |
| 7330 | WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global |
Christopher Tate | 06cbadd | 2015-03-16 18:29:42 -0700 | [diff] [blame] | 7331 | SELECTED_SPELL_CHECKER, |
| 7332 | SELECTED_SPELL_CHECKER_SUBTYPE, |
| 7333 | SPELL_CHECKER_ENABLED, |
San Mehat | 87734d3 | 2010-01-08 12:53:06 -0800 | [diff] [blame] | 7334 | MOUNT_PLAY_NOTIFICATION_SND, |
| 7335 | MOUNT_UMS_AUTOSTART, |
| 7336 | MOUNT_UMS_PROMPT, |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 7337 | MOUNT_UMS_NOTIFY_ENABLED, |
Jason Monk | 27bbb2d | 2015-03-31 16:46:39 -0400 | [diff] [blame] | 7338 | SLEEP_TIMEOUT, |
| 7339 | DOUBLE_TAP_TO_WAKE, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7340 | WAKE_GESTURE_ENABLED, |
| 7341 | LONG_PRESS_TIMEOUT, |
Jason Monk | 5a5e7d6 | 2015-08-04 11:20:25 -0400 | [diff] [blame] | 7342 | CAMERA_GESTURE_DISABLED, |
Toni Barzic | 386f834 | 2015-09-09 12:30:41 -0700 | [diff] [blame] | 7343 | ACCESSIBILITY_AUTOCLICK_ENABLED, |
Anna Galusza | fa7786c | 2015-12-22 10:53:44 -0800 | [diff] [blame] | 7344 | ACCESSIBILITY_AUTOCLICK_DELAY, |
| 7345 | ACCESSIBILITY_LARGE_POINTER_ICON, |
| 7346 | PREFERRED_TTY_MODE, |
| 7347 | ENHANCED_VOICE_PRIVACY_ENABLED, |
| 7348 | TTY_MODE_ENABLED, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7349 | INCALL_POWER_BUTTON_BEHAVIOR, |
| 7350 | NIGHT_DISPLAY_CUSTOM_START_TIME, |
| 7351 | NIGHT_DISPLAY_CUSTOM_END_TIME, |
Christine Franks | 6418d0b | 2017-02-13 09:48:00 -0800 | [diff] [blame] | 7352 | NIGHT_DISPLAY_COLOR_TEMPERATURE, |
Mike Tsao | fc47ba7 | 2016-07-15 09:54:07 -0700 | [diff] [blame] | 7353 | NIGHT_DISPLAY_AUTO_MODE, |
Doris Ling | 5fafa3c | 2016-08-26 15:00:49 -0700 | [diff] [blame] | 7354 | SYNC_PARENT_SOUNDS, |
Doris Ling | 8a33273 | 2016-08-24 15:05:43 -0700 | [diff] [blame] | 7355 | CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, |
| 7356 | CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, |
Jason Monk | baade75 | 2016-08-25 15:57:14 -0400 | [diff] [blame] | 7357 | SYSTEM_NAVIGATION_KEYS_ENABLED, |
| 7358 | QS_TILES, |
Doris Ling | 6403b40 | 2016-09-09 14:29:19 -0700 | [diff] [blame] | 7359 | DOZE_ENABLED, |
| 7360 | DOZE_PULSE_ON_PICK_UP, |
Ruchi Kandoi | 104e0b4 | 2016-12-29 13:31:43 -0800 | [diff] [blame] | 7361 | DOZE_PULSE_ON_DOUBLE_TAP, |
Daniel Nishi | eb70ad4 | 2017-01-27 10:51:35 -0800 | [diff] [blame] | 7362 | NFC_PAYMENT_DEFAULT_COMPONENT, |
Philip Quinn | c4cc308 | 2017-02-13 20:18:16 -0800 | [diff] [blame] | 7363 | AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, |
Santos Cordon | 5bce494 | 2017-02-27 11:50:18 -0800 | [diff] [blame] | 7364 | ASSIST_GESTURE_ENABLED, |
Philip Quinn | 80274ca | 2017-03-03 10:38:38 -0800 | [diff] [blame] | 7365 | ASSIST_GESTURE_SENSITIVITY, |
Kevin Chyn | 8093937 | 2017-06-09 15:40:18 -0700 | [diff] [blame] | 7366 | ASSIST_GESTURE_SETUP_COMPLETE, |
| 7367 | ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, |
| 7368 | ASSIST_GESTURE_WAKE_ENABLED, |
Chris Wren | 89aa226 | 2017-05-05 18:05:56 -0400 | [diff] [blame] | 7369 | VR_DISPLAY_MODE, |
Jason Monk | cb5296a | 2017-06-30 10:28:18 -0400 | [diff] [blame] | 7370 | NOTIFICATION_BADGING, |
| 7371 | QS_AUTO_ADDED_TILES, |
Jason Monk | df31eff | 2017-07-10 11:14:19 -0400 | [diff] [blame] | 7372 | SCREENSAVER_ENABLED, |
| 7373 | SCREENSAVER_COMPONENTS, |
| 7374 | SCREENSAVER_ACTIVATE_ON_DOCK, |
| 7375 | SCREENSAVER_ACTIVATE_ON_SLEEP, |
Chad Brubaker | 4f28f0d | 2017-09-07 14:28:13 -0700 | [diff] [blame] | 7376 | LOCKDOWN_IN_POWER_MENU, |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7377 | }; |
| 7378 | |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 7379 | /** @hide */ |
| 7380 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
Julia Reynolds | b852e56 | 2017-06-06 16:14:18 -0400 | [diff] [blame] | 7381 | ENABLED_NOTIFICATION_LISTENERS, |
| 7382 | ENABLED_NOTIFICATION_ASSISTANT, |
| 7383 | ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 7384 | }; |
| 7385 | |
-b master | 501eec9 | 2009-07-06 13:53:11 -0700 | [diff] [blame] | 7386 | /** |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7387 | * These entries are considered common between the personal and the managed profile, |
| 7388 | * since the managed profile doesn't get to change them. |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7389 | */ |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7390 | private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); |
Amith Yamasani | b0ff322 | 2015-03-04 09:56:14 -0800 | [diff] [blame] | 7391 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7392 | static { |
| 7393 | CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); |
| 7394 | CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); |
| 7395 | CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); |
Felipe Leme | aa00896 | 2017-04-18 14:54:33 -0700 | [diff] [blame] | 7396 | CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7397 | CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); |
| 7398 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 7399 | CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); |
| 7400 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 7401 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7402 | CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7403 | CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 7404 | } |
| 7405 | |
| 7406 | /** @hide */ |
| 7407 | public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { |
| 7408 | outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); |
| 7409 | } |
Amith Yamasani | 4f7e2e3 | 2014-08-14 18:49:48 -0700 | [diff] [blame] | 7410 | |
| 7411 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7412 | * Secure settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7413 | * @hide |
| 7414 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7415 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7416 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7417 | INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); |
| 7418 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); |
| 7419 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); |
Chad Brubaker | 9408d51 | 2017-03-28 16:11:38 -0700 | [diff] [blame] | 7420 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); |
| 7421 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); |
| 7422 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); |
| 7423 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); |
| 7424 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); |
| 7425 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); |
| 7426 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); |
| 7427 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); |
| 7428 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); |
Chad Brubaker | d9285b5 | 2017-04-27 15:28:57 -0700 | [diff] [blame] | 7429 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); |
| 7430 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); |
| 7431 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); |
| 7432 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); |
| 7433 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); |
| 7434 | INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7435 | |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 7436 | INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); |
| 7437 | INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); |
Chad Brubaker | 1bed937 | 2017-03-20 10:52:52 -0700 | [diff] [blame] | 7438 | |
| 7439 | INSTANT_APP_SETTINGS.add(ANDROID_ID); |
Chad Brubaker | 8d7b36f | 2017-04-06 22:57:18 -0700 | [diff] [blame] | 7440 | |
| 7441 | INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 7442 | INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 7443 | } |
| 7444 | |
| 7445 | /** |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7446 | * Helper method for determining if a location provider is enabled. |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 7447 | * |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7448 | * @param cr the content resolver to use |
| 7449 | * @param provider the location provider to query |
| 7450 | * @return true if the provider is enabled |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 7451 | * |
| 7452 | * @deprecated use {@link #LOCATION_MODE} or |
| 7453 | * {@link LocationManager#isProviderEnabled(String)} |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7454 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7455 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7456 | public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7457 | return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId()); |
| 7458 | } |
| 7459 | |
| 7460 | /** |
| 7461 | * Helper method for determining if a location provider is enabled. |
| 7462 | * @param cr the content resolver to use |
| 7463 | * @param provider the location provider to query |
| 7464 | * @param userId the userId to query |
| 7465 | * @return true if the provider is enabled |
Tom O'Neill | d575943 | 2013-09-11 11:03:03 -0700 | [diff] [blame] | 7466 | * @deprecated use {@link #LOCATION_MODE} or |
| 7467 | * {@link LocationManager#isProviderEnabled(String)} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7468 | * @hide |
| 7469 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7470 | @Deprecated |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7471 | public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) { |
| 7472 | String allowedProviders = Settings.Secure.getStringForUser(cr, |
| 7473 | LOCATION_PROVIDERS_ALLOWED, userId); |
Brad Fitzpatrick | 11fe181 | 2010-09-10 16:07:52 -0700 | [diff] [blame] | 7474 | return TextUtils.delimitedStringContains(allowedProviders, ',', provider); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7475 | } |
| 7476 | |
| 7477 | /** |
| 7478 | * Thread-safe method for enabling or disabling a single location provider. |
| 7479 | * @param cr the content resolver to use |
| 7480 | * @param provider the location provider to enable or disable |
| 7481 | * @param enabled true if the provider should be enabled |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7482 | * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE} |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7483 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7484 | @Deprecated |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7485 | public static final void setLocationProviderEnabled(ContentResolver cr, |
| 7486 | String provider, boolean enabled) { |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7487 | setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId()); |
| 7488 | } |
| 7489 | |
| 7490 | /** |
| 7491 | * Thread-safe method for enabling or disabling a single location provider. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7492 | * |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7493 | * @param cr the content resolver to use |
| 7494 | * @param provider the location provider to enable or disable |
| 7495 | * @param enabled true if the provider should be enabled |
| 7496 | * @param userId the userId for which to enable/disable providers |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7497 | * @return true if the value was set, false on database errors |
| 7498 | * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and |
| 7499 | * {@link #LOCATION_MODE} |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7500 | * @hide |
| 7501 | */ |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7502 | @Deprecated |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7503 | public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, |
Victoria Lease | b711d57 | 2012-10-02 13:14:11 -0700 | [diff] [blame] | 7504 | String provider, boolean enabled, int userId) { |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 7505 | synchronized (mLocationSettingsLock) { |
| 7506 | // to ensure thread safety, we write the provider name with a '+' or '-' |
| 7507 | // and let the SettingsProvider handle it rather than reading and modifying |
| 7508 | // the list of enabled providers. |
| 7509 | if (enabled) { |
| 7510 | provider = "+" + provider; |
| 7511 | } else { |
| 7512 | provider = "-" + provider; |
| 7513 | } |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7514 | return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, |
David Christie | 3f7b652 | 2013-08-06 19:19:08 -0700 | [diff] [blame] | 7515 | userId); |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7516 | } |
Mike Lockwood | bd2a712 | 2009-04-02 23:41:33 -0700 | [diff] [blame] | 7517 | } |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7518 | |
| 7519 | /** |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 7520 | * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}. |
| 7521 | */ |
| 7522 | private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) { |
| 7523 | final int mode = getLocationModeForUser(cr, userId); |
| 7524 | return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId); |
| 7525 | } |
| 7526 | |
| 7527 | /** |
| 7528 | * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}. |
| 7529 | */ |
| 7530 | private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) { |
| 7531 | int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, |
| 7532 | LOCATION_MODE_HIGH_ACCURACY, userId); |
| 7533 | // Make sure that the previous mode is never "off". Otherwise the user won't be able to |
| 7534 | // turn on location any longer. |
| 7535 | if (mode == LOCATION_MODE_OFF) { |
| 7536 | mode = LOCATION_MODE_HIGH_ACCURACY; |
| 7537 | } |
| 7538 | return setLocationModeForUser(cr, mode, userId); |
| 7539 | } |
| 7540 | |
| 7541 | /** |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7542 | * Thread-safe method for setting the location mode to one of |
| 7543 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
| 7544 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 7545 | * Necessary because the mode is a composite of the underlying location provider |
| 7546 | * settings. |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7547 | * |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7548 | * @param cr the content resolver to use |
| 7549 | * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} |
| 7550 | * @param userId the userId for which to change mode |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7551 | * @return true if the value was set, false on database errors |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7552 | * |
| 7553 | * @throws IllegalArgumentException if mode is not one of the supported values |
| 7554 | */ |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 7555 | private static final boolean setLocationModeForUser(ContentResolver cr, int mode, |
| 7556 | int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7557 | synchronized (mLocationSettingsLock) { |
| 7558 | boolean gps = false; |
| 7559 | boolean network = false; |
| 7560 | switch (mode) { |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 7561 | case LOCATION_MODE_PREVIOUS: |
| 7562 | // Retrieve the actual mode and set to that mode. |
| 7563 | return restoreLocationModeForUser(cr, userId); |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7564 | case LOCATION_MODE_OFF: |
Lifu Tang | d1fa1d6 | 2015-11-25 21:42:44 -0800 | [diff] [blame] | 7565 | saveLocationModeForUser(cr, userId); |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7566 | break; |
| 7567 | case LOCATION_MODE_SENSORS_ONLY: |
| 7568 | gps = true; |
| 7569 | break; |
| 7570 | case LOCATION_MODE_BATTERY_SAVING: |
| 7571 | network = true; |
| 7572 | break; |
| 7573 | case LOCATION_MODE_HIGH_ACCURACY: |
| 7574 | gps = true; |
| 7575 | network = true; |
| 7576 | break; |
| 7577 | default: |
| 7578 | throw new IllegalArgumentException("Invalid location mode: " + mode); |
| 7579 | } |
Tom O'Neill | 7731a99 | 2014-10-09 11:30:49 -0700 | [diff] [blame] | 7580 | // Note it's important that we set the NLP mode first. The Google implementation |
| 7581 | // of NLP clears its NLP consent setting any time it receives a |
| 7582 | // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also, |
| 7583 | // it shows an NLP consent dialog any time it receives the broadcast, NLP is |
| 7584 | // enabled, and the NLP consent is not set. If 1) we were to enable GPS first, |
| 7585 | // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting, |
| 7586 | // and 3) the receiver happened to complete before we enabled NLP, then the Google |
| 7587 | // NLP would detect the attempt to enable NLP and show a redundant NLP consent |
| 7588 | // dialog. Then the people who wrote the setup wizard would be sad. |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7589 | boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7590 | cr, LocationManager.NETWORK_PROVIDER, network, userId); |
Tom O'Neill | 7731a99 | 2014-10-09 11:30:49 -0700 | [diff] [blame] | 7591 | boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( |
| 7592 | cr, LocationManager.GPS_PROVIDER, gps, userId); |
Tom O'Neill | a324ac7 | 2013-08-26 14:40:23 -0700 | [diff] [blame] | 7593 | return gpsSuccess && nlpSuccess; |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7594 | } |
| 7595 | } |
| 7596 | |
| 7597 | /** |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7598 | * Thread-safe method for reading the location mode, returns one of |
| 7599 | * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, |
Tom O'Neill | 87c7fad | 2016-08-04 08:16:12 -0700 | [diff] [blame] | 7600 | * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary |
| 7601 | * 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] | 7602 | * |
| 7603 | * @param cr the content resolver to use |
| 7604 | * @param userId the userId for which to read the mode |
| 7605 | * @return the location mode |
| 7606 | */ |
Tom O'Neill | 7f6f457 | 2013-08-27 10:53:15 -0700 | [diff] [blame] | 7607 | private static final int getLocationModeForUser(ContentResolver cr, int userId) { |
Tom O'Neill | 1f48b78 | 2013-08-19 18:14:56 -0700 | [diff] [blame] | 7608 | synchronized (mLocationSettingsLock) { |
| 7609 | boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 7610 | cr, LocationManager.GPS_PROVIDER, userId); |
| 7611 | boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( |
| 7612 | cr, LocationManager.NETWORK_PROVIDER, userId); |
| 7613 | if (gpsEnabled && networkEnabled) { |
| 7614 | return LOCATION_MODE_HIGH_ACCURACY; |
| 7615 | } else if (gpsEnabled) { |
| 7616 | return LOCATION_MODE_SENSORS_ONLY; |
| 7617 | } else if (networkEnabled) { |
| 7618 | return LOCATION_MODE_BATTERY_SAVING; |
| 7619 | } else { |
| 7620 | return LOCATION_MODE_OFF; |
| 7621 | } |
| 7622 | } |
| 7623 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7624 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 7625 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7626 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7627 | * Global system settings, containing preferences that always apply identically |
| 7628 | * to all defined users. Applications can read these but are not allowed to write; |
| 7629 | * like the "Secure" settings, these are for preferences that the user must |
| 7630 | * explicitly modify through the system UI or specialized APIs for those values. |
| 7631 | */ |
| 7632 | public static final class Global extends NameValueTable { |
Kweku Adams | b0886f3 | 2017-10-31 15:32:09 -0700 | [diff] [blame] | 7633 | // NOTE: If you add new settings here, be sure to add them to |
| 7634 | // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. |
| 7635 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7636 | /** |
| 7637 | * The content:// style URL for global secure settings items. Not public. |
| 7638 | */ |
| 7639 | public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); |
| 7640 | |
| 7641 | /** |
Amith Yamasani | 23a0f05 | 2014-07-25 12:26:53 -0700 | [diff] [blame] | 7642 | * Whether users are allowed to add more users or guest from lockscreen. |
| 7643 | * <p> |
| 7644 | * Type: int |
| 7645 | * @hide |
| 7646 | */ |
| 7647 | public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; |
| 7648 | |
| 7649 | /** |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 7650 | * Setting whether the global gesture for enabling accessibility is enabled. |
| 7651 | * If this gesture is enabled the user will be able to perfrom it to enable |
| 7652 | * the accessibility state without visiting the settings app. |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7653 | * |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 7654 | * @hide |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 7655 | * No longer used. Should be removed once all dependencies have been updated. |
Svetoslav Ganov | 7befb7d | 2012-09-27 16:49:23 -0700 | [diff] [blame] | 7656 | */ |
| 7657 | public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = |
| 7658 | "enable_accessibility_global_gesture_enabled"; |
| 7659 | |
| 7660 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7661 | * Whether Airplane Mode is on. |
| 7662 | */ |
| 7663 | public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; |
| 7664 | |
| 7665 | /** |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 7666 | * Whether Theater Mode is on. |
| 7667 | * {@hide} |
| 7668 | */ |
Bryce Lee | cdfebd6 | 2015-02-02 08:19:11 -0800 | [diff] [blame] | 7669 | @SystemApi |
Bryce Lee | 584a445 | 2014-10-21 15:55:55 -0700 | [diff] [blame] | 7670 | public static final String THEATER_MODE_ON = "theater_mode_on"; |
| 7671 | |
| 7672 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7673 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. |
| 7674 | */ |
| 7675 | public static final String RADIO_BLUETOOTH = "bluetooth"; |
| 7676 | |
| 7677 | /** |
| 7678 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. |
| 7679 | */ |
| 7680 | public static final String RADIO_WIFI = "wifi"; |
| 7681 | |
| 7682 | /** |
| 7683 | * {@hide} |
| 7684 | */ |
| 7685 | public static final String RADIO_WIMAX = "wimax"; |
| 7686 | /** |
| 7687 | * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
| 7688 | */ |
| 7689 | public static final String RADIO_CELL = "cell"; |
| 7690 | |
| 7691 | /** |
| 7692 | * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. |
| 7693 | */ |
| 7694 | public static final String RADIO_NFC = "nfc"; |
| 7695 | |
| 7696 | /** |
| 7697 | * A comma separated list of radios that need to be disabled when airplane mode |
| 7698 | * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are |
| 7699 | * included in the comma separated list. |
| 7700 | */ |
| 7701 | public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; |
| 7702 | |
| 7703 | /** |
| 7704 | * A comma separated list of radios that should to be disabled when airplane mode |
| 7705 | * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is |
| 7706 | * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi |
| 7707 | * will be turned off when entering airplane mode, but the user will be able to reenable |
| 7708 | * Wifi in the Settings app. |
| 7709 | * |
| 7710 | * {@hide} |
| 7711 | */ |
| 7712 | public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; |
| 7713 | |
| 7714 | /** |
Pulkit Bhuwalka | 547853d | 2017-09-25 17:55:12 -0700 | [diff] [blame] | 7715 | * An integer representing the Bluetooth Class of Device (CoD). |
| 7716 | * |
| 7717 | * @hide |
| 7718 | */ |
| 7719 | public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; |
| 7720 | |
| 7721 | /** |
Bryce Lee | ec85f34 | 2015-12-16 13:32:28 -0800 | [diff] [blame] | 7722 | * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. |
| 7723 | * See {@link android.bluetooth.BluetoothProfile}. |
| 7724 | * {@hide} |
| 7725 | */ |
| 7726 | public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; |
| 7727 | |
| 7728 | /** |
Andre Eisenbach | 82a94d9 | 2016-01-14 14:20:34 -0800 | [diff] [blame] | 7729 | * A semi-colon separated list of Bluetooth interoperability workarounds. |
| 7730 | * Each entry is a partial Bluetooth device address string and an integer representing |
| 7731 | * the feature to be disabled, separated by a comma. The integer must correspond |
| 7732 | * to a interoperability feature as defined in "interop.h" in /system/bt. |
| 7733 | * <p> |
| 7734 | * Example: <br/> |
| 7735 | * "00:11:22,0;01:02:03:04,2" |
| 7736 | * @hide |
| 7737 | */ |
| 7738 | public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; |
| 7739 | |
| 7740 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7741 | * The policy for deciding when Wi-Fi should go to sleep (which will in |
| 7742 | * turn switch to using the mobile data as an Internet connection). |
| 7743 | * <p> |
| 7744 | * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, |
| 7745 | * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or |
| 7746 | * {@link #WIFI_SLEEP_POLICY_NEVER}. |
| 7747 | */ |
| 7748 | public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; |
| 7749 | |
| 7750 | /** |
| 7751 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep |
| 7752 | * policy, which is to sleep shortly after the turning off |
| 7753 | * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. |
| 7754 | */ |
| 7755 | public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; |
| 7756 | |
| 7757 | /** |
| 7758 | * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when |
| 7759 | * the device is on battery, and never go to sleep when the device is |
| 7760 | * plugged in. |
| 7761 | */ |
| 7762 | public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; |
| 7763 | |
| 7764 | /** |
| 7765 | * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. |
| 7766 | */ |
| 7767 | public static final int WIFI_SLEEP_POLICY_NEVER = 2; |
| 7768 | |
| 7769 | /** |
| 7770 | * Value to specify if the user prefers the date, time and time zone |
| 7771 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 7772 | */ |
| 7773 | public static final String AUTO_TIME = "auto_time"; |
| 7774 | |
| 7775 | /** |
| 7776 | * Value to specify if the user prefers the time zone |
| 7777 | * to be automatically fetched from the network (NITZ). 1=yes, 0=no |
| 7778 | */ |
| 7779 | public static final String AUTO_TIME_ZONE = "auto_time_zone"; |
| 7780 | |
| 7781 | /** |
| 7782 | * URI for the car dock "in" event sound. |
| 7783 | * @hide |
| 7784 | */ |
| 7785 | public static final String CAR_DOCK_SOUND = "car_dock_sound"; |
| 7786 | |
| 7787 | /** |
| 7788 | * URI for the car dock "out" event sound. |
| 7789 | * @hide |
| 7790 | */ |
| 7791 | public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; |
| 7792 | |
| 7793 | /** |
| 7794 | * URI for the desk dock "in" event sound. |
| 7795 | * @hide |
| 7796 | */ |
| 7797 | public static final String DESK_DOCK_SOUND = "desk_dock_sound"; |
| 7798 | |
| 7799 | /** |
| 7800 | * URI for the desk dock "out" event sound. |
| 7801 | * @hide |
| 7802 | */ |
| 7803 | public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; |
| 7804 | |
| 7805 | /** |
| 7806 | * Whether to play a sound for dock events. |
| 7807 | * @hide |
| 7808 | */ |
| 7809 | public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; |
| 7810 | |
| 7811 | /** |
Vinod Krishnan | cf11cea | 2016-10-20 22:57:02 -0700 | [diff] [blame] | 7812 | * Whether to play a sound for dock events, only when an accessibility service is on. |
| 7813 | * @hide |
| 7814 | */ |
| 7815 | public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; |
| 7816 | |
| 7817 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7818 | * URI for the "device locked" (keyguard shown) sound. |
| 7819 | * @hide |
| 7820 | */ |
| 7821 | public static final String LOCK_SOUND = "lock_sound"; |
| 7822 | |
| 7823 | /** |
| 7824 | * URI for the "device unlocked" sound. |
| 7825 | * @hide |
| 7826 | */ |
| 7827 | public static final String UNLOCK_SOUND = "unlock_sound"; |
| 7828 | |
| 7829 | /** |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 7830 | * URI for the "device is trusted" sound, which is played when the device enters the trusted |
| 7831 | * state without unlocking. |
| 7832 | * @hide |
| 7833 | */ |
| 7834 | public static final String TRUSTED_SOUND = "trusted_sound"; |
| 7835 | |
| 7836 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7837 | * URI for the low battery sound file. |
| 7838 | * @hide |
| 7839 | */ |
| 7840 | public static final String LOW_BATTERY_SOUND = "low_battery_sound"; |
| 7841 | |
| 7842 | /** |
| 7843 | * Whether to play a sound for low-battery alerts. |
| 7844 | * @hide |
| 7845 | */ |
| 7846 | public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; |
| 7847 | |
| 7848 | /** |
Jeff Brown | 84e2756 | 2012-12-07 13:56:34 -0800 | [diff] [blame] | 7849 | * URI for the "wireless charging started" sound. |
| 7850 | * @hide |
| 7851 | */ |
| 7852 | public static final String WIRELESS_CHARGING_STARTED_SOUND = |
| 7853 | "wireless_charging_started_sound"; |
| 7854 | |
| 7855 | /** |
John Spurlock | 51a871d | 2015-05-06 17:41:30 -0400 | [diff] [blame] | 7856 | * Whether to play a sound for charging events. |
| 7857 | * @hide |
| 7858 | */ |
| 7859 | public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; |
| 7860 | |
| 7861 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7862 | * Whether we keep the device on while the device is plugged in. |
| 7863 | * Supported values are: |
| 7864 | * <ul> |
| 7865 | * <li>{@code 0} to never stay on while plugged in</li> |
| 7866 | * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> |
| 7867 | * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> |
| 7868 | * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> |
| 7869 | * </ul> |
| 7870 | * These values can be OR-ed together. |
| 7871 | */ |
| 7872 | public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; |
| 7873 | |
| 7874 | /** |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 7875 | * When the user has enable the option to have a "bug report" command |
| 7876 | * in the power menu. |
| 7877 | * @hide |
| 7878 | */ |
| 7879 | public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; |
| 7880 | |
| 7881 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7882 | * Whether ADB is enabled. |
| 7883 | */ |
| 7884 | public static final String ADB_ENABLED = "adb_enabled"; |
| 7885 | |
| 7886 | /** |
Jon Miranda | 836c0a8 | 2014-08-11 12:32:26 -0700 | [diff] [blame] | 7887 | * Whether Views are allowed to save their attribute data. |
| 7888 | * @hide |
| 7889 | */ |
| 7890 | public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; |
| 7891 | |
| 7892 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7893 | * Whether assisted GPS should be enabled or not. |
| 7894 | * @hide |
| 7895 | */ |
| 7896 | public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; |
| 7897 | |
| 7898 | /** |
| 7899 | * Whether bluetooth is enabled/disabled |
| 7900 | * 0=disabled. 1=enabled. |
| 7901 | */ |
| 7902 | public static final String BLUETOOTH_ON = "bluetooth_on"; |
| 7903 | |
| 7904 | /** |
| 7905 | * CDMA Cell Broadcast SMS |
| 7906 | * 0 = CDMA Cell Broadcast SMS disabled |
| 7907 | * 1 = CDMA Cell Broadcast SMS enabled |
| 7908 | * @hide |
| 7909 | */ |
| 7910 | public static final String CDMA_CELL_BROADCAST_SMS = |
| 7911 | "cdma_cell_broadcast_sms"; |
| 7912 | |
| 7913 | /** |
| 7914 | * The CDMA roaming mode 0 = Home Networks, CDMA default |
| 7915 | * 1 = Roaming on Affiliated networks |
| 7916 | * 2 = Roaming on any networks |
| 7917 | * @hide |
| 7918 | */ |
| 7919 | public static final String CDMA_ROAMING_MODE = "roaming_settings"; |
| 7920 | |
| 7921 | /** |
| 7922 | * The CDMA subscription mode 0 = RUIM/SIM (default) |
| 7923 | * 1 = NV |
| 7924 | * @hide |
| 7925 | */ |
| 7926 | public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; |
| 7927 | |
Narayan Kamath | 94bcdbc | 2017-07-17 15:32:53 +0100 | [diff] [blame] | 7928 | /** |
| 7929 | * The default value for whether background data is enabled or not. |
| 7930 | * |
| 7931 | * Used by {@code NetworkPolicyManagerService}. |
| 7932 | * |
| 7933 | * @hide |
| 7934 | */ |
| 7935 | public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = |
| 7936 | "default_restrict_background_data"; |
| 7937 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 7938 | /** Inactivity timeout to track mobile data activity. |
| 7939 | * |
| 7940 | * If set to a positive integer, it indicates the inactivity timeout value in seconds to |
| 7941 | * infer the data activity of mobile network. After a period of no activity on mobile |
| 7942 | * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} |
| 7943 | * intent is fired to indicate a transition of network status from "active" to "idle". Any |
| 7944 | * subsequent activity on mobile networks triggers the firing of {@code |
| 7945 | * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". |
| 7946 | * |
| 7947 | * Network activity refers to transmitting or receiving data on the network interfaces. |
| 7948 | * |
| 7949 | * Tracking is disabled if set to zero or negative value. |
| 7950 | * |
| 7951 | * @hide |
| 7952 | */ |
| 7953 | public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; |
| 7954 | |
| 7955 | /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} |
| 7956 | * but for Wifi network. |
| 7957 | * @hide |
| 7958 | */ |
| 7959 | public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; |
| 7960 | |
| 7961 | /** |
| 7962 | * Whether or not data roaming is enabled. (0 = false, 1 = true) |
| 7963 | */ |
| 7964 | public static final String DATA_ROAMING = "data_roaming"; |
| 7965 | |
| 7966 | /** |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 7967 | * The value passed to a Mobile DataConnection via bringUp which defines the |
| 7968 | * number of retries to preform when setting up the initial connection. The default |
| 7969 | * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. |
| 7970 | * @hide |
| 7971 | */ |
| 7972 | public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; |
| 7973 | |
| 7974 | /** |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 7975 | * Whether any package can be on external storage. When this is true, any |
| 7976 | * package, regardless of manifest values, is a candidate for installing |
| 7977 | * or moving onto external storage. (0 = false, 1 = true) |
| 7978 | * @hide |
| 7979 | */ |
| 7980 | public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; |
| 7981 | |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 7982 | /** |
Jeff Davidson | 91c3d07 | 2017-04-12 12:17:11 -0700 | [diff] [blame] | 7983 | * The default SM-DP+ configured for this device. |
| 7984 | * |
| 7985 | * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to |
| 7986 | * download profiles. If this value is set, the LPA will query this server for any profiles |
| 7987 | * available to this device. If any are available, they may be downloaded during device |
| 7988 | * provisioning or in settings without needing the user to enter an activation code. |
| 7989 | * |
| 7990 | * @see android.service.euicc.EuiccService |
| 7991 | * @hide |
| 7992 | * |
| 7993 | * TODO(b/35851809): Make this a SystemApi. |
| 7994 | */ |
| 7995 | public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; |
| 7996 | |
| 7997 | /** |
Jeff Davidson | dff3933 | 2017-05-19 17:07:48 -0700 | [diff] [blame] | 7998 | * Whether any profile has ever been downloaded onto a eUICC on the device. |
| 7999 | * |
| 8000 | * <p>Used to hide eUICC UI from users who have never made use of it and would only be |
| 8001 | * confused by seeing references to it in settings. |
| 8002 | * (0 = false, 1 = true) |
| 8003 | * @hide |
| 8004 | */ |
| 8005 | public static final String EUICC_PROVISIONED = "euicc_provisioned"; |
| 8006 | |
| 8007 | /** |
Jorim Jaggi | 8ccdf3a | 2015-10-22 12:50:31 +0200 | [diff] [blame] | 8008 | * Whether any activity can be resized. When this is true, any |
| 8009 | * activity, regardless of manifest values, can be resized for multi-window. |
| 8010 | * (0 = false, 1 = true) |
| 8011 | * @hide |
| 8012 | */ |
| 8013 | public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES |
| 8014 | = "force_resizable_activities"; |
| 8015 | |
Jorim Jaggi | 6f2efd3 | 2015-12-23 12:04:39 +0100 | [diff] [blame] | 8016 | /** |
| 8017 | * Whether to enable experimental freeform support for windows. |
| 8018 | * @hide |
| 8019 | */ |
| 8020 | public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT |
| 8021 | = "enable_freeform_support"; |
| 8022 | |
Todd Kennedy | f39ca8f | 2015-08-07 14:15:07 -0700 | [diff] [blame] | 8023 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8024 | * Whether user has enabled development settings. |
| 8025 | */ |
| 8026 | public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; |
| 8027 | |
| 8028 | /** |
Amith Yamasani | cb15d66 | 2015-11-10 11:11:15 -0800 | [diff] [blame] | 8029 | * Whether the device has been provisioned (0 = false, 1 = true). |
| 8030 | * <p>On a multiuser device with a separate system user, the screen may be locked |
| 8031 | * as soon as this is set to true and further activities cannot be launched on the |
| 8032 | * system user unless they are marked to show over keyguard. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8033 | */ |
| 8034 | public static final String DEVICE_PROVISIONED = "device_provisioned"; |
| 8035 | |
| 8036 | /** |
Robert Greenwalt | beb482c | 2016-03-28 15:40:56 -0700 | [diff] [blame] | 8037 | * Whether mobile data should be allowed while the device is being provisioned. |
| 8038 | * This allows the provisioning process to turn off mobile data before the user |
| 8039 | * has an opportunity to set things up, preventing other processes from burning |
| 8040 | * precious bytes before wifi is setup. |
| 8041 | * (0 = false, 1 = true) |
| 8042 | * @hide |
| 8043 | */ |
| 8044 | public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = |
| 8045 | "device_provisioning_mobile_data"; |
| 8046 | |
| 8047 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8048 | * The saved value for WindowManagerService.setForcedDisplaySize(). |
| 8049 | * Two integers separated by a comma. If unset, then use the real display size. |
| 8050 | * @hide |
| 8051 | */ |
| 8052 | public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; |
| 8053 | |
| 8054 | /** |
Jeff Brown | d46747a | 2015-04-15 19:02:36 -0700 | [diff] [blame] | 8055 | * The saved value for WindowManagerService.setForcedDisplayScalingMode(). |
| 8056 | * 0 or unset if scaling is automatic, 1 if scaling is disabled. |
| 8057 | * @hide |
| 8058 | */ |
| 8059 | public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; |
| 8060 | |
| 8061 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8062 | * The maximum size, in bytes, of a download that the download manager will transfer over |
| 8063 | * a non-wifi connection. |
| 8064 | * @hide |
| 8065 | */ |
| 8066 | public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = |
| 8067 | "download_manager_max_bytes_over_mobile"; |
| 8068 | |
| 8069 | /** |
| 8070 | * The recommended maximum size, in bytes, of a download that the download manager should |
| 8071 | * transfer over a non-wifi connection. Over this size, the use will be warned, but will |
| 8072 | * have the option to start the download over the mobile connection anyway. |
| 8073 | * @hide |
| 8074 | */ |
| 8075 | public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = |
| 8076 | "download_manager_recommended_max_bytes_over_mobile"; |
| 8077 | |
| 8078 | /** |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8079 | * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8080 | */ |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 8081 | @Deprecated |
| 8082 | 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] | 8083 | |
| 8084 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8085 | * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be |
| 8086 | * sent or processed. (0 = false, 1 = true) |
| 8087 | * @hide |
| 8088 | */ |
| 8089 | public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; |
| 8090 | |
| 8091 | /** |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8092 | * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on |
| 8093 | * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will |
| 8094 | * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be |
| 8095 | * activated. |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8096 | * @hide |
| 8097 | */ |
Donghyun Cho | c1fa9af | 2016-12-27 18:31:09 +0900 | [diff] [blame] | 8098 | public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = |
| 8099 | "hdmi_system_audio_control_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8100 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8101 | /** |
| 8102 | * Whether TV will automatically turn on upon reception of the CEC command |
| 8103 | * <Text View On> or <Image View On>. (0 = false, 1 = true) |
| 8104 | * |
| 8105 | * @hide |
| 8106 | */ |
| 8107 | public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = |
| 8108 | "hdmi_control_auto_wakeup_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8109 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8110 | /** |
| 8111 | * Whether TV will also turn off other CEC devices when it goes to standby mode. |
| 8112 | * (0 = false, 1 = true) |
| 8113 | * |
| 8114 | * @hide |
| 8115 | */ |
| 8116 | public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = |
| 8117 | "hdmi_control_auto_device_off_enabled"; |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8118 | |
Alex Salo | 8994a1f | 2017-11-01 14:52:59 -0700 | [diff] [blame] | 8119 | /** |
| 8120 | * If <b>true</b>, enables out-of-the-box execution for priv apps. |
| 8121 | * Default: false |
| 8122 | * Values: 0 = false, 1 = true |
| 8123 | * |
| 8124 | * @hide |
| 8125 | */ |
| 8126 | public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled"; |
| 8127 | |
| 8128 | /** |
| 8129 | * The interval in milliseconds at which location requests will be throttled when they are |
| 8130 | * coming from the background. |
| 8131 | * |
| 8132 | * @hide |
| 8133 | */ |
| 8134 | public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = |
Soonil Nagarkar | 7decfb6 | 2017-01-18 12:18:49 -0800 | [diff] [blame] | 8135 | "location_background_throttle_interval_ms"; |
| 8136 | |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8137 | /** |
Lifu Tang | c94ef4d | 2017-03-23 23:48:00 -0700 | [diff] [blame] | 8138 | * Most frequent location update interval in milliseconds that proximity alert is allowed |
| 8139 | * to request. |
| 8140 | * @hide |
| 8141 | */ |
| 8142 | public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = |
| 8143 | "location_background_throttle_proximity_alert_interval_ms"; |
| 8144 | |
| 8145 | /** |
Soonil Nagarkar | 2f1f7e8 | 2017-01-24 12:52:10 -0800 | [diff] [blame] | 8146 | * Packages that are whitelisted for background throttling (throttling will not be applied). |
| 8147 | * @hide |
| 8148 | */ |
| 8149 | public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8150 | "location_background_throttle_package_whitelist"; |
| 8151 | |
Wei Wang | cdbffa9 | 2017-04-17 19:49:29 -0700 | [diff] [blame] | 8152 | /** |
| 8153 | * The interval in milliseconds at which wifi scan requests will be throttled when they are |
| 8154 | * coming from the background. |
| 8155 | * @hide |
| 8156 | */ |
| 8157 | public static final String WIFI_SCAN_BACKGROUND_THROTTLE_INTERVAL_MS = |
| 8158 | "wifi_scan_background_throttle_interval_ms"; |
| 8159 | |
| 8160 | /** |
| 8161 | * Packages that are whitelisted to be exempt for wifi background throttling. |
| 8162 | * @hide |
| 8163 | */ |
| 8164 | public static final String WIFI_SCAN_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = |
| 8165 | "wifi_scan_background_throttle_package_whitelist"; |
| 8166 | |
| 8167 | /** |
Jinsuk Kim | b3d9177 | 2014-07-10 12:48:54 +0900 | [diff] [blame] | 8168 | * Whether TV will switch to MHL port when a mobile device is plugged in. |
| 8169 | * (0 = false, 1 = true) |
| 8170 | * @hide |
| 8171 | */ |
| 8172 | public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; |
| 8173 | |
| 8174 | /** |
| 8175 | * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) |
| 8176 | * @hide |
| 8177 | */ |
| 8178 | public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; |
| 8179 | |
| 8180 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8181 | * Whether mobile data connections are allowed by the user. See |
| 8182 | * ConnectivityManager for more info. |
| 8183 | * @hide |
| 8184 | */ |
| 8185 | public static final String MOBILE_DATA = "mobile_data"; |
| 8186 | |
Erik Kline | da4bfa8 | 2015-04-30 12:58:40 +0900 | [diff] [blame] | 8187 | /** |
| 8188 | * Whether the mobile data connection should remain active even when higher |
| 8189 | * priority networks like WiFi are active, to help make network switching faster. |
| 8190 | * |
| 8191 | * See ConnectivityService for more info. |
| 8192 | * |
| 8193 | * (0 = disabled, 1 = enabled) |
| 8194 | * @hide |
| 8195 | */ |
| 8196 | public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; |
| 8197 | |
Hugo Benichi | 05686db | 2016-10-19 11:17:28 +0900 | [diff] [blame] | 8198 | /** |
| 8199 | * Size of the event buffer for IP connectivity metrics. |
| 8200 | * @hide |
| 8201 | */ |
| 8202 | public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = |
| 8203 | "connectivity_metrics_buffer_size"; |
| 8204 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8205 | /** {@hide} */ |
| 8206 | public static final String NETSTATS_ENABLED = "netstats_enabled"; |
| 8207 | /** {@hide} */ |
| 8208 | public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; |
| 8209 | /** {@hide} */ |
| 8210 | public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; |
| 8211 | /** {@hide} */ |
| 8212 | public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; |
| 8213 | /** {@hide} */ |
| 8214 | public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; |
Jeff Sharkey | f4de294 | 2017-08-29 15:32:13 -0600 | [diff] [blame] | 8215 | /** {@hide} */ |
| 8216 | public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8217 | |
| 8218 | /** {@hide} */ |
| 8219 | public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; |
| 8220 | /** {@hide} */ |
| 8221 | public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; |
| 8222 | /** {@hide} */ |
| 8223 | public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; |
| 8224 | /** {@hide} */ |
| 8225 | public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; |
| 8226 | |
| 8227 | /** {@hide} */ |
| 8228 | public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; |
| 8229 | /** {@hide} */ |
| 8230 | public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; |
| 8231 | /** {@hide} */ |
| 8232 | public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; |
| 8233 | /** {@hide} */ |
| 8234 | public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; |
| 8235 | |
| 8236 | /** {@hide} */ |
| 8237 | public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; |
| 8238 | /** {@hide} */ |
| 8239 | public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; |
| 8240 | /** {@hide} */ |
| 8241 | public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; |
| 8242 | /** {@hide} */ |
| 8243 | public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; |
| 8244 | |
| 8245 | /** |
| 8246 | * User preference for which network(s) should be used. Only the |
| 8247 | * connectivity service should touch this. |
| 8248 | */ |
| 8249 | public static final String NETWORK_PREFERENCE = "network_preference"; |
| 8250 | |
| 8251 | /** |
Jeff Davidson | dd6fd1e | 2014-04-14 15:14:30 -0700 | [diff] [blame] | 8252 | * Which package name to use for network scoring. If null, or if the package is not a valid |
| 8253 | * scorer app, external network scores will neither be requested nor accepted. |
| 8254 | * @hide |
| 8255 | */ |
| 8256 | public static final String NETWORK_SCORER_APP = "network_scorer_app"; |
| 8257 | |
| 8258 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8259 | * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment |
| 8260 | * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been |
| 8261 | * exceeded. |
| 8262 | * @hide |
| 8263 | */ |
| 8264 | public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; |
| 8265 | |
| 8266 | /** |
| 8267 | * The length of time in milli-seconds that automatic small adjustments to |
| 8268 | * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. |
| 8269 | * @hide |
| 8270 | */ |
| 8271 | public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; |
| 8272 | |
| 8273 | /** Preferred NTP server. {@hide} */ |
| 8274 | public static final String NTP_SERVER = "ntp_server"; |
| 8275 | /** Timeout in milliseconds to wait for NTP server. {@hide} */ |
| 8276 | public static final String NTP_TIMEOUT = "ntp_timeout"; |
| 8277 | |
Jeff Sharkey | e8a4b66 | 2015-06-27 15:43:45 -0700 | [diff] [blame] | 8278 | /** {@hide} */ |
| 8279 | public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; |
| 8280 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8281 | /** |
Pierre Imai | 8e48e67 | 2016-04-21 13:30:43 +0900 | [diff] [blame] | 8282 | * Sample validity in seconds to configure for the system DNS resolver. |
| 8283 | * {@hide} |
| 8284 | */ |
| 8285 | public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = |
| 8286 | "dns_resolver_sample_validity_seconds"; |
| 8287 | |
| 8288 | /** |
| 8289 | * Success threshold in percent for use with the system DNS resolver. |
| 8290 | * {@hide} |
| 8291 | */ |
| 8292 | public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = |
| 8293 | "dns_resolver_success_threshold_percent"; |
| 8294 | |
| 8295 | /** |
| 8296 | * Minimum number of samples needed for statistics to be considered meaningful in the |
| 8297 | * system DNS resolver. |
| 8298 | * {@hide} |
| 8299 | */ |
| 8300 | public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; |
| 8301 | |
| 8302 | /** |
| 8303 | * Maximum number taken into account for statistics purposes in the system DNS resolver. |
| 8304 | * {@hide} |
| 8305 | */ |
| 8306 | public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; |
| 8307 | |
| 8308 | /** |
Tao Bao | fdf7c5d | 2016-02-15 20:59:15 -0800 | [diff] [blame] | 8309 | * Whether to disable the automatic scheduling of system updates. |
| 8310 | * 1 = system updates won't be automatically scheduled (will always |
| 8311 | * present notification instead). |
| 8312 | * 0 = system updates will be automatically scheduled. (default) |
| 8313 | * @hide |
| 8314 | */ |
| 8315 | @SystemApi |
| 8316 | public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; |
| 8317 | |
| 8318 | /** |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8319 | * Whether the package manager should send package verification broadcasts for verifiers to |
| 8320 | * review apps prior to installation. |
| 8321 | * 1 = request apps to be verified prior to installation, if a verifier exists. |
| 8322 | * 0 = do not verify apps before installation |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8323 | * @hide |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8324 | */ |
| 8325 | public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; |
| 8326 | |
| 8327 | /** Timeout for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8328 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8329 | public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; |
| 8330 | |
| 8331 | /** Default response code for package verification. |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8332 | * @hide */ |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8333 | public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; |
| 8334 | |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8335 | /** |
| 8336 | * Show package verification setting in the Settings app. |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 8337 | * 1 = show (default) |
| 8338 | * 0 = hide |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8339 | * @hide |
rich cannings | e6686b3 | 2012-09-16 14:02:20 -0700 | [diff] [blame] | 8340 | */ |
| 8341 | public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; |
| 8342 | |
rich cannings | 4d8fc79 | 2012-09-07 14:43:43 -0700 | [diff] [blame] | 8343 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 8344 | * Run package verification on apps installed through ADB/ADT/USB |
rich cannings | 4e5753f | 2012-09-19 16:03:56 -0700 | [diff] [blame] | 8345 | * 1 = perform package verification on ADB installs (default) |
| 8346 | * 0 = bypass package verification on ADB installs |
| 8347 | * @hide |
| 8348 | */ |
| 8349 | public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; |
| 8350 | |
| 8351 | /** |
Christopher Tate | 7265abe | 2014-11-21 13:54:45 -0800 | [diff] [blame] | 8352 | * Time since last fstrim (milliseconds) after which we force one to happen |
| 8353 | * during device startup. If unset, the default is 3 days. |
| 8354 | * @hide |
| 8355 | */ |
| 8356 | public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; |
| 8357 | |
| 8358 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8359 | * The interval in milliseconds at which to check packet counts on the |
| 8360 | * mobile data interface when screen is on, to detect possible data |
| 8361 | * connection problems. |
| 8362 | * @hide |
| 8363 | */ |
| 8364 | public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = |
| 8365 | "pdp_watchdog_poll_interval_ms"; |
| 8366 | |
| 8367 | /** |
| 8368 | * The interval in milliseconds at which to check packet counts on the |
| 8369 | * mobile data interface when screen is off, to detect possible data |
| 8370 | * connection problems. |
| 8371 | * @hide |
| 8372 | */ |
| 8373 | public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = |
| 8374 | "pdp_watchdog_long_poll_interval_ms"; |
| 8375 | |
| 8376 | /** |
| 8377 | * The interval in milliseconds at which to check packet counts on the |
| 8378 | * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} |
| 8379 | * outgoing packets has been reached without incoming packets. |
| 8380 | * @hide |
| 8381 | */ |
| 8382 | public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = |
| 8383 | "pdp_watchdog_error_poll_interval_ms"; |
| 8384 | |
| 8385 | /** |
| 8386 | * The number of outgoing packets sent without seeing an incoming packet |
| 8387 | * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} |
| 8388 | * device is logged to the event log |
| 8389 | * @hide |
| 8390 | */ |
| 8391 | public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = |
| 8392 | "pdp_watchdog_trigger_packet_count"; |
| 8393 | |
| 8394 | /** |
| 8395 | * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) |
| 8396 | * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before |
| 8397 | * attempting data connection recovery. |
| 8398 | * @hide |
| 8399 | */ |
| 8400 | public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = |
| 8401 | "pdp_watchdog_error_poll_count"; |
| 8402 | |
| 8403 | /** |
| 8404 | * The number of failed PDP reset attempts before moving to something more |
| 8405 | * drastic: re-registering to the network. |
| 8406 | * @hide |
| 8407 | */ |
| 8408 | public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = |
| 8409 | "pdp_watchdog_max_pdp_reset_fail_count"; |
| 8410 | |
| 8411 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8412 | * URL to open browser on to allow user to manage a prepay account |
| 8413 | * @hide |
| 8414 | */ |
| 8415 | public static final String SETUP_PREPAID_DATA_SERVICE_URL = |
| 8416 | "setup_prepaid_data_service_url"; |
| 8417 | |
| 8418 | /** |
| 8419 | * URL to attempt a GET on to see if this is a prepay device |
| 8420 | * @hide |
| 8421 | */ |
| 8422 | public static final String SETUP_PREPAID_DETECTION_TARGET_URL = |
| 8423 | "setup_prepaid_detection_target_url"; |
| 8424 | |
| 8425 | /** |
| 8426 | * Host to check for a redirect to after an attempt to GET |
| 8427 | * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, |
| 8428 | * this is a prepaid device with zero balance.) |
| 8429 | * @hide |
| 8430 | */ |
| 8431 | public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = |
| 8432 | "setup_prepaid_detection_redir_host"; |
| 8433 | |
| 8434 | /** |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 8435 | * The interval in milliseconds at which to check the number of SMS sent out without asking |
| 8436 | * for use permit, to limit the un-authorized SMS usage. |
| 8437 | * |
| 8438 | * @hide |
| 8439 | */ |
| 8440 | public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = |
| 8441 | "sms_outgoing_check_interval_ms"; |
| 8442 | |
| 8443 | /** |
| 8444 | * The number of outgoing SMS sent without asking for user permit (of {@link |
| 8445 | * #SMS_OUTGOING_CHECK_INTERVAL_MS} |
| 8446 | * |
| 8447 | * @hide |
| 8448 | */ |
| 8449 | public static final String SMS_OUTGOING_CHECK_MAX_COUNT = |
| 8450 | "sms_outgoing_check_max_count"; |
| 8451 | |
| 8452 | /** |
| 8453 | * Used to disable SMS short code confirmation - defaults to true. |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 8454 | * 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] | 8455 | * @see com.android.internal.telephony.SmsUsageMonitor |
| 8456 | * @hide |
| 8457 | */ |
| 8458 | public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; |
| 8459 | |
Robert Greenwalt | 026efcc | 2012-09-24 10:03:21 -0700 | [diff] [blame] | 8460 | /** |
| 8461 | * Used to select which country we use to determine premium sms codes. |
| 8462 | * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, |
| 8463 | * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, |
| 8464 | * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. |
| 8465 | * @hide |
| 8466 | */ |
| 8467 | public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; |
| 8468 | |
Jake Hamby | 76a6142 | 2012-09-06 17:40:21 -0700 | [diff] [blame] | 8469 | /** |
JP Abgrall | 32d1ac4d | 2014-02-21 12:05:20 -0800 | [diff] [blame] | 8470 | * Used to select TCP's default initial receiver window size in segments - defaults to a build config value |
| 8471 | * @hide |
| 8472 | */ |
| 8473 | public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; |
| 8474 | |
| 8475 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8476 | * Used to disable Tethering on a device - defaults to true |
| 8477 | * @hide |
| 8478 | */ |
| 8479 | public static final String TETHER_SUPPORTED = "tether_supported"; |
| 8480 | |
| 8481 | /** |
| 8482 | * Used to require DUN APN on the device or not - defaults to a build config value |
| 8483 | * which defaults to false |
| 8484 | * @hide |
| 8485 | */ |
| 8486 | public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; |
| 8487 | |
| 8488 | /** |
| 8489 | * Used to hold a gservices-provisioned apn value for DUN. If set, or the |
| 8490 | * corresponding build config values are set it will override the APN DB |
| 8491 | * values. |
| 8492 | * Consists of a comma seperated list of strings: |
| 8493 | * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" |
| 8494 | * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" |
| 8495 | * @hide |
| 8496 | */ |
| 8497 | public static final String TETHER_DUN_APN = "tether_dun_apn"; |
| 8498 | |
Erik Kline | 92c4db0 | 2017-05-31 10:21:32 +0900 | [diff] [blame] | 8499 | /** |
| 8500 | * Used to disable trying to talk to any available tethering offload HAL. |
| 8501 | * |
| 8502 | * Integer values are interpreted as boolean, and the absence of an explicit setting |
| 8503 | * is interpreted as |false|. |
| 8504 | * @hide |
| 8505 | */ |
| 8506 | public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; |
| 8507 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8508 | /** |
Junda Liu | 0c35fbc | 2016-01-19 23:20:15 -0800 | [diff] [blame] | 8509 | * List of carrier apps which are whitelisted to prompt the user for install when |
| 8510 | * a sim card with matching uicc carrier privilege rules is inserted. |
| 8511 | * |
| 8512 | * The value is "package1;package2;..." |
| 8513 | * @hide |
| 8514 | */ |
| 8515 | public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; |
| 8516 | |
| 8517 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8518 | * USB Mass Storage Enabled |
| 8519 | */ |
| 8520 | public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; |
| 8521 | |
| 8522 | /** |
| 8523 | * If this setting is set (to anything), then all references |
| 8524 | * to Gmail on the device must change to Google Mail. |
| 8525 | */ |
| 8526 | public static final String USE_GOOGLE_MAIL = "use_google_mail"; |
| 8527 | |
Hui Shu | 2267177 | 2014-10-01 21:41:07 +0000 | [diff] [blame] | 8528 | /** |
| 8529 | * Webview Data reduction proxy key. |
| 8530 | * @hide |
| 8531 | */ |
| 8532 | public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = |
| 8533 | "webview_data_reduction_proxy_key"; |
| 8534 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 8535 | /** |
| 8536 | * Whether or not the WebView fallback mechanism should be enabled. |
| 8537 | * 0=disabled, 1=enabled. |
| 8538 | * @hide |
| 8539 | */ |
| 8540 | public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = |
| 8541 | "webview_fallback_logic_enabled"; |
Gustav Sennton | c83e3fa | 2016-02-18 12:19:13 +0000 | [diff] [blame] | 8542 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 8543 | /** |
| 8544 | * Name of the package used as WebView provider (if unset the provider is instead determined |
| 8545 | * by the system). |
| 8546 | * @hide |
| 8547 | */ |
| 8548 | public static final String WEBVIEW_PROVIDER = "webview_provider"; |
Gustav Sennton | 14c033c | 2016-02-11 12:51:27 +0000 | [diff] [blame] | 8549 | |
Lorenzo Colitti | 84e6f123 | 2016-08-29 14:03:11 +0900 | [diff] [blame] | 8550 | /** |
| 8551 | * Developer setting to enable WebView multiprocess rendering. |
| 8552 | * @hide |
| 8553 | */ |
| 8554 | @SystemApi |
| 8555 | public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; |
| 8556 | |
| 8557 | /** |
| 8558 | * The maximum number of notifications shown in 24 hours when switching networks. |
| 8559 | * @hide |
| 8560 | */ |
| 8561 | public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = |
| 8562 | "network_switch_notification_daily_limit"; |
| 8563 | |
| 8564 | /** |
| 8565 | * The minimum time in milliseconds between notifications when switching networks. |
| 8566 | * @hide |
| 8567 | */ |
| 8568 | public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = |
| 8569 | "network_switch_notification_rate_limit_millis"; |
Tobias Sargeant | da85710 | 2016-02-11 14:52:28 +0000 | [diff] [blame] | 8570 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8571 | /** |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 8572 | * Whether to automatically switch away from wifi networks that lose Internet access. |
Lorenzo Colitti | 165c51c | 2016-09-19 01:00:19 +0900 | [diff] [blame] | 8573 | * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always |
| 8574 | * avoids such networks. Valid values are: |
| 8575 | * |
| 8576 | * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. |
| 8577 | * null: Ask the user whether to switch away from bad wifi. |
| 8578 | * 1: Avoid bad wifi. |
| 8579 | * |
Hugo Benichi | c8e9e12 | 2016-09-14 23:23:08 +0000 | [diff] [blame] | 8580 | * @hide |
| 8581 | */ |
| 8582 | public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; |
| 8583 | |
| 8584 | /** |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 8585 | * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be |
| 8586 | * overridden by the system based on device or application state. If null, the value |
| 8587 | * specified by config_networkMeteredMultipathPreference is used. |
| 8588 | * |
| 8589 | * @hide |
| 8590 | */ |
| 8591 | public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = |
| 8592 | "network_metered_multipath_preference"; |
| 8593 | |
Ricky Wai | 1a6e667 | 2017-10-27 14:46:01 +0100 | [diff] [blame] | 8594 | /** |
| 8595 | * Network watchlist last report time. |
| 8596 | * @hide |
| 8597 | */ |
| 8598 | public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = |
| 8599 | "network_watchlist_last_report_time"; |
| 8600 | |
Lorenzo Colitti | 2de4925 | 2017-01-24 18:08:41 +0900 | [diff] [blame] | 8601 | /** |
William Mee | cd62f3a | 2017-01-24 18:01:38 -0800 | [diff] [blame] | 8602 | * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of |
| 8603 | * colon-delimited key-value pairs. The key is the badging enum value defined in |
| 8604 | * android.net.ScoredNetwork and the value is the minimum sustained network throughput in |
| 8605 | * kbps required for the badge. For example: "10:3000,20:5000,30:25000" |
| 8606 | * |
| 8607 | * @hide |
| 8608 | */ |
| 8609 | @SystemApi |
| 8610 | public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; |
| 8611 | |
| 8612 | /** |
Jeff Brown | 89d5546 | 2012-09-19 11:33:42 -0700 | [diff] [blame] | 8613 | * Whether Wifi display is enabled/disabled |
| 8614 | * 0=disabled. 1=enabled. |
| 8615 | * @hide |
| 8616 | */ |
| 8617 | public static final String WIFI_DISPLAY_ON = "wifi_display_on"; |
| 8618 | |
| 8619 | /** |
Chong Zhang | 1f3ecaa | 2013-05-03 15:55:36 -0700 | [diff] [blame] | 8620 | * Whether Wifi display certification mode is enabled/disabled |
| 8621 | * 0=disabled. 1=enabled. |
| 8622 | * @hide |
| 8623 | */ |
| 8624 | public static final String WIFI_DISPLAY_CERTIFICATION_ON = |
| 8625 | "wifi_display_certification_on"; |
| 8626 | |
| 8627 | /** |
Chong Zhang | e38af81 | 2013-08-29 17:25:17 -0700 | [diff] [blame] | 8628 | * WPS Configuration method used by Wifi display, this setting only |
| 8629 | * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). |
| 8630 | * |
| 8631 | * Possible values are: |
| 8632 | * |
| 8633 | * WpsInfo.INVALID: use default WPS method chosen by framework |
| 8634 | * WpsInfo.PBC : use Push button |
| 8635 | * WpsInfo.KEYPAD : use Keypad |
| 8636 | * WpsInfo.DISPLAY: use Display |
| 8637 | * @hide |
| 8638 | */ |
| 8639 | public static final String WIFI_DISPLAY_WPS_CONFIG = |
| 8640 | "wifi_display_wps_config"; |
| 8641 | |
| 8642 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8643 | * Whether to notify the user of open networks. |
| 8644 | * <p> |
| 8645 | * If not connected and the scan results have an open network, we will |
| 8646 | * put this notification up. If we attempt to connect to a network or |
| 8647 | * the open network(s) disappear, we remove the notification. When we |
| 8648 | * show the notification, we will not show it again for |
| 8649 | * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 8650 | * |
| 8651 | * @deprecated This feature is no longer controlled by this setting in |
| 8652 | * {@link android.os.Build.VERSION_CODES#O}. |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8653 | */ |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 8654 | @Deprecated |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8655 | public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 8656 | "wifi_networks_available_notification_on"; |
Amin Shaikh | 3087e32 | 2017-03-24 17:34:24 -0700 | [diff] [blame] | 8657 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8658 | /** |
| 8659 | * {@hide} |
| 8660 | */ |
| 8661 | public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = |
| 8662 | "wimax_networks_available_notification_on"; |
| 8663 | |
| 8664 | /** |
| 8665 | * Delay (in seconds) before repeating the Wi-Fi networks available notification. |
| 8666 | * Connecting to a network will reset the timer. |
| 8667 | */ |
| 8668 | public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = |
| 8669 | "wifi_networks_available_repeat_delay"; |
| 8670 | |
| 8671 | /** |
Robert Greenwalt | 3ea0c99 | 2013-10-03 21:13:49 +0000 | [diff] [blame] | 8672 | * 802.11 country code in ISO 3166 format |
| 8673 | * @hide |
| 8674 | */ |
| 8675 | public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; |
| 8676 | |
| 8677 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8678 | * The interval in milliseconds to issue wake up scans when wifi needs |
| 8679 | * to connect. This is necessary to connect to an access point when |
| 8680 | * device is on the move and the screen is off. |
| 8681 | * @hide |
| 8682 | */ |
| 8683 | public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = |
| 8684 | "wifi_framework_scan_interval_ms"; |
| 8685 | |
| 8686 | /** |
| 8687 | * The interval in milliseconds after which Wi-Fi is considered idle. |
| 8688 | * When idle, it is possible for the device to be switched from Wi-Fi to |
| 8689 | * the mobile data network. |
| 8690 | * @hide |
| 8691 | */ |
| 8692 | public static final String WIFI_IDLE_MS = "wifi_idle_ms"; |
| 8693 | |
| 8694 | /** |
| 8695 | * When the number of open networks exceeds this number, the |
| 8696 | * least-recently-used excess networks will be removed. |
| 8697 | */ |
| 8698 | public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; |
| 8699 | |
| 8700 | /** |
| 8701 | * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. |
| 8702 | */ |
| 8703 | public static final String WIFI_ON = "wifi_on"; |
| 8704 | |
| 8705 | /** |
Irfan Sheriff | 11aefad | 2013-03-06 07:57:41 -0800 | [diff] [blame] | 8706 | * Setting to allow scans to be enabled even wifi is turned off for connectivity. |
| 8707 | * @hide |
| 8708 | */ |
| 8709 | public static final String WIFI_SCAN_ALWAYS_AVAILABLE = |
| 8710 | "wifi_scan_always_enabled"; |
| 8711 | |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8712 | /** |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 8713 | * Whether soft AP will shut down after a timeout period when no devices are connected. |
| 8714 | * @hide |
| 8715 | */ |
| 8716 | public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; |
| 8717 | |
| 8718 | /** |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8719 | * Value to specify if Wi-Fi Wakeup feature is enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 8720 | * |
| 8721 | * Type: int (0 for false, 1 for true) |
Stephen Chen | 8ca96c1 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8722 | * @hide |
| 8723 | */ |
| 8724 | @SystemApi |
| 8725 | public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; |
| 8726 | |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8727 | /** |
Jeremy Joslin | 45caa25 | 2017-05-04 11:22:46 -0700 | [diff] [blame] | 8728 | * Value to specify if Wi-Fi Wakeup is available. |
| 8729 | * |
| 8730 | * Wi-Fi Wakeup will only operate if it's available |
| 8731 | * and {@link #WIFI_WAKEUP_ENABLED} is true. |
| 8732 | * |
| 8733 | * Type: int (0 for false, 1 for true) |
| 8734 | * @hide |
| 8735 | */ |
| 8736 | public static final String WIFI_WAKEUP_AVAILABLE = "wifi_wakeup_available"; |
| 8737 | |
| 8738 | /** |
Sundeep Ghuman | e869d83 | 2017-01-25 16:23:43 -0800 | [diff] [blame] | 8739 | * Value to specify whether network quality scores and badging should be shown in the UI. |
| 8740 | * |
| 8741 | * Type: int (0 for false, 1 for true) |
| 8742 | * @hide |
| 8743 | */ |
| 8744 | public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; |
| 8745 | |
| 8746 | /** |
Sundeep Ghuman | 9bb85d3 | 2017-08-28 17:04:16 -0700 | [diff] [blame] | 8747 | * Value to specify how long in milliseconds to retain seen score cache curves to be used |
| 8748 | * when generating SSID only bases score curves. |
| 8749 | * |
| 8750 | * Type: long |
| 8751 | * @hide |
| 8752 | */ |
| 8753 | public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = |
| 8754 | "speed_label_cache_eviction_age_millis"; |
| 8755 | |
| 8756 | /** |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8757 | * Value to specify if network recommendations from |
| 8758 | * {@link com.android.server.NetworkScoreService} are enabled. |
Stephen Chen | f1b7564 | 2016-12-06 16:08:52 -0800 | [diff] [blame] | 8759 | * |
Jeremy Joslin | 9925c6a | 2017-03-06 10:39:35 -0800 | [diff] [blame] | 8760 | * Type: int |
| 8761 | * Valid values: |
| 8762 | * -1 = Forced off |
| 8763 | * 0 = Disabled |
| 8764 | * 1 = Enabled |
| 8765 | * |
| 8766 | * Most readers of this setting should simply check if value == 1 to determined the |
| 8767 | * enabled state. |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8768 | * @hide |
| 8769 | */ |
Stephen Chen | 6a0c879 | 2016-11-16 15:46:51 -0800 | [diff] [blame] | 8770 | public static final String NETWORK_RECOMMENDATIONS_ENABLED = |
| 8771 | "network_recommendations_enabled"; |
| 8772 | |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 8773 | /** |
Jeremy Joslin | c9eb3c4 | 2017-02-08 10:45:30 -0800 | [diff] [blame] | 8774 | * Which package name to use for network recommendations. If null, network recommendations |
| 8775 | * will neither be requested nor accepted. |
| 8776 | * |
| 8777 | * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and |
| 8778 | * {@link NetworkScoreManager#setActiveScorer(String)} to write it. |
| 8779 | * |
| 8780 | * Type: string - package name |
| 8781 | * @hide |
| 8782 | */ |
| 8783 | public static final String NETWORK_RECOMMENDATIONS_PACKAGE = |
| 8784 | "network_recommendations_package"; |
| 8785 | |
| 8786 | /** |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 8787 | * The package name of the application that connect and secures high quality open wifi |
| 8788 | * networks automatically. |
| 8789 | * |
| 8790 | * Type: string package name or null if the feature is either not provided or disabled. |
| 8791 | * @hide |
| 8792 | */ |
Eric Enslen | 1e423b9 | 2017-12-18 11:30:21 -0800 | [diff] [blame] | 8793 | @TestApi |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 8794 | public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; |
| 8795 | |
| 8796 | /** |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 8797 | * The number of milliseconds the {@link com.android.server.NetworkScoreService} |
| 8798 | * will give a recommendation request to complete before returning a default response. |
| 8799 | * |
| 8800 | * Type: long |
| 8801 | * @hide |
Jeremy Joslin | b1a0139 | 2017-04-14 13:35:48 -0700 | [diff] [blame] | 8802 | * @deprecated to be removed |
Jeremy Joslin | cb594f3 | 2017-01-03 17:31:23 -0800 | [diff] [blame] | 8803 | */ |
| 8804 | public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = |
| 8805 | "network_recommendation_request_timeout_ms"; |
| 8806 | |
Amin Shaikh | d3c8193 | 2017-02-06 16:22:42 -0800 | [diff] [blame] | 8807 | /** |
| 8808 | * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in |
| 8809 | * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. |
| 8810 | * |
| 8811 | * Type: long |
| 8812 | * @hide |
| 8813 | */ |
| 8814 | public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = |
| 8815 | "recommended_network_evaluator_cache_expiry_ms"; |
| 8816 | |
Irfan Sheriff | 11aefad | 2013-03-06 07:57:41 -0800 | [diff] [blame] | 8817 | /** |
Wei Wang | d91f193 | 2015-03-19 15:09:56 -0700 | [diff] [blame] | 8818 | * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for |
| 8819 | * connectivity. |
| 8820 | * @hide |
| 8821 | */ |
| 8822 | public static final String BLE_SCAN_ALWAYS_AVAILABLE = |
| 8823 | "ble_scan_always_enabled"; |
| 8824 | |
| 8825 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8826 | * Used to save the Wifi_ON state prior to tethering. |
| 8827 | * This state will be checked to restore Wifi after |
| 8828 | * the user turns off tethering. |
| 8829 | * |
| 8830 | * @hide |
| 8831 | */ |
| 8832 | public static final String WIFI_SAVED_STATE = "wifi_saved_state"; |
| 8833 | |
| 8834 | /** |
| 8835 | * The interval in milliseconds to scan as used by the wifi supplicant |
| 8836 | * @hide |
| 8837 | */ |
| 8838 | public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = |
| 8839 | "wifi_supplicant_scan_interval_ms"; |
| 8840 | |
vandwalle | 7c3606c | 2014-03-31 19:12:07 -0700 | [diff] [blame] | 8841 | /** |
| 8842 | * whether frameworks handles wifi auto-join |
| 8843 | * @hide |
| 8844 | */ |
| 8845 | public static final String WIFI_ENHANCED_AUTO_JOIN = |
| 8846 | "wifi_enhanced_auto_join"; |
| 8847 | |
| 8848 | /** |
| 8849 | * whether settings show RSSI |
| 8850 | * @hide |
| 8851 | */ |
| 8852 | public static final String WIFI_NETWORK_SHOW_RSSI = |
| 8853 | "wifi_network_show_rssi"; |
| 8854 | |
| 8855 | /** |
Irfan Sheriff | 3809f50 | 2012-09-17 16:04:57 -0700 | [diff] [blame] | 8856 | * The interval in milliseconds to scan at supplicant when p2p is connected |
| 8857 | * @hide |
| 8858 | */ |
| 8859 | public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = |
| 8860 | "wifi_scan_interval_p2p_connected_ms"; |
| 8861 | |
| 8862 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8863 | * Whether the Wi-Fi watchdog is enabled. |
| 8864 | */ |
| 8865 | public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; |
| 8866 | |
| 8867 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8868 | * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and |
| 8869 | * the setting needs to be set to 0 to disable it. |
| 8870 | * @hide |
| 8871 | */ |
| 8872 | public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = |
| 8873 | "wifi_watchdog_poor_network_test_enabled"; |
| 8874 | |
| 8875 | /** |
| 8876 | * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and |
| 8877 | * needs to be set to 0 to disable it. |
| 8878 | * @hide |
| 8879 | */ |
| 8880 | public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = |
| 8881 | "wifi_suspend_optimizations_enabled"; |
| 8882 | |
| 8883 | /** |
Nathan Harold | 29589fc | 2016-03-30 21:53:48 -0700 | [diff] [blame] | 8884 | * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 |
| 8885 | * will enable it. In the future, additional values may be supported. |
| 8886 | * @hide |
| 8887 | */ |
| 8888 | public static final String WIFI_VERBOSE_LOGGING_ENABLED = |
| 8889 | "wifi_verbose_logging_enabled"; |
| 8890 | |
| 8891 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8892 | * The maximum number of times we will retry a connection to an access |
| 8893 | * point for which we have failed in acquiring an IP address from DHCP. |
| 8894 | * A value of N means that we will make N+1 connection attempts in all. |
| 8895 | */ |
| 8896 | public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; |
| 8897 | |
| 8898 | /** |
| 8899 | * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile |
| 8900 | * data connectivity to be established after a disconnect from Wi-Fi. |
| 8901 | */ |
| 8902 | public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = |
| 8903 | "wifi_mobile_data_transition_wakelock_timeout_ms"; |
| 8904 | |
| 8905 | /** |
Zoltan Szatmary-Ban | 4045d24 | 2015-05-27 12:42:39 +0100 | [diff] [blame] | 8906 | * This setting controls whether WiFi configurations created by a Device Owner app |
| 8907 | * should be locked down (that is, be editable or removable only by the Device Owner App, |
| 8908 | * not even by Settings app). |
| 8909 | * This setting takes integer values. Non-zero values mean DO created configurations |
| 8910 | * are locked down. Value of zero means they are not. Default value in the absence of |
| 8911 | * actual value to this setting is 0. |
| 8912 | */ |
| 8913 | public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = |
| 8914 | "wifi_device_owner_configs_lockdown"; |
| 8915 | |
| 8916 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8917 | * The operational wifi frequency band |
| 8918 | * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, |
| 8919 | * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or |
| 8920 | * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} |
| 8921 | * |
| 8922 | * @hide |
| 8923 | */ |
| 8924 | public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; |
| 8925 | |
| 8926 | /** |
| 8927 | * The Wi-Fi peer-to-peer device name |
| 8928 | * @hide |
| 8929 | */ |
| 8930 | public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; |
| 8931 | |
| 8932 | /** |
Robert Greenwalt | c12783a | 2013-05-16 12:48:20 -0700 | [diff] [blame] | 8933 | * The min time between wifi disable and wifi enable |
| 8934 | * @hide |
| 8935 | */ |
| 8936 | public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; |
| 8937 | |
| 8938 | /** |
Jeff Davidson | a20ca67d | 2014-12-16 11:48:54 -0800 | [diff] [blame] | 8939 | * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect |
| 8940 | * from an ephemeral network if there is no BSSID for that network with a non-null score that |
| 8941 | * has been seen in this time period. |
| 8942 | * |
| 8943 | * If this is less than or equal to zero, we use a more conservative behavior and only check |
| 8944 | * for a non-null score from the currently connected or target BSSID. |
| 8945 | * @hide |
| 8946 | */ |
| 8947 | public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = |
| 8948 | "wifi_ephemeral_out_of_range_timeout_ms"; |
| 8949 | |
| 8950 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 8951 | * The number of milliseconds to delay when checking for data stalls during |
| 8952 | * non-aggressive detection. (screen is turned off.) |
| 8953 | * @hide |
| 8954 | */ |
| 8955 | public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = |
| 8956 | "data_stall_alarm_non_aggressive_delay_in_ms"; |
| 8957 | |
| 8958 | /** |
| 8959 | * The number of milliseconds to delay when checking for data stalls during |
| 8960 | * aggressive detection. (screen on or suspected data stall) |
| 8961 | * @hide |
| 8962 | */ |
| 8963 | public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = |
| 8964 | "data_stall_alarm_aggressive_delay_in_ms"; |
| 8965 | |
| 8966 | /** |
Wink Saville | ce1e379 | 2013-09-03 16:41:44 -0700 | [diff] [blame] | 8967 | * The number of milliseconds to allow the provisioning apn to remain active |
| 8968 | * @hide |
| 8969 | */ |
| 8970 | public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = |
| 8971 | "provisioning_apn_alarm_delay_in_ms"; |
| 8972 | |
| 8973 | /** |
Christopher Tate | c868b64 | 2012-09-12 17:41:04 -0700 | [diff] [blame] | 8974 | * The interval in milliseconds at which to check gprs registration |
| 8975 | * after the first registration mismatch of gprs and voice service, |
| 8976 | * to detect possible data network registration problems. |
| 8977 | * |
| 8978 | * @hide |
| 8979 | */ |
| 8980 | public static final String GPRS_REGISTER_CHECK_PERIOD_MS = |
| 8981 | "gprs_register_check_period_ms"; |
| 8982 | |
| 8983 | /** |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8984 | * Nonzero causes Log.wtf() to crash. |
| 8985 | * @hide |
| 8986 | */ |
| 8987 | public static final String WTF_IS_FATAL = "wtf_is_fatal"; |
| 8988 | |
Eric Laurent | bc0fab1f | 2012-09-19 11:24:41 -0700 | [diff] [blame] | 8989 | /** |
| 8990 | * Ringer mode. This is used internally, changing this value will not |
| 8991 | * change the ringer mode. See AudioManager. |
| 8992 | */ |
| 8993 | public static final String MODE_RINGER = "mode_ringer"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 8994 | |
Jeff Brown | d493596 | 2012-09-25 13:27:20 -0700 | [diff] [blame] | 8995 | /** |
| 8996 | * Overlay display devices setting. |
| 8997 | * The associated value is a specially formatted string that describes the |
| 8998 | * size and density of simulated secondary display devices. |
| 8999 | * <p> |
| 9000 | * Format: {width}x{height}/{dpi};... |
| 9001 | * </p><p> |
| 9002 | * Example: |
| 9003 | * <ul> |
| 9004 | * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> |
| 9005 | * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first |
| 9006 | * at 1080p and the second at 720p.</li> |
| 9007 | * <li>If the value is empty, then no overlay display devices are created.</li> |
| 9008 | * </ul></p> |
| 9009 | * |
| 9010 | * @hide |
| 9011 | */ |
| 9012 | public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 9013 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9014 | /** |
| 9015 | * Threshold values for the duration and level of a discharge cycle, |
| 9016 | * under which we log discharge cycle info. |
| 9017 | * |
| 9018 | * @hide |
| 9019 | */ |
| 9020 | public static final String |
| 9021 | BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; |
| 9022 | |
| 9023 | /** @hide */ |
| 9024 | public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; |
| 9025 | |
| 9026 | /** |
| 9027 | * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR |
| 9028 | * intents on application crashes and ANRs. If this is disabled, the |
| 9029 | * crash/ANR dialog will never display the "Report" button. |
| 9030 | * <p> |
| 9031 | * Type: int (0 = disallow, 1 = allow) |
| 9032 | * |
| 9033 | * @hide |
| 9034 | */ |
| 9035 | public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; |
| 9036 | |
| 9037 | /** |
| 9038 | * Maximum age of entries kept by {@link DropBoxManager}. |
| 9039 | * |
| 9040 | * @hide |
| 9041 | */ |
| 9042 | public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; |
| 9043 | |
| 9044 | /** |
| 9045 | * Maximum number of entry files which {@link DropBoxManager} will keep |
| 9046 | * around. |
| 9047 | * |
| 9048 | * @hide |
| 9049 | */ |
| 9050 | public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; |
| 9051 | |
| 9052 | /** |
| 9053 | * Maximum amount of disk space used by {@link DropBoxManager} no matter |
| 9054 | * what. |
| 9055 | * |
| 9056 | * @hide |
| 9057 | */ |
| 9058 | public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; |
| 9059 | |
| 9060 | /** |
| 9061 | * Percent of free disk (excluding reserve) which {@link DropBoxManager} |
| 9062 | * will use. |
| 9063 | * |
| 9064 | * @hide |
| 9065 | */ |
| 9066 | public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; |
| 9067 | |
| 9068 | /** |
| 9069 | * Percent of total disk which {@link DropBoxManager} will never dip |
| 9070 | * into. |
| 9071 | * |
| 9072 | * @hide |
| 9073 | */ |
| 9074 | public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; |
| 9075 | |
| 9076 | /** |
| 9077 | * Prefix for per-tag dropbox disable/enable settings. |
| 9078 | * |
| 9079 | * @hide |
| 9080 | */ |
| 9081 | public static final String DROPBOX_TAG_PREFIX = "dropbox:"; |
| 9082 | |
| 9083 | /** |
| 9084 | * Lines of logcat to include with system crash/ANR/etc. reports, as a |
| 9085 | * prefix of the dropbox tag of the report type. For example, |
| 9086 | * "logcat_for_system_server_anr" controls the lines of logcat captured |
| 9087 | * with system server ANR reports. 0 to disable. |
| 9088 | * |
| 9089 | * @hide |
| 9090 | */ |
| 9091 | public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; |
| 9092 | |
| 9093 | /** |
| 9094 | * The interval in minutes after which the amount of free storage left |
| 9095 | * on the device is logged to the event log |
| 9096 | * |
| 9097 | * @hide |
| 9098 | */ |
| 9099 | public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; |
| 9100 | |
| 9101 | /** |
| 9102 | * Threshold for the amount of change in disk free space required to |
| 9103 | * report the amount of free space. Used to prevent spamming the logs |
| 9104 | * when the disk free space isn't changing frequently. |
| 9105 | * |
| 9106 | * @hide |
| 9107 | */ |
| 9108 | public static final String |
| 9109 | DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; |
| 9110 | |
| 9111 | /** |
| 9112 | * Minimum percentage of free storage on the device that is used to |
| 9113 | * determine if the device is running low on storage. The default is 10. |
| 9114 | * <p> |
| 9115 | * Say this value is set to 10, the device is considered running low on |
| 9116 | * storage if 90% or more of the device storage is filled up. |
| 9117 | * |
| 9118 | * @hide |
| 9119 | */ |
| 9120 | public static final String |
| 9121 | SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; |
| 9122 | |
| 9123 | /** |
| 9124 | * Maximum byte size of the low storage threshold. This is to ensure |
| 9125 | * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an |
| 9126 | * overly large threshold for large storage devices. Currently this must |
| 9127 | * be less than 2GB. This default is 500MB. |
| 9128 | * |
| 9129 | * @hide |
| 9130 | */ |
| 9131 | public static final String |
| 9132 | SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; |
| 9133 | |
| 9134 | /** |
| 9135 | * Minimum bytes of free storage on the device before the data partition |
| 9136 | * is considered full. By default, 1 MB is reserved to avoid system-wide |
| 9137 | * SQLite disk full exceptions. |
| 9138 | * |
| 9139 | * @hide |
| 9140 | */ |
| 9141 | public static final String |
| 9142 | SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; |
| 9143 | |
| 9144 | /** |
Jeff Sharkey | d5d5e92 | 2017-02-21 10:51:23 -0700 | [diff] [blame] | 9145 | * Minimum percentage of storage on the device that is reserved for |
| 9146 | * cached data. |
| 9147 | * |
| 9148 | * @hide |
| 9149 | */ |
| 9150 | public static final String |
| 9151 | SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; |
| 9152 | |
| 9153 | /** |
| 9154 | * Maximum bytes of storage on the device that is reserved for cached |
| 9155 | * data. |
| 9156 | * |
| 9157 | * @hide |
| 9158 | */ |
| 9159 | public static final String |
| 9160 | SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; |
| 9161 | |
| 9162 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9163 | * The maximum reconnect delay for short network outages or when the |
| 9164 | * network is suspended due to phone use. |
| 9165 | * |
| 9166 | * @hide |
| 9167 | */ |
| 9168 | public static final String |
| 9169 | SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; |
| 9170 | |
| 9171 | /** |
| 9172 | * The number of milliseconds to delay before sending out |
Erik Kline | 8f29dcf | 2014-12-08 16:25:20 +0900 | [diff] [blame] | 9173 | * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9174 | * |
| 9175 | * @hide |
| 9176 | */ |
| 9177 | public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; |
| 9178 | |
Vinit Deshapnde | 1f12cb5 | 2013-08-21 13:09:01 -0700 | [diff] [blame] | 9179 | |
| 9180 | /** |
| 9181 | * Network sampling interval, in seconds. We'll generate link information |
| 9182 | * about bytes/packets sent and error rates based on data sampled in this interval |
| 9183 | * |
| 9184 | * @hide |
| 9185 | */ |
| 9186 | |
| 9187 | public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = |
| 9188 | "connectivity_sampling_interval_in_seconds"; |
| 9189 | |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9190 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 9191 | * The series of successively longer delays used in retrying to download PAC file. |
| 9192 | * Last delay is used between successful PAC downloads. |
| 9193 | * |
| 9194 | * @hide |
| 9195 | */ |
| 9196 | public static final String PAC_CHANGE_DELAY = "pac_change_delay"; |
| 9197 | |
| 9198 | /** |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 9199 | * Don't attempt to detect captive portals. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9200 | * |
| 9201 | * @hide |
| 9202 | */ |
Calvin On | be96da1 | 2016-10-11 15:10:46 -0700 | [diff] [blame] | 9203 | public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; |
| 9204 | |
| 9205 | /** |
| 9206 | * When detecting a captive portal, display a notification that |
| 9207 | * prompts the user to sign in. |
| 9208 | * |
| 9209 | * @hide |
| 9210 | */ |
| 9211 | public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; |
| 9212 | |
| 9213 | /** |
| 9214 | * When detecting a captive portal, immediately disconnect from the |
| 9215 | * network and do not reconnect to that network in the future. |
| 9216 | * |
| 9217 | * @hide |
| 9218 | */ |
| 9219 | public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; |
| 9220 | |
| 9221 | /** |
| 9222 | * What to do when connecting a network that presents a captive portal. |
| 9223 | * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. |
| 9224 | * |
| 9225 | * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. |
| 9226 | * @hide |
| 9227 | */ |
| 9228 | public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; |
| 9229 | |
| 9230 | /** |
| 9231 | * Setting to turn off captive portal detection. Feature is enabled by |
| 9232 | * default and the setting needs to be set to 0 to disable it. |
| 9233 | * |
| 9234 | * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection |
| 9235 | * @hide |
| 9236 | */ |
| 9237 | @Deprecated |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9238 | public static final String |
| 9239 | CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; |
| 9240 | |
| 9241 | /** |
| 9242 | * The server used for captive portal detection upon a new conection. A |
| 9243 | * 204 response code from the server is used for validation. |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9244 | * TODO: remove this deprecated symbol. |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9245 | * |
| 9246 | * @hide |
| 9247 | */ |
| 9248 | public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; |
| 9249 | |
| 9250 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9251 | * The URL used for HTTPS captive portal detection upon a new connection. |
| 9252 | * A 204 response code from the server is used for validation. |
| 9253 | * |
| 9254 | * @hide |
| 9255 | */ |
| 9256 | public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; |
| 9257 | |
| 9258 | /** |
| 9259 | * The URL used for HTTP captive portal detection upon a new connection. |
| 9260 | * A 204 response code from the server is used for validation. |
| 9261 | * |
| 9262 | * @hide |
| 9263 | */ |
| 9264 | public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; |
| 9265 | |
| 9266 | /** |
| 9267 | * The URL used for fallback HTTP captive portal detection when previous HTTP |
| 9268 | * and HTTPS captive portal detection attemps did not return a conclusive answer. |
| 9269 | * |
| 9270 | * @hide |
| 9271 | */ |
| 9272 | public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; |
| 9273 | |
| 9274 | /** |
Hugo Benichi | eef918a | 2017-04-10 17:43:08 +0900 | [diff] [blame] | 9275 | * A comma separated list of URLs used for captive portal detection in addition to the |
| 9276 | * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. |
| 9277 | * |
| 9278 | * @hide |
| 9279 | */ |
| 9280 | public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = |
| 9281 | "captive_portal_other_fallback_urls"; |
| 9282 | |
| 9283 | /** |
Lorenzo Colitti | c5be12e | 2016-04-19 21:57:31 +0900 | [diff] [blame] | 9284 | * Whether to use HTTPS for network validation. This is enabled by default and the setting |
| 9285 | * needs to be set to 0 to disable it. This setting is a misnomer because captive portals |
| 9286 | * don't actually use HTTPS, but it's consistent with the other settings. |
| 9287 | * |
| 9288 | * @hide |
| 9289 | */ |
| 9290 | public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; |
| 9291 | |
| 9292 | /** |
Hugo Benichi | 92eb22fd | 2016-09-27 13:01:41 +0900 | [diff] [blame] | 9293 | * Which User-Agent string to use in the header of the captive portal detection probes. |
| 9294 | * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). |
| 9295 | * |
| 9296 | * @hide |
| 9297 | */ |
| 9298 | public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; |
| 9299 | |
| 9300 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9301 | * Whether network service discovery is enabled. |
| 9302 | * |
| 9303 | * @hide |
| 9304 | */ |
| 9305 | public static final String NSD_ON = "nsd_on"; |
| 9306 | |
| 9307 | /** |
| 9308 | * Let user pick default install location. |
| 9309 | * |
| 9310 | * @hide |
| 9311 | */ |
| 9312 | public static final String SET_INSTALL_LOCATION = "set_install_location"; |
| 9313 | |
| 9314 | /** |
| 9315 | * Default install location value. |
| 9316 | * 0 = auto, let system decide |
| 9317 | * 1 = internal |
| 9318 | * 2 = sdcard |
| 9319 | * @hide |
| 9320 | */ |
| 9321 | public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; |
| 9322 | |
| 9323 | /** |
| 9324 | * ms during which to consume extra events related to Inet connection |
| 9325 | * condition after a transtion to fully-connected |
| 9326 | * |
| 9327 | * @hide |
| 9328 | */ |
| 9329 | public static final String |
| 9330 | INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; |
| 9331 | |
| 9332 | /** |
| 9333 | * ms during which to consume extra events related to Inet connection |
| 9334 | * condtion after a transtion to partly-connected |
| 9335 | * |
| 9336 | * @hide |
| 9337 | */ |
| 9338 | public static final String |
| 9339 | INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; |
| 9340 | |
| 9341 | /** {@hide} */ |
| 9342 | public static final String |
| 9343 | READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; |
| 9344 | |
| 9345 | /** |
| 9346 | * Host name and port for global http proxy. Uses ':' seperator for |
| 9347 | * between host and port. |
| 9348 | */ |
| 9349 | public static final String HTTP_PROXY = "http_proxy"; |
| 9350 | |
| 9351 | /** |
| 9352 | * Host name for global http proxy. Set via ConnectivityManager. |
| 9353 | * |
| 9354 | * @hide |
| 9355 | */ |
| 9356 | public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; |
| 9357 | |
| 9358 | /** |
| 9359 | * Integer host port for global http proxy. Set via ConnectivityManager. |
| 9360 | * |
| 9361 | * @hide |
| 9362 | */ |
| 9363 | public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; |
| 9364 | |
| 9365 | /** |
| 9366 | * Exclusion list for global proxy. This string contains a list of |
| 9367 | * comma-separated domains where the global proxy does not apply. |
| 9368 | * Domains should be listed in a comma- separated list. Example of |
| 9369 | * acceptable formats: ".domain1.com,my.domain2.com" Use |
| 9370 | * ConnectivityManager to set/get. |
| 9371 | * |
| 9372 | * @hide |
| 9373 | */ |
| 9374 | public static final String |
| 9375 | GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; |
| 9376 | |
| 9377 | /** |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 9378 | * The location PAC File for the proxy. |
| 9379 | * @hide |
| 9380 | */ |
| 9381 | public static final String |
| 9382 | GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; |
| 9383 | |
| 9384 | /** |
Jeff Sharkey | 625239a | 2012-09-26 22:03:49 -0700 | [diff] [blame] | 9385 | * Enables the UI setting to allow the user to specify the global HTTP |
| 9386 | * proxy and associated exclusion list. |
| 9387 | * |
| 9388 | * @hide |
| 9389 | */ |
| 9390 | public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; |
| 9391 | |
| 9392 | /** |
| 9393 | * Setting for default DNS in case nobody suggests one |
| 9394 | * |
| 9395 | * @hide |
| 9396 | */ |
| 9397 | public static final String DEFAULT_DNS_SERVER = "default_dns_server"; |
| 9398 | |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 9399 | /** |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 9400 | * The requested Private DNS mode (string), and an accompanying specifier (string). |
| 9401 | * |
| 9402 | * Currently, the specifier holds the chosen provider name when the mode requests |
| 9403 | * a specific provider. It may be used to store the provider name even when the |
| 9404 | * mode changes so that temporarily disabling and re-enabling the specific |
| 9405 | * provider mode does not necessitate retyping the provider hostname. |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 9406 | * |
| 9407 | * @hide |
| 9408 | */ |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 9409 | public static final String PRIVATE_DNS_MODE = "private_dns_mode"; |
| 9410 | /** |
| 9411 | * @hide |
| 9412 | */ |
| 9413 | public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; |
Ben Schwartz | bccbd00 | 2017-10-02 13:27:13 -0400 | [diff] [blame] | 9414 | |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9415 | /** {@hide} */ |
| 9416 | public static final String |
| 9417 | BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; |
| 9418 | /** {@hide} */ |
| 9419 | public static final String |
| 9420 | BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; |
| 9421 | /** {@hide} */ |
| 9422 | public static final String |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 9423 | BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; |
| 9424 | /** {@hide} */ |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 9425 | public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = |
| 9426 | "bluetooth_a2dp_supports_optional_codecs_"; |
| 9427 | /** {@hide} */ |
| 9428 | public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = |
| 9429 | "bluetooth_a2dp_optional_codecs_enabled_"; |
| 9430 | /** {@hide} */ |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 9431 | public static final String |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9432 | BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 9433 | /** {@hide} */ |
| 9434 | public static final String |
| 9435 | BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 9436 | /** {@hide} */ |
| 9437 | public static final String |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 9438 | BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; |
| 9439 | /** {@hide} */ |
| 9440 | public static final String |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 9441 | BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; |
| 9442 | /** {@hide} */ |
| 9443 | public static final String |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 9444 | BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 9445 | /** {@hide} */ |
| 9446 | public static final String |
| 9447 | BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 9448 | /** {@hide} */ |
| 9449 | public static final String |
| 9450 | BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9451 | |
| 9452 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 9453 | * Activity manager specific settings. |
| 9454 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9455 | * |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 9456 | * "gc_timeout=5000,max_cached_processes=24" |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 9457 | * |
| 9458 | * The following keys are supported: |
| 9459 | * |
| 9460 | * <pre> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 9461 | * max_cached_processes (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 9462 | * background_settle_time (long) |
Dianne Hackborn | cb01563 | 2017-06-14 17:30:15 -0700 | [diff] [blame] | 9463 | * fgservice_min_shown_time (long) |
| 9464 | * fgservice_min_report_time (long) |
| 9465 | * fgservice_screen_on_before_time (long) |
| 9466 | * fgservice_screen_on_after_time (long) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 9467 | * content_provider_retain_time (long) |
| 9468 | * gc_timeout (long) |
| 9469 | * gc_min_interval (long) |
| 9470 | * full_pss_min_interval (long) |
| 9471 | * full_pss_lowered_interval (long) |
Dianne Hackborn | ffca58b | 2017-05-24 16:15:45 -0700 | [diff] [blame] | 9472 | * power_check_interval (long) |
| 9473 | * power_check_max_cpu_1 (int) |
| 9474 | * power_check_max_cpu_2 (int) |
| 9475 | * power_check_max_cpu_3 (int) |
| 9476 | * power_check_max_cpu_4 (int) |
Dianne Hackborn | 83b40f6 | 2017-04-26 13:59:47 -0700 | [diff] [blame] | 9477 | * service_usage_interaction_time (long) |
| 9478 | * usage_stats_interaction_interval (long) |
| 9479 | * service_restart_duration (long) |
| 9480 | * service_reset_run_duration (long) |
| 9481 | * service_restart_duration_factor (int) |
| 9482 | * service_min_restart_time_between (long) |
| 9483 | * service_max_inactivity (long) |
| 9484 | * service_bg_start_timeout (long) |
Sudheer Shanka | f669010 | 2017-10-16 10:20:32 -0700 | [diff] [blame] | 9485 | * process_start_async (boolean) |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 9486 | * </pre> |
| 9487 | * |
| 9488 | * <p> |
| 9489 | * Type: string |
| 9490 | * @hide |
| 9491 | * @see com.android.server.am.ActivityManagerConstants |
| 9492 | */ |
| 9493 | public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; |
| 9494 | |
| 9495 | /** |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 9496 | * Device Idle (Doze) specific settings. |
| 9497 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9498 | * |
Henrik Baard | eac10ab | 2016-04-19 07:50:24 +0200 | [diff] [blame] | 9499 | * "inactive_to=60000,sensing_to=400000" |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 9500 | * |
| 9501 | * The following keys are supported: |
| 9502 | * |
| 9503 | * <pre> |
| 9504 | * inactive_to (long) |
| 9505 | * sensing_to (long) |
| 9506 | * motion_inactive_to (long) |
| 9507 | * idle_after_inactive_to (long) |
| 9508 | * idle_pending_to (long) |
| 9509 | * max_idle_pending_to (long) |
| 9510 | * idle_pending_factor (float) |
| 9511 | * idle_to (long) |
| 9512 | * max_idle_to (long) |
| 9513 | * idle_factor (float) |
| 9514 | * min_time_to_alarm (long) |
| 9515 | * max_temp_app_whitelist_duration (long) |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 9516 | * notification_whitelist_duration (long) |
Adam Lesinski | 31c05d1 | 2015-06-09 17:34:04 -0700 | [diff] [blame] | 9517 | * </pre> |
| 9518 | * |
| 9519 | * <p> |
| 9520 | * Type: string |
| 9521 | * @hide |
| 9522 | * @see com.android.server.DeviceIdleController.Constants |
| 9523 | */ |
| 9524 | public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; |
| 9525 | |
| 9526 | /** |
jackqdyulei | 455e90a | 2017-02-09 15:29:16 -0800 | [diff] [blame] | 9527 | * Battery Saver specific settings |
| 9528 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9529 | * |
| 9530 | * "vibration_disabled=true,adjust_brightness_factor=0.5" |
| 9531 | * |
| 9532 | * The following keys are supported: |
| 9533 | * |
| 9534 | * <pre> |
| 9535 | * vibration_disabled (boolean) |
| 9536 | * animation_disabled (boolean) |
| 9537 | * soundtrigger_disabled (boolean) |
| 9538 | * fullbackup_deferred (boolean) |
| 9539 | * keyvaluebackup_deferred (boolean) |
| 9540 | * firewall_disabled (boolean) |
| 9541 | * gps_mode (int) |
| 9542 | * adjust_brightness_disabled (boolean) |
| 9543 | * adjust_brightness_factor (float) |
| 9544 | * </pre> |
| 9545 | * @hide |
| 9546 | * @see com.android.server.power.BatterySaverPolicy |
| 9547 | */ |
| 9548 | public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; |
| 9549 | |
| 9550 | /** |
Makoto Onuki | 66a7812 | 2017-11-14 15:03:21 -0800 | [diff] [blame] | 9551 | * Battery Saver device specific settings |
| 9552 | * This is encoded as a key=value list, separated by commas. |
| 9553 | * See {@link com.android.server.power.BatterySaverPolicy} for the details. |
| 9554 | * |
| 9555 | * @hide |
| 9556 | */ |
| 9557 | public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = |
| 9558 | "battery_saver_device_specific_constants"; |
| 9559 | |
| 9560 | /** |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 9561 | * Battery anomaly detection specific settings |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 9562 | * This is encoded as a key=value list, separated by commas. |
| 9563 | * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via |
| 9564 | * {@link Uri#encode(String)}, separated by colons. Ex: |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 9565 | * |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 9566 | * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," |
| 9567 | * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 9568 | * |
| 9569 | * The following keys are supported: |
| 9570 | * |
| 9571 | * <pre> |
| 9572 | * anomaly_detection_enabled (boolean) |
| 9573 | * wakelock_enabled (boolean) |
| 9574 | * wakelock_threshold (long) |
Andrew Sapperstein | 858a464 | 2017-10-05 18:23:13 -0700 | [diff] [blame] | 9575 | * wakeup_alarm_enabled (boolean) |
| 9576 | * wakeup_alarm_threshold (long) |
| 9577 | * wakeup_blacklisted_tags (string) |
| 9578 | * bluetooth_scan_enabled (boolean) |
| 9579 | * bluetooth_scan_threshold (long) |
jackqdyulei | 7a5e06f | 2017-05-12 16:00:53 -0700 | [diff] [blame] | 9580 | * </pre> |
| 9581 | * @hide |
| 9582 | */ |
| 9583 | public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; |
| 9584 | |
| 9585 | /** |
jackqdyulei | 29f91ea | 2017-12-13 15:01:43 -0800 | [diff] [blame] | 9586 | * Battery tip specific settings |
| 9587 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9588 | * |
| 9589 | * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," |
| 9590 | * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50" |
| 9591 | * |
| 9592 | * The following keys are supported: |
| 9593 | * |
| 9594 | * <pre> |
| 9595 | * battery_tip_enabled (boolean) |
| 9596 | * summary_enabled (boolean) |
| 9597 | * battery_saver_tip_enabled (boolean) |
| 9598 | * high_usage_enabled (boolean) |
| 9599 | * high_usage_app_count (int) |
| 9600 | * app_restriction_enabled (boolean) |
| 9601 | * reduced_battery_enabled (boolean) |
| 9602 | * reduced_battery_percent (int) |
| 9603 | * low_battery_enabled (boolean) |
| 9604 | * low_battery_hour (int) |
| 9605 | * </pre> |
| 9606 | * @hide |
| 9607 | */ |
| 9608 | public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; |
| 9609 | |
| 9610 | /** |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 9611 | * Always on display(AOD) specific settings |
| 9612 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9613 | * |
| 9614 | * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" |
| 9615 | * |
| 9616 | * The following keys are supported: |
| 9617 | * |
| 9618 | * <pre> |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 9619 | * screen_brightness_array (int[]) |
| 9620 | * dimming_scrim_array (int[]) |
jackqdyulei | 8443dd0 | 2017-08-24 16:14:34 -0700 | [diff] [blame] | 9621 | * prox_screen_off_delay (long) |
| 9622 | * prox_cooldown_trigger (long) |
| 9623 | * prox_cooldown_period (long) |
| 9624 | * </pre> |
| 9625 | * @hide |
| 9626 | */ |
| 9627 | public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; |
| 9628 | |
| 9629 | /** |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 9630 | * App standby (app idle) specific settings. |
| 9631 | * This is encoded as a key=value list, separated by commas. Ex: |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 9632 | * <p> |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 9633 | * "idle_duration=5000,parole_interval=4500" |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 9634 | * <p> |
| 9635 | * All durations are in millis. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 9636 | * The following keys are supported: |
| 9637 | * |
| 9638 | * <pre> |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 9639 | * idle_duration2 (long) |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 9640 | * wallclock_threshold (long) |
| 9641 | * parole_interval (long) |
| 9642 | * parole_duration (long) |
Adam Lesinski | f0ef3c1 | 2016-01-13 12:26:07 -0800 | [diff] [blame] | 9643 | * |
| 9644 | * idle_duration (long) // This is deprecated and used to circumvent b/26355386. |
Adam Lesinski | a6232df | 2015-06-11 18:16:41 -0700 | [diff] [blame] | 9645 | * </pre> |
| 9646 | * |
| 9647 | * <p> |
| 9648 | * Type: string |
| 9649 | * @hide |
| 9650 | * @see com.android.server.usage.UsageStatsService.SettingsObserver |
| 9651 | */ |
| 9652 | public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; |
| 9653 | |
| 9654 | /** |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 9655 | * Power manager specific settings. |
| 9656 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9657 | * |
| 9658 | * "no_cached_wake_locks=1" |
| 9659 | * |
| 9660 | * The following keys are supported: |
| 9661 | * |
| 9662 | * <pre> |
| 9663 | * no_cached_wake_locks (boolean) |
| 9664 | * </pre> |
| 9665 | * |
| 9666 | * <p> |
| 9667 | * Type: string |
| 9668 | * @hide |
| 9669 | * @see com.android.server.power.PowerManagerConstants |
| 9670 | */ |
| 9671 | public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; |
| 9672 | |
| 9673 | /** |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 9674 | * Alarm manager specific settings. |
| 9675 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9676 | * |
| 9677 | * "min_futurity=5000,allow_while_idle_short_time=4500" |
| 9678 | * |
| 9679 | * The following keys are supported: |
| 9680 | * |
| 9681 | * <pre> |
| 9682 | * min_futurity (long) |
| 9683 | * min_interval (long) |
| 9684 | * allow_while_idle_short_time (long) |
| 9685 | * allow_while_idle_long_time (long) |
| 9686 | * allow_while_idle_whitelist_duration (long) |
| 9687 | * </pre> |
| 9688 | * |
| 9689 | * <p> |
| 9690 | * Type: string |
| 9691 | * @hide |
| 9692 | * @see com.android.server.AlarmManagerService.Constants |
| 9693 | */ |
| 9694 | public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; |
| 9695 | |
| 9696 | /** |
Dianne Hackborn | e9a988c | 2016-05-27 17:59:40 -0700 | [diff] [blame] | 9697 | * Job scheduler specific settings. |
| 9698 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9699 | * |
| 9700 | * "min_ready_jobs_count=2,moderate_use_factor=.5" |
| 9701 | * |
| 9702 | * The following keys are supported: |
| 9703 | * |
| 9704 | * <pre> |
| 9705 | * min_idle_count (int) |
| 9706 | * min_charging_count (int) |
| 9707 | * min_connectivity_count (int) |
| 9708 | * min_content_count (int) |
| 9709 | * min_ready_jobs_count (int) |
| 9710 | * heavy_use_factor (float) |
| 9711 | * moderate_use_factor (float) |
| 9712 | * fg_job_count (int) |
| 9713 | * bg_normal_job_count (int) |
| 9714 | * bg_moderate_job_count (int) |
| 9715 | * bg_low_job_count (int) |
| 9716 | * bg_critical_job_count (int) |
| 9717 | * </pre> |
| 9718 | * |
| 9719 | * <p> |
| 9720 | * Type: string |
| 9721 | * @hide |
| 9722 | * @see com.android.server.job.JobSchedulerService.Constants |
| 9723 | */ |
| 9724 | public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; |
| 9725 | |
| 9726 | /** |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 9727 | * ShortcutManager specific settings. |
| 9728 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9729 | * |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 9730 | * "reset_interval_sec=86400,max_updates_per_interval=1" |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 9731 | * |
| 9732 | * The following keys are supported: |
| 9733 | * |
| 9734 | * <pre> |
| 9735 | * reset_interval_sec (long) |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 9736 | * max_updates_per_interval (int) |
Makoto Onuki | 4362a66 | 2016-03-08 18:59:09 -0800 | [diff] [blame] | 9737 | * max_icon_dimension_dp (int, DP) |
| 9738 | * max_icon_dimension_dp_lowram (int, DP) |
| 9739 | * max_shortcuts (int) |
| 9740 | * icon_quality (int, 0-100) |
| 9741 | * icon_format (String) |
| 9742 | * </pre> |
| 9743 | * |
| 9744 | * <p> |
| 9745 | * Type: string |
| 9746 | * @hide |
| 9747 | * @see com.android.server.pm.ShortcutService.ConfigConstants |
| 9748 | */ |
| 9749 | public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; |
| 9750 | |
| 9751 | /** |
Makoto Onuki | 09c529a | 2017-05-01 10:05:28 -0700 | [diff] [blame] | 9752 | * DevicePolicyManager specific settings. |
| 9753 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9754 | * |
| 9755 | * <pre> |
| 9756 | * das_died_service_reconnect_backoff_sec (long) |
| 9757 | * das_died_service_reconnect_backoff_increase (float) |
| 9758 | * das_died_service_reconnect_max_backoff_sec (long) |
| 9759 | * </pre> |
| 9760 | * |
| 9761 | * <p> |
| 9762 | * Type: string |
| 9763 | * @hide |
| 9764 | * see also com.android.server.devicepolicy.DevicePolicyConstants |
| 9765 | */ |
| 9766 | public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; |
| 9767 | |
| 9768 | /** |
Abodunrinwa Toki | 0e6b43e | 2017-09-19 23:18:40 +0100 | [diff] [blame] | 9769 | * TextClassifier specific settings. |
| 9770 | * This is encoded as a key=value list, separated by commas. Ex: |
| 9771 | * |
| 9772 | * <pre> |
| 9773 | * smart_selection_dark_launch (boolean) |
| 9774 | * smart_selection_enabled_for_edit_text (boolean) |
| 9775 | * </pre> |
| 9776 | * |
| 9777 | * <p> |
| 9778 | * Type: string |
| 9779 | * @hide |
| 9780 | * see also android.view.textclassifier.TextClassifierConstants |
| 9781 | */ |
| 9782 | public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; |
| 9783 | |
| 9784 | /** |
Amith Yamasani | 172612c | 2017-12-15 10:51:53 -0800 | [diff] [blame] | 9785 | * Whether or not App Standby feature is enabled. This controls throttling of apps |
| 9786 | * based on usage patterns and predictions. |
| 9787 | * Type: int (0 for false, 1 for true) |
| 9788 | * Default: 1 |
| 9789 | * @hide |
| 9790 | */ |
| 9791 | public static final java.lang.String APP_STANDBY_ENABLED = "app_standby_enabled"; |
| 9792 | |
| 9793 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9794 | * Get the key that retrieves a bluetooth headset's priority. |
| 9795 | * @hide |
| 9796 | */ |
| 9797 | public static final String getBluetoothHeadsetPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 9798 | return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9799 | } |
| 9800 | |
| 9801 | /** |
| 9802 | * Get the key that retrieves a bluetooth a2dp sink's priority. |
| 9803 | * @hide |
| 9804 | */ |
| 9805 | public static final String getBluetoothA2dpSinkPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 9806 | return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9807 | } |
| 9808 | |
| 9809 | /** |
Sanket Agarwal | 1bec6a5 | 2015-10-21 18:23:27 -0700 | [diff] [blame] | 9810 | * Get the key that retrieves a bluetooth a2dp src's priority. |
| 9811 | * @hide |
| 9812 | */ |
| 9813 | public static final String getBluetoothA2dpSrcPriorityKey(String address) { |
| 9814 | return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9815 | } |
| 9816 | |
| 9817 | /** |
Antony Sargent | f5772c6 | 2017-04-26 16:37:53 -0700 | [diff] [blame] | 9818 | * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs. |
| 9819 | * @hide |
| 9820 | */ |
| 9821 | public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) { |
| 9822 | return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX + |
| 9823 | address.toUpperCase(Locale.ROOT); |
| 9824 | } |
| 9825 | |
| 9826 | /** |
| 9827 | * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs |
| 9828 | * enabled. |
| 9829 | * @hide |
| 9830 | */ |
| 9831 | public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) { |
| 9832 | return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX + |
| 9833 | address.toUpperCase(Locale.ROOT); |
| 9834 | } |
| 9835 | |
| 9836 | /** |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9837 | * Get the key that retrieves a bluetooth Input Device's priority. |
| 9838 | * @hide |
| 9839 | */ |
Hansong Zhang | c26c76c | 2017-10-20 15:55:59 -0700 | [diff] [blame] | 9840 | public static final String getBluetoothHidHostPriorityKey(String address) { |
Elliott Hughes | cb64d43 | 2013-08-02 10:00:44 -0700 | [diff] [blame] | 9841 | return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
Jeff Sharkey | 0ac1028 | 2012-10-01 12:50:22 -0700 | [diff] [blame] | 9842 | } |
| 9843 | |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9844 | /** |
Sanket Agarwal | 773297a | 2016-08-04 16:16:20 -0700 | [diff] [blame] | 9845 | * Get the key that retrieves a bluetooth pan client priority. |
| 9846 | * @hide |
| 9847 | */ |
| 9848 | public static final String getBluetoothPanPriorityKey(String address) { |
| 9849 | return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9850 | } |
| 9851 | |
| 9852 | /** |
Jakub Pawlowski | c2d7be6 | 2017-11-22 10:57:42 -0800 | [diff] [blame] | 9853 | * Get the key that retrieves a bluetooth hearing aid priority. |
| 9854 | * @hide |
| 9855 | */ |
| 9856 | public static final String getBluetoothHearingAidPriorityKey(String address) { |
| 9857 | return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9858 | } |
| 9859 | |
| 9860 | /** |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 9861 | * Get the key that retrieves a bluetooth map priority. |
| 9862 | * @hide |
| 9863 | */ |
| 9864 | public static final String getBluetoothMapPriorityKey(String address) { |
| 9865 | return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9866 | } |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 9867 | |
| 9868 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 9869 | * Get the key that retrieves a bluetooth map client priority. |
| 9870 | * @hide |
| 9871 | */ |
| 9872 | public static final String getBluetoothMapClientPriorityKey(String address) { |
| 9873 | return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9874 | } |
| 9875 | |
| 9876 | /** |
Joseph Pirozzo | 563c700 | 2016-03-21 15:49:48 -0700 | [diff] [blame] | 9877 | * Get the key that retrieves a bluetooth pbap client priority. |
| 9878 | * @hide |
| 9879 | */ |
| 9880 | public static final String getBluetoothPbapClientPriorityKey(String address) { |
| 9881 | return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9882 | } |
| 9883 | |
| 9884 | /** |
Joseph Pirozzo | 631768d | 2016-09-01 14:19:28 -0700 | [diff] [blame] | 9885 | * Get the key that retrieves a bluetooth sap priority. |
Casper Bonde | 2a5f608 | 2015-03-19 10:36:45 +0100 | [diff] [blame] | 9886 | * @hide |
| 9887 | */ |
| 9888 | public static final String getBluetoothSapPriorityKey(String address) { |
| 9889 | return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); |
| 9890 | } |
| 9891 | |
Kim Schulz | 0d37605 | 2013-08-22 11:18:02 +0200 | [diff] [blame] | 9892 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9893 | * Scaling factor for normal window animations. Setting to 0 will |
| 9894 | * disable window animations. |
| 9895 | */ |
| 9896 | public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; |
| 9897 | |
| 9898 | /** |
| 9899 | * Scaling factor for activity transition animations. Setting to 0 will |
| 9900 | * disable window animations. |
| 9901 | */ |
| 9902 | public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; |
| 9903 | |
| 9904 | /** |
| 9905 | * Scaling factor for Animator-based animations. This affects both the |
| 9906 | * start delay and duration of all such animations. Setting to 0 will |
| 9907 | * cause animations to end immediately. The default value is 1. |
| 9908 | */ |
| 9909 | public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; |
| 9910 | |
| 9911 | /** |
| 9912 | * Scaling factor for normal window animations. Setting to 0 will |
| 9913 | * disable window animations. |
| 9914 | * |
| 9915 | * @hide |
| 9916 | */ |
| 9917 | public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; |
| 9918 | |
| 9919 | /** |
| 9920 | * If 0, the compatibility mode is off for all applications. |
| 9921 | * If 1, older applications run under compatibility mode. |
| 9922 | * TODO: remove this settings before code freeze (bug/1907571) |
| 9923 | * @hide |
| 9924 | */ |
| 9925 | public static final String COMPATIBILITY_MODE = "compatibility_mode"; |
| 9926 | |
| 9927 | /** |
| 9928 | * CDMA only settings |
| 9929 | * Emergency Tone 0 = Off |
| 9930 | * 1 = Alert |
| 9931 | * 2 = Vibrate |
| 9932 | * @hide |
| 9933 | */ |
| 9934 | public static final String EMERGENCY_TONE = "emergency_tone"; |
| 9935 | |
| 9936 | /** |
| 9937 | * CDMA only settings |
| 9938 | * Whether the auto retry is enabled. The value is |
| 9939 | * boolean (1 or 0). |
| 9940 | * @hide |
| 9941 | */ |
| 9942 | public static final String CALL_AUTO_RETRY = "call_auto_retry"; |
| 9943 | |
| 9944 | /** |
Selim Cinek | 705442f | 2016-09-13 16:02:33 -0700 | [diff] [blame] | 9945 | * A setting that can be read whether the emergency affordance is currently needed. |
| 9946 | * The value is a boolean (1 or 0). |
| 9947 | * @hide |
| 9948 | */ |
| 9949 | public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; |
| 9950 | |
| 9951 | /** |
Sungmin Choi | e099ab1 | 2014-06-09 14:45:51 +0900 | [diff] [blame] | 9952 | * See RIL_PreferredNetworkType in ril.h |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9953 | * @hide |
| 9954 | */ |
| 9955 | public static final String PREFERRED_NETWORK_MODE = |
| 9956 | "preferred_network_mode"; |
| 9957 | |
| 9958 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9959 | * Name of an application package to be debugged. |
| 9960 | */ |
| 9961 | public static final String DEBUG_APP = "debug_app"; |
| 9962 | |
| 9963 | /** |
| 9964 | * If 1, when launching DEBUG_APP it will wait for the debugger before |
| 9965 | * starting user code. If 0, it will run normally. |
| 9966 | */ |
| 9967 | public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; |
| 9968 | |
| 9969 | /** |
Cody Northrop | 86cedcb | 2017-10-20 09:03:13 -0600 | [diff] [blame] | 9970 | * Allow GPU debug layers? |
| 9971 | * 0 = no |
| 9972 | * 1 = yes |
| 9973 | * @hide |
| 9974 | */ |
| 9975 | public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; |
| 9976 | |
| 9977 | /** |
| 9978 | * App allowed to load GPU debug layers |
| 9979 | * @hide |
| 9980 | */ |
| 9981 | public static final String GPU_DEBUG_APP = "gpu_debug_app"; |
| 9982 | |
| 9983 | /** |
| 9984 | * Ordered GPU debug layer list |
| 9985 | * i.e. <layer1>:<layer2>:...:<layerN> |
| 9986 | * @hide |
| 9987 | */ |
| 9988 | public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; |
| 9989 | |
| 9990 | /** |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9991 | * Control whether the process CPU usage meter should be shown. |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 9992 | * |
| 9993 | * @deprecated This functionality is no longer available as of |
| 9994 | * {@link android.os.Build.VERSION_CODES#N_MR1}. |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9995 | */ |
Nick Kralevich | fc4a5c2 | 2016-10-11 09:01:38 -0700 | [diff] [blame] | 9996 | @Deprecated |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 9997 | public static final String SHOW_PROCESSES = "show_processes"; |
| 9998 | |
| 9999 | /** |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 10000 | * If 1 low power mode is enabled. |
| 10001 | * @hide |
| 10002 | */ |
| 10003 | public static final String LOW_POWER_MODE = "low_power"; |
| 10004 | |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 10005 | /** |
| 10006 | * Battery level [1-99] at which low power mode automatically turns on. |
Dianne Hackborn | 1427230 | 2014-06-10 23:13:02 -0700 | [diff] [blame] | 10007 | * If 0, it will not automatically turn on. |
John Spurlock | f8f524c | 2014-06-10 14:47:29 -0400 | [diff] [blame] | 10008 | * @hide |
| 10009 | */ |
| 10010 | public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; |
| 10011 | |
Ruchi Kandoi | 62b8a49 | 2014-04-17 18:01:40 -0700 | [diff] [blame] | 10012 | /** |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 10013 | * If not 0, the activity manager will aggressively finish activities and |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10014 | * processes as soon as they are no longer needed. If 0, the normal |
| 10015 | * extended lifetime is used. |
| 10016 | */ |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 10017 | public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; |
Jeff Sharkey | 6e2bee7 | 2012-10-01 13:39:08 -0700 | [diff] [blame] | 10018 | |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10019 | /** |
Eric Laurent | 7ee1e4f | 2012-10-26 18:11:21 -0700 | [diff] [blame] | 10020 | * Use Dock audio output for media: |
| 10021 | * 0 = disabled |
| 10022 | * 1 = enabled |
| 10023 | * @hide |
| 10024 | */ |
| 10025 | public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; |
| 10026 | |
| 10027 | /** |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 10028 | * The surround sound formats AC3, DTS or IEC61937 are |
| 10029 | * available for use if they are detected. |
| 10030 | * This is the default mode. |
| 10031 | * |
| 10032 | * Note that AUTO is equivalent to ALWAYS for Android TVs and other |
| 10033 | * devices that have an S/PDIF output. This is because S/PDIF |
| 10034 | * is unidirectional and the TV cannot know if a decoder is |
| 10035 | * connected. So it assumes they are always available. |
| 10036 | * @hide |
| 10037 | */ |
| 10038 | public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; |
| 10039 | |
| 10040 | /** |
| 10041 | * AC3, DTS or IEC61937 are NEVER available, even if they |
| 10042 | * are detected by the hardware. Those formats will not be |
| 10043 | * reported. |
| 10044 | * |
| 10045 | * An example use case would be an AVR reports that it is capable of |
| 10046 | * surround sound decoding but is broken. If NEVER is chosen |
| 10047 | * then apps must use PCM output instead of encoded output. |
| 10048 | * @hide |
| 10049 | */ |
| 10050 | public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; |
| 10051 | |
| 10052 | /** |
| 10053 | * AC3, DTS or IEC61937 are ALWAYS available, even if they |
| 10054 | * are not detected by the hardware. Those formats will be |
| 10055 | * reported as part of the HDMI output capability. Applications |
| 10056 | * are then free to use either PCM or encoded output. |
| 10057 | * |
| 10058 | * An example use case would be a when TV was connected over |
| 10059 | * TOS-link to an AVR. But the TV could not see it because TOS-link |
| 10060 | * is unidirectional. |
| 10061 | * @hide |
| 10062 | */ |
| 10063 | public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; |
| 10064 | |
| 10065 | /** |
| 10066 | * Set to ENCODED_SURROUND_OUTPUT_AUTO, |
| 10067 | * ENCODED_SURROUND_OUTPUT_NEVER or |
| 10068 | * ENCODED_SURROUND_OUTPUT_ALWAYS |
| 10069 | * @hide |
| 10070 | */ |
| 10071 | public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; |
| 10072 | |
| 10073 | /** |
Eric Laurent | 05274f3 | 2012-11-29 12:48:18 -0800 | [diff] [blame] | 10074 | * Persisted safe headphone volume management state by AudioService |
| 10075 | * @hide |
| 10076 | */ |
| 10077 | public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; |
| 10078 | |
| 10079 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10080 | * URL for tzinfo (time zone) updates |
| 10081 | * @hide |
| 10082 | */ |
| 10083 | public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; |
| 10084 | |
| 10085 | /** |
| 10086 | * URL for tzinfo (time zone) update metadata |
| 10087 | * @hide |
| 10088 | */ |
| 10089 | public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; |
| 10090 | |
| 10091 | /** |
| 10092 | * URL for selinux (mandatory access control) updates |
| 10093 | * @hide |
| 10094 | */ |
| 10095 | public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; |
| 10096 | |
| 10097 | /** |
| 10098 | * URL for selinux (mandatory access control) update metadata |
| 10099 | * @hide |
| 10100 | */ |
| 10101 | public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; |
| 10102 | |
| 10103 | /** |
| 10104 | * URL for sms short code updates |
| 10105 | * @hide |
| 10106 | */ |
| 10107 | public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = |
| 10108 | "sms_short_codes_content_url"; |
| 10109 | |
| 10110 | /** |
| 10111 | * URL for sms short code update metadata |
| 10112 | * @hide |
| 10113 | */ |
| 10114 | public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = |
| 10115 | "sms_short_codes_metadata_url"; |
| 10116 | |
| 10117 | /** |
Amit Mahajan | 9069fab | 2015-05-01 11:05:47 -0700 | [diff] [blame] | 10118 | * URL for apn_db updates |
| 10119 | * @hide |
| 10120 | */ |
| 10121 | public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; |
| 10122 | |
| 10123 | /** |
| 10124 | * URL for apn_db update metadata |
| 10125 | * @hide |
| 10126 | */ |
| 10127 | public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; |
| 10128 | |
| 10129 | /** |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10130 | * URL for cert pinlist updates |
| 10131 | * @hide |
| 10132 | */ |
| 10133 | public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; |
| 10134 | |
| 10135 | /** |
| 10136 | * URL for cert pinlist updates |
| 10137 | * @hide |
| 10138 | */ |
| 10139 | public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; |
| 10140 | |
Geremy Condra | 757ee52 | 2013-03-29 16:39:45 -0700 | [diff] [blame] | 10141 | /** |
Ben Gruver | 633dc9b | 2013-04-04 12:05:49 -0700 | [diff] [blame] | 10142 | * URL for intent firewall updates |
| 10143 | * @hide |
| 10144 | */ |
| 10145 | public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = |
| 10146 | "intent_firewall_content_url"; |
| 10147 | |
| 10148 | /** |
| 10149 | * URL for intent firewall update metadata |
| 10150 | * @hide |
| 10151 | */ |
| 10152 | public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = |
| 10153 | "intent_firewall_metadata_url"; |
| 10154 | |
| 10155 | /** |
Abodunrinwa Toki | 51c4203 | 2017-04-02 19:16:01 +0100 | [diff] [blame] | 10156 | * URL for lang id model updates |
| 10157 | * @hide |
| 10158 | */ |
| 10159 | public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; |
| 10160 | |
| 10161 | /** |
| 10162 | * URL for lang id model update metadata |
| 10163 | * @hide |
| 10164 | */ |
| 10165 | public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; |
| 10166 | |
| 10167 | /** |
Abodunrinwa Toki | bb957d1 | 2017-04-12 14:40:46 +0100 | [diff] [blame] | 10168 | * URL for smart selection model updates |
| 10169 | * @hide |
| 10170 | */ |
| 10171 | public static final String SMART_SELECTION_UPDATE_CONTENT_URL = |
| 10172 | "smart_selection_content_url"; |
| 10173 | |
| 10174 | /** |
| 10175 | * URL for smart selection model update metadata |
| 10176 | * @hide |
| 10177 | */ |
| 10178 | public static final String SMART_SELECTION_UPDATE_METADATA_URL = |
| 10179 | "smart_selection_metadata_url"; |
| 10180 | |
| 10181 | /** |
Geremy Condra | 4e7f7e8 | 2013-03-26 21:09:01 -0700 | [diff] [blame] | 10182 | * SELinux enforcement status. If 0, permissive; if 1, enforcing. |
| 10183 | * @hide |
| 10184 | */ |
| 10185 | public static final String SELINUX_STATUS = "selinux_status"; |
| 10186 | |
Geremy Condra | a073511 | 2013-03-26 21:49:26 -0700 | [diff] [blame] | 10187 | /** |
Amith Yamasani | d8415f4 | 2013-08-07 20:15:10 -0700 | [diff] [blame] | 10188 | * Developer setting to force RTL layout. |
| 10189 | * @hide |
| 10190 | */ |
| 10191 | public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; |
| 10192 | |
| 10193 | /** |
Daniel Sandler | dea6462 | 2013-09-23 16:05:57 -0400 | [diff] [blame] | 10194 | * Milliseconds after screen-off after which low battery sounds will be silenced. |
| 10195 | * |
| 10196 | * If zero, battery sounds will always play. |
| 10197 | * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. |
| 10198 | * |
| 10199 | * @hide |
| 10200 | */ |
| 10201 | public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; |
| 10202 | |
| 10203 | /** |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 10204 | * 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] | 10205 | * 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] | 10206 | * clean up any value that they may have written. |
| 10207 | * |
| 10208 | * @hide |
| 10209 | */ |
| 10210 | public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; |
| 10211 | |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 10212 | /** |
| 10213 | * Defines global runtime overrides to window policy. |
| 10214 | * |
Jorim Jaggi | b10e33f | 2015-02-04 21:57:40 +0100 | [diff] [blame] | 10215 | * See {@link com.android.server.policy.PolicyControl} for value format. |
John Spurlock | c6d1c60 | 2014-01-17 15:22:06 -0500 | [diff] [blame] | 10216 | * |
| 10217 | * @hide |
| 10218 | */ |
| 10219 | public static final String POLICY_CONTROL = "policy_control"; |
Evan Charlton | cc7b043 | 2014-01-14 14:47:11 -0800 | [diff] [blame] | 10220 | |
| 10221 | /** |
Adrian Roos | 000cf5e | 2017-11-10 15:55:18 +0100 | [diff] [blame] | 10222 | * {@link android.view.DisplayCutout DisplayCutout} emulation mode. |
| 10223 | * |
| 10224 | * @hide |
| 10225 | */ |
| 10226 | public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; |
| 10227 | |
| 10228 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; |
| 10229 | /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; |
| 10230 | |
| 10231 | /** |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10232 | * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, |
| 10233 | * or ZEN_MODE_NO_INTERRUPTIONS. |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10234 | * |
| 10235 | * @hide |
| 10236 | */ |
| 10237 | public static final String ZEN_MODE = "zen_mode"; |
| 10238 | |
| 10239 | /** @hide */ public static final int ZEN_MODE_OFF = 0; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10240 | /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; |
| 10241 | /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 10242 | /** @hide */ public static final int ZEN_MODE_ALARMS = 3; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10243 | |
| 10244 | /** @hide */ public static String zenModeToString(int mode) { |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10245 | if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; |
John Spurlock | 4f1163c | 2015-04-02 17:41:21 -0400 | [diff] [blame] | 10246 | if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; |
John Spurlock | ae641c9 | 2014-06-30 18:11:40 -0400 | [diff] [blame] | 10247 | if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; |
| 10248 | return "ZEN_MODE_OFF"; |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10249 | } |
| 10250 | |
John Spurlock | b2278d6 | 2015-04-07 12:47:12 -0400 | [diff] [blame] | 10251 | /** @hide */ public static boolean isValidZenMode(int value) { |
| 10252 | switch (value) { |
| 10253 | case Global.ZEN_MODE_OFF: |
| 10254 | case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: |
| 10255 | case Global.ZEN_MODE_ALARMS: |
| 10256 | case Global.ZEN_MODE_NO_INTERRUPTIONS: |
| 10257 | return true; |
| 10258 | default: |
| 10259 | return false; |
| 10260 | } |
| 10261 | } |
| 10262 | |
John Spurlock | e677d71 | 2014-02-13 12:52:19 -0500 | [diff] [blame] | 10263 | /** |
Julia Reynolds | 9b11fdb | 2015-07-31 09:49:55 -0400 | [diff] [blame] | 10264 | * Value of the ringer before entering zen mode. |
| 10265 | * |
| 10266 | * @hide |
| 10267 | */ |
| 10268 | public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; |
| 10269 | |
| 10270 | /** |
John Spurlock | 056c519 | 2014-04-20 21:52:01 -0400 | [diff] [blame] | 10271 | * Opaque value, changes when persisted zen mode configuration changes. |
| 10272 | * |
| 10273 | * @hide |
| 10274 | */ |
| 10275 | public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; |
| 10276 | |
| 10277 | /** |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 10278 | * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. |
| 10279 | * |
| 10280 | * @hide |
| 10281 | */ |
Chris Wren | 10d82df | 2014-03-01 10:34:51 -0500 | [diff] [blame] | 10282 | public static final String HEADS_UP_NOTIFICATIONS_ENABLED = |
| 10283 | "heads_up_notifications_enabled"; |
Chris Wren | 7bd24123 | 2014-02-28 16:25:05 -0500 | [diff] [blame] | 10284 | |
| 10285 | /** @hide */ public static final int HEADS_UP_OFF = 0; |
| 10286 | /** @hide */ public static final int HEADS_UP_ON = 1; |
| 10287 | |
| 10288 | /** |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 10289 | * The name of the device |
Jerome Poichet | 147b4d7 | 2014-05-12 18:13:27 -0700 | [diff] [blame] | 10290 | */ |
| 10291 | public static final String DEVICE_NAME = "device_name"; |
| 10292 | |
| 10293 | /** |
Jeff Davidson | 56f9f73 | 2014-08-14 16:47:23 -0700 | [diff] [blame] | 10294 | * Whether the NetworkScoringService has been first initialized. |
| 10295 | * <p> |
| 10296 | * Type: int (0 for false, 1 for true) |
| 10297 | * @hide |
| 10298 | */ |
| 10299 | public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; |
| 10300 | |
| 10301 | /** |
Jim Miller | 6848dc8 | 2014-10-13 18:51:53 -0700 | [diff] [blame] | 10302 | * Whether the user wants to be prompted for password to decrypt the device on boot. |
| 10303 | * This only matters if the storage is encrypted. |
| 10304 | * <p> |
| 10305 | * Type: int (0 for false, 1 for true) |
| 10306 | * @hide |
| 10307 | */ |
| 10308 | public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; |
| 10309 | |
| 10310 | /** |
manabu, shimoda | 14723e3 | 2017-10-06 14:39:01 +0900 | [diff] [blame] | 10311 | * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config |
| 10312 | * 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] | 10313 | * <p> |
| 10314 | * Type: int (0 for false, 1 for true) |
| 10315 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10316 | * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED} |
| 10317 | * instead. |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 10318 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10319 | @Deprecated |
| 10320 | public static final String ENHANCED_4G_MODE_ENABLED = |
| 10321 | SubscriptionManager.ENHANCED_4G_MODE_ENABLED; |
Libin.Tang@motorola.com | 0499bb5 | 2014-10-10 14:55:57 -0500 | [diff] [blame] | 10322 | |
| 10323 | /** |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 10324 | * Whether VT (Video Telephony over IMS) is enabled |
| 10325 | * <p> |
| 10326 | * Type: int (0 for false, 1 for true) |
| 10327 | * |
| 10328 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10329 | * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead. |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 10330 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10331 | @Deprecated |
| 10332 | public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED; |
Etan Cohen | 93bbf27 | 2015-05-04 18:01:47 -0700 | [diff] [blame] | 10333 | |
| 10334 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10335 | * Whether WFC is enabled |
| 10336 | * <p> |
| 10337 | * Type: int (0 for false, 1 for true) |
| 10338 | * |
| 10339 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10340 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10341 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10342 | @Deprecated |
| 10343 | public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10344 | |
| 10345 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 10346 | * WFC mode on home/non-roaming network. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10347 | * <p> |
| 10348 | * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only |
| 10349 | * |
| 10350 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10351 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead. |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10352 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10353 | @Deprecated |
| 10354 | public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10355 | |
| 10356 | /** |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 10357 | * WFC mode on roaming network. |
| 10358 | * <p> |
Dianne Hackborn | 0ef403e | 2017-01-24 18:22:15 -0800 | [diff] [blame] | 10359 | * Type: int - see {@link #WFC_IMS_MODE} for values |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 10360 | * |
| 10361 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10362 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE} |
| 10363 | * instead. |
Meng Wang | 2c25e4a | 2016-09-19 14:18:05 -0700 | [diff] [blame] | 10364 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10365 | @Deprecated |
| 10366 | 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] | 10367 | |
| 10368 | /** |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10369 | * Whether WFC roaming is enabled |
| 10370 | * <p> |
| 10371 | * Type: int (0 for false, 1 for true) |
| 10372 | * |
| 10373 | * @hide |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10374 | * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED} |
| 10375 | * instead |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10376 | */ |
Malcolm Chen | c66dee9 | 2017-09-26 14:45:40 -0700 | [diff] [blame] | 10377 | @Deprecated |
| 10378 | public static final String WFC_IMS_ROAMING_ENABLED = |
| 10379 | SubscriptionManager.WFC_IMS_ROAMING_ENABLED; |
Etan Cohen | 9c8f21b | 2014-12-23 15:02:19 -0800 | [diff] [blame] | 10380 | |
| 10381 | /** |
Amit Mahajan | 4fea092 | 2014-11-18 12:56:28 -0800 | [diff] [blame] | 10382 | * Whether user can enable/disable LTE as a preferred network. A carrier might control |
| 10383 | * this via gservices, OMA-DM, carrier app, etc. |
| 10384 | * <p> |
| 10385 | * Type: int (0 for false, 1 for true) |
| 10386 | * @hide |
| 10387 | */ |
| 10388 | public static final String LTE_SERVICE_FORCED = "lte_service_forced"; |
| 10389 | |
| 10390 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 10391 | * Ephemeral app cookie max size in bytes. |
| 10392 | * <p> |
| 10393 | * Type: int |
| 10394 | * @hide |
| 10395 | */ |
| 10396 | public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = |
| 10397 | "ephemeral_cookie_max_size_bytes"; |
| 10398 | |
| 10399 | /** |
Todd Kennedy | d15bb75 | 2016-09-13 16:38:31 -0700 | [diff] [blame] | 10400 | * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is |
| 10401 | * enabled. Set to zero to disable. |
| 10402 | * <p> |
| 10403 | * Type: int (0 for false, 1 for true) |
| 10404 | * |
| 10405 | * @hide |
| 10406 | */ |
| 10407 | public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; |
| 10408 | |
| 10409 | /** |
Todd Kennedy | 133c5da | 2017-06-15 09:44:34 -0700 | [diff] [blame] | 10410 | * Toggle to enable/disable dexopt for instant applications. The default is for dexopt |
| 10411 | * to be disabled. |
| 10412 | * <p> |
| 10413 | * Type: int (0 to disable, 1 to enable) |
| 10414 | * |
| 10415 | * @hide |
| 10416 | */ |
| 10417 | public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; |
| 10418 | |
| 10419 | /** |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 10420 | * The min period for caching installed instant apps in milliseconds. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 10421 | * <p> |
| 10422 | * Type: long |
| 10423 | * @hide |
| 10424 | */ |
Svet Ganov | f36d53c | 2017-05-24 00:27:21 -0700 | [diff] [blame] | 10425 | public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 10426 | "installed_instant_app_min_cache_period"; |
| 10427 | |
| 10428 | /** |
| 10429 | * The max period for caching installed instant apps in milliseconds. |
| 10430 | * <p> |
| 10431 | * Type: long |
| 10432 | * @hide |
| 10433 | */ |
| 10434 | public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 10435 | "installed_instant_app_max_cache_period"; |
| 10436 | |
| 10437 | /** |
| 10438 | * The min period for caching uninstalled instant apps in milliseconds. |
| 10439 | * <p> |
| 10440 | * Type: long |
| 10441 | * @hide |
| 10442 | */ |
| 10443 | public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = |
| 10444 | "uninstalled_instant_app_min_cache_period"; |
| 10445 | |
| 10446 | /** |
| 10447 | * The max period for caching uninstalled instant apps in milliseconds. |
| 10448 | * <p> |
| 10449 | * Type: long |
| 10450 | * @hide |
| 10451 | */ |
| 10452 | public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = |
| 10453 | "uninstalled_instant_app_max_cache_period"; |
| 10454 | |
| 10455 | /** |
| 10456 | * The min period for caching unused static shared libs in milliseconds. |
| 10457 | * <p> |
| 10458 | * Type: long |
| 10459 | * @hide |
| 10460 | */ |
| 10461 | public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = |
| 10462 | "unused_static_shared_lib_min_cache_period"; |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 10463 | |
| 10464 | /** |
Fyodor Kupolov | 07140f7 | 2016-02-17 10:46:11 -0800 | [diff] [blame] | 10465 | * Allows switching users when system user is locked. |
| 10466 | * <p> |
| 10467 | * Type: int |
| 10468 | * @hide |
| 10469 | */ |
| 10470 | public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = |
| 10471 | "allow_user_switching_when_system_user_locked"; |
| 10472 | |
| 10473 | /** |
Kenny Guy | c4db5ca | 2017-09-21 11:40:44 +0100 | [diff] [blame] | 10474 | * Boot count since the device starts running API level 24. |
Daichi Hirono | 82ab980 | 2016-03-02 13:23:29 +0900 | [diff] [blame] | 10475 | * <p> |
| 10476 | * Type: int |
| 10477 | */ |
| 10478 | public static final String BOOT_COUNT = "boot_count"; |
| 10479 | |
| 10480 | /** |
Lenka Trochtova | 6474f0e | 2016-03-24 16:43:10 +0100 | [diff] [blame] | 10481 | * Whether the safe boot is disallowed. |
| 10482 | * |
| 10483 | * <p>This setting should have the identical value as the corresponding user restriction. |
| 10484 | * The purpose of the setting is to make the restriction available in early boot stages |
| 10485 | * before the user restrictions are loaded. |
| 10486 | * @hide |
| 10487 | */ |
| 10488 | public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; |
| 10489 | |
| 10490 | /** |
Amith Yamasani | eb437d4 | 2016-04-29 09:31:25 -0700 | [diff] [blame] | 10491 | * Whether this device is currently in retail demo mode. If true, device |
| 10492 | * usage is severely limited. |
| 10493 | * <p> |
| 10494 | * Type: int (0 for false, 1 for true) |
| 10495 | * @hide |
| 10496 | */ |
| 10497 | public static final String DEVICE_DEMO_MODE = "device_demo_mode"; |
| 10498 | |
| 10499 | /** |
Sudheer Shanka | 5918c67 | 2017-03-21 19:31:37 -0700 | [diff] [blame] | 10500 | * Indicates the maximum time that an app is blocked for the network rules to get updated. |
| 10501 | * |
| 10502 | * Type: long |
| 10503 | * |
| 10504 | * @hide |
| 10505 | */ |
| 10506 | public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; |
| 10507 | |
| 10508 | /** |
Svetoslav Ganov | 264c7a9 | 2016-08-24 17:31:14 -0700 | [diff] [blame] | 10509 | * The reason for the settings database being downgraded. This is only for |
| 10510 | * troubleshooting purposes and its value should not be interpreted in any way. |
| 10511 | * |
| 10512 | * Type: string |
| 10513 | * |
| 10514 | * @hide |
| 10515 | */ |
| 10516 | public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; |
| 10517 | |
| 10518 | /** |
Amith Yamasani | 3945202 | 2017-03-21 15:23:47 -0700 | [diff] [blame] | 10519 | * The build id of when the settings database was first created (or re-created due it |
| 10520 | * being missing). |
| 10521 | * |
| 10522 | * Type: string |
| 10523 | * |
| 10524 | * @hide |
| 10525 | */ |
| 10526 | public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; |
| 10527 | |
| 10528 | /** |
Suprabh Shukla | 502fd88 | 2016-09-30 15:06:00 -0700 | [diff] [blame] | 10529 | * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by |
| 10530 | * default. Set to 0 to disable. |
| 10531 | * |
| 10532 | * @hide |
| 10533 | */ |
| 10534 | public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; |
| 10535 | |
| 10536 | /** |
songchenxi | 825f69a | 2017-01-19 14:18:41 -0800 | [diff] [blame] | 10537 | * Flag to enable the link to location permissions in location setting. Set to 0 to disable. |
| 10538 | * |
| 10539 | * @hide |
| 10540 | */ |
| 10541 | public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = |
| 10542 | "location_settings_link_to_permissions_enabled"; |
| 10543 | |
| 10544 | /** |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 10545 | * Flag to set the waiting time for euicc factory reset inside System > Settings |
| 10546 | * Type: long |
| 10547 | * |
| 10548 | * @hide |
| 10549 | */ |
qingxi | 2f23151 | 2017-06-23 15:32:53 -0700 | [diff] [blame] | 10550 | public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = |
| 10551 | "euicc_factory_reset_timeout_millis"; |
qingxi | 0ca328f | 2017-05-19 15:20:03 -0700 | [diff] [blame] | 10552 | |
| 10553 | /** |
Daniel Nishi | 5782b5c | 2017-08-24 10:28:52 -0700 | [diff] [blame] | 10554 | * Flag to set the timeout for when to refresh the storage settings cached data. |
| 10555 | * Type: long |
| 10556 | * |
| 10557 | * @hide |
| 10558 | */ |
| 10559 | public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = |
| 10560 | "storage_settings_clobber_threshold"; |
| 10561 | |
| 10562 | /** |
Makoto Onuki | 0000d32 | 2017-11-28 16:31:47 -0800 | [diff] [blame] | 10563 | * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} |
| 10564 | * temporarily for all users. |
| 10565 | * |
| 10566 | * @hide |
| 10567 | */ |
| 10568 | public static final String LOCATION_GLOBAL_KILL_SWITCH = |
| 10569 | "location_global_kill_switch"; |
| 10570 | |
| 10571 | /** |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10572 | * Settings to backup. This is here so that it's in the same place as the settings |
| 10573 | * keys and easy to update. |
| 10574 | * |
| 10575 | * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System |
| 10576 | * and Secure as well. This is because those tables drive both backup and |
| 10577 | * restore, and restore needs to properly whitelist keys that used to live |
| 10578 | * in those namespaces. The keys will only actually be backed up / restored |
| 10579 | * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). |
| 10580 | * |
| 10581 | * NOTE: Settings are backed up and restored in the order they appear |
| 10582 | * in this array. If you have one setting depending on another, |
| 10583 | * make sure that they are ordered appropriately. |
| 10584 | * |
| 10585 | * @hide |
| 10586 | */ |
| 10587 | public static final String[] SETTINGS_TO_BACKUP = { |
Christopher Tate | 58f41ec | 2013-01-11 15:40:36 -0800 | [diff] [blame] | 10588 | BUGREPORT_IN_POWER_MENU, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10589 | STAY_ON_WHILE_PLUGGED_IN, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10590 | AUTO_TIME, |
| 10591 | AUTO_TIME_ZONE, |
| 10592 | POWER_SOUNDS_ENABLED, |
| 10593 | DOCK_SOUNDS_ENABLED, |
Ritesh Reddy | f8f1213 | 2015-11-20 16:43:28 +0000 | [diff] [blame] | 10594 | CHARGING_SOUNDS_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10595 | USB_MASS_STORAGE_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 10596 | NETWORK_RECOMMENDATIONS_ENABLED, |
Stephen Chen | 42f5f29 | 2017-01-20 11:24:08 -0800 | [diff] [blame] | 10597 | WIFI_WAKEUP_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10598 | WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, |
Amin Shaikh | bc9a8e6 | 2017-02-02 15:39:12 -0800 | [diff] [blame] | 10599 | USE_OPEN_WIFI_PACKAGE, |
Christopher Tate | 16eb7cd | 2012-10-09 15:26:30 -0700 | [diff] [blame] | 10600 | WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10601 | EMERGENCY_TONE, |
| 10602 | CALL_AUTO_RETRY, |
Amith Yamasani | 9400524 | 2014-10-31 11:35:13 -0700 | [diff] [blame] | 10603 | DOCK_AUDIO_MEDIA_ENABLED, |
Phil Burk | deaa8d9 | 2016-02-23 17:12:04 -0800 | [diff] [blame] | 10604 | ENCODED_SURROUND_OUTPUT, |
Stanley Tng | 767f05f | 2017-05-01 21:27:31 -0700 | [diff] [blame] | 10605 | LOW_POWER_MODE_TRIGGER_LEVEL, |
Erik Kline | 4d09223 | 2017-10-30 15:29:44 +0900 | [diff] [blame] | 10606 | BLUETOOTH_ON, |
| 10607 | PRIVATE_DNS_MODE, |
Mehdi Alizadeh | dcc0da2 | 2017-11-10 15:37:13 -0800 | [diff] [blame] | 10608 | PRIVATE_DNS_SPECIFIER, |
| 10609 | SOFT_AP_TIMEOUT_ENABLED |
Christopher Tate | 66488d6 | 2012-10-02 11:58:01 -0700 | [diff] [blame] | 10610 | }; |
| 10611 | |
Makoto Onuki | 53f0e02 | 2017-11-29 13:51:01 -0800 | [diff] [blame] | 10612 | /** |
| 10613 | * Global settings that shouldn't be persisted. |
| 10614 | * |
| 10615 | * @hide |
| 10616 | */ |
| 10617 | public static final String[] TRANSIENT_SETTINGS = { |
| 10618 | LOCATION_GLOBAL_KILL_SWITCH, |
| 10619 | }; |
| 10620 | |
Christopher Tate | 1d0fca3 | 2017-06-06 13:30:00 -0700 | [diff] [blame] | 10621 | /** @hide */ |
| 10622 | public static final String[] LEGACY_RESTORE_SETTINGS = { |
| 10623 | }; |
| 10624 | |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10625 | private static final ContentProviderHolder sProviderHolder = |
| 10626 | new ContentProviderHolder(CONTENT_URI); |
| 10627 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10628 | // Populated lazily, guarded by class object: |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10629 | private static final NameValueCache sNameValueCache = new NameValueCache( |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 10630 | CONTENT_URI, |
| 10631 | CALL_METHOD_GET_GLOBAL, |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10632 | CALL_METHOD_PUT_GLOBAL, |
| 10633 | sProviderHolder); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10634 | |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 10635 | // Certain settings have been moved from global to the per-user secure namespace |
| 10636 | private static final HashSet<String> MOVED_TO_SECURE; |
| 10637 | static { |
Steve McKay | ea93fe7 | 2016-12-02 11:35:35 -0800 | [diff] [blame] | 10638 | MOVED_TO_SECURE = new HashSet<>(1); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 10639 | MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); |
| 10640 | } |
| 10641 | |
Svetoslav | 683914b | 2015-01-15 14:22:26 -0800 | [diff] [blame] | 10642 | /** @hide */ |
| 10643 | public static void getMovedToSecureSettings(Set<String> outKeySet) { |
| 10644 | outKeySet.addAll(MOVED_TO_SECURE); |
| 10645 | } |
| 10646 | |
Sudheer Shanka | aa3c30d | 2017-05-23 15:19:10 -0700 | [diff] [blame] | 10647 | /** @hide */ |
| 10648 | public static void clearProviderForTest() { |
| 10649 | sProviderHolder.clearProviderForTest(); |
| 10650 | sNameValueCache.clearGenerationTrackerForTest(); |
| 10651 | } |
| 10652 | |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10653 | /** |
| 10654 | * Look up a name in the database. |
| 10655 | * @param resolver to access the database with |
| 10656 | * @param name to look up in the table |
| 10657 | * @return the corresponding value, or null if not present |
| 10658 | */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 10659 | public static String getString(ContentResolver resolver, String name) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10660 | return getStringForUser(resolver, name, UserHandle.myUserId()); |
| 10661 | } |
| 10662 | |
| 10663 | /** @hide */ |
Dianne Hackborn | 139748f | 2012-09-24 11:36:57 -0700 | [diff] [blame] | 10664 | public static String getStringForUser(ContentResolver resolver, String name, |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10665 | int userHandle) { |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 10666 | if (MOVED_TO_SECURE.contains(name)) { |
| 10667 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 10668 | + " to android.provider.Settings.Secure, returning read-only value."); |
| 10669 | return Secure.getStringForUser(resolver, name, userHandle); |
| 10670 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10671 | return sNameValueCache.getStringForUser(resolver, name, userHandle); |
| 10672 | } |
| 10673 | |
| 10674 | /** |
| 10675 | * Store a name/value pair into the database. |
| 10676 | * @param resolver to access the database with |
| 10677 | * @param name to store |
| 10678 | * @param value to associate with the name |
| 10679 | * @return true if the value was set, false on database errors |
| 10680 | */ |
| 10681 | public static boolean putString(ContentResolver resolver, |
| 10682 | String name, String value) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10683 | return putStringForUser(resolver, name, value, null, false, UserHandle.myUserId()); |
| 10684 | } |
| 10685 | |
| 10686 | /** |
| 10687 | * Store a name/value pair into the database. |
| 10688 | * <p> |
| 10689 | * The method takes an optional tag to associate with the setting |
| 10690 | * which can be used to clear only settings made by your package and |
| 10691 | * associated with this tag by passing the tag to {@link |
| 10692 | * #resetToDefaults(ContentResolver, String)}. Anyone can override |
| 10693 | * the current tag. Also if another package changes the setting |
| 10694 | * then the tag will be set to the one specified in the set call |
| 10695 | * which can be null. Also any of the settings setters that do not |
| 10696 | * take a tag as an argument effectively clears the tag. |
| 10697 | * </p><p> |
| 10698 | * For example, if you set settings A and B with tags T1 and T2 and |
| 10699 | * another app changes setting A (potentially to the same value), it |
| 10700 | * can assign to it a tag T3 (note that now the package that changed |
| 10701 | * the setting is not yours). Now if you reset your changes for T1 and |
| 10702 | * T2 only setting B will be reset and A not (as it was changed by |
| 10703 | * another package) but since A did not change you are in the desired |
| 10704 | * initial state. Now if the other app changes the value of A (assuming |
| 10705 | * you registered an observer in the beginning) you would detect that |
| 10706 | * the setting was changed by another app and handle this appropriately |
| 10707 | * (ignore, set back to some value, etc). |
| 10708 | * </p><p> |
| 10709 | * Also the method takes an argument whether to make the value the |
| 10710 | * default for this setting. If the system already specified a default |
| 10711 | * value, then the one passed in here will <strong>not</strong> |
| 10712 | * be set as the default. |
| 10713 | * </p> |
| 10714 | * |
| 10715 | * @param resolver to access the database with. |
| 10716 | * @param name to store. |
| 10717 | * @param value to associate with the name. |
| 10718 | * @param tag to associated with the setting. |
| 10719 | * @param makeDefault whether to make the value the default one. |
| 10720 | * @return true if the value was set, false on database errors. |
| 10721 | * |
| 10722 | * @see #resetToDefaults(ContentResolver, String) |
| 10723 | * |
| 10724 | * @hide |
| 10725 | */ |
| 10726 | @SystemApi |
| 10727 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 10728 | public static boolean putString(@NonNull ContentResolver resolver, |
| 10729 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 10730 | boolean makeDefault) { |
| 10731 | return putStringForUser(resolver, name, value, tag, makeDefault, |
| 10732 | UserHandle.myUserId()); |
| 10733 | } |
| 10734 | |
| 10735 | /** |
| 10736 | * Reset the settings to their defaults. This would reset <strong>only</strong> |
| 10737 | * settings set by the caller's package. Think of it of a way to undo your own |
| 10738 | * changes to the secure settings. Passing in the optional tag will reset only |
| 10739 | * settings changed by your package and associated with this tag. |
| 10740 | * |
| 10741 | * @param resolver Handle to the content resolver. |
| 10742 | * @param tag Optional tag which should be associated with the settings to reset. |
| 10743 | * |
| 10744 | * @see #putString(ContentResolver, String, String, String, boolean) |
| 10745 | * |
| 10746 | * @hide |
| 10747 | */ |
| 10748 | @SystemApi |
| 10749 | @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) |
| 10750 | public static void resetToDefaults(@NonNull ContentResolver resolver, |
| 10751 | @Nullable String tag) { |
| 10752 | resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, |
| 10753 | UserHandle.myUserId()); |
| 10754 | } |
| 10755 | |
| 10756 | /** |
| 10757 | * Reset the settings to their defaults for a given user with a specific mode. The |
| 10758 | * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} |
| 10759 | * allowing resetting the settings made by a package and associated with the tag. |
| 10760 | * |
| 10761 | * @param resolver Handle to the content resolver. |
| 10762 | * @param tag Optional tag which should be associated with the settings to reset. |
| 10763 | * @param mode The reset mode. |
| 10764 | * @param userHandle The user for which to reset to defaults. |
| 10765 | * |
| 10766 | * @see #RESET_MODE_PACKAGE_DEFAULTS |
| 10767 | * @see #RESET_MODE_UNTRUSTED_DEFAULTS |
| 10768 | * @see #RESET_MODE_UNTRUSTED_CHANGES |
| 10769 | * @see #RESET_MODE_TRUSTED_DEFAULTS |
| 10770 | * |
| 10771 | * @hide |
| 10772 | */ |
| 10773 | public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, |
| 10774 | @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { |
| 10775 | try { |
| 10776 | Bundle arg = new Bundle(); |
| 10777 | arg.putInt(CALL_METHOD_USER_KEY, userHandle); |
| 10778 | if (tag != null) { |
| 10779 | arg.putString(CALL_METHOD_TAG_KEY, tag); |
| 10780 | } |
| 10781 | arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); |
| 10782 | IContentProvider cp = sProviderHolder.getProvider(resolver); |
| 10783 | cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); |
| 10784 | } catch (RemoteException e) { |
| 10785 | Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); |
| 10786 | } |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10787 | } |
| 10788 | |
| 10789 | /** @hide */ |
| 10790 | public static boolean putStringForUser(ContentResolver resolver, |
| 10791 | String name, String value, int userHandle) { |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10792 | return putStringForUser(resolver, name, value, null, false, userHandle); |
| 10793 | } |
| 10794 | |
| 10795 | /** @hide */ |
| 10796 | public static boolean putStringForUser(@NonNull ContentResolver resolver, |
| 10797 | @NonNull String name, @Nullable String value, @Nullable String tag, |
| 10798 | boolean makeDefault, @UserIdInt int userHandle) { |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10799 | if (LOCAL_LOGV) { |
| 10800 | Log.v(TAG, "Global.putString(name=" + name + ", value=" + value |
| 10801 | + " for " + userHandle); |
| 10802 | } |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 10803 | // Global and Secure have the same access policy so we can forward writes |
| 10804 | if (MOVED_TO_SECURE.contains(name)) { |
| 10805 | Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" |
| 10806 | + " to android.provider.Settings.Secure, value is unchanged."); |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10807 | return Secure.putStringForUser(resolver, name, value, tag, |
| 10808 | makeDefault, userHandle); |
Christopher Tate | aa036a2 | 2014-05-19 16:33:27 -0700 | [diff] [blame] | 10809 | } |
Svetoslav Ganov | e080da9 | 2016-12-21 17:10:35 -0800 | [diff] [blame] | 10810 | return sNameValueCache.putStringForUser(resolver, name, value, tag, |
| 10811 | makeDefault, userHandle); |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 10812 | } |
| 10813 | |
| 10814 | /** |
| 10815 | * Construct the content URI for a particular name/value pair, |
| 10816 | * useful for monitoring changes with a ContentObserver. |
| 10817 | * @param name to look up in the table |
| 10818 | * @return the corresponding content URI, or null if not present |
| 10819 | */ |
| 10820 | public static Uri getUriFor(String name) { |
| 10821 | return getUriFor(CONTENT_URI, name); |
| 10822 | } |
| 10823 | |
| 10824 | /** |
| 10825 | * Convenience function for retrieving a single secure settings value |
| 10826 | * as an integer. Note that internally setting values are always |
| 10827 | * stored as strings; this function converts the string to an integer |
| 10828 | * for you. The default value will be returned if the setting is |
| 10829 | * not defined or not an integer. |
| 10830 | * |
| 10831 | * @param cr The ContentResolver to access. |
| 10832 | * @param name The name of the setting to retrieve. |
| 10833 | * @param def Value to return if the setting is not defined. |
| 10834 | * |
| 10835 | * @return The setting's current value, or 'def' if it is not defined |
| 10836 | * or not a valid integer. |
| 10837 | */ |
| 10838 | public static int getInt(ContentResolver cr, String name, int def) { |
| 10839 | String v = getString(cr, name); |
| 10840 | try { |
| 10841 | return v != null ? Integer.parseInt(v) : def; |
| 10842 | } catch (NumberFormatException e) { |
| 10843 | return def; |
| 10844 | } |
| 10845 | } |
| 10846 | |
| 10847 | /** |
| 10848 | * Convenience function for retrieving a single secure settings value |
| 10849 | * as an integer. Note that internally setting values are always |
| 10850 | * stored as strings; this function converts the string to an integer |
| 10851 | * for you. |
| 10852 | * <p> |
| 10853 | * This version does not take a default value. If the setting has not |
| 10854 | * been set, or the string value is not a number, |
| 10855 | * it throws {@link SettingNotFoundException}. |
| 10856 | * |
| 10857 | * @param cr The ContentResolver to access. |
| 10858 | * @param name The name of the setting to retrieve. |
| 10859 | * |
| 10860 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 10861 | * name can't be found or the setting value is not an integer. |
| 10862 | * |
| 10863 | * @return The setting's current value. |
| 10864 | */ |
| 10865 | public static int getInt(ContentResolver cr, String name) |
| 10866 | throws SettingNotFoundException { |
| 10867 | String v = getString(cr, name); |
| 10868 | try { |
| 10869 | return Integer.parseInt(v); |
| 10870 | } catch (NumberFormatException e) { |
| 10871 | throw new SettingNotFoundException(name); |
| 10872 | } |
| 10873 | } |
| 10874 | |
| 10875 | /** |
| 10876 | * Convenience function for updating a single settings value as an |
| 10877 | * integer. This will either create a new entry in the table if the |
| 10878 | * given name does not exist, or modify the value of the existing row |
| 10879 | * with that name. Note that internally setting values are always |
| 10880 | * stored as strings, so this function converts the given value to a |
| 10881 | * string before storing it. |
| 10882 | * |
| 10883 | * @param cr The ContentResolver to access. |
| 10884 | * @param name The name of the setting to modify. |
| 10885 | * @param value The new value for the setting. |
| 10886 | * @return true if the value was set, false on database errors |
| 10887 | */ |
| 10888 | public static boolean putInt(ContentResolver cr, String name, int value) { |
| 10889 | return putString(cr, name, Integer.toString(value)); |
| 10890 | } |
| 10891 | |
| 10892 | /** |
| 10893 | * Convenience function for retrieving a single secure settings value |
| 10894 | * as a {@code long}. Note that internally setting values are always |
| 10895 | * stored as strings; this function converts the string to a {@code long} |
| 10896 | * for you. The default value will be returned if the setting is |
| 10897 | * not defined or not a {@code long}. |
| 10898 | * |
| 10899 | * @param cr The ContentResolver to access. |
| 10900 | * @param name The name of the setting to retrieve. |
| 10901 | * @param def Value to return if the setting is not defined. |
| 10902 | * |
| 10903 | * @return The setting's current value, or 'def' if it is not defined |
| 10904 | * or not a valid {@code long}. |
| 10905 | */ |
| 10906 | public static long getLong(ContentResolver cr, String name, long def) { |
| 10907 | String valString = getString(cr, name); |
| 10908 | long value; |
| 10909 | try { |
| 10910 | value = valString != null ? Long.parseLong(valString) : def; |
| 10911 | } catch (NumberFormatException e) { |
| 10912 | value = def; |
| 10913 | } |
| 10914 | return value; |
| 10915 | } |
| 10916 | |
| 10917 | /** |
| 10918 | * Convenience function for retrieving a single secure settings value |
| 10919 | * as a {@code long}. Note that internally setting values are always |
| 10920 | * stored as strings; this function converts the string to a {@code long} |
| 10921 | * for you. |
| 10922 | * <p> |
| 10923 | * This version does not take a default value. If the setting has not |
| 10924 | * been set, or the string value is not a number, |
| 10925 | * it throws {@link SettingNotFoundException}. |
| 10926 | * |
| 10927 | * @param cr The ContentResolver to access. |
| 10928 | * @param name The name of the setting to retrieve. |
| 10929 | * |
| 10930 | * @return The setting's current value. |
| 10931 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 10932 | * name can't be found or the setting value is not an integer. |
| 10933 | */ |
| 10934 | public static long getLong(ContentResolver cr, String name) |
| 10935 | throws SettingNotFoundException { |
| 10936 | String valString = getString(cr, name); |
| 10937 | try { |
| 10938 | return Long.parseLong(valString); |
| 10939 | } catch (NumberFormatException e) { |
| 10940 | throw new SettingNotFoundException(name); |
| 10941 | } |
| 10942 | } |
| 10943 | |
| 10944 | /** |
| 10945 | * Convenience function for updating a secure settings value as a long |
| 10946 | * integer. This will either create a new entry in the table if the |
| 10947 | * given name does not exist, or modify the value of the existing row |
| 10948 | * with that name. Note that internally setting values are always |
| 10949 | * stored as strings, so this function converts the given value to a |
| 10950 | * string before storing it. |
| 10951 | * |
| 10952 | * @param cr The ContentResolver to access. |
| 10953 | * @param name The name of the setting to modify. |
| 10954 | * @param value The new value for the setting. |
| 10955 | * @return true if the value was set, false on database errors |
| 10956 | */ |
| 10957 | public static boolean putLong(ContentResolver cr, String name, long value) { |
| 10958 | return putString(cr, name, Long.toString(value)); |
| 10959 | } |
| 10960 | |
| 10961 | /** |
| 10962 | * Convenience function for retrieving a single secure settings value |
| 10963 | * as a floating point number. Note that internally setting values are |
| 10964 | * always stored as strings; this function converts the string to an |
| 10965 | * float for you. The default value will be returned if the setting |
| 10966 | * is not defined or not a valid float. |
| 10967 | * |
| 10968 | * @param cr The ContentResolver to access. |
| 10969 | * @param name The name of the setting to retrieve. |
| 10970 | * @param def Value to return if the setting is not defined. |
| 10971 | * |
| 10972 | * @return The setting's current value, or 'def' if it is not defined |
| 10973 | * or not a valid float. |
| 10974 | */ |
| 10975 | public static float getFloat(ContentResolver cr, String name, float def) { |
| 10976 | String v = getString(cr, name); |
| 10977 | try { |
| 10978 | return v != null ? Float.parseFloat(v) : def; |
| 10979 | } catch (NumberFormatException e) { |
| 10980 | return def; |
| 10981 | } |
| 10982 | } |
| 10983 | |
| 10984 | /** |
| 10985 | * Convenience function for retrieving a single secure settings value |
| 10986 | * as a float. Note that internally setting values are always |
| 10987 | * stored as strings; this function converts the string to a float |
| 10988 | * for you. |
| 10989 | * <p> |
| 10990 | * This version does not take a default value. If the setting has not |
| 10991 | * been set, or the string value is not a number, |
| 10992 | * it throws {@link SettingNotFoundException}. |
| 10993 | * |
| 10994 | * @param cr The ContentResolver to access. |
| 10995 | * @param name The name of the setting to retrieve. |
| 10996 | * |
| 10997 | * @throws SettingNotFoundException Thrown if a setting by the given |
| 10998 | * name can't be found or the setting value is not a float. |
| 10999 | * |
| 11000 | * @return The setting's current value. |
| 11001 | */ |
| 11002 | public static float getFloat(ContentResolver cr, String name) |
| 11003 | throws SettingNotFoundException { |
| 11004 | String v = getString(cr, name); |
| 11005 | if (v == null) { |
| 11006 | throw new SettingNotFoundException(name); |
| 11007 | } |
| 11008 | try { |
| 11009 | return Float.parseFloat(v); |
| 11010 | } catch (NumberFormatException e) { |
| 11011 | throw new SettingNotFoundException(name); |
| 11012 | } |
| 11013 | } |
| 11014 | |
| 11015 | /** |
| 11016 | * Convenience function for updating a single settings value as a |
| 11017 | * floating point number. This will either create a new entry in the |
| 11018 | * table if the given name does not exist, or modify the value of the |
| 11019 | * existing row with that name. Note that internally setting values |
| 11020 | * are always stored as strings, so this function converts the given |
| 11021 | * value to a string before storing it. |
| 11022 | * |
| 11023 | * @param cr The ContentResolver to access. |
| 11024 | * @param name The name of the setting to modify. |
| 11025 | * @param value The new value for the setting. |
| 11026 | * @return true if the value was set, false on database errors |
| 11027 | */ |
| 11028 | public static boolean putFloat(ContentResolver cr, String name, float value) { |
| 11029 | return putString(cr, name, Float.toString(value)); |
| 11030 | } |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11031 | |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11032 | /** |
| 11033 | * Subscription to be used for voice call on a multi sim device. The supported values |
| 11034 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11035 | * @hide |
| 11036 | */ |
| 11037 | public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; |
| 11038 | |
| 11039 | /** |
| 11040 | * Used to provide option to user to select subscription during dial. |
| 11041 | * The supported values are 0 = disable or 1 = enable prompt. |
| 11042 | * @hide |
| 11043 | */ |
| 11044 | public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; |
| 11045 | |
| 11046 | /** |
| 11047 | * Subscription to be used for data call on a multi sim device. The supported values |
| 11048 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11049 | * @hide |
| 11050 | */ |
| 11051 | public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; |
| 11052 | |
| 11053 | /** |
| 11054 | * Subscription to be used for SMS on a multi sim device. The supported values |
| 11055 | * are 0 = SUB1, 1 = SUB2 and etc. |
| 11056 | * @hide |
| 11057 | */ |
| 11058 | public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; |
| 11059 | |
| 11060 | /** |
| 11061 | * Used to provide option to user to select subscription during send SMS. |
| 11062 | * The value 1 - enable, 0 - disable |
| 11063 | * @hide |
| 11064 | */ |
| 11065 | public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; |
| 11066 | |
| 11067 | |
| 11068 | |
| 11069 | /** User preferred subscriptions setting. |
| 11070 | * 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] | 11071 | * the activation status. Each settings string have the comma separated values |
Wink Saville | fb40dd4 | 2014-06-12 17:02:31 -0700 | [diff] [blame] | 11072 | * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index |
| 11073 | * @hide |
| 11074 | */ |
| 11075 | public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", |
| 11076 | "user_preferred_sub2","user_preferred_sub3"}; |
Zheng Fu | b218ff4 | 2015-04-13 16:31:16 -0700 | [diff] [blame] | 11077 | |
| 11078 | /** |
| 11079 | * Whether to enable new contacts aggregator or not. |
| 11080 | * The value 1 - enable, 0 - disable |
| 11081 | * @hide |
| 11082 | */ |
| 11083 | public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11084 | |
| 11085 | /** |
| 11086 | * Whether to enable contacts metadata syncing or not |
| 11087 | * The value 1 - enable, 0 - disable |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11088 | * |
| 11089 | * @removed |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11090 | */ |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11091 | @Deprecated |
Zheng Fu | 31ce78c | 2015-04-15 16:57:53 -0700 | [diff] [blame] | 11092 | public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 11093 | |
| 11094 | /** |
Tingting Wang | e0cbda4 | 2016-05-10 15:39:37 -0700 | [diff] [blame] | 11095 | * Whether to enable contacts metadata syncing or not |
| 11096 | * The value 1 - enable, 0 - disable |
| 11097 | */ |
| 11098 | public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; |
| 11099 | |
| 11100 | /** |
Wei Liu | a181770 | 2015-08-11 21:21:12 -0700 | [diff] [blame] | 11101 | * Whether to enable cellular on boot. |
| 11102 | * The value 1 - enable, 0 - disable |
| 11103 | * @hide |
| 11104 | */ |
| 11105 | public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; |
Steven Ng | dc20ba6 | 2016-04-26 18:19:04 +0100 | [diff] [blame] | 11106 | |
| 11107 | /** |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 11108 | * The maximum allowed notification enqueue rate in Hertz. |
| 11109 | * |
Julia Reynolds | 76c096d | 2017-06-19 08:16:04 -0400 | [diff] [blame] | 11110 | * Should be a float, and includes updates only. |
Chris Wren | 763a9bb | 2016-05-31 17:14:12 -0400 | [diff] [blame] | 11111 | * @hide |
| 11112 | */ |
| 11113 | public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; |
Doris Ling | 628cea4 | 2016-06-09 10:35:02 -0700 | [diff] [blame] | 11114 | |
| 11115 | /** |
Geoffrey Pitsch | 4c6eef2 | 2017-04-19 10:26:45 -0400 | [diff] [blame] | 11116 | * Displays toasts when an app posts a notification that does not specify a valid channel. |
| 11117 | * |
| 11118 | * The value 1 - enable, 0 - disable |
| 11119 | * @hide |
| 11120 | */ |
| 11121 | public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = |
| 11122 | "show_notification_channel_warnings"; |
| 11123 | |
| 11124 | /** |
Chris Manton | 95a6c89 | 2016-03-15 13:26:11 -0700 | [diff] [blame] | 11125 | * Whether cell is enabled/disabled |
| 11126 | * @hide |
| 11127 | */ |
| 11128 | public static final String CELL_ON = "cell_on"; |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11129 | |
| 11130 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11131 | * Global settings which can be accessed by instant apps. |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11132 | * @hide |
| 11133 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11134 | public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11135 | static { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 11136 | INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); |
| 11137 | INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); |
| 11138 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); |
| 11139 | INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); |
| 11140 | INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); |
Chad Brubaker | 1f6a266 | 2017-03-20 11:11:30 -0700 | [diff] [blame] | 11141 | INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); |
Chad Brubaker | 91d2e28 | 2017-04-03 14:34:50 -0700 | [diff] [blame] | 11142 | INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); |
| 11143 | INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); |
| 11144 | INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); |
| 11145 | INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); |
Chad Brubaker | 562afaf | 2017-04-10 13:32:37 -0700 | [diff] [blame] | 11146 | INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); |
Chad Brubaker | a6170b8 | 2017-09-01 14:48:46 -0700 | [diff] [blame] | 11147 | INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); |
Svet Ganov | 8f90bcc | 2017-12-22 23:29:24 -0800 | [diff] [blame] | 11148 | INSTANT_APP_SETTINGS.add(ZEN_MODE); |
Chad Brubaker | 97bccee | 2017-01-05 15:51:41 -0800 | [diff] [blame] | 11149 | } |
| 11150 | |
Andrew Sapperstein | e335256 | 2017-01-20 15:41:03 -0800 | [diff] [blame] | 11151 | /** |
| 11152 | * Whether to show the high temperature warning notification. |
| 11153 | * @hide |
| 11154 | */ |
| 11155 | public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; |
| 11156 | |
| 11157 | /** |
| 11158 | * Temperature at which the high temperature warning notification should be shown. |
| 11159 | * @hide |
| 11160 | */ |
| 11161 | public static final String WARNING_TEMPERATURE = "warning_temperature"; |
Daniel Nishi | 88e45dc | 2017-01-25 11:43:55 -0800 | [diff] [blame] | 11162 | |
| 11163 | /** |
| 11164 | * Whether the diskstats logging task is enabled/disabled. |
| 11165 | * @hide |
| 11166 | */ |
| 11167 | public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; |
Daniel Nishi | 0f703e6 | 2017-02-21 15:19:27 -0800 | [diff] [blame] | 11168 | |
| 11169 | /** |
| 11170 | * Whether the cache quota calculation task is enabled/disabled. |
| 11171 | * @hide |
| 11172 | */ |
| 11173 | public static final String ENABLE_CACHE_QUOTA_CALCULATION = |
| 11174 | "enable_cache_quota_calculation"; |
Daniel Nishi | 4f5320e | 2017-06-13 17:51:21 -0700 | [diff] [blame] | 11175 | |
| 11176 | /** |
| 11177 | * Whether the Deletion Helper no threshold toggle is available. |
| 11178 | * @hide |
| 11179 | */ |
| 11180 | public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = |
| 11181 | "enable_deletion_helper_no_threshold_toggle"; |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 11182 | |
| 11183 | /** |
| 11184 | * The list of snooze options for notifications |
| 11185 | * This is encoded as a key=value list, separated by commas. Ex: |
| 11186 | * |
| 11187 | * "default=60,options_array=15:30:60:120" |
| 11188 | * |
| 11189 | * The following keys are supported: |
| 11190 | * |
| 11191 | * <pre> |
| 11192 | * default (int) |
Chris Wren | 4170751 | 2017-12-06 00:12:17 -0500 | [diff] [blame] | 11193 | * options_array (int[]) |
Chris Wren | e901a7e | 2017-10-02 17:29:46 -0400 | [diff] [blame] | 11194 | * </pre> |
| 11195 | * |
| 11196 | * All delays in integer minutes. Array order is respected. |
| 11197 | * Options will be used in order up to the maximum allowed by the UI. |
| 11198 | * @hide |
| 11199 | */ |
| 11200 | public static final String NOTIFICATION_SNOOZE_OPTIONS = |
| 11201 | "notification_snooze_options"; |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 11202 | |
| 11203 | /** |
Fyodor Kupolov | ee90c03 | 2017-12-12 11:52:57 -0800 | [diff] [blame] | 11204 | * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated |
| 11205 | * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF |
| 11206 | * |
| 11207 | * Supported keys: |
| 11208 | * compatibility_wal_supported (boolean) |
| 11209 | * wal_syncmode (String) |
| 11210 | * |
| 11211 | * @hide |
| 11212 | */ |
| 11213 | public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = |
| 11214 | "sqlite_compatibility_wal_flags"; |
| 11215 | |
| 11216 | /** |
gomo | 48f1a64 | 2017-11-10 20:35:46 -0800 | [diff] [blame] | 11217 | * Enable GNSS Raw Measurements Full Tracking? |
| 11218 | * 0 = no |
| 11219 | * 1 = yes |
| 11220 | * @hide |
| 11221 | */ |
| 11222 | public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = |
| 11223 | "enable_gnss_raw_meas_full_tracking"; |
Christopher Tate | 06efb53 | 2012-08-24 15:29:27 -0700 | [diff] [blame] | 11224 | } |
| 11225 | |
| 11226 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11227 | * User-defined bookmarks and shortcuts. The target of each bookmark is an |
| 11228 | * Intent URL, allowing it to be either a web page or a particular |
| 11229 | * application activity. |
| 11230 | * |
| 11231 | * @hide |
| 11232 | */ |
| 11233 | public static final class Bookmarks implements BaseColumns |
| 11234 | { |
| 11235 | private static final String TAG = "Bookmarks"; |
| 11236 | |
| 11237 | /** |
| 11238 | * The content:// style URL for this table |
| 11239 | */ |
| 11240 | public static final Uri CONTENT_URI = |
| 11241 | Uri.parse("content://" + AUTHORITY + "/bookmarks"); |
| 11242 | |
| 11243 | /** |
| 11244 | * The row ID. |
| 11245 | * <p>Type: INTEGER</p> |
| 11246 | */ |
| 11247 | public static final String ID = "_id"; |
| 11248 | |
| 11249 | /** |
| 11250 | * Descriptive name of the bookmark that can be displayed to the user. |
| 11251 | * If this is empty, the title should be resolved at display time (use |
| 11252 | * {@link #getTitle(Context, Cursor)} any time you want to display the |
| 11253 | * title of a bookmark.) |
| 11254 | * <P> |
| 11255 | * Type: TEXT |
| 11256 | * </P> |
| 11257 | */ |
| 11258 | public static final String TITLE = "title"; |
| 11259 | |
| 11260 | /** |
| 11261 | * Arbitrary string (displayed to the user) that allows bookmarks to be |
| 11262 | * organized into categories. There are some special names for |
| 11263 | * standard folders, which all start with '@'. The label displayed for |
| 11264 | * the folder changes with the locale (via {@link #getLabelForFolder}) but |
| 11265 | * the folder name does not change so you can consistently query for |
| 11266 | * the folder regardless of the current locale. |
| 11267 | * |
| 11268 | * <P>Type: TEXT</P> |
| 11269 | * |
| 11270 | */ |
| 11271 | public static final String FOLDER = "folder"; |
| 11272 | |
| 11273 | /** |
| 11274 | * The Intent URL of the bookmark, describing what it points to. This |
| 11275 | * value is given to {@link android.content.Intent#getIntent} to create |
| 11276 | * an Intent that can be launched. |
| 11277 | * <P>Type: TEXT</P> |
| 11278 | */ |
| 11279 | public static final String INTENT = "intent"; |
| 11280 | |
| 11281 | /** |
| 11282 | * Optional shortcut character associated with this bookmark. |
| 11283 | * <P>Type: INTEGER</P> |
| 11284 | */ |
| 11285 | public static final String SHORTCUT = "shortcut"; |
| 11286 | |
| 11287 | /** |
| 11288 | * The order in which the bookmark should be displayed |
| 11289 | * <P>Type: INTEGER</P> |
| 11290 | */ |
| 11291 | public static final String ORDERING = "ordering"; |
| 11292 | |
| 11293 | private static final String[] sIntentProjection = { INTENT }; |
| 11294 | private static final String[] sShortcutProjection = { ID, SHORTCUT }; |
| 11295 | private static final String sShortcutSelection = SHORTCUT + "=?"; |
| 11296 | |
| 11297 | /** |
| 11298 | * Convenience function to retrieve the bookmarked Intent for a |
| 11299 | * particular shortcut key. |
| 11300 | * |
| 11301 | * @param cr The ContentResolver to query. |
| 11302 | * @param shortcut The shortcut key. |
| 11303 | * |
| 11304 | * @return Intent The bookmarked URL, or null if there is no bookmark |
| 11305 | * matching the given shortcut. |
| 11306 | */ |
| 11307 | public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) |
| 11308 | { |
| 11309 | Intent intent = null; |
| 11310 | |
| 11311 | Cursor c = cr.query(CONTENT_URI, |
| 11312 | sIntentProjection, sShortcutSelection, |
| 11313 | new String[] { String.valueOf((int) shortcut) }, ORDERING); |
| 11314 | // Keep trying until we find a valid shortcut |
| 11315 | try { |
| 11316 | while (intent == null && c.moveToNext()) { |
| 11317 | try { |
| 11318 | String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 11319 | intent = Intent.parseUri(intentURI, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11320 | } catch (java.net.URISyntaxException e) { |
| 11321 | // The stored URL is bad... ignore it. |
| 11322 | } catch (IllegalArgumentException e) { |
| 11323 | // Column not found |
Dianne Hackborn | a33e3f7 | 2009-09-29 17:28:24 -0700 | [diff] [blame] | 11324 | Log.w(TAG, "Intent column not found", e); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11325 | } |
| 11326 | } |
| 11327 | } finally { |
| 11328 | if (c != null) c.close(); |
| 11329 | } |
| 11330 | |
| 11331 | return intent; |
| 11332 | } |
| 11333 | |
| 11334 | /** |
| 11335 | * Add a new bookmark to the system. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11336 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11337 | * @param cr The ContentResolver to query. |
| 11338 | * @param intent The desired target of the bookmark. |
| 11339 | * @param title Bookmark title that is shown to the user; null if none |
| 11340 | * or it should be resolved to the intent's title. |
| 11341 | * @param folder Folder in which to place the bookmark; null if none. |
| 11342 | * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If |
| 11343 | * this is non-zero and there is an existing bookmark entry |
| 11344 | * with this same shortcut, then that existing shortcut is |
| 11345 | * cleared (the bookmark is not removed). |
| 11346 | * @return The unique content URL for the new bookmark entry. |
| 11347 | */ |
| 11348 | public static Uri add(ContentResolver cr, |
| 11349 | Intent intent, |
| 11350 | String title, |
| 11351 | String folder, |
| 11352 | char shortcut, |
| 11353 | int ordering) |
| 11354 | { |
| 11355 | // If a shortcut is supplied, and it is already defined for |
| 11356 | // another bookmark, then remove the old definition. |
| 11357 | if (shortcut != 0) { |
Jeff Hamilton | 7cd51ef | 2010-05-12 17:30:27 -0500 | [diff] [blame] | 11358 | cr.delete(CONTENT_URI, sShortcutSelection, |
| 11359 | new String[] { String.valueOf((int) shortcut) }); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11360 | } |
| 11361 | |
| 11362 | ContentValues values = new ContentValues(); |
| 11363 | if (title != null) values.put(TITLE, title); |
| 11364 | if (folder != null) values.put(FOLDER, folder); |
Jean-Baptiste Queru | 3b9f0a3 | 2010-06-21 13:46:59 -0700 | [diff] [blame] | 11365 | values.put(INTENT, intent.toUri(0)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11366 | if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); |
| 11367 | values.put(ORDERING, ordering); |
| 11368 | return cr.insert(CONTENT_URI, values); |
| 11369 | } |
| 11370 | |
| 11371 | /** |
| 11372 | * Return the folder name as it should be displayed to the user. This |
| 11373 | * takes care of localizing special folders. |
| 11374 | * |
| 11375 | * @param r Resources object for current locale; only need access to |
| 11376 | * system resources. |
| 11377 | * @param folder The value found in the {@link #FOLDER} column. |
| 11378 | * |
| 11379 | * @return CharSequence The label for this folder that should be shown |
| 11380 | * to the user. |
| 11381 | */ |
| 11382 | public static CharSequence getLabelForFolder(Resources r, String folder) { |
| 11383 | return folder; |
| 11384 | } |
| 11385 | |
| 11386 | /** |
| 11387 | * Return the title as it should be displayed to the user. This takes |
| 11388 | * care of localizing bookmarks that point to activities. |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11389 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11390 | * @param context A context. |
| 11391 | * @param cursor A cursor pointing to the row whose title should be |
| 11392 | * returned. The cursor must contain at least the {@link #TITLE} |
| 11393 | * and {@link #INTENT} columns. |
| 11394 | * @return A title that is localized and can be displayed to the user, |
| 11395 | * or the empty string if one could not be found. |
| 11396 | */ |
| 11397 | public static CharSequence getTitle(Context context, Cursor cursor) { |
| 11398 | int titleColumn = cursor.getColumnIndex(TITLE); |
| 11399 | int intentColumn = cursor.getColumnIndex(INTENT); |
| 11400 | if (titleColumn == -1 || intentColumn == -1) { |
| 11401 | throw new IllegalArgumentException( |
| 11402 | "The cursor must contain the TITLE and INTENT columns."); |
| 11403 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11404 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11405 | String title = cursor.getString(titleColumn); |
| 11406 | if (!TextUtils.isEmpty(title)) { |
| 11407 | return title; |
| 11408 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11409 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11410 | String intentUri = cursor.getString(intentColumn); |
| 11411 | if (TextUtils.isEmpty(intentUri)) { |
| 11412 | return ""; |
| 11413 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11414 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11415 | Intent intent; |
| 11416 | try { |
Christian Mehlmauer | a34d2c9 | 2010-05-25 19:04:20 +0200 | [diff] [blame] | 11417 | intent = Intent.parseUri(intentUri, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11418 | } catch (URISyntaxException e) { |
| 11419 | return ""; |
| 11420 | } |
Jaikumar Ganesh | 9bfbfbd | 2009-05-15 12:05:56 -0700 | [diff] [blame] | 11421 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11422 | PackageManager packageManager = context.getPackageManager(); |
| 11423 | ResolveInfo info = packageManager.resolveActivity(intent, 0); |
| 11424 | return info != null ? info.loadLabel(packageManager) : ""; |
| 11425 | } |
| 11426 | } |
| 11427 | |
| 11428 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11429 | * Returns the device ID that we should use when connecting to the mobile gtalk server. |
| 11430 | * This is a string like "android-0x1242", where the hex string is the Android ID obtained |
| 11431 | * from the GoogleLoginService. |
| 11432 | * |
| 11433 | * @param androidId The Android ID for this device. |
| 11434 | * @return The device ID that should be used when connecting to the mobile gtalk server. |
| 11435 | * @hide |
| 11436 | */ |
| 11437 | public static String getGTalkDeviceId(long androidId) { |
| 11438 | return "android-" + Long.toHexString(androidId); |
| 11439 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11440 | |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11441 | private static final String[] PM_WRITE_SETTINGS = { |
| 11442 | android.Manifest.permission.WRITE_SETTINGS |
| 11443 | }; |
| 11444 | private static final String[] PM_CHANGE_NETWORK_STATE = { |
| 11445 | android.Manifest.permission.CHANGE_NETWORK_STATE, |
| 11446 | android.Manifest.permission.WRITE_SETTINGS |
| 11447 | }; |
| 11448 | private static final String[] PM_SYSTEM_ALERT_WINDOW = { |
| 11449 | android.Manifest.permission.SYSTEM_ALERT_WINDOW |
| 11450 | }; |
| 11451 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11452 | /** |
| 11453 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 11454 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 11455 | * privileged/preinstalled apps. If the provided uid does not match the |
| 11456 | * callingPackage, a negative result will be returned. |
| 11457 | * @hide |
| 11458 | */ |
| 11459 | public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, |
| 11460 | String callingPackage, boolean throwException) { |
| 11461 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 11462 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11463 | PM_WRITE_SETTINGS, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11464 | } |
| 11465 | |
| 11466 | /** |
| 11467 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 11468 | * write/modify system settings, as the condition differs for pre-M, M+, and |
| 11469 | * privileged/preinstalled apps. If the provided uid does not match the |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11470 | * 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] | 11471 | * the WRITE_SETTINGS permission declared. |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11472 | * |
| 11473 | * Note: if the check is successful, the operation of this app will be updated to the |
| 11474 | * current time. |
| 11475 | * @hide |
| 11476 | */ |
| 11477 | public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, |
| 11478 | String callingPackage, boolean throwException) { |
| 11479 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 11480 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11481 | PM_WRITE_SETTINGS, true); |
| 11482 | } |
| 11483 | |
| 11484 | /** |
| 11485 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 11486 | * 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] | 11487 | * privileged/preinstalled apps. The caller is expected to have either the |
| 11488 | * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these |
| 11489 | * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and |
| 11490 | * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal |
| 11491 | * permission and cannot be revoked. See http://b/23597341 |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11492 | * |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 11493 | * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation |
| 11494 | * of this app will be updated to the current time. |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11495 | * @hide |
| 11496 | */ |
| 11497 | public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, |
| 11498 | String callingPackage, boolean throwException) { |
Lorenzo Colitti | d542705 | 2015-10-15 16:29:00 +0900 | [diff] [blame] | 11499 | if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) |
| 11500 | == PackageManager.PERMISSION_GRANTED) { |
| 11501 | return true; |
| 11502 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11503 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 11504 | callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, |
| 11505 | PM_CHANGE_NETWORK_STATE, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11506 | } |
| 11507 | |
| 11508 | /** |
| 11509 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 11510 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 11511 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 11512 | * a negative result will be returned. |
| 11513 | * @hide |
| 11514 | */ |
| 11515 | public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, |
| 11516 | String callingPackage, boolean throwException) { |
| 11517 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 11518 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11519 | PM_SYSTEM_ALERT_WINDOW, false); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11520 | } |
| 11521 | |
| 11522 | /** |
| 11523 | * Performs a strict and comprehensive check of whether a calling package is allowed to |
| 11524 | * draw on top of other apps, as the conditions differs for pre-M, M+, and |
| 11525 | * privileged/preinstalled apps. If the provided uid does not match the callingPackage, |
| 11526 | * a negative result will be returned. |
| 11527 | * |
| 11528 | * Note: if the check is successful, the operation of this app will be updated to the |
| 11529 | * current time. |
| 11530 | * @hide |
| 11531 | */ |
| 11532 | public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String |
| 11533 | callingPackage, boolean throwException) { |
| 11534 | return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, |
| 11535 | callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11536 | PM_SYSTEM_ALERT_WINDOW, true); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11537 | } |
| 11538 | |
| 11539 | /** |
| 11540 | * Helper method to perform a general and comprehensive check of whether an operation that is |
| 11541 | * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and |
| 11542 | * OP_WRITE_SETTINGS |
| 11543 | * @hide |
| 11544 | */ |
| 11545 | public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11546 | int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] |
| 11547 | permissions, boolean makeNote) { |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11548 | if (callingPackage == null) { |
| 11549 | return false; |
| 11550 | } |
| 11551 | |
| 11552 | AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); |
| 11553 | int mode = AppOpsManager.MODE_DEFAULT; |
| 11554 | if (makeNote) { |
| 11555 | mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 11556 | } else { |
| 11557 | mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); |
| 11558 | } |
| 11559 | |
| 11560 | switch (mode) { |
| 11561 | case AppOpsManager.MODE_ALLOWED: |
| 11562 | return true; |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11563 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11564 | case AppOpsManager.MODE_DEFAULT: |
| 11565 | // this is the default operating mode after an app's installation |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11566 | // In this case we will check all associated static permission to see |
| 11567 | // if it is granted during install time. |
| 11568 | for (String permission : permissions) { |
| 11569 | if (context.checkCallingOrSelfPermission(permission) == PackageManager |
| 11570 | .PERMISSION_GRANTED) { |
| 11571 | // if either of the permissions are granted, we will allow it |
| 11572 | return true; |
| 11573 | } |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11574 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11575 | |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11576 | default: |
| 11577 | // this is for all other cases trickled down here... |
| 11578 | if (!throwException) { |
| 11579 | return false; |
| 11580 | } |
| 11581 | } |
Billy Lau | a7238a3 | 2015-08-01 12:45:02 +0100 | [diff] [blame] | 11582 | |
| 11583 | // prepare string to throw SecurityException |
| 11584 | StringBuilder exceptionMessage = new StringBuilder(); |
| 11585 | exceptionMessage.append(callingPackage); |
| 11586 | exceptionMessage.append(" was not granted "); |
| 11587 | if (permissions.length > 1) { |
| 11588 | exceptionMessage.append(" either of these permissions: "); |
| 11589 | } else { |
| 11590 | exceptionMessage.append(" this permission: "); |
| 11591 | } |
| 11592 | for (int i = 0; i < permissions.length; i++) { |
| 11593 | exceptionMessage.append(permissions[i]); |
| 11594 | exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); |
| 11595 | } |
| 11596 | |
| 11597 | throw new SecurityException(exceptionMessage.toString()); |
Billy Lau | 6ad2d66 | 2015-07-18 00:26:58 +0100 | [diff] [blame] | 11598 | } |
| 11599 | |
| 11600 | /** |
| 11601 | * Retrieves a correponding package name for a given uid. It will query all |
| 11602 | * packages that are associated with the given uid, but it will return only |
| 11603 | * the zeroth result. |
| 11604 | * Note: If package could not be found, a null is returned. |
| 11605 | * @hide |
| 11606 | */ |
| 11607 | public static String getPackageNameForUid(Context context, int uid) { |
| 11608 | String[] packages = context.getPackageManager().getPackagesForUid(uid); |
| 11609 | if (packages == null) { |
| 11610 | return null; |
| 11611 | } |
| 11612 | return packages[0]; |
| 11613 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 11614 | } |