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 19 import android.Manifest; 20 import android.annotation.IntDef; 21 import android.annotation.IntRange; 22 import android.annotation.NonNull; 23 import android.annotation.Nullable; 24 import android.annotation.RequiresPermission; 25 import android.annotation.SdkConstant; 26 import android.annotation.SdkConstant.SdkConstantType; 27 import android.annotation.SuppressLint; 28 import android.annotation.SystemApi; 29 import android.annotation.TestApi; 30 import android.annotation.UserIdInt; 31 import android.app.ActivityThread; 32 import android.app.AppOpsManager; 33 import android.app.Application; 34 import android.app.AutomaticZenRule; 35 import android.app.NotificationChannel; 36 import android.app.NotificationManager; 37 import android.app.SearchManager; 38 import android.app.WallpaperManager; 39 import android.compat.annotation.UnsupportedAppUsage; 40 import android.content.ComponentName; 41 import android.content.ContentResolver; 42 import android.content.ContentValues; 43 import android.content.Context; 44 import android.content.IContentProvider; 45 import android.content.Intent; 46 import android.content.pm.ActivityInfo; 47 import android.content.pm.PackageManager; 48 import android.content.pm.ResolveInfo; 49 import android.content.res.Configuration; 50 import android.content.res.Resources; 51 import android.database.Cursor; 52 import android.database.SQLException; 53 import android.location.LocationManager; 54 import android.net.ConnectivityManager; 55 import android.net.NetworkScoreManager; 56 import android.net.Uri; 57 import android.net.wifi.SoftApConfiguration; 58 import android.net.wifi.WifiManager; 59 import android.net.wifi.p2p.WifiP2pManager; 60 import android.os.BatteryManager; 61 import android.os.Binder; 62 import android.os.Build.VERSION_CODES; 63 import android.os.Bundle; 64 import android.os.DropBoxManager; 65 import android.os.IBinder; 66 import android.os.LocaleList; 67 import android.os.PowerManager.AutoPowerSaveModeTriggers; 68 import android.os.Process; 69 import android.os.RemoteCallback; 70 import android.os.RemoteException; 71 import android.os.ResultReceiver; 72 import android.os.ServiceManager; 73 import android.os.UserHandle; 74 import android.speech.tts.TextToSpeech; 75 import android.text.TextUtils; 76 import android.util.AndroidException; 77 import android.util.ArrayMap; 78 import android.util.ArraySet; 79 import android.util.Log; 80 import android.util.MemoryIntArray; 81 import android.view.Display; 82 83 import com.android.internal.annotations.GuardedBy; 84 import com.android.internal.util.Preconditions; 85 import com.android.internal.widget.ILockSettings; 86 87 import java.io.IOException; 88 import java.lang.annotation.Retention; 89 import java.lang.annotation.RetentionPolicy; 90 import java.net.URISyntaxException; 91 import java.util.ArrayList; 92 import java.util.HashMap; 93 import java.util.HashSet; 94 import java.util.List; 95 import java.util.Map; 96 import java.util.Set; 97 98 /** 99 * The Settings provider contains global system-level device preferences. 100 */ 101 public final class Settings { 102 /** @hide */ 103 public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false; 104 105 // Intent actions for Settings 106 107 /** 108 * Activity Action: Show system settings. 109 * <p> 110 * Input: Nothing. 111 * <p> 112 * Output: Nothing. 113 */ 114 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 115 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 116 117 /** 118 * Activity Action: Show settings to allow configuration of APNs. 119 * <p> 120 * Input: Nothing. 121 * <p> 122 * Output: Nothing. 123 * 124 * <p class="note"> 125 * In some cases, a matching Activity may not exist, so ensure you 126 * safeguard against this. 127 */ 128 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 129 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 130 131 /** 132 * Activity Action: Show settings to allow configuration of current location 133 * sources. 134 * <p> 135 * In some cases, a matching Activity may not exist, so ensure you 136 * safeguard against this. 137 * <p> 138 * Input: Nothing. 139 * <p> 140 * Output: Nothing. 141 */ 142 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 143 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 144 "android.settings.LOCATION_SOURCE_SETTINGS"; 145 146 /** 147 * Activity Action: Show settings to allow configuration of location controller extra package. 148 * <p> 149 * In some cases, a matching Activity may not exist, so ensure you 150 * safeguard against this. 151 * <p> 152 * Input: Nothing. 153 * <p> 154 * Output: Nothing. 155 * 156 * @hide 157 */ 158 @SystemApi 159 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 160 public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = 161 "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS"; 162 163 /** 164 * Activity Action: Show scanning settings to allow configuration of Wi-Fi 165 * and Bluetooth scanning settings. 166 * <p> 167 * In some cases, a matching Activity may not exist, so ensure you 168 * safeguard against this. 169 * <p> 170 * Input: Nothing. 171 * <p> 172 * Output: Nothing. 173 * @hide 174 */ 175 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 176 public static final String ACTION_LOCATION_SCANNING_SETTINGS = 177 "android.settings.LOCATION_SCANNING_SETTINGS"; 178 179 /** 180 * Activity Action: Show settings to allow configuration of users. 181 * <p> 182 * In some cases, a matching Activity may not exist, so ensure you 183 * safeguard against this. 184 * <p> 185 * Input: Nothing. 186 * <p> 187 * Output: Nothing. 188 * @hide 189 */ 190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 191 public static final String ACTION_USER_SETTINGS = 192 "android.settings.USER_SETTINGS"; 193 194 /** 195 * Activity Action: Show settings to allow configuration of wireless controls 196 * such as Wi-Fi, Bluetooth and Mobile networks. 197 * <p> 198 * In some cases, a matching Activity may not exist, so ensure you 199 * safeguard against this. 200 * <p> 201 * Input: Nothing. 202 * <p> 203 * Output: Nothing. 204 */ 205 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 206 public static final String ACTION_WIRELESS_SETTINGS = 207 "android.settings.WIRELESS_SETTINGS"; 208 209 /** 210 * Activity Action: Show tether provisioning activity. 211 * 212 * <p> 213 * In some cases, a matching Activity may not exist, so ensure you 214 * safeguard against this. 215 * <p> 216 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type 217 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should 218 * contain a {@link ResultReceiver} which will be called back with a tether result code. 219 * <p> 220 * Output: The result of the provisioning check. 221 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, 222 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. 223 * 224 * @hide 225 */ 226 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 227 @SystemApi 228 @TestApi 229 public static final String ACTION_TETHER_PROVISIONING_UI = 230 "android.settings.TETHER_PROVISIONING_UI"; 231 232 /** 233 * Activity Action: Show settings to allow entering/exiting airplane mode. 234 * <p> 235 * In some cases, a matching Activity may not exist, so ensure you 236 * safeguard against this. 237 * <p> 238 * Input: Nothing. 239 * <p> 240 * Output: Nothing. 241 */ 242 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 243 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 244 "android.settings.AIRPLANE_MODE_SETTINGS"; 245 246 /** 247 * Activity Action: Show mobile data usage list. 248 * <p> 249 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify 250 * how and what mobile data statistics should be collected. 251 * <p> 252 * Output: Nothing 253 * @hide 254 */ 255 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 256 public static final String ACTION_MOBILE_DATA_USAGE = 257 "android.settings.MOBILE_DATA_USAGE"; 258 259 /** @hide */ 260 public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; 261 262 /** @hide */ 263 public static final String KEY_CONFIG_SET_RETURN = "config_set_return"; 264 265 /** 266 * An int extra specifying a subscription ID. 267 * 268 * @see android.telephony.SubscriptionInfo#getSubscriptionId 269 */ 270 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; 271 272 /** 273 * Activity Action: Modify Airplane mode settings using a voice command. 274 * <p> 275 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 276 * <p> 277 * This intent MUST be started using 278 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 279 * startVoiceActivity}. 280 * <p> 281 * Note: The activity implementing this intent MUST verify that 282 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 283 * modifying the setting. 284 * <p> 285 * Input: To tell which state airplane mode should be set to, add the 286 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. 287 * If the extra is not included, no changes will be made. 288 * <p> 289 * Output: Nothing. 290 */ 291 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 292 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = 293 "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; 294 295 /** 296 * Activity Action: Show settings for accessibility modules. 297 * <p> 298 * In some cases, a matching Activity may not exist, so ensure you 299 * safeguard against this. 300 * <p> 301 * Input: Nothing. 302 * <p> 303 * Output: Nothing. 304 */ 305 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 306 public static final String ACTION_ACCESSIBILITY_SETTINGS = 307 "android.settings.ACCESSIBILITY_SETTINGS"; 308 309 /** 310 * Activity Action: Show detail settings of a particular accessibility service. 311 * <p> 312 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 313 * <p> 314 * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component 315 * name to be shown. 316 * <p> 317 * Output: Nothing. 318 * @hide 319 **/ 320 @SystemApi 321 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 322 public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = 323 "android.settings.ACCESSIBILITY_DETAILS_SETTINGS"; 324 325 /** 326 * Activity Action: Show settings to control access to usage information. 327 * <p> 328 * In some cases, a matching Activity may not exist, so ensure you 329 * safeguard against this. 330 * <p> 331 * Input: Nothing. 332 * <p> 333 * Output: Nothing. 334 */ 335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 336 public static final String ACTION_USAGE_ACCESS_SETTINGS = 337 "android.settings.USAGE_ACCESS_SETTINGS"; 338 339 /** 340 * Activity Category: Show application settings related to usage access. 341 * <p> 342 * An activity that provides a user interface for adjusting usage access related 343 * preferences for its containing application. Optional but recommended for apps that 344 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. 345 * <p> 346 * The activity may define meta-data to describe what usage access is 347 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which 348 * will be displayed in Settings. 349 * <p> 350 * Input: Nothing. 351 * <p> 352 * Output: Nothing. 353 */ 354 @SdkConstant(SdkConstantType.INTENT_CATEGORY) 355 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = 356 "android.intent.category.USAGE_ACCESS_CONFIG"; 357 358 /** 359 * Metadata key: Reason for needing usage access. 360 * <p> 361 * A key for metadata attached to an activity that receives action 362 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the 363 * user as description of how the app uses usage access. 364 * <p> 365 */ 366 public static final String METADATA_USAGE_ACCESS_REASON = 367 "android.settings.metadata.USAGE_ACCESS_REASON"; 368 369 /** 370 * Activity Action: Show settings to allow configuration of security and 371 * location privacy. 372 * <p> 373 * In some cases, a matching Activity may not exist, so ensure you 374 * safeguard against this. 375 * <p> 376 * Input: Nothing. 377 * <p> 378 * Output: Nothing. 379 */ 380 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 381 public static final String ACTION_SECURITY_SETTINGS = 382 "android.settings.SECURITY_SETTINGS"; 383 384 /** 385 * Activity Action: Show settings to allow configuration of trusted external sources 386 * 387 * Input: Optionally, the Intent's data URI can specify the application package name to 388 * directly invoke the management GUI specific to the package name. For example 389 * "package:com.my.app". 390 * <p> 391 * Output: Nothing. 392 */ 393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 394 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = 395 "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; 396 397 /** 398 * Activity Action: Show settings to allow configuration of cross-profile access for apps 399 * 400 * Input: Optionally, the Intent's data URI can specify the application package name to 401 * directly invoke the management GUI specific to the package name. For example 402 * "package:com.my.app". 403 * <p> 404 * Output: Nothing. 405 * 406 * @hide 407 */ 408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 409 public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS = 410 "android.settings.MANAGE_CROSS_PROFILE_ACCESS"; 411 412 /** 413 * Activity Action: Show the "Open by Default" page in a particular application's details page. 414 * <p> 415 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 416 * <p> 417 * Input: The Intent's data URI specifies the application package name 418 * to be shown, with the "package" scheme. That is "package:com.my.app". 419 * <p> 420 * Output: Nothing. 421 * @hide 422 */ 423 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 424 public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS = 425 "com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS"; 426 427 /** 428 * Activity Action: Show trusted credentials settings, opening to the user tab, 429 * to allow management of installed credentials. 430 * <p> 431 * In some cases, a matching Activity may not exist, so ensure you 432 * safeguard against this. 433 * <p> 434 * Input: Nothing. 435 * <p> 436 * Output: Nothing. 437 * @hide 438 */ 439 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 440 @UnsupportedAppUsage 441 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 442 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 443 444 /** 445 * Activity Action: Show dialog explaining that an installed CA cert may enable 446 * monitoring of encrypted network traffic. 447 * <p> 448 * In some cases, a matching Activity may not exist, so ensure you 449 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the 450 * number of certificates. 451 * <p> 452 * Input: Nothing. 453 * <p> 454 * Output: Nothing. 455 * @hide 456 */ 457 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 458 public static final String ACTION_MONITORING_CERT_INFO = 459 "com.android.settings.MONITORING_CERT_INFO"; 460 461 /** 462 * Activity Action: Show settings to allow configuration of privacy options. 463 * <p> 464 * In some cases, a matching Activity may not exist, so ensure you 465 * safeguard against this. 466 * <p> 467 * Input: Nothing. 468 * <p> 469 * Output: Nothing. 470 */ 471 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 472 public static final String ACTION_PRIVACY_SETTINGS = 473 "android.settings.PRIVACY_SETTINGS"; 474 475 /** 476 * Activity Action: Show settings to allow configuration of VPN. 477 * <p> 478 * In some cases, a matching Activity may not exist, so ensure you 479 * safeguard against this. 480 * <p> 481 * Input: Nothing. 482 * <p> 483 * Output: Nothing. 484 */ 485 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 486 public static final String ACTION_VPN_SETTINGS = 487 "android.settings.VPN_SETTINGS"; 488 489 /** 490 * Activity Action: Show settings to allow configuration of Wi-Fi. 491 * <p> 492 * In some cases, a matching Activity may not exist, so ensure you 493 * safeguard against this. 494 * <p> 495 * Input: Nothing. 496 * <p> 497 * Output: Nothing. 498 */ 499 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 500 public static final String ACTION_WIFI_SETTINGS = 501 "android.settings.WIFI_SETTINGS"; 502 503 /** 504 * Activity Action: Show settings to allow configuration of a static IP 505 * address for Wi-Fi. 506 * <p> 507 * In some cases, a matching Activity may not exist, so ensure you safeguard 508 * against this. 509 * <p> 510 * Input: Nothing. 511 * <p> 512 * Output: Nothing. 513 */ 514 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 515 public static final String ACTION_WIFI_IP_SETTINGS = 516 "android.settings.WIFI_IP_SETTINGS"; 517 518 /** 519 * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start 520 * configuration. This intent should be used when you want to use this device to take on the 521 * configurator role for an IoT/other device. When provided with a valid DPP URI 522 * string, Settings will open a Wi-Fi selection screen for the user to indicate which network 523 * they would like to configure the device specified in the DPP URI string and 524 * carry them through the rest of the flow for provisioning the device. 525 * <p> 526 * In some cases, a matching Activity may not exist, so ensure to safeguard against this by 527 * checking {@link WifiManager#isEasyConnectSupported()}. 528 * <p> 529 * Input: The Intent's data URI specifies bootstrapping information for authenticating and 530 * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent 531 * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any 532 * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also 533 * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information 534 * about the bands supported by the enrollee device. 535 * <p> 536 * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback 537 * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if 538 * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or 539 * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the 540 * 'Cancel' button. In case the operation has failed, a status code from 541 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will 542 * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2 543 * Enrollees report additional details about the error they encountered, which will be 544 * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID}, 545 * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}. 546 */ 547 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 548 public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI = 549 "android.settings.PROCESS_WIFI_EASY_CONNECT_URI"; 550 551 /** 552 * Activity Extra: The Easy Connect operation error code 553 * <p> 554 * An extra returned on the result intent received when using the 555 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. 556 * This extra contains the integer error code of the operation - one of 557 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If 558 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, 559 * then this extra is not attached to the result intent. 560 * <p> 561 * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and 562 * {@link Intent#getIntExtra(String, int)} to obtain the error code data. 563 */ 564 public static final String EXTRA_EASY_CONNECT_ERROR_CODE = 565 "android.provider.extra.EASY_CONNECT_ERROR_CODE"; 566 567 /** 568 * Activity Extra: The SSID that the Enrollee tried to connect to. 569 * <p> 570 * An extra returned on the result intent received when using the {@link 571 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 572 * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to. 573 * This value is populated only by remote R2 devices, and only for the following error codes: 574 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK} 575 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}. 576 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 577 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 578 * this extra is not attached to the result intent. 579 * <p> 580 * Use the {@link Intent#getStringExtra(String)} to obtain the SSID. 581 */ 582 public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID = 583 "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID"; 584 585 /** 586 * Activity Extra: The Channel List that the Enrollee used to scan a network. 587 * <p> 588 * An extra returned on the result intent received when using the {@link 589 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 590 * extra contains the channel list that the Enrollee scanned for a network. This value is 591 * populated only by remote R2 devices, and only for the following error code: {@link 592 * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}. 593 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 594 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 595 * this extra is not attached to the result intent. The list is JSON formatted, as an array 596 * (Wi-Fi global operating classes) of arrays (Wi-Fi channels). 597 * <p> 598 * Use the {@link Intent#getStringExtra(String)} to obtain the list. 599 */ 600 public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST = 601 "android.provider.extra.EASY_CONNECT_CHANNEL_LIST"; 602 603 /** 604 * Activity Extra: The Band List that the Enrollee supports. 605 * <p> 606 * This extra contains the bands the Enrollee supports, expressed as the Global Operating 607 * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as 608 * input, to configure the Easy Connect operation and as output of the operation. 609 * <p> 610 * As input: an optional extra to be attached to the 611 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which 612 * the remote device (enrollee, device-to-be-configured) supports. The Settings operation 613 * may take this into account when presenting the user with list of networks configurations 614 * to be used. The calling app may obtain this information in any out-of-band method. The 615 * information should be attached as an array of raw integers - using the 616 * {@link Intent#putExtra(String, int[])}. 617 * <p> 618 * As output: an extra returned on the result intent received when using the 619 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation 620 * . This value is populated only by remote R2 devices, and only for the following error 621 * codes: 622 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}, 623 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}, 624 * or 625 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}. 626 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. 627 * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK} 628 * , then this extra is not attached to the result intent. 629 * <p> 630 * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list. 631 */ 632 public static final String EXTRA_EASY_CONNECT_BAND_LIST = 633 "android.provider.extra.EASY_CONNECT_BAND_LIST"; 634 635 /** 636 * Activity Action: Show settings to allow configuration of data and view data usage. 637 * <p> 638 * In some cases, a matching Activity may not exist, so ensure you 639 * safeguard against this. 640 * <p> 641 * Input: Nothing. 642 * <p> 643 * Output: Nothing. 644 */ 645 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 646 public static final String ACTION_DATA_USAGE_SETTINGS = 647 "android.settings.DATA_USAGE_SETTINGS"; 648 649 /** 650 * Activity Action: Show settings to allow configuration of Bluetooth. 651 * <p> 652 * In some cases, a matching Activity may not exist, so ensure you 653 * safeguard against this. 654 * <p> 655 * Input: Nothing. 656 * <p> 657 * Output: Nothing. 658 */ 659 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 660 public static final String ACTION_BLUETOOTH_SETTINGS = 661 "android.settings.BLUETOOTH_SETTINGS"; 662 663 /** 664 * Activity action: Show Settings app search UI when this action is available for device. 665 * <p> 666 * Input: Nothing. 667 * <p> 668 * Output: Nothing. 669 */ 670 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 671 public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS"; 672 673 /** 674 * Activity Action: Show settings to allow configuration of Assist Gesture. 675 * <p> 676 * In some cases, a matching Activity may not exist, so ensure you 677 * safeguard against this. 678 * <p> 679 * Input: Nothing. 680 * <p> 681 * Output: Nothing. 682 * @hide 683 */ 684 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 685 public static final String ACTION_ASSIST_GESTURE_SETTINGS = 686 "android.settings.ASSIST_GESTURE_SETTINGS"; 687 688 /** 689 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if 690 * necessary. 691 * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}. 692 * <p> 693 * Input: Nothing. 694 * <p> 695 * Output: Nothing. 696 */ 697 @Deprecated 698 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 699 public static final String ACTION_FINGERPRINT_ENROLL = 700 "android.settings.FINGERPRINT_ENROLL"; 701 702 /** 703 * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if 704 * necessary. By default, this prompts the user to enroll biometrics with strength 705 * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined 706 * in the CDD are allowed to participate in Keystore operations. 707 * <p> 708 * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with 709 * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators}, 710 * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}. 711 * If not specified, the default behavior is 712 * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}. 713 * <p> 714 * Output: Nothing. Note that callers should still check 715 * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)} 716 * afterwards to ensure that the user actually completed enrollment. 717 */ 718 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 719 public static final String ACTION_BIOMETRIC_ENROLL = 720 "android.settings.BIOMETRIC_ENROLL"; 721 722 /** 723 * Activity Extra: The minimum strength to request enrollment for. 724 * <p> 725 * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to 726 * indicate that only enrollment for sensors that meet these requirements should be shown. The 727 * value should be a combination of the constants defined in 728 * {@link android.hardware.biometrics.BiometricManager.Authenticators}. 729 */ 730 public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED = 731 "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED"; 732 733 /** 734 * Activity Action: Show settings to allow configuration of cast endpoints. 735 * <p> 736 * In some cases, a matching Activity may not exist, so ensure you 737 * safeguard against this. 738 * <p> 739 * Input: Nothing. 740 * <p> 741 * Output: Nothing. 742 */ 743 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 744 public static final String ACTION_CAST_SETTINGS = 745 "android.settings.CAST_SETTINGS"; 746 747 /** 748 * Activity Action: Show settings to allow configuration of date and time. 749 * <p> 750 * In some cases, a matching Activity may not exist, so ensure you 751 * safeguard against this. 752 * <p> 753 * Input: Nothing. 754 * <p> 755 * Output: Nothing. 756 */ 757 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 758 public static final String ACTION_DATE_SETTINGS = 759 "android.settings.DATE_SETTINGS"; 760 761 /** 762 * Activity Action: Show settings to allow configuration of sound and volume. 763 * <p> 764 * In some cases, a matching Activity may not exist, so ensure you 765 * safeguard against this. 766 * <p> 767 * Input: Nothing. 768 * <p> 769 * Output: Nothing. 770 */ 771 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 772 public static final String ACTION_SOUND_SETTINGS = 773 "android.settings.SOUND_SETTINGS"; 774 775 /** 776 * Activity Action: Show settings to allow configuration of display. 777 * <p> 778 * In some cases, a matching Activity may not exist, so ensure you 779 * safeguard against this. 780 * <p> 781 * Input: Nothing. 782 * <p> 783 * Output: Nothing. 784 */ 785 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 786 public static final String ACTION_DISPLAY_SETTINGS = 787 "android.settings.DISPLAY_SETTINGS"; 788 789 /** 790 * Activity Action: Show settings to allow configuration of Night display. 791 * <p> 792 * In some cases, a matching Activity may not exist, so ensure you 793 * safeguard against this. 794 * <p> 795 * Input: Nothing. 796 * <p> 797 * Output: Nothing. 798 */ 799 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 800 public static final String ACTION_NIGHT_DISPLAY_SETTINGS = 801 "android.settings.NIGHT_DISPLAY_SETTINGS"; 802 803 /** 804 * Activity Action: Show settings to allow configuration of Dark theme. 805 * <p> 806 * In some cases, a matching Activity may not exist, so ensure you 807 * safeguard against this. 808 * <p> 809 * Input: Nothing. 810 * <p> 811 * Output: Nothing. 812 * 813 * @hide 814 */ 815 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 816 public static final String ACTION_DARK_THEME_SETTINGS = 817 "android.settings.DARK_THEME_SETTINGS"; 818 819 /** 820 * Activity Action: Show settings to allow configuration of locale. 821 * <p> 822 * In some cases, a matching Activity may not exist, so ensure you 823 * safeguard against this. 824 * <p> 825 * Input: Nothing. 826 * <p> 827 * Output: Nothing. 828 */ 829 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 830 public static final String ACTION_LOCALE_SETTINGS = 831 "android.settings.LOCALE_SETTINGS"; 832 833 /** 834 * Activity Action: Show settings to configure input methods, in particular 835 * allowing the user to enable input methods. 836 * <p> 837 * In some cases, a matching Activity may not exist, so ensure you 838 * safeguard against this. 839 * <p> 840 * Input: Nothing. 841 * <p> 842 * Output: Nothing. 843 */ 844 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 845 public static final String ACTION_VOICE_INPUT_SETTINGS = 846 "android.settings.VOICE_INPUT_SETTINGS"; 847 848 /** 849 * Activity Action: Show settings to configure input methods, in particular 850 * allowing the user to enable input methods. 851 * <p> 852 * In some cases, a matching Activity may not exist, so ensure you 853 * safeguard against this. 854 * <p> 855 * Input: Nothing. 856 * <p> 857 * Output: Nothing. 858 */ 859 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 860 public static final String ACTION_INPUT_METHOD_SETTINGS = 861 "android.settings.INPUT_METHOD_SETTINGS"; 862 863 /** 864 * Activity Action: Show settings to enable/disable input method subtypes. 865 * <p> 866 * In some cases, a matching Activity may not exist, so ensure you 867 * safeguard against this. 868 * <p> 869 * To tell which input method's subtypes are displayed in the settings, add 870 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 871 * If there is no extra in this Intent, subtypes from all installed input methods 872 * will be displayed in the settings. 873 * 874 * @see android.view.inputmethod.InputMethodInfo#getId 875 * <p> 876 * Input: Nothing. 877 * <p> 878 * Output: Nothing. 879 */ 880 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 881 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 882 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 883 884 /** 885 * Activity Action: Show settings to manage the user input dictionary. 886 * <p> 887 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 888 * it is guaranteed there will always be an appropriate implementation for this Intent action. 889 * In prior releases of the platform this was optional, so ensure you safeguard against it. 890 * <p> 891 * Input: Nothing. 892 * <p> 893 * Output: Nothing. 894 */ 895 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 896 public static final String ACTION_USER_DICTIONARY_SETTINGS = 897 "android.settings.USER_DICTIONARY_SETTINGS"; 898 899 /** 900 * Activity Action: Show settings to configure the hardware keyboard. 901 * <p> 902 * In some cases, a matching Activity may not exist, so ensure you 903 * safeguard against this. 904 * <p> 905 * Input: Nothing. 906 * <p> 907 * Output: Nothing. 908 */ 909 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 910 public static final String ACTION_HARD_KEYBOARD_SETTINGS = 911 "android.settings.HARD_KEYBOARD_SETTINGS"; 912 913 /** 914 * Activity Action: Adds a word to the user dictionary. 915 * <p> 916 * In some cases, a matching Activity may not exist, so ensure you 917 * safeguard against this. 918 * <p> 919 * Input: An extra with key <code>word</code> that contains the word 920 * that should be added to the dictionary. 921 * <p> 922 * Output: Nothing. 923 * 924 * @hide 925 */ 926 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 927 @UnsupportedAppUsage 928 public static final String ACTION_USER_DICTIONARY_INSERT = 929 "com.android.settings.USER_DICTIONARY_INSERT"; 930 931 /** 932 * Activity Action: Show settings to allow configuration of application-related settings. 933 * <p> 934 * In some cases, a matching Activity may not exist, so ensure you 935 * safeguard against this. 936 * <p> 937 * Input: Nothing. 938 * <p> 939 * Output: Nothing. 940 */ 941 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 942 public static final String ACTION_APPLICATION_SETTINGS = 943 "android.settings.APPLICATION_SETTINGS"; 944 945 /** 946 * Activity Action: Show settings to allow configuration of application 947 * development-related settings. As of 948 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 949 * a required part of the platform. 950 * <p> 951 * Input: Nothing. 952 * <p> 953 * Output: Nothing. 954 */ 955 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 956 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 957 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 958 959 /** 960 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 961 * <p> 962 * In some cases, a matching Activity may not exist, so ensure you 963 * safeguard against this. 964 * <p> 965 * Input: Nothing. 966 * <p> 967 * Output: Nothing. 968 */ 969 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 970 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 971 "android.settings.QUICK_LAUNCH_SETTINGS"; 972 973 /** 974 * Activity Action: Show settings to manage installed applications. 975 * <p> 976 * In some cases, a matching Activity may not exist, so ensure you 977 * safeguard against this. 978 * <p> 979 * Input: Nothing. 980 * <p> 981 * Output: Nothing. 982 */ 983 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 984 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 985 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 986 987 /** 988 * Activity Action: Show settings to manage all applications. 989 * <p> 990 * In some cases, a matching Activity may not exist, so ensure you 991 * safeguard against this. 992 * <p> 993 * Input: Nothing. 994 * <p> 995 * Output: Nothing. 996 */ 997 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 998 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 999 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 1000 1001 /** 1002 * Activity Action: Show screen for controlling which apps can draw on top of other apps. 1003 * <p> 1004 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1005 * <p> 1006 * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R}, 1007 * the Intent's data URI can specify the application package name to directly invoke the 1008 * management GUI specific to the package name. 1009 * For example "package:com.my.app". 1010 * <p> 1011 * Output: Nothing. 1012 */ 1013 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1014 public static final String ACTION_MANAGE_OVERLAY_PERMISSION = 1015 "android.settings.action.MANAGE_OVERLAY_PERMISSION"; 1016 1017 /** 1018 * Activity Action: Show screen for controlling if the app specified in the data URI of the 1019 * intent can draw on top of other apps. 1020 * <p> 1021 * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link 1022 * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package, 1023 * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity 1024 * with this intent. 1025 * <p> 1026 * In some cases, a matching Activity may not exist, so ensure you 1027 * safeguard against this. 1028 * <p> 1029 * Input: The Intent's data URI MUST specify the application package name whose ability of 1030 * drawing on top of other apps you want to control. 1031 * For example "package:com.my.app". 1032 * <p> 1033 * Output: Nothing. 1034 * 1035 * @hide 1036 */ 1037 @TestApi 1038 @SystemApi 1039 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1040 public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = 1041 "android.settings.MANAGE_APP_OVERLAY_PERMISSION"; 1042 1043 /** 1044 * Activity Action: Show screen for controlling which apps are allowed to write/modify 1045 * system settings. 1046 * <p> 1047 * In some cases, a matching Activity may not exist, so ensure you 1048 * safeguard against this. 1049 * <p> 1050 * Input: Optionally, the Intent's data URI can specify the application package name to 1051 * directly invoke the management GUI specific to the package name. For example 1052 * "package:com.my.app". 1053 * <p> 1054 * Output: Nothing. 1055 */ 1056 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1057 public static final String ACTION_MANAGE_WRITE_SETTINGS = 1058 "android.settings.action.MANAGE_WRITE_SETTINGS"; 1059 1060 /** 1061 * Activity Action: Show screen for controlling app usage properties for an app. 1062 * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the 1063 * application package name. 1064 * Output: Nothing. 1065 */ 1066 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1067 public static final String ACTION_APP_USAGE_SETTINGS = 1068 "android.settings.action.APP_USAGE_SETTINGS"; 1069 1070 /** 1071 * Activity Action: Show screen of details about a particular application. 1072 * <p> 1073 * In some cases, a matching Activity may not exist, so ensure you 1074 * safeguard against this. 1075 * <p> 1076 * Input: The Intent's data URI specifies the application package name 1077 * to be shown, with the "package" scheme. That is "package:com.my.app". 1078 * <p> 1079 * Output: Nothing. 1080 */ 1081 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1082 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 1083 "android.settings.APPLICATION_DETAILS_SETTINGS"; 1084 1085 /** 1086 * Activity Action: Show list of applications that have been running 1087 * foreground services (to the user "running in the background"). 1088 * <p> 1089 * Input: Extras "packages" is a string array of package names. 1090 * <p> 1091 * Output: Nothing. 1092 * @hide 1093 */ 1094 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1095 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = 1096 "android.settings.FOREGROUND_SERVICES_SETTINGS"; 1097 1098 /** 1099 * Activity Action: Show screen for controlling which apps can ignore battery optimizations. 1100 * <p> 1101 * Input: Nothing. 1102 * <p> 1103 * Output: Nothing. 1104 * <p> 1105 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1106 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1107 * already ignoring optimizations. You can use 1108 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you 1109 * on this list. 1110 */ 1111 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1112 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 1113 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; 1114 1115 /** 1116 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, 1117 * put them on the whitelist of apps shown by 1118 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also 1119 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} 1120 * permission. 1121 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities 1122 * provided by the platform for applications to operate correctly in the various power 1123 * saving modes. This is only for unusual applications that need to deeply control their own 1124 * execution, at the potential expense of the user's battery life. Note that these applications 1125 * greatly run the risk of showing to the user as high power consumers on their device.</p> 1126 * <p> 1127 * Input: The Intent's data URI must specify the application package name 1128 * to be shown, with the "package" scheme. That is "package:com.my.app". 1129 * <p> 1130 * Output: Nothing. 1131 * <p> 1132 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1133 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1134 * already ignoring optimizations. 1135 */ 1136 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1137 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 1138 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; 1139 1140 /** 1141 * Activity Action: Open the advanced power usage details page of an associated app. 1142 * <p> 1143 * Input: Intent's data URI set with an application name, using the 1144 * "package" schema (like "package:com.my.app") 1145 * <p> 1146 * Output: Nothing. 1147 * 1148 * @hide 1149 */ 1150 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1151 public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL = 1152 "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL"; 1153 1154 /** 1155 * Activity Action: Show screen for controlling background data 1156 * restrictions for a particular application. 1157 * <p> 1158 * Input: Intent's data URI set with an application name, using the 1159 * "package" schema (like "package:com.my.app"). 1160 * 1161 * <p> 1162 * Output: Nothing. 1163 * <p> 1164 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus 1165 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the 1166 * status of the background data restrictions for them. 1167 * 1168 * <p class="note"> 1169 * In some cases, a matching Activity may not exist, so ensure you 1170 * safeguard against this. 1171 */ 1172 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1173 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 1174 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; 1175 1176 /** 1177 * @hide 1178 * Activity Action: Show the "app ops" settings screen. 1179 * <p> 1180 * Input: Nothing. 1181 * <p> 1182 * Output: Nothing. 1183 */ 1184 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1185 public static final String ACTION_APP_OPS_SETTINGS = 1186 "android.settings.APP_OPS_SETTINGS"; 1187 1188 /** 1189 * Activity Action: Show settings for system update functionality. 1190 * <p> 1191 * In some cases, a matching Activity may not exist, so ensure you 1192 * safeguard against this. 1193 * <p> 1194 * Input: Nothing. 1195 * <p> 1196 * Output: Nothing. 1197 * 1198 * @hide 1199 */ 1200 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1201 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 1202 "android.settings.SYSTEM_UPDATE_SETTINGS"; 1203 1204 /** 1205 * Activity Action: Show settings for managed profile settings. 1206 * <p> 1207 * In some cases, a matching Activity may not exist, so ensure you 1208 * safeguard against this. 1209 * <p> 1210 * Input: Nothing. 1211 * <p> 1212 * Output: Nothing. 1213 * 1214 * @hide 1215 */ 1216 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1217 public static final String ACTION_MANAGED_PROFILE_SETTINGS = 1218 "android.settings.MANAGED_PROFILE_SETTINGS"; 1219 1220 /** 1221 * Activity Action: Show settings to allow configuration of sync settings. 1222 * <p> 1223 * In some cases, a matching Activity may not exist, so ensure you 1224 * safeguard against this. 1225 * <p> 1226 * The account types available to add via the add account button may be restricted by adding an 1227 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 1228 * authorities. Only account types which can sync with that content provider will be offered to 1229 * the user. 1230 * <p> 1231 * Input: Nothing. 1232 * <p> 1233 * Output: Nothing. 1234 */ 1235 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1236 public static final String ACTION_SYNC_SETTINGS = 1237 "android.settings.SYNC_SETTINGS"; 1238 1239 /** 1240 * Activity Action: Show add account screen for creating a new account. 1241 * <p> 1242 * In some cases, a matching Activity may not exist, so ensure you 1243 * safeguard against this. 1244 * <p> 1245 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 1246 * extra to the Intent with one or more syncable content provider's authorities. Only account 1247 * types which can sync with that content provider will be offered to the user. 1248 * <p> 1249 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 1250 * Intent with one or more account types. 1251 * <p> 1252 * Input: Nothing. 1253 * <p> 1254 * Output: Nothing. 1255 */ 1256 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1257 public static final String ACTION_ADD_ACCOUNT = 1258 "android.settings.ADD_ACCOUNT_SETTINGS"; 1259 1260 /** 1261 * Activity Action: Show settings for enabling or disabling data saver 1262 * <p></p> 1263 * In some cases, a matching Activity may not exist, so ensure you 1264 * safeguard against this. 1265 * <p> 1266 * Input: Nothing. 1267 * <p> 1268 * Output: Nothing. 1269 * 1270 * @hide 1271 */ 1272 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1273 public static final String ACTION_DATA_SAVER_SETTINGS = 1274 "android.settings.DATA_SAVER_SETTINGS"; 1275 1276 /** 1277 * Activity Action: Show settings for selecting the network operator. 1278 * <p> 1279 * In some cases, a matching Activity may not exist, so ensure you 1280 * safeguard against this. 1281 * <p> 1282 * The subscription ID of the subscription for which available network operators should be 1283 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. 1284 * <p> 1285 * Input: Nothing. 1286 * <p> 1287 * Output: Nothing. 1288 */ 1289 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1290 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 1291 "android.settings.NETWORK_OPERATOR_SETTINGS"; 1292 1293 /** 1294 * Activity Action: Show settings for selection of 2G/3G. 1295 * <p> 1296 * In some cases, a matching Activity may not exist, so ensure you 1297 * safeguard against this. 1298 * <p> 1299 * Input: Nothing. 1300 * <p> 1301 * Output: Nothing. 1302 */ 1303 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1304 public static final String ACTION_DATA_ROAMING_SETTINGS = 1305 "android.settings.DATA_ROAMING_SETTINGS"; 1306 1307 /** 1308 * Activity Action: Show settings for internal storage. 1309 * <p> 1310 * In some cases, a matching Activity may not exist, so ensure you 1311 * safeguard against this. 1312 * <p> 1313 * Input: Nothing. 1314 * <p> 1315 * Output: Nothing. 1316 */ 1317 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1318 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 1319 "android.settings.INTERNAL_STORAGE_SETTINGS"; 1320 /** 1321 * Activity Action: Show settings for memory card storage. 1322 * <p> 1323 * In some cases, a matching Activity may not exist, so ensure you 1324 * safeguard against this. 1325 * <p> 1326 * Input: Nothing. 1327 * <p> 1328 * Output: Nothing. 1329 */ 1330 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1331 public static final String ACTION_MEMORY_CARD_SETTINGS = 1332 "android.settings.MEMORY_CARD_SETTINGS"; 1333 1334 /** 1335 * Activity Action: Show settings for global search. 1336 * <p> 1337 * In some cases, a matching Activity may not exist, so ensure you 1338 * safeguard against this. 1339 * <p> 1340 * Input: Nothing. 1341 * <p> 1342 * Output: Nothing 1343 */ 1344 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1345 public static final String ACTION_SEARCH_SETTINGS = 1346 "android.search.action.SEARCH_SETTINGS"; 1347 1348 /** 1349 * Activity Action: Show general device information settings (serial 1350 * number, software version, phone number, etc.). 1351 * <p> 1352 * In some cases, a matching Activity may not exist, so ensure you 1353 * safeguard against this. 1354 * <p> 1355 * Input: Nothing. 1356 * <p> 1357 * Output: Nothing 1358 */ 1359 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1360 public static final String ACTION_DEVICE_INFO_SETTINGS = 1361 "android.settings.DEVICE_INFO_SETTINGS"; 1362 1363 /** 1364 * Activity Action: Show NFC settings. 1365 * <p> 1366 * This shows UI that allows NFC to be turned on or off. 1367 * <p> 1368 * In some cases, a matching Activity may not exist, so ensure you 1369 * safeguard against this. 1370 * <p> 1371 * Input: Nothing. 1372 * <p> 1373 * Output: Nothing 1374 * @see android.nfc.NfcAdapter#isEnabled() 1375 */ 1376 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1377 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 1378 1379 /** 1380 * Activity Action: Show NFC Sharing settings. 1381 * <p> 1382 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 1383 * off. 1384 * <p> 1385 * In some cases, a matching Activity may not exist, so ensure you 1386 * safeguard against this. 1387 * <p> 1388 * Input: Nothing. 1389 * <p> 1390 * Output: Nothing 1391 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 1392 */ 1393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1394 public static final String ACTION_NFCSHARING_SETTINGS = 1395 "android.settings.NFCSHARING_SETTINGS"; 1396 1397 /** 1398 * Activity Action: Show NFC Tap & Pay settings 1399 * <p> 1400 * This shows UI that allows the user to configure Tap&Pay 1401 * settings. 1402 * <p> 1403 * In some cases, a matching Activity may not exist, so ensure you 1404 * safeguard against this. 1405 * <p> 1406 * Input: Nothing. 1407 * <p> 1408 * Output: Nothing 1409 */ 1410 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1411 public static final String ACTION_NFC_PAYMENT_SETTINGS = 1412 "android.settings.NFC_PAYMENT_SETTINGS"; 1413 1414 /** 1415 * Activity Action: Show Daydream settings. 1416 * <p> 1417 * In some cases, a matching Activity may not exist, so ensure you 1418 * safeguard against this. 1419 * <p> 1420 * Input: Nothing. 1421 * <p> 1422 * Output: Nothing. 1423 * @see android.service.dreams.DreamService 1424 */ 1425 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1426 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 1427 1428 /** 1429 * Activity Action: Show Notification assistant settings. 1430 * <p> 1431 * In some cases, a matching Activity may not exist, so ensure you 1432 * safeguard against this. 1433 * <p> 1434 * Input: Nothing. 1435 * <p> 1436 * Output: Nothing. 1437 * @see android.service.notification.NotificationAssistantService 1438 */ 1439 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1440 public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS = 1441 "android.settings.NOTIFICATION_ASSISTANT_SETTINGS"; 1442 1443 /** 1444 * Activity Action: Show Notification listener settings. 1445 * <p> 1446 * In some cases, a matching Activity may not exist, so ensure you 1447 * safeguard against this. 1448 * <p> 1449 * Input: Nothing. 1450 * <p> 1451 * Output: Nothing. 1452 * @see android.service.notification.NotificationListenerService 1453 */ 1454 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1455 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 1456 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 1457 1458 /** 1459 * Activity Action: Show notification listener permission settings page for app. 1460 * <p> 1461 * Users can grant and deny access to notifications for a {@link ComponentName} from here. 1462 * See 1463 * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)} 1464 * for more details. 1465 * <p> 1466 * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name 1467 * of the component to grant or revoke notification listener access to. 1468 * <p> 1469 * Output: Nothing. 1470 */ 1471 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1472 public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS = 1473 "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS"; 1474 1475 /** 1476 * Activity Extra: What component name to show the notification listener permission 1477 * page for. 1478 * <p> 1479 * A string extra containing a {@link ComponentName}. This must be passed as an extra field to 1480 * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}. 1481 */ 1482 public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME = 1483 "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME"; 1484 1485 /** 1486 * Activity Action: Show Do Not Disturb access settings. 1487 * <p> 1488 * Users can grant and deny access to Do Not Disturb configuration from here. Managed 1489 * profiles cannot grant Do Not Disturb access. 1490 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1491 * details. 1492 * <p> 1493 * Input: Nothing. 1494 * <p> 1495 * Output: Nothing. 1496 * 1497 * <p class="note"> 1498 * In some cases, a matching Activity may not exist, so ensure you 1499 * safeguard against this. 1500 */ 1501 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1502 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS 1503 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; 1504 1505 /** 1506 * Activity Action: Show do not disturb setting page for app. 1507 * <p> 1508 * Users can grant and deny access to Do Not Disturb configuration for an app from here. 1509 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1510 * details. 1511 * <p> 1512 * Input: Intent's data URI set with an application name, using the 1513 * "package" schema (like "package:com.my.app"). 1514 * <p> 1515 * Output: Nothing. 1516 * 1517 * @hide 1518 */ 1519 @SystemApi 1520 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1521 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = 1522 "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS"; 1523 1524 /** 1525 * Activity Action: Show the automatic do not disturb rule listing page 1526 * <p> 1527 * Users can add, enable, disable, and remove automatic do not disturb rules from this 1528 * screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more 1529 * details. 1530 * </p> 1531 * <p> 1532 * Input: Nothing 1533 * Output: Nothing 1534 * </p> 1535 * 1536 */ 1537 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1538 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 1539 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 1540 1541 /** 1542 * Activity Action: Show settings for video captioning. 1543 * <p> 1544 * In some cases, a matching Activity may not exist, so ensure you safeguard 1545 * against this. 1546 * <p> 1547 * Input: Nothing. 1548 * <p> 1549 * Output: Nothing. 1550 */ 1551 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1552 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 1553 1554 /** 1555 * Activity Action: Show the top level print settings. 1556 * <p> 1557 * In some cases, a matching Activity may not exist, so ensure you 1558 * safeguard against this. 1559 * <p> 1560 * Input: Nothing. 1561 * <p> 1562 * Output: Nothing. 1563 */ 1564 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1565 public static final String ACTION_PRINT_SETTINGS = 1566 "android.settings.ACTION_PRINT_SETTINGS"; 1567 1568 /** 1569 * Activity Action: Show Zen Mode configuration settings. 1570 * 1571 * @hide 1572 */ 1573 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1574 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 1575 1576 /** 1577 * Activity Action: Show Zen Mode visual effects configuration settings. 1578 * 1579 * @hide 1580 */ 1581 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1582 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS = 1583 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS"; 1584 1585 /** 1586 * Activity Action: Show Zen Mode onboarding activity. 1587 * 1588 * @hide 1589 */ 1590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1591 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING"; 1592 1593 /** 1594 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. 1595 */ 1596 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1597 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS 1598 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; 1599 1600 /** 1601 * Activity Action: Show Zen Mode automation configuration settings. 1602 * 1603 * @hide 1604 */ 1605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1606 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS 1607 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; 1608 1609 /** 1610 * Activity Action: Modify do not disturb mode settings. 1611 * <p> 1612 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1613 * <p> 1614 * This intent MUST be started using 1615 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1616 * startVoiceActivity}. 1617 * <p> 1618 * Note: The Activity implementing this intent MUST verify that 1619 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. 1620 * returns true before modifying the setting. 1621 * <p> 1622 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate 1623 * how long the user wishes to avoid interruptions for. The optional 1624 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is 1625 * enabling or disabling do not disturb mode. If either extra is not included, the 1626 * user maybe asked to provide the value. 1627 * <p> 1628 * Output: Nothing. 1629 */ 1630 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1631 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 1632 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; 1633 1634 /** 1635 * Activity Action: Show Zen Mode schedule rule configuration settings. 1636 * 1637 * @hide 1638 */ 1639 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1640 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS 1641 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; 1642 1643 /** 1644 * Activity Action: Show Zen Mode event rule configuration settings. 1645 * 1646 * @hide 1647 */ 1648 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1649 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS 1650 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; 1651 1652 /** 1653 * Activity Action: Show Zen Mode external rule configuration settings. 1654 * 1655 * @hide 1656 */ 1657 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1658 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS 1659 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; 1660 1661 /** 1662 * Activity Action: Show the regulatory information screen for the device. 1663 * <p> 1664 * In some cases, a matching Activity may not exist, so ensure you safeguard 1665 * against this. 1666 * <p> 1667 * Input: Nothing. 1668 * <p> 1669 * Output: Nothing. 1670 */ 1671 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1672 public static final String 1673 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 1674 1675 /** 1676 * Activity Action: Show Device Name Settings. 1677 * <p> 1678 * In some cases, a matching Activity may not exist, so ensure you safeguard 1679 * against this. 1680 * 1681 * @hide 1682 */ 1683 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1684 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 1685 1686 /** 1687 * Activity Action: Show pairing settings. 1688 * <p> 1689 * In some cases, a matching Activity may not exist, so ensure you safeguard 1690 * against this. 1691 * 1692 * @hide 1693 */ 1694 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1695 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 1696 1697 /** 1698 * Activity Action: Show battery saver settings. 1699 * <p> 1700 * In some cases, a matching Activity may not exist, so ensure you safeguard 1701 * against this. 1702 */ 1703 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1704 public static final String ACTION_BATTERY_SAVER_SETTINGS 1705 = "android.settings.BATTERY_SAVER_SETTINGS"; 1706 1707 /** 1708 * Activity Action: Modify Battery Saver mode setting using a voice command. 1709 * <p> 1710 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1711 * <p> 1712 * This intent MUST be started using 1713 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1714 * startVoiceActivity}. 1715 * <p> 1716 * Note: The activity implementing this intent MUST verify that 1717 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 1718 * modifying the setting. 1719 * <p> 1720 * Input: To tell which state batter saver mode should be set to, add the 1721 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. 1722 * If the extra is not included, no changes will be made. 1723 * <p> 1724 * Output: Nothing. 1725 */ 1726 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1727 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 1728 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; 1729 1730 /** 1731 * Activity Action: Show Home selection settings. If there are multiple activities 1732 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 1733 * to pick your preferred activity. 1734 */ 1735 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1736 public static final String ACTION_HOME_SETTINGS 1737 = "android.settings.HOME_SETTINGS"; 1738 1739 /** 1740 * Activity Action: Show Default apps settings. 1741 * <p> 1742 * In some cases, a matching Activity may not exist, so ensure you 1743 * safeguard against this. 1744 * <p> 1745 * Input: Nothing. 1746 * <p> 1747 * Output: Nothing. 1748 */ 1749 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1750 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS 1751 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; 1752 1753 /** 1754 * Activity Action: Show More default apps settings. 1755 * <p> 1756 * If a Settings activity handles this intent action, a "More defaults" entry will be shown in 1757 * the Default apps settings, and clicking it will launch that activity. 1758 * <p> 1759 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1760 * <p> 1761 * Input: Nothing. 1762 * <p> 1763 * Output: Nothing. 1764 * 1765 * @hide 1766 */ 1767 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1768 @SystemApi 1769 public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = 1770 "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS"; 1771 1772 /** 1773 * Activity Action: Show notification settings. 1774 * 1775 * @hide 1776 */ 1777 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1778 public static final String ACTION_NOTIFICATION_SETTINGS 1779 = "android.settings.NOTIFICATION_SETTINGS"; 1780 1781 /** 1782 * Activity Action: Show conversation settings. 1783 * 1784 * @hide 1785 */ 1786 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1787 public static final String ACTION_CONVERSATION_SETTINGS 1788 = "android.settings.CONVERSATION_SETTINGS"; 1789 1790 /** 1791 * Activity Action: Show notification history screen. 1792 * 1793 * @hide 1794 */ 1795 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1796 public static final String ACTION_NOTIFICATION_HISTORY 1797 = "android.settings.NOTIFICATION_HISTORY"; 1798 1799 /** 1800 * Activity Action: Show app listing settings, filtered by those that send notifications. 1801 * 1802 * @hide 1803 */ 1804 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1805 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = 1806 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; 1807 1808 /** 1809 * Activity Action: Show notification settings for a single app. 1810 * <p> 1811 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1812 * <p> 1813 * Output: Nothing. 1814 */ 1815 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1816 public static final String ACTION_APP_NOTIFICATION_SETTINGS 1817 = "android.settings.APP_NOTIFICATION_SETTINGS"; 1818 1819 /** 1820 * Activity Action: Show notification settings for a single {@link NotificationChannel}. 1821 * <p> 1822 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1823 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. 1824 * <p> 1825 * Output: Nothing. 1826 */ 1827 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1828 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS 1829 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; 1830 1831 /** 1832 * Activity Action: Show notification bubble settings for a single app. 1833 * See {@link NotificationManager#areBubblesAllowed()}. 1834 * <p> 1835 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1836 * <p> 1837 * Output: Nothing. 1838 */ 1839 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1840 public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS 1841 = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS"; 1842 1843 /** 1844 * Activity Extra: The package owner of the notification channel settings to display. 1845 * <p> 1846 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1847 */ 1848 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; 1849 1850 /** 1851 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings 1852 * to display. 1853 * <p> 1854 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1855 */ 1856 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; 1857 1858 /** 1859 * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification 1860 * conversation settings to display. 1861 * <p> 1862 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If 1863 * included the system will first look up notification settings by channel and conversation id, 1864 * and will fall back to channel id if a specialized channel for this conversation doesn't 1865 * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}. 1866 */ 1867 public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID"; 1868 1869 /** 1870 * Activity Action: Show notification redaction settings. 1871 * 1872 * @hide 1873 */ 1874 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1875 public static final String ACTION_APP_NOTIFICATION_REDACTION 1876 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; 1877 1878 /** @hide */ 1879 @UnsupportedAppUsage 1880 public static final String EXTRA_APP_UID = "app_uid"; 1881 1882 /** 1883 * Activity Action: Show power menu settings. 1884 * 1885 * @hide 1886 */ 1887 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1888 public static final String ACTION_POWER_MENU_SETTINGS = 1889 "android.settings.ACTION_POWER_MENU_SETTINGS"; 1890 1891 /** 1892 * Activity Action: Show controls settings. 1893 * 1894 * @hide 1895 */ 1896 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1897 public static final String ACTION_DEVICE_CONTROLS_SETTINGS = 1898 "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS"; 1899 1900 /** 1901 * Activity Action: Show media control settings 1902 * 1903 * @hide 1904 */ 1905 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1906 public static final String ACTION_MEDIA_CONTROLS_SETTINGS = 1907 "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS"; 1908 1909 /** 1910 * Activity Action: Show a dialog with disabled by policy message. 1911 * <p> If an user action is disabled by policy, this dialog can be triggered to let 1912 * the user know about this. 1913 * <p> 1914 * Input: {@link Intent#EXTRA_USER}: The user of the admin. 1915 * <p> 1916 * Output: Nothing. 1917 * 1918 * @hide 1919 */ 1920 // Intent#EXTRA_USER_ID can also be used 1921 @SystemApi 1922 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1923 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS 1924 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; 1925 1926 /** 1927 * Activity Action: Show a dialog for remote bugreport flow. 1928 * <p> 1929 * Input: Nothing. 1930 * <p> 1931 * Output: Nothing. 1932 * 1933 * @hide 1934 */ 1935 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1936 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG 1937 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; 1938 1939 /** 1940 * Activity Action: Show VR listener settings. 1941 * <p> 1942 * Input: Nothing. 1943 * <p> 1944 * Output: Nothing. 1945 * 1946 * @see android.service.vr.VrListenerService 1947 */ 1948 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1949 public static final String ACTION_VR_LISTENER_SETTINGS 1950 = "android.settings.VR_LISTENER_SETTINGS"; 1951 1952 /** 1953 * Activity Action: Show Picture-in-picture settings. 1954 * <p> 1955 * Input: Nothing. 1956 * <p> 1957 * Output: Nothing. 1958 * 1959 * @hide 1960 */ 1961 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1962 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS 1963 = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; 1964 1965 /** 1966 * Activity Action: Show Storage Manager settings. 1967 * <p> 1968 * Input: Nothing. 1969 * <p> 1970 * Output: Nothing. 1971 * 1972 * @hide 1973 */ 1974 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1975 public static final String ACTION_STORAGE_MANAGER_SETTINGS 1976 = "android.settings.STORAGE_MANAGER_SETTINGS"; 1977 1978 /** 1979 * Activity Action: Allows user to select current webview implementation. 1980 * <p> 1981 * Input: Nothing. 1982 * <p> 1983 * Output: Nothing. 1984 * <p class="note"> 1985 * In some cases, a matching Activity may not exist, so ensure you 1986 * safeguard against this. 1987 1988 */ 1989 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1990 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; 1991 1992 /** 1993 * Activity Action: Show enterprise privacy section. 1994 * <p> 1995 * Input: Nothing. 1996 * <p> 1997 * Output: Nothing. 1998 * @hide 1999 */ 2000 @SystemApi 2001 @TestApi 2002 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2003 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS 2004 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; 2005 2006 /** 2007 * Activity Action: Show Work Policy info. 2008 * DPC apps can implement an activity that handles this intent in order to show device policies 2009 * associated with the work profile or managed device. 2010 * <p> 2011 * Input: Nothing. 2012 * <p> 2013 * Output: Nothing. 2014 * 2015 */ 2016 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2017 public static final String ACTION_SHOW_WORK_POLICY_INFO = 2018 "android.settings.SHOW_WORK_POLICY_INFO"; 2019 2020 /** 2021 * Activity Action: Show screen that let user select its Autofill Service. 2022 * <p> 2023 * Input: Intent's data URI set with an application name, using the 2024 * "package" schema (like "package:com.my.app"). 2025 * 2026 * <p> 2027 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging 2028 * to the caller package. 2029 * 2030 * <p> 2031 * <b>NOTE: </b> Applications should call 2032 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and 2033 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action 2034 * to start an activity if they return {@code false} and {@code true} respectively. 2035 */ 2036 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2037 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = 2038 "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; 2039 2040 /** 2041 * Activity Action: Show screen for controlling the Quick Access Wallet. 2042 * <p> 2043 * In some cases, a matching Activity may not exist, so ensure you 2044 * safeguard against this. 2045 * <p> 2046 * Input: Nothing. 2047 * <p> 2048 * Output: Nothing. 2049 */ 2050 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2051 public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS = 2052 "android.settings.QUICK_ACCESS_WALLET_SETTINGS"; 2053 2054 /** 2055 * Activity Action: Show screen for controlling which apps have access on volume directories. 2056 * <p> 2057 * Input: Nothing. 2058 * <p> 2059 * Output: Nothing. 2060 * <p> 2061 * Applications typically use this action to ask the user to revert the "Do not ask again" 2062 * status of directory access requests made by 2063 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. 2064 * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions 2065 * for a specific application 2066 */ 2067 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2068 @Deprecated 2069 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = 2070 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; 2071 2072 2073 /** 2074 * Activity Action: Show screen that let user select enable (or disable) Content Capture. 2075 * <p> 2076 * Input: Nothing. 2077 * 2078 * <p> 2079 * Output: Nothing 2080 * 2081 * @hide 2082 */ 2083 @SystemApi 2084 @TestApi 2085 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2086 public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = 2087 "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE"; 2088 2089 /** 2090 * Activity Action: Show screen that let user manage how Android handles URL resolution. 2091 * <p> 2092 * Input: Nothing. 2093 * <p> 2094 * Output: Nothing 2095 * 2096 * @hide 2097 */ 2098 @SystemApi 2099 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2100 public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS"; 2101 2102 /** 2103 * Activity Action: Show screen that let user select enable (or disable) tethering. 2104 * <p> 2105 * Input: Nothing. 2106 * <p> 2107 * Output: Nothing 2108 * 2109 * @hide 2110 */ 2111 @SystemApi 2112 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2113 public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS"; 2114 2115 /** 2116 * Broadcast to trigger notification of asking user to enable MMS. 2117 * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}. 2118 * 2119 * @hide 2120 */ 2121 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2122 public static final String ACTION_ENABLE_MMS_DATA_REQUEST = 2123 "android.settings.ENABLE_MMS_DATA_REQUEST"; 2124 2125 /** 2126 * Integer value that specifies the reason triggering enable MMS data notification. 2127 * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}. 2128 * Extra with value of EnableMmsDataReason interface. 2129 * @hide 2130 */ 2131 public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON = 2132 "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON"; 2133 2134 /** @hide */ 2135 @Retention(RetentionPolicy.SOURCE) 2136 @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = { 2137 ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS, 2138 ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS, 2139 }) 2140 public @interface EnableMmsDataReason{} 2141 2142 /** 2143 * Requesting to enable MMS data because there's an incoming MMS. 2144 * @hide 2145 */ 2146 public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0; 2147 2148 /** 2149 * Requesting to enable MMS data because user is sending MMS. 2150 * @hide 2151 */ 2152 public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1; 2153 2154 /** 2155 * Activity Action: Show screen of a cellular subscription and highlight the 2156 * "enable MMS" toggle. 2157 * <p> 2158 * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription. 2159 * <p> 2160 * Output: Nothing 2161 * 2162 * @hide 2163 */ 2164 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2165 public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING"; 2166 2167 // End of Intent actions for Settings 2168 2169 /** 2170 * @hide - Private call() method on SettingsProvider to read from 'system' table. 2171 */ 2172 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 2173 2174 /** 2175 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 2176 */ 2177 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 2178 2179 /** 2180 * @hide - Private call() method on SettingsProvider to read from 'global' table. 2181 */ 2182 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 2183 2184 /** 2185 * @hide - Private call() method on SettingsProvider to read from 'config' table. 2186 */ 2187 public static final String CALL_METHOD_GET_CONFIG = "GET_config"; 2188 2189 /** 2190 * @hide - Specifies that the caller of the fast-path call()-based flow tracks 2191 * the settings generation in order to cache values locally. If this key is 2192 * mapped to a <code>null</code> string extra in the request bundle, the response 2193 * bundle will contain the same key mapped to a parcelable extra which would be 2194 * an {@link android.util.MemoryIntArray}. The response will also contain an 2195 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the 2196 * index in the array clients should use to lookup the generation. For efficiency 2197 * the caller should request the generation tracking memory array only if it 2198 * doesn't already have it. 2199 * 2200 * @see #CALL_METHOD_GENERATION_INDEX_KEY 2201 */ 2202 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; 2203 2204 /** 2205 * @hide Key with the location in the {@link android.util.MemoryIntArray} where 2206 * to look up the generation id of the backing table. The value is an integer. 2207 * 2208 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2209 */ 2210 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; 2211 2212 /** 2213 * @hide Key with the settings table generation. The value is an integer. 2214 * 2215 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2216 */ 2217 public static final String CALL_METHOD_GENERATION_KEY = "_generation"; 2218 2219 /** 2220 * @hide - User handle argument extra to the fast-path call()-based requests 2221 */ 2222 public static final String CALL_METHOD_USER_KEY = "_user"; 2223 2224 /** 2225 * @hide - Boolean argument extra to the fast-path call()-based requests 2226 */ 2227 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; 2228 2229 /** 2230 * @hide - User handle argument extra to the fast-path call()-based requests 2231 */ 2232 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; 2233 2234 /** 2235 * @hide - String argument extra to the fast-path call()-based requests 2236 */ 2237 public static final String CALL_METHOD_TAG_KEY = "_tag"; 2238 2239 /** 2240 * @hide - String argument extra to the fast-path call()-based requests 2241 */ 2242 public static final String CALL_METHOD_PREFIX_KEY = "_prefix"; 2243 2244 /** 2245 * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests 2246 */ 2247 public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key"; 2248 2249 /** 2250 * @hide - String argument extra to the fast-path call()-based requests 2251 */ 2252 public static final String CALL_METHOD_FLAGS_KEY = "_flags"; 2253 2254 /** 2255 * @hide - String argument extra to the fast-path call()-based requests 2256 */ 2257 public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore"; 2258 2259 /** @hide - Private call() method to write to 'system' table */ 2260 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 2261 2262 /** @hide - Private call() method to write to 'secure' table */ 2263 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 2264 2265 /** @hide - Private call() method to write to 'global' table */ 2266 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 2267 2268 /** @hide - Private call() method to write to 'configuration' table */ 2269 public static final String CALL_METHOD_PUT_CONFIG = "PUT_config"; 2270 2271 /** @hide - Private call() method to write to and delete from the 'configuration' table */ 2272 public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config"; 2273 2274 /** @hide - Private call() method to delete from the 'system' table */ 2275 public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system"; 2276 2277 /** @hide - Private call() method to delete from the 'secure' table */ 2278 public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure"; 2279 2280 /** @hide - Private call() method to delete from the 'global' table */ 2281 public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global"; 2282 2283 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2284 public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config"; 2285 2286 /** @hide - Private call() method to reset to defaults the 'secure' table */ 2287 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; 2288 2289 /** @hide - Private call() method to reset to defaults the 'global' table */ 2290 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; 2291 2292 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2293 public static final String CALL_METHOD_RESET_CONFIG = "RESET_config"; 2294 2295 /** @hide - Private call() method to query the 'system' table */ 2296 public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system"; 2297 2298 /** @hide - Private call() method to query the 'secure' table */ 2299 public static final String CALL_METHOD_LIST_SECURE = "LIST_secure"; 2300 2301 /** @hide - Private call() method to query the 'global' table */ 2302 public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global"; 2303 2304 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2305 public static final String CALL_METHOD_LIST_CONFIG = "LIST_config"; 2306 2307 /** @hide - Private call() method to register monitor callback for 'configuration' table */ 2308 public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG = 2309 "REGISTER_MONITOR_CALLBACK_config"; 2310 2311 /** @hide - String argument extra to the config monitor callback */ 2312 public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type"; 2313 2314 /** @hide - String argument extra to the config monitor callback */ 2315 public static final String EXTRA_ACCESS_CALLBACK = "access_callback"; 2316 2317 /** @hide - String argument extra to the config monitor callback */ 2318 public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK = 2319 "namespace_updated_callback"; 2320 2321 /** @hide - String argument extra to the config monitor callback */ 2322 public static final String EXTRA_NAMESPACE = "namespace"; 2323 2324 /** @hide - String argument extra to the config monitor callback */ 2325 public static final String EXTRA_CALLING_PACKAGE = "calling_package"; 2326 2327 /** 2328 * Activity Extra: Limit available options in launched activity based on the given authority. 2329 * <p> 2330 * This can be passed as an extra field in an Activity Intent with one or more syncable content 2331 * provider's authorities as a String[]. This field is used by some intents to alter the 2332 * behavior of the called activity. 2333 * <p> 2334 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 2335 * on the authority given. 2336 */ 2337 public static final String EXTRA_AUTHORITIES = "authorities"; 2338 2339 /** 2340 * Activity Extra: Limit available options in launched activity based on the given account 2341 * types. 2342 * <p> 2343 * This can be passed as an extra field in an Activity Intent with one or more account types 2344 * as a String[]. This field is used by some intents to alter the behavior of the called 2345 * activity. 2346 * <p> 2347 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 2348 * list. 2349 */ 2350 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 2351 2352 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 2353 2354 /** 2355 * Activity Extra: The device identifier to act upon. 2356 * <p> 2357 * This can be passed as an extra field in an Activity Intent with a single 2358 * InputDeviceIdentifier. This field is used by some activities to jump straight into the 2359 * settings for the given device. 2360 * <p> 2361 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout 2362 * dialog for the given device. 2363 * @hide 2364 */ 2365 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; 2366 2367 /** 2368 * Activity Extra: Enable or disable Airplane Mode. 2369 * <p> 2370 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} 2371 * intent as a boolean to indicate if it should be enabled. 2372 */ 2373 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; 2374 2375 /** 2376 * Activity Extra: Enable or disable Battery saver mode. 2377 * <p> 2378 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} 2379 * intent as a boolean to indicate if it should be enabled. 2380 */ 2381 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = 2382 "android.settings.extra.battery_saver_mode_enabled"; 2383 2384 /** 2385 * Activity Extra: Enable or disable Do Not Disturb mode. 2386 * <p> 2387 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2388 * intent as a boolean to indicate if it should be enabled. 2389 */ 2390 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = 2391 "android.settings.extra.do_not_disturb_mode_enabled"; 2392 2393 /** 2394 * Activity Extra: How many minutes to enable do not disturb mode for. 2395 * <p> 2396 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2397 * intent to indicate how long do not disturb mode should be enabled for. 2398 */ 2399 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = 2400 "android.settings.extra.do_not_disturb_mode_minutes"; 2401 2402 /** 2403 * Reset mode: reset to defaults only settings changed by the 2404 * calling package. If there is a default set the setting 2405 * will be set to it, otherwise the setting will be deleted. 2406 * This is the only type of reset available to non-system clients. 2407 * @hide 2408 */ 2409 @UnsupportedAppUsage 2410 @TestApi 2411 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; 2412 2413 /** 2414 * Reset mode: reset all settings set by untrusted packages, which is 2415 * packages that aren't a part of the system, to the current defaults. 2416 * If there is a default set the setting will be set to it, otherwise 2417 * the setting will be deleted. This mode is only available to the system. 2418 * @hide 2419 */ 2420 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; 2421 2422 /** 2423 * Reset mode: delete all settings set by untrusted packages, which is 2424 * packages that aren't a part of the system. If a setting is set by an 2425 * untrusted package it will be deleted if its default is not provided 2426 * by the system, otherwise the setting will be set to its default. 2427 * This mode is only available to the system. 2428 * @hide 2429 */ 2430 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; 2431 2432 /** 2433 * Reset mode: reset all settings to defaults specified by trusted 2434 * packages, which is packages that are a part of the system, and 2435 * delete all settings set by untrusted packages. If a setting has 2436 * a default set by a system package it will be set to the default, 2437 * otherwise the setting will be deleted. This mode is only available 2438 * to the system. 2439 * @hide 2440 */ 2441 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; 2442 2443 /** @hide */ 2444 @Retention(RetentionPolicy.SOURCE) 2445 @IntDef(prefix = { "RESET_MODE_" }, value = { 2446 RESET_MODE_PACKAGE_DEFAULTS, 2447 RESET_MODE_UNTRUSTED_DEFAULTS, 2448 RESET_MODE_UNTRUSTED_CHANGES, 2449 RESET_MODE_TRUSTED_DEFAULTS 2450 }) 2451 public @interface ResetMode{} 2452 2453 /** 2454 * Activity Extra: Number of certificates 2455 * <p> 2456 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} 2457 * intent to indicate the number of certificates 2458 * @hide 2459 */ 2460 public static final String EXTRA_NUMBER_OF_CERTIFICATES = 2461 "android.settings.extra.number_of_certificates"; 2462 2463 private static final String JID_RESOURCE_PREFIX = "android"; 2464 2465 public static final String AUTHORITY = "settings"; 2466 2467 private static final String TAG = "Settings"; 2468 private static final boolean LOCAL_LOGV = false; 2469 2470 // Used in system server calling uid workaround in call() 2471 private static boolean sInSystemServer = false; 2472 private static final Object sInSystemServerLock = new Object(); 2473 2474 /** @hide */ setInSystemServer()2475 public static void setInSystemServer() { 2476 synchronized (sInSystemServerLock) { 2477 sInSystemServer = true; 2478 } 2479 } 2480 2481 /** @hide */ isInSystemServer()2482 public static boolean isInSystemServer() { 2483 synchronized (sInSystemServerLock) { 2484 return sInSystemServer; 2485 } 2486 } 2487 2488 public static class SettingNotFoundException extends AndroidException { SettingNotFoundException(String msg)2489 public SettingNotFoundException(String msg) { 2490 super(msg); 2491 } 2492 } 2493 2494 /** 2495 * Common base for tables of name/value settings. 2496 */ 2497 public static class NameValueTable implements BaseColumns { 2498 public static final String NAME = "name"; 2499 public static final String VALUE = "value"; 2500 // A flag indicating whether the current value of a setting should be preserved during 2501 // restore. 2502 /** @hide */ 2503 public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore"; 2504 putString(ContentResolver resolver, Uri uri, String name, String value)2505 protected static boolean putString(ContentResolver resolver, Uri uri, 2506 String name, String value) { 2507 // The database will take care of replacing duplicates. 2508 try { 2509 ContentValues values = new ContentValues(); 2510 values.put(NAME, name); 2511 values.put(VALUE, value); 2512 resolver.insert(uri, values); 2513 return true; 2514 } catch (SQLException e) { 2515 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 2516 return false; 2517 } 2518 } 2519 getUriFor(Uri uri, String name)2520 public static Uri getUriFor(Uri uri, String name) { 2521 return Uri.withAppendedPath(uri, name); 2522 } 2523 } 2524 2525 private static final class GenerationTracker { 2526 private final MemoryIntArray mArray; 2527 private final Runnable mErrorHandler; 2528 private final int mIndex; 2529 private int mCurrentGeneration; 2530 GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2531 public GenerationTracker(@NonNull MemoryIntArray array, int index, 2532 int generation, Runnable errorHandler) { 2533 mArray = array; 2534 mIndex = index; 2535 mErrorHandler = errorHandler; 2536 mCurrentGeneration = generation; 2537 } 2538 isGenerationChanged()2539 public boolean isGenerationChanged() { 2540 final int currentGeneration = readCurrentGeneration(); 2541 if (currentGeneration >= 0) { 2542 if (currentGeneration == mCurrentGeneration) { 2543 return false; 2544 } 2545 mCurrentGeneration = currentGeneration; 2546 } 2547 return true; 2548 } 2549 getCurrentGeneration()2550 public int getCurrentGeneration() { 2551 return mCurrentGeneration; 2552 } 2553 readCurrentGeneration()2554 private int readCurrentGeneration() { 2555 try { 2556 return mArray.get(mIndex); 2557 } catch (IOException e) { 2558 Log.e(TAG, "Error getting current generation", e); 2559 if (mErrorHandler != null) { 2560 mErrorHandler.run(); 2561 } 2562 } 2563 return -1; 2564 } 2565 destroy()2566 public void destroy() { 2567 try { 2568 mArray.close(); 2569 } catch (IOException e) { 2570 Log.e(TAG, "Error closing backing array", e); 2571 if (mErrorHandler != null) { 2572 mErrorHandler.run(); 2573 } 2574 } 2575 } 2576 } 2577 2578 private static final class ContentProviderHolder { 2579 private final Object mLock = new Object(); 2580 2581 @GuardedBy("mLock") 2582 private final Uri mUri; 2583 @GuardedBy("mLock") 2584 @UnsupportedAppUsage 2585 private IContentProvider mContentProvider; 2586 ContentProviderHolder(Uri uri)2587 public ContentProviderHolder(Uri uri) { 2588 mUri = uri; 2589 } 2590 getProvider(ContentResolver contentResolver)2591 public IContentProvider getProvider(ContentResolver contentResolver) { 2592 synchronized (mLock) { 2593 if (mContentProvider == null) { 2594 mContentProvider = contentResolver 2595 .acquireProvider(mUri.getAuthority()); 2596 } 2597 return mContentProvider; 2598 } 2599 } 2600 clearProviderForTest()2601 public void clearProviderForTest() { 2602 synchronized (mLock) { 2603 mContentProvider = null; 2604 } 2605 } 2606 } 2607 2608 // Thread-safe. 2609 private static class NameValueCache { 2610 private static final boolean DEBUG = false; 2611 2612 private static final String[] SELECT_VALUE_PROJECTION = new String[] { 2613 Settings.NameValueTable.VALUE 2614 }; 2615 2616 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 2617 2618 // Must synchronize on 'this' to access mValues and mValuesVersion. 2619 private final ArrayMap<String, String> mValues = new ArrayMap<>(); 2620 2621 private final Uri mUri; 2622 @UnsupportedAppUsage 2623 private final ContentProviderHolder mProviderHolder; 2624 2625 // The method we'll call (or null, to not use) on the provider 2626 // for the fast path of retrieving settings. 2627 private final String mCallGetCommand; 2628 private final String mCallSetCommand; 2629 private final String mCallListCommand; 2630 private final String mCallSetAllCommand; 2631 2632 @GuardedBy("this") 2633 private GenerationTracker mGenerationTracker; 2634 NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder)2635 public NameValueCache(Uri uri, String getCommand, String setCommand, 2636 ContentProviderHolder providerHolder) { 2637 this(uri, getCommand, setCommand, null, null, providerHolder); 2638 } 2639 NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder)2640 NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand, 2641 String setAllCommand, ContentProviderHolder providerHolder) { 2642 mUri = uri; 2643 mCallGetCommand = getCommand; 2644 mCallSetCommand = setCommand; 2645 mCallListCommand = listCommand; 2646 mCallSetAllCommand = setAllCommand; 2647 mProviderHolder = providerHolder; 2648 } 2649 putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)2650 public boolean putStringForUser(ContentResolver cr, String name, String value, 2651 String tag, boolean makeDefault, final int userHandle, 2652 boolean overrideableByRestore) { 2653 try { 2654 Bundle arg = new Bundle(); 2655 arg.putString(Settings.NameValueTable.VALUE, value); 2656 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 2657 if (tag != null) { 2658 arg.putString(CALL_METHOD_TAG_KEY, tag); 2659 } 2660 if (makeDefault) { 2661 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); 2662 } 2663 if (overrideableByRestore) { 2664 arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true); 2665 } 2666 IContentProvider cp = mProviderHolder.getProvider(cr); 2667 cp.call(cr.getPackageName(), cr.getAttributionTag(), 2668 mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg); 2669 } catch (RemoteException e) { 2670 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 2671 return false; 2672 } 2673 return true; 2674 } 2675 setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)2676 public boolean setStringsForPrefix(ContentResolver cr, String prefix, 2677 HashMap<String, String> keyValues) { 2678 if (mCallSetAllCommand == null) { 2679 // This NameValueCache does not support atomically setting multiple flags 2680 return false; 2681 } 2682 try { 2683 Bundle args = new Bundle(); 2684 args.putString(CALL_METHOD_PREFIX_KEY, prefix); 2685 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues); 2686 IContentProvider cp = mProviderHolder.getProvider(cr); 2687 Bundle bundle = cp.call(cr.getPackageName(), cr.getAttributionTag(), 2688 mProviderHolder.mUri.getAuthority(), 2689 mCallSetAllCommand, null, args); 2690 return bundle.getBoolean(KEY_CONFIG_SET_RETURN); 2691 } catch (RemoteException e) { 2692 // Not supported by the remote side 2693 return false; 2694 } 2695 } 2696 2697 @UnsupportedAppUsage getStringForUser(ContentResolver cr, String name, final int userHandle)2698 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 2699 final boolean isSelf = (userHandle == UserHandle.myUserId()); 2700 int currentGeneration = -1; 2701 if (isSelf) { 2702 synchronized (NameValueCache.this) { 2703 if (mGenerationTracker != null) { 2704 if (mGenerationTracker.isGenerationChanged()) { 2705 if (DEBUG) { 2706 Log.i(TAG, "Generation changed for type:" 2707 + mUri.getPath() + " in package:" 2708 + cr.getPackageName() +" and user:" + userHandle); 2709 } 2710 mValues.clear(); 2711 } else if (mValues.containsKey(name)) { 2712 return mValues.get(name); 2713 } 2714 if (mGenerationTracker != null) { 2715 currentGeneration = mGenerationTracker.getCurrentGeneration(); 2716 } 2717 } 2718 } 2719 } else { 2720 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 2721 + " by user " + UserHandle.myUserId() + " so skipping cache"); 2722 } 2723 2724 IContentProvider cp = mProviderHolder.getProvider(cr); 2725 2726 // Try the fast path first, not using query(). If this 2727 // fails (alternate Settings provider that doesn't support 2728 // this interface?) then we fall back to the query/table 2729 // interface. 2730 if (mCallGetCommand != null) { 2731 try { 2732 Bundle args = null; 2733 if (!isSelf) { 2734 args = new Bundle(); 2735 args.putInt(CALL_METHOD_USER_KEY, userHandle); 2736 } 2737 boolean needsGenerationTracker = false; 2738 synchronized (NameValueCache.this) { 2739 if (isSelf && mGenerationTracker == null) { 2740 needsGenerationTracker = true; 2741 if (args == null) { 2742 args = new Bundle(); 2743 } 2744 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 2745 if (DEBUG) { 2746 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() 2747 + " in package:" + cr.getPackageName() +" and user:" 2748 + userHandle); 2749 } 2750 } 2751 } 2752 Bundle b; 2753 // If we're in system server and in a binder transaction we need to clear the 2754 // calling uid. This works around code in system server that did not call 2755 // clearCallingIdentity, previously this wasn't needed because reading settings 2756 // did not do permission checking but thats no longer the case. 2757 // Long term this should be removed and callers should properly call 2758 // clearCallingIdentity or use a ContentResolver from the caller as needed. 2759 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2760 final long token = Binder.clearCallingIdentity(); 2761 try { 2762 b = cp.call(cr.getPackageName(), cr.getAttributionTag(), 2763 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, 2764 args); 2765 } finally { 2766 Binder.restoreCallingIdentity(token); 2767 } 2768 } else { 2769 b = cp.call(cr.getPackageName(), cr.getAttributionTag(), 2770 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args); 2771 } 2772 if (b != null) { 2773 String value = b.getString(Settings.NameValueTable.VALUE); 2774 // Don't update our cache for reads of other users' data 2775 if (isSelf) { 2776 synchronized (NameValueCache.this) { 2777 if (needsGenerationTracker) { 2778 MemoryIntArray array = b.getParcelable( 2779 CALL_METHOD_TRACK_GENERATION_KEY); 2780 final int index = b.getInt( 2781 CALL_METHOD_GENERATION_INDEX_KEY, -1); 2782 if (array != null && index >= 0) { 2783 final int generation = b.getInt( 2784 CALL_METHOD_GENERATION_KEY, 0); 2785 if (DEBUG) { 2786 Log.i(TAG, "Received generation tracker for type:" 2787 + mUri.getPath() + " in package:" 2788 + cr.getPackageName() + " and user:" 2789 + userHandle + " with index:" + index); 2790 } 2791 if (mGenerationTracker != null) { 2792 mGenerationTracker.destroy(); 2793 } 2794 mGenerationTracker = new GenerationTracker(array, index, 2795 generation, () -> { 2796 synchronized (NameValueCache.this) { 2797 Log.e(TAG, "Error accessing generation" 2798 + " tracker - removing"); 2799 if (mGenerationTracker != null) { 2800 GenerationTracker generationTracker = 2801 mGenerationTracker; 2802 mGenerationTracker = null; 2803 generationTracker.destroy(); 2804 mValues.clear(); 2805 } 2806 } 2807 }); 2808 currentGeneration = generation; 2809 } 2810 } 2811 if (mGenerationTracker != null && currentGeneration == 2812 mGenerationTracker.getCurrentGeneration()) { 2813 mValues.put(name, value); 2814 } 2815 } 2816 } else { 2817 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 2818 + " by " + UserHandle.myUserId() 2819 + " so not updating cache"); 2820 } 2821 return value; 2822 } 2823 // If the response Bundle is null, we fall through 2824 // to the query interface below. 2825 } catch (RemoteException e) { 2826 // Not supported by the remote side? Fall through 2827 // to query(). 2828 } 2829 } 2830 2831 Cursor c = null; 2832 try { 2833 Bundle queryArgs = ContentResolver.createSqlQueryBundle( 2834 NAME_EQ_PLACEHOLDER, new String[]{name}, null); 2835 // Same workaround as above. 2836 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2837 final long token = Binder.clearCallingIdentity(); 2838 try { 2839 c = cp.query(cr.getPackageName(), cr.getAttributionTag(), mUri, 2840 SELECT_VALUE_PROJECTION, queryArgs, null); 2841 } finally { 2842 Binder.restoreCallingIdentity(token); 2843 } 2844 } else { 2845 c = cp.query(cr.getPackageName(), cr.getAttributionTag(), mUri, 2846 SELECT_VALUE_PROJECTION, queryArgs, null); 2847 } 2848 if (c == null) { 2849 Log.w(TAG, "Can't get key " + name + " from " + mUri); 2850 return null; 2851 } 2852 2853 String value = c.moveToNext() ? c.getString(0) : null; 2854 synchronized (NameValueCache.this) { 2855 if (mGenerationTracker != null 2856 && currentGeneration == mGenerationTracker.getCurrentGeneration()) { 2857 mValues.put(name, value); 2858 } 2859 } 2860 if (LOCAL_LOGV) { 2861 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 2862 name + " = " + (value == null ? "(null)" : value)); 2863 } 2864 return value; 2865 } catch (RemoteException e) { 2866 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 2867 return null; // Return null, but don't cache it. 2868 } finally { 2869 if (c != null) c.close(); 2870 } 2871 } 2872 getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)2873 public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix, 2874 List<String> names) { 2875 String namespace = prefix.substring(0, prefix.length() - 1); 2876 DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace); 2877 ArrayMap<String, String> keyValues = new ArrayMap<>(); 2878 int currentGeneration = -1; 2879 2880 synchronized (NameValueCache.this) { 2881 if (mGenerationTracker != null) { 2882 if (mGenerationTracker.isGenerationChanged()) { 2883 if (DEBUG) { 2884 Log.i(TAG, "Generation changed for type:" + mUri.getPath() 2885 + " in package:" + cr.getPackageName()); 2886 } 2887 mValues.clear(); 2888 } else { 2889 boolean prefixCached = mValues.containsKey(prefix); 2890 if (prefixCached) { 2891 if (!names.isEmpty()) { 2892 for (String name : names) { 2893 if (mValues.containsKey(name)) { 2894 keyValues.put(name, mValues.get(name)); 2895 } 2896 } 2897 } else { 2898 for (int i = 0; i < mValues.size(); ++i) { 2899 String key = mValues.keyAt(i); 2900 // Explicitly exclude the prefix as it is only there to 2901 // signal that the prefix has been cached. 2902 if (key.startsWith(prefix) && !key.equals(prefix)) { 2903 keyValues.put(key, mValues.get(key)); 2904 } 2905 } 2906 } 2907 return keyValues; 2908 } 2909 } 2910 if (mGenerationTracker != null) { 2911 currentGeneration = mGenerationTracker.getCurrentGeneration(); 2912 } 2913 } 2914 } 2915 2916 if (mCallListCommand == null) { 2917 // No list command specified, return empty map 2918 return keyValues; 2919 } 2920 IContentProvider cp = mProviderHolder.getProvider(cr); 2921 2922 try { 2923 Bundle args = new Bundle(); 2924 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix); 2925 boolean needsGenerationTracker = false; 2926 synchronized (NameValueCache.this) { 2927 if (mGenerationTracker == null) { 2928 needsGenerationTracker = true; 2929 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 2930 if (DEBUG) { 2931 Log.i(TAG, "Requested generation tracker for type: " 2932 + mUri.getPath() + " in package:" + cr.getPackageName()); 2933 } 2934 } 2935 } 2936 2937 // Fetch all flags for the namespace at once for caching purposes 2938 Bundle b = cp.call(cr.getPackageName(), cr.getAttributionTag(), 2939 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args); 2940 if (b == null) { 2941 // Invalid response, return an empty map 2942 return keyValues; 2943 } 2944 2945 // All flags for the namespace 2946 Map<String, String> flagsToValues = 2947 (HashMap) b.getSerializable(Settings.NameValueTable.VALUE); 2948 // Only the flags requested by the caller 2949 if (!names.isEmpty()) { 2950 for (Map.Entry<String, String> flag : flagsToValues.entrySet()) { 2951 if (names.contains(flag.getKey())) { 2952 keyValues.put(flag.getKey(), flag.getValue()); 2953 } 2954 } 2955 } else { 2956 keyValues.putAll(flagsToValues); 2957 } 2958 2959 synchronized (NameValueCache.this) { 2960 if (needsGenerationTracker) { 2961 MemoryIntArray array = b.getParcelable( 2962 CALL_METHOD_TRACK_GENERATION_KEY); 2963 final int index = b.getInt( 2964 CALL_METHOD_GENERATION_INDEX_KEY, -1); 2965 if (array != null && index >= 0) { 2966 final int generation = b.getInt( 2967 CALL_METHOD_GENERATION_KEY, 0); 2968 if (DEBUG) { 2969 Log.i(TAG, "Received generation tracker for type:" 2970 + mUri.getPath() + " in package:" 2971 + cr.getPackageName() + " with index:" + index); 2972 } 2973 if (mGenerationTracker != null) { 2974 mGenerationTracker.destroy(); 2975 } 2976 mGenerationTracker = new GenerationTracker(array, index, 2977 generation, () -> { 2978 synchronized (NameValueCache.this) { 2979 Log.e(TAG, "Error accessing generation tracker" 2980 + " - removing"); 2981 if (mGenerationTracker != null) { 2982 GenerationTracker generationTracker = 2983 mGenerationTracker; 2984 mGenerationTracker = null; 2985 generationTracker.destroy(); 2986 mValues.clear(); 2987 } 2988 } 2989 }); 2990 currentGeneration = generation; 2991 } 2992 } 2993 if (mGenerationTracker != null && currentGeneration 2994 == mGenerationTracker.getCurrentGeneration()) { 2995 // cache the complete list of flags for the namespace 2996 mValues.putAll(flagsToValues); 2997 // Adding the prefix as a signal that the prefix is cached. 2998 mValues.put(prefix, null); 2999 } 3000 } 3001 return keyValues; 3002 } catch (RemoteException e) { 3003 // Not supported by the remote side, return an empty map 3004 return keyValues; 3005 } 3006 } 3007 clearGenerationTrackerForTest()3008 public void clearGenerationTrackerForTest() { 3009 synchronized (NameValueCache.this) { 3010 if (mGenerationTracker != null) { 3011 mGenerationTracker.destroy(); 3012 } 3013 mValues.clear(); 3014 mGenerationTracker = null; 3015 } 3016 } 3017 } 3018 3019 /** 3020 * Checks if the specified context can draw on top of other apps. As of API 3021 * level 23, an app cannot draw on top of other apps unless it declares the 3022 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its 3023 * manifest, <em>and</em> the user specifically grants the app this 3024 * capability. To prompt the user to grant this approval, the app must send an 3025 * intent with the action 3026 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which 3027 * causes the system to display a permission management screen. 3028 * 3029 * @param context App context. 3030 * @return true if the specified context can draw on top of other apps, false otherwise 3031 */ canDrawOverlays(Context context)3032 public static boolean canDrawOverlays(Context context) { 3033 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), 3034 context.getOpPackageName(), false); 3035 } 3036 3037 /** 3038 * System settings, containing miscellaneous system preferences. This 3039 * table holds simple name/value pairs. There are convenience 3040 * functions for accessing individual settings entries. 3041 */ 3042 public static final class System extends NameValueTable { 3043 // NOTE: If you add new settings here, be sure to add them to 3044 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. 3045 3046 private static final float DEFAULT_FONT_SCALE = 1.0f; 3047 3048 /** 3049 * The content:// style URL for this table 3050 */ 3051 public static final Uri CONTENT_URI = 3052 Uri.parse("content://" + AUTHORITY + "/system"); 3053 3054 @UnsupportedAppUsage 3055 private static final ContentProviderHolder sProviderHolder = 3056 new ContentProviderHolder(CONTENT_URI); 3057 3058 @UnsupportedAppUsage 3059 private static final NameValueCache sNameValueCache = new NameValueCache( 3060 CONTENT_URI, 3061 CALL_METHOD_GET_SYSTEM, 3062 CALL_METHOD_PUT_SYSTEM, 3063 sProviderHolder); 3064 3065 @UnsupportedAppUsage 3066 private static final HashSet<String> MOVED_TO_SECURE; 3067 static { 3068 MOVED_TO_SECURE = new HashSet<>(30); 3069 MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP); 3070 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 3071 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 3072 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 3073 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 3074 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 3075 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 3076 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 3077 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 3078 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 3079 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 3080 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 3081 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 3082 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 3083 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 3084 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 3085 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 3086 MOVED_TO_SECURE.add(Secure.WIFI_ON); 3087 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 3088 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 3089 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 3090 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 3091 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 3092 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 3093 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 3094 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 3095 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 3096 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 3097 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 3098 3099 // At one time in System, then Global, but now back in Secure 3100 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 3101 } 3102 3103 @UnsupportedAppUsage 3104 private static final HashSet<String> MOVED_TO_GLOBAL; 3105 @UnsupportedAppUsage 3106 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 3107 static { 3108 MOVED_TO_GLOBAL = new HashSet<>(); 3109 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); 3110 3111 // these were originally in system but migrated to secure in the past, 3112 // so are duplicated in the Secure.* namespace 3113 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 3114 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 3115 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 3116 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 3117 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 3118 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 3119 3120 // these are moving directly from system to global 3121 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 3122 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 3123 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 3124 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 3125 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 3126 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 3127 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 3128 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 3129 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 3130 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 3131 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 3132 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 3133 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 3134 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 3135 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 3136 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 3137 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 3138 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 3139 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 3140 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 3141 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 3142 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 3143 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 3144 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 3145 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 3146 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 3147 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 3148 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 3149 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 3150 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 3151 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 3152 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 3153 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 3154 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 3155 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 3156 } 3157 3158 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)3159 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 3160 outKeySet.addAll(MOVED_TO_GLOBAL); 3161 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 3162 } 3163 3164 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)3165 public static void getMovedToSecureSettings(Set<String> outKeySet) { 3166 outKeySet.addAll(MOVED_TO_SECURE); 3167 } 3168 3169 /** @hide */ getNonLegacyMovedKeys(HashSet<String> outKeySet)3170 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 3171 outKeySet.addAll(MOVED_TO_GLOBAL); 3172 } 3173 3174 /** @hide */ clearProviderForTest()3175 public static void clearProviderForTest() { 3176 sProviderHolder.clearProviderForTest(); 3177 sNameValueCache.clearGenerationTrackerForTest(); 3178 } 3179 3180 /** 3181 * Look up a name in the database. 3182 * @param resolver to access the database with 3183 * @param name to look up in the table 3184 * @return the corresponding value, or null if not present 3185 */ getString(ContentResolver resolver, String name)3186 public static String getString(ContentResolver resolver, String name) { 3187 return getStringForUser(resolver, name, resolver.getUserId()); 3188 } 3189 3190 /** @hide */ 3191 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)3192 public static String getStringForUser(ContentResolver resolver, String name, 3193 int userHandle) { 3194 if (MOVED_TO_SECURE.contains(name)) { 3195 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3196 + " to android.provider.Settings.Secure, returning read-only value."); 3197 return Secure.getStringForUser(resolver, name, userHandle); 3198 } 3199 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3200 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3201 + " to android.provider.Settings.Global, returning read-only value."); 3202 return Global.getStringForUser(resolver, name, userHandle); 3203 } 3204 return sNameValueCache.getStringForUser(resolver, name, userHandle); 3205 } 3206 3207 /** 3208 * Store a name/value pair into the database. 3209 * @param resolver to access the database with 3210 * @param name to store 3211 * @param value to associate with the name 3212 * @return true if the value was set, false on database errors 3213 */ putString(ContentResolver resolver, String name, String value)3214 public static boolean putString(ContentResolver resolver, String name, String value) { 3215 return putStringForUser(resolver, name, value, resolver.getUserId()); 3216 } 3217 3218 /** 3219 * Store a name/value pair into the database. Values written by this method will be 3220 * overridden if a restore happens in the future. 3221 * 3222 * @param resolver to access the database with 3223 * @param name to store 3224 * @param value to associate with the name 3225 * 3226 * @return true if the value was set, false on database errors 3227 * 3228 * @hide 3229 */ 3230 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) 3231 @SystemApi putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3232 public static boolean putString(@NonNull ContentResolver resolver, 3233 @NonNull String name, @Nullable String value, boolean overrideableByRestore) { 3234 return putStringForUser(resolver, name, value, resolver.getUserId(), 3235 overrideableByRestore); 3236 } 3237 3238 /** @hide */ 3239 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3240 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 3241 int userHandle) { 3242 return putStringForUser(resolver, name, value, userHandle, 3243 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3244 } 3245 putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3246 private static boolean putStringForUser(ContentResolver resolver, String name, String value, 3247 int userHandle, boolean overrideableByRestore) { 3248 if (MOVED_TO_SECURE.contains(name)) { 3249 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3250 + " to android.provider.Settings.Secure, value is unchanged."); 3251 return false; 3252 } 3253 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3254 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3255 + " to android.provider.Settings.Global, value is unchanged."); 3256 return false; 3257 } 3258 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle, 3259 overrideableByRestore); 3260 } 3261 3262 /** 3263 * Construct the content URI for a particular name/value pair, 3264 * useful for monitoring changes with a ContentObserver. 3265 * @param name to look up in the table 3266 * @return the corresponding content URI, or null if not present 3267 */ getUriFor(String name)3268 public static Uri getUriFor(String name) { 3269 if (MOVED_TO_SECURE.contains(name)) { 3270 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3271 + " to android.provider.Settings.Secure, returning Secure URI."); 3272 return Secure.getUriFor(Secure.CONTENT_URI, name); 3273 } 3274 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3275 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3276 + " to android.provider.Settings.Global, returning read-only global URI."); 3277 return Global.getUriFor(Global.CONTENT_URI, name); 3278 } 3279 return getUriFor(CONTENT_URI, name); 3280 } 3281 3282 /** 3283 * Convenience function for retrieving a single system settings value 3284 * as an integer. Note that internally setting values are always 3285 * stored as strings; this function converts the string to an integer 3286 * for you. The default value will be returned if the setting is 3287 * not defined or not an integer. 3288 * 3289 * @param cr The ContentResolver to access. 3290 * @param name The name of the setting to retrieve. 3291 * @param def Value to return if the setting is not defined. 3292 * 3293 * @return The setting's current value, or 'def' if it is not defined 3294 * or not a valid integer. 3295 */ getInt(ContentResolver cr, String name, int def)3296 public static int getInt(ContentResolver cr, String name, int def) { 3297 return getIntForUser(cr, name, def, cr.getUserId()); 3298 } 3299 3300 /** @hide */ 3301 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)3302 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 3303 String v = getStringForUser(cr, name, userHandle); 3304 try { 3305 return v != null ? Integer.parseInt(v) : def; 3306 } catch (NumberFormatException e) { 3307 return def; 3308 } 3309 } 3310 3311 /** 3312 * Convenience function for retrieving a single system settings value 3313 * as an integer. Note that internally setting values are always 3314 * stored as strings; this function converts the string to an integer 3315 * for you. 3316 * <p> 3317 * This version does not take a default value. If the setting has not 3318 * been set, or the string value is not a number, 3319 * it throws {@link SettingNotFoundException}. 3320 * 3321 * @param cr The ContentResolver to access. 3322 * @param name The name of the setting to retrieve. 3323 * 3324 * @throws SettingNotFoundException Thrown if a setting by the given 3325 * name can't be found or the setting value is not an integer. 3326 * 3327 * @return The setting's current value. 3328 */ getInt(ContentResolver cr, String name)3329 public static int getInt(ContentResolver cr, String name) 3330 throws SettingNotFoundException { 3331 return getIntForUser(cr, name, cr.getUserId()); 3332 } 3333 3334 /** @hide */ 3335 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int userHandle)3336 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 3337 throws SettingNotFoundException { 3338 String v = getStringForUser(cr, name, userHandle); 3339 try { 3340 return Integer.parseInt(v); 3341 } catch (NumberFormatException e) { 3342 throw new SettingNotFoundException(name); 3343 } 3344 } 3345 3346 /** 3347 * Convenience function for updating a single settings value as an 3348 * integer. This will either create a new entry in the table if the 3349 * given name does not exist, or modify the value of the existing row 3350 * with that name. Note that internally setting values are always 3351 * stored as strings, so this function converts the given value to a 3352 * string before storing it. 3353 * 3354 * @param cr The ContentResolver to access. 3355 * @param name The name of the setting to modify. 3356 * @param value The new value for the setting. 3357 * @return true if the value was set, false on database errors 3358 */ putInt(ContentResolver cr, String name, int value)3359 public static boolean putInt(ContentResolver cr, String name, int value) { 3360 return putIntForUser(cr, name, value, cr.getUserId()); 3361 } 3362 3363 /** @hide */ 3364 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)3365 public static boolean putIntForUser(ContentResolver cr, String name, int value, 3366 int userHandle) { 3367 return putStringForUser(cr, name, Integer.toString(value), userHandle); 3368 } 3369 3370 /** 3371 * Convenience function for retrieving a single system settings value 3372 * as a {@code long}. Note that internally setting values are always 3373 * stored as strings; this function converts the string to a {@code long} 3374 * for you. The default value will be returned if the setting is 3375 * not defined or not a {@code long}. 3376 * 3377 * @param cr The ContentResolver to access. 3378 * @param name The name of the setting to retrieve. 3379 * @param def Value to return if the setting is not defined. 3380 * 3381 * @return The setting's current value, or 'def' if it is not defined 3382 * or not a valid {@code long}. 3383 */ getLong(ContentResolver cr, String name, long def)3384 public static long getLong(ContentResolver cr, String name, long def) { 3385 return getLongForUser(cr, name, def, cr.getUserId()); 3386 } 3387 3388 /** @hide */ getLongForUser(ContentResolver cr, String name, long def, int userHandle)3389 public static long getLongForUser(ContentResolver cr, String name, long def, 3390 int userHandle) { 3391 String valString = getStringForUser(cr, name, userHandle); 3392 long value; 3393 try { 3394 value = valString != null ? Long.parseLong(valString) : def; 3395 } catch (NumberFormatException e) { 3396 value = def; 3397 } 3398 return value; 3399 } 3400 3401 /** 3402 * Convenience function for retrieving a single system settings value 3403 * as a {@code long}. Note that internally setting values are always 3404 * stored as strings; this function converts the string to a {@code long} 3405 * for you. 3406 * <p> 3407 * This version does not take a default value. If the setting has not 3408 * been set, or the string value is not a number, 3409 * it throws {@link SettingNotFoundException}. 3410 * 3411 * @param cr The ContentResolver to access. 3412 * @param name The name of the setting to retrieve. 3413 * 3414 * @return The setting's current value. 3415 * @throws SettingNotFoundException Thrown if a setting by the given 3416 * name can't be found or the setting value is not an integer. 3417 */ getLong(ContentResolver cr, String name)3418 public static long getLong(ContentResolver cr, String name) 3419 throws SettingNotFoundException { 3420 return getLongForUser(cr, name, cr.getUserId()); 3421 } 3422 3423 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)3424 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 3425 throws SettingNotFoundException { 3426 String valString = getStringForUser(cr, name, userHandle); 3427 try { 3428 return Long.parseLong(valString); 3429 } catch (NumberFormatException e) { 3430 throw new SettingNotFoundException(name); 3431 } 3432 } 3433 3434 /** 3435 * Convenience function for updating a single settings value as a long 3436 * integer. This will either create a new entry in the table if the 3437 * given name does not exist, or modify the value of the existing row 3438 * with that name. Note that internally setting values are always 3439 * stored as strings, so this function converts the given value to a 3440 * string before storing it. 3441 * 3442 * @param cr The ContentResolver to access. 3443 * @param name The name of the setting to modify. 3444 * @param value The new value for the setting. 3445 * @return true if the value was set, false on database errors 3446 */ putLong(ContentResolver cr, String name, long value)3447 public static boolean putLong(ContentResolver cr, String name, long value) { 3448 return putLongForUser(cr, name, value, cr.getUserId()); 3449 } 3450 3451 /** @hide */ putLongForUser(ContentResolver cr, String name, long value, int userHandle)3452 public static boolean putLongForUser(ContentResolver cr, String name, long value, 3453 int userHandle) { 3454 return putStringForUser(cr, name, Long.toString(value), userHandle); 3455 } 3456 3457 /** 3458 * Convenience function for retrieving a single system settings value 3459 * as a floating point number. Note that internally setting values are 3460 * always stored as strings; this function converts the string to an 3461 * float for you. The default value will be returned if the setting 3462 * is not defined or not a valid float. 3463 * 3464 * @param cr The ContentResolver to access. 3465 * @param name The name of the setting to retrieve. 3466 * @param def Value to return if the setting is not defined. 3467 * 3468 * @return The setting's current value, or 'def' if it is not defined 3469 * or not a valid float. 3470 */ getFloat(ContentResolver cr, String name, float def)3471 public static float getFloat(ContentResolver cr, String name, float def) { 3472 return getFloatForUser(cr, name, def, cr.getUserId()); 3473 } 3474 3475 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)3476 public static float getFloatForUser(ContentResolver cr, String name, float def, 3477 int userHandle) { 3478 String v = getStringForUser(cr, name, userHandle); 3479 try { 3480 return v != null ? Float.parseFloat(v) : def; 3481 } catch (NumberFormatException e) { 3482 return def; 3483 } 3484 } 3485 3486 /** 3487 * Convenience function for retrieving a single system settings value 3488 * as a float. Note that internally setting values are always 3489 * stored as strings; this function converts the string to a float 3490 * for you. 3491 * <p> 3492 * This version does not take a default value. If the setting has not 3493 * been set, or the string value is not a number, 3494 * it throws {@link SettingNotFoundException}. 3495 * 3496 * @param cr The ContentResolver to access. 3497 * @param name The name of the setting to retrieve. 3498 * 3499 * @throws SettingNotFoundException Thrown if a setting by the given 3500 * name can't be found or the setting value is not a float. 3501 * 3502 * @return The setting's current value. 3503 */ getFloat(ContentResolver cr, String name)3504 public static float getFloat(ContentResolver cr, String name) 3505 throws SettingNotFoundException { 3506 return getFloatForUser(cr, name, cr.getUserId()); 3507 } 3508 3509 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)3510 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 3511 throws SettingNotFoundException { 3512 String v = getStringForUser(cr, name, userHandle); 3513 if (v == null) { 3514 throw new SettingNotFoundException(name); 3515 } 3516 try { 3517 return Float.parseFloat(v); 3518 } catch (NumberFormatException e) { 3519 throw new SettingNotFoundException(name); 3520 } 3521 } 3522 3523 /** 3524 * Convenience function for updating a single settings value as a 3525 * floating point number. This will either create a new entry in the 3526 * table if the given name does not exist, or modify the value of the 3527 * existing row with that name. Note that internally setting values 3528 * are always stored as strings, so this function converts the given 3529 * value to a string before storing it. 3530 * 3531 * @param cr The ContentResolver to access. 3532 * @param name The name of the setting to modify. 3533 * @param value The new value for the setting. 3534 * @return true if the value was set, false on database errors 3535 */ putFloat(ContentResolver cr, String name, float value)3536 public static boolean putFloat(ContentResolver cr, String name, float value) { 3537 return putFloatForUser(cr, name, value, cr.getUserId()); 3538 } 3539 3540 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)3541 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 3542 int userHandle) { 3543 return putStringForUser(cr, name, Float.toString(value), userHandle); 3544 } 3545 3546 /** 3547 * Convenience function to read all of the current 3548 * configuration-related settings into a 3549 * {@link Configuration} object. 3550 * 3551 * @param cr The ContentResolver to access. 3552 * @param outConfig Where to place the configuration settings. 3553 */ getConfiguration(ContentResolver cr, Configuration outConfig)3554 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 3555 adjustConfigurationForUser(cr, outConfig, cr.getUserId(), 3556 false /* updateSettingsIfEmpty */); 3557 } 3558 3559 /** @hide */ adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3560 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, 3561 int userHandle, boolean updateSettingsIfEmpty) { 3562 outConfig.fontScale = Settings.System.getFloatForUser( 3563 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); 3564 if (outConfig.fontScale < 0) { 3565 outConfig.fontScale = DEFAULT_FONT_SCALE; 3566 } 3567 3568 final String localeValue = 3569 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); 3570 if (localeValue != null) { 3571 outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); 3572 } else { 3573 // Do not update configuration with emtpy settings since we need to take over the 3574 // locale list of previous user if the settings value is empty. This happens when a 3575 // new user is created. 3576 3577 if (updateSettingsIfEmpty) { 3578 // Make current configuration persistent. This is necessary the first time a 3579 // user log in. At the first login, the configuration settings are empty, so we 3580 // need to store the adjusted configuration as the initial settings. 3581 Settings.System.putStringForUser( 3582 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), 3583 userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 3584 } 3585 } 3586 } 3587 3588 /** 3589 * @hide Erase the fields in the Configuration that should be applied 3590 * by the settings. 3591 */ clearConfiguration(Configuration inoutConfig)3592 public static void clearConfiguration(Configuration inoutConfig) { 3593 inoutConfig.fontScale = 0; 3594 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { 3595 inoutConfig.clearLocales(); 3596 } 3597 } 3598 3599 /** 3600 * Convenience function to write a batch of configuration-related 3601 * settings from a {@link Configuration} object. 3602 * 3603 * @param cr The ContentResolver to access. 3604 * @param config The settings to write. 3605 * @return true if the values were set, false on database errors 3606 */ putConfiguration(ContentResolver cr, Configuration config)3607 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 3608 return putConfigurationForUser(cr, config, cr.getUserId()); 3609 } 3610 3611 /** @hide */ putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3612 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 3613 int userHandle) { 3614 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && 3615 Settings.System.putStringForUser( 3616 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle, 3617 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3618 } 3619 3620 /** @hide */ hasInterestingConfigurationChanges(int changes)3621 public static boolean hasInterestingConfigurationChanges(int changes) { 3622 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || 3623 (changes & ActivityInfo.CONFIG_LOCALE) != 0; 3624 } 3625 3626 /** @deprecated - Do not use */ 3627 @Deprecated getShowGTalkServiceStatus(ContentResolver cr)3628 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 3629 return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); 3630 } 3631 3632 /** 3633 * @hide 3634 * @deprecated - Do not use 3635 */ 3636 @Deprecated getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3637 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 3638 int userHandle) { 3639 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 3640 } 3641 3642 /** @deprecated - Do not use */ 3643 @Deprecated setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3644 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 3645 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); 3646 } 3647 3648 /** 3649 * @hide 3650 * @deprecated - Do not use 3651 */ 3652 @Deprecated setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3653 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 3654 int userHandle) { 3655 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 3656 } 3657 3658 /** 3659 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 3660 */ 3661 @Deprecated 3662 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 3663 3664 /** 3665 * What happens when the user presses the end call button if they're not 3666 * on a call.<br/> 3667 * <b>Values:</b><br/> 3668 * 0 - The end button does nothing.<br/> 3669 * 1 - The end button goes to the home screen.<br/> 3670 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 3671 * 3 - The end button goes to the home screen. If the user is already on the 3672 * home screen, it puts the device to sleep. 3673 */ 3674 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 3675 3676 /** 3677 * END_BUTTON_BEHAVIOR value for "go home". 3678 * @hide 3679 */ 3680 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 3681 3682 /** 3683 * END_BUTTON_BEHAVIOR value for "go to sleep". 3684 * @hide 3685 */ 3686 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 3687 3688 /** 3689 * END_BUTTON_BEHAVIOR default value. 3690 * @hide 3691 */ 3692 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 3693 3694 /** 3695 * Is advanced settings mode turned on. 0 == no, 1 == yes 3696 * @hide 3697 */ 3698 public static final String ADVANCED_SETTINGS = "advanced_settings"; 3699 3700 /** 3701 * ADVANCED_SETTINGS default value. 3702 * @hide 3703 */ 3704 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 3705 3706 /** 3707 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 3708 */ 3709 @Deprecated 3710 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 3711 3712 /** 3713 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 3714 */ 3715 @Deprecated 3716 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 3717 3718 /** 3719 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 3720 */ 3721 @Deprecated 3722 public static final String RADIO_WIFI = Global.RADIO_WIFI; 3723 3724 /** 3725 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 3726 * {@hide} 3727 */ 3728 @Deprecated 3729 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 3730 3731 /** 3732 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 3733 */ 3734 @Deprecated 3735 public static final String RADIO_CELL = Global.RADIO_CELL; 3736 3737 /** 3738 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 3739 */ 3740 @Deprecated 3741 public static final String RADIO_NFC = Global.RADIO_NFC; 3742 3743 /** 3744 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 3745 */ 3746 @Deprecated 3747 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 3748 3749 /** 3750 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 3751 * 3752 * {@hide} 3753 */ 3754 @Deprecated 3755 @UnsupportedAppUsage 3756 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 3757 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 3758 3759 /** 3760 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 3761 */ 3762 @Deprecated 3763 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 3764 3765 /** 3766 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 3767 */ 3768 @Deprecated 3769 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 3770 3771 /** 3772 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 3773 */ 3774 @Deprecated 3775 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 3776 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 3777 3778 /** 3779 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 3780 */ 3781 @Deprecated 3782 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 3783 3784 /** 3785 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 3786 */ 3787 @Deprecated 3788 public static final String MODE_RINGER = Global.MODE_RINGER; 3789 3790 /** 3791 * Whether to use static IP and other static network attributes. 3792 * <p> 3793 * Set to 1 for true and 0 for false. 3794 * 3795 * @deprecated Use {@link WifiManager} instead 3796 */ 3797 @Deprecated 3798 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 3799 3800 /** 3801 * The static IP address. 3802 * <p> 3803 * Example: "192.168.1.51" 3804 * 3805 * @deprecated Use {@link WifiManager} instead 3806 */ 3807 @Deprecated 3808 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 3809 3810 /** 3811 * If using static IP, the gateway's IP address. 3812 * <p> 3813 * Example: "192.168.1.1" 3814 * 3815 * @deprecated Use {@link WifiManager} instead 3816 */ 3817 @Deprecated 3818 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 3819 3820 /** 3821 * If using static IP, the net mask. 3822 * <p> 3823 * Example: "255.255.255.0" 3824 * 3825 * @deprecated Use {@link WifiManager} instead 3826 */ 3827 @Deprecated 3828 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 3829 3830 /** 3831 * If using static IP, the primary DNS's IP address. 3832 * <p> 3833 * Example: "192.168.1.1" 3834 * 3835 * @deprecated Use {@link WifiManager} instead 3836 */ 3837 @Deprecated 3838 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 3839 3840 /** 3841 * If using static IP, the secondary DNS's IP address. 3842 * <p> 3843 * Example: "192.168.1.2" 3844 * 3845 * @deprecated Use {@link WifiManager} instead 3846 */ 3847 @Deprecated 3848 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 3849 3850 /** 3851 * Determines whether remote devices may discover and/or connect to 3852 * this device. 3853 * <P>Type: INT</P> 3854 * 2 -- discoverable and connectable 3855 * 1 -- connectable but not discoverable 3856 * 0 -- neither connectable nor discoverable 3857 */ 3858 public static final String BLUETOOTH_DISCOVERABILITY = 3859 "bluetooth_discoverability"; 3860 3861 /** 3862 * Bluetooth discoverability timeout. If this value is nonzero, then 3863 * Bluetooth becomes discoverable for a certain number of seconds, 3864 * after which is becomes simply connectable. The value is in seconds. 3865 */ 3866 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 3867 "bluetooth_discoverability_timeout"; 3868 3869 /** 3870 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 3871 * instead 3872 */ 3873 @Deprecated 3874 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 3875 3876 /** 3877 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 3878 * instead 3879 */ 3880 @Deprecated 3881 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 3882 3883 /** 3884 * @deprecated Use 3885 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 3886 * instead 3887 */ 3888 @Deprecated 3889 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 3890 "lock_pattern_tactile_feedback_enabled"; 3891 3892 /** 3893 * A formatted string of the next alarm that is set, or the empty string 3894 * if there is no alarm set. 3895 * 3896 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 3897 */ 3898 @Deprecated 3899 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 3900 3901 /** 3902 * Scaling factor for fonts, float. 3903 */ 3904 public static final String FONT_SCALE = "font_scale"; 3905 3906 /** 3907 * The serialized system locale value. 3908 * 3909 * Do not use this value directory. 3910 * To get system locale, use {@link LocaleList#getDefault} instead. 3911 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} 3912 * instead. 3913 * @hide 3914 */ 3915 public static final String SYSTEM_LOCALES = "system_locales"; 3916 3917 3918 /** 3919 * Name of an application package to be debugged. 3920 * 3921 * @deprecated Use {@link Global#DEBUG_APP} instead 3922 */ 3923 @Deprecated 3924 public static final String DEBUG_APP = Global.DEBUG_APP; 3925 3926 /** 3927 * If 1, when launching DEBUG_APP it will wait for the debugger before 3928 * starting user code. If 0, it will run normally. 3929 * 3930 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 3931 */ 3932 @Deprecated 3933 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 3934 3935 /** 3936 * Whether or not to dim the screen. 0=no 1=yes 3937 * @deprecated This setting is no longer used. 3938 */ 3939 @Deprecated 3940 public static final String DIM_SCREEN = "dim_screen"; 3941 3942 /** 3943 * The display color mode. 3944 * @hide 3945 */ 3946 public static final String DISPLAY_COLOR_MODE = "display_color_mode"; 3947 3948 /** 3949 * The user selected min refresh rate in frames per second. 3950 * 3951 * If this isn't set, 0 will be used. 3952 * @hide 3953 */ 3954 public static final String MIN_REFRESH_RATE = "min_refresh_rate"; 3955 3956 /** 3957 * The user selected peak refresh rate in frames per second. 3958 * 3959 * If this isn't set, the system falls back to a device specific default. 3960 * @hide 3961 */ 3962 public static final String PEAK_REFRESH_RATE = "peak_refresh_rate"; 3963 3964 /** 3965 * The amount of time in milliseconds before the device goes to sleep or begins 3966 * to dream after a period of inactivity. This value is also known as the 3967 * user activity timeout period since the screen isn't necessarily turned off 3968 * when it expires. 3969 * 3970 * <p> 3971 * This value is bounded by maximum timeout set by 3972 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. 3973 */ 3974 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 3975 3976 /** 3977 * The screen backlight brightness between 0 and 255. 3978 */ 3979 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 3980 3981 /** 3982 * The screen backlight brightness between 0 and 255. 3983 * @hide 3984 */ 3985 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; 3986 3987 /** 3988 * The screen backlight brightness between 0.0f and 1.0f. 3989 * @hide 3990 */ 3991 public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT = 3992 "screen_brightness_for_vr_float"; 3993 3994 /** 3995 * The screen backlight brightness between 0.0f and 1.0f. 3996 * @hide 3997 */ 3998 public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float"; 3999 4000 /** 4001 * Control whether to enable automatic brightness mode. 4002 */ 4003 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 4004 4005 /** 4006 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 4007 * or less (<0.0 >-1.0) bright. 4008 * @hide 4009 */ 4010 @UnsupportedAppUsage 4011 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 4012 4013 /** 4014 * SCREEN_BRIGHTNESS_MODE value for manual mode. 4015 */ 4016 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 4017 4018 /** 4019 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 4020 */ 4021 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 4022 4023 /** 4024 * Control whether to enable adaptive sleep mode. 4025 * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead. 4026 * @hide 4027 */ 4028 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 4029 4030 /** 4031 * Control whether the process CPU usage meter should be shown. 4032 * 4033 * @deprecated This functionality is no longer available as of 4034 * {@link android.os.Build.VERSION_CODES#N_MR1}. 4035 */ 4036 @Deprecated 4037 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 4038 4039 /** 4040 * If 1, the activity manager will aggressively finish activities and 4041 * processes as soon as they are no longer needed. If 0, the normal 4042 * extended lifetime is used. 4043 * 4044 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 4045 */ 4046 @Deprecated 4047 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 4048 4049 /** 4050 * Determines which streams are affected by ringer and zen mode changes. The 4051 * stream type's bit should be set to 1 if it should be muted when going 4052 * into an inaudible ringer mode. 4053 */ 4054 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 4055 4056 /** 4057 * Determines which streams are affected by mute. The 4058 * stream type's bit should be set to 1 if it should be muted when a mute request 4059 * is received. 4060 */ 4061 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 4062 4063 /** 4064 * Whether vibrate is on for different events. This is used internally, 4065 * changing this value will not change the vibrate. See AudioManager. 4066 */ 4067 public static final String VIBRATE_ON = "vibrate_on"; 4068 4069 /** 4070 * If 1, redirects the system vibrator to all currently attached input devices 4071 * that support vibration. If there are no such input devices, then the system 4072 * vibrator is used instead. 4073 * If 0, does not register the system vibrator. 4074 * 4075 * This setting is mainly intended to provide a compatibility mechanism for 4076 * applications that only know about the system vibrator and do not use the 4077 * input device vibrator API. 4078 * 4079 * @hide 4080 */ 4081 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 4082 4083 /** 4084 * The intensity of notification vibrations, if configurable. 4085 * 4086 * Not all devices are capable of changing their vibration intensity; on these devices 4087 * there will likely be no difference between the various vibration intensities except for 4088 * intensity 0 (off) and the rest. 4089 * 4090 * <b>Values:</b><br/> 4091 * 0 - Vibration is disabled<br/> 4092 * 1 - Weak vibrations<br/> 4093 * 2 - Medium vibrations<br/> 4094 * 3 - Strong vibrations 4095 * @hide 4096 */ 4097 public static final String NOTIFICATION_VIBRATION_INTENSITY = 4098 "notification_vibration_intensity"; 4099 /** 4100 * The intensity of ringtone vibrations, if configurable. 4101 * 4102 * Not all devices are capable of changing their vibration intensity; on these devices 4103 * there will likely be no difference between the various vibration intensities except for 4104 * intensity 0 (off) and the rest. 4105 * 4106 * <b>Values:</b><br/> 4107 * 0 - Vibration is disabled<br/> 4108 * 1 - Weak vibrations<br/> 4109 * 2 - Medium vibrations<br/> 4110 * 3 - Strong vibrations 4111 * @hide 4112 */ 4113 public static final String RING_VIBRATION_INTENSITY = 4114 "ring_vibration_intensity"; 4115 4116 /** 4117 * The intensity of haptic feedback vibrations, if configurable. 4118 * 4119 * Not all devices are capable of changing their feedback intensity; on these devices 4120 * there will likely be no difference between the various vibration intensities except for 4121 * intensity 0 (off) and the rest. 4122 * 4123 * <b>Values:</b><br/> 4124 * 0 - Vibration is disabled<br/> 4125 * 1 - Weak vibrations<br/> 4126 * 2 - Medium vibrations<br/> 4127 * 3 - Strong vibrations 4128 * @hide 4129 */ 4130 public static final String HAPTIC_FEEDBACK_INTENSITY = 4131 "haptic_feedback_intensity"; 4132 4133 /** 4134 * Ringer volume. This is used internally, changing this value will not 4135 * change the volume. See AudioManager. 4136 * 4137 * @removed Not used by anything since API 2. 4138 */ 4139 public static final String VOLUME_RING = "volume_ring"; 4140 4141 /** 4142 * System/notifications volume. This is used internally, changing this 4143 * value will not change the volume. See AudioManager. 4144 * 4145 * @removed Not used by anything since API 2. 4146 */ 4147 public static final String VOLUME_SYSTEM = "volume_system"; 4148 4149 /** 4150 * Voice call volume. This is used internally, changing this value will 4151 * not change the volume. See AudioManager. 4152 * 4153 * @removed Not used by anything since API 2. 4154 */ 4155 public static final String VOLUME_VOICE = "volume_voice"; 4156 4157 /** 4158 * Music/media/gaming volume. This is used internally, changing this 4159 * value will not change the volume. See AudioManager. 4160 * 4161 * @removed Not used by anything since API 2. 4162 */ 4163 public static final String VOLUME_MUSIC = "volume_music"; 4164 4165 /** 4166 * Alarm volume. This is used internally, changing this 4167 * value will not change the volume. See AudioManager. 4168 * 4169 * @removed Not used by anything since API 2. 4170 */ 4171 public static final String VOLUME_ALARM = "volume_alarm"; 4172 4173 /** 4174 * Notification volume. This is used internally, changing this 4175 * value will not change the volume. See AudioManager. 4176 * 4177 * @removed Not used by anything since API 2. 4178 */ 4179 public static final String VOLUME_NOTIFICATION = "volume_notification"; 4180 4181 /** 4182 * Bluetooth Headset volume. This is used internally, changing this value will 4183 * not change the volume. See AudioManager. 4184 * 4185 * @removed Not used by anything since API 2. 4186 */ 4187 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 4188 4189 /** 4190 * @hide 4191 * Acessibility volume. This is used internally, changing this 4192 * value will not change the volume. 4193 */ 4194 public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; 4195 4196 /** 4197 * @hide 4198 * Volume index for virtual assistant. 4199 */ 4200 public static final String VOLUME_ASSISTANT = "volume_assistant"; 4201 4202 /** 4203 * Master volume (float in the range 0.0f to 1.0f). 4204 * 4205 * @hide 4206 */ 4207 public static final String VOLUME_MASTER = "volume_master"; 4208 4209 /** 4210 * Master mono (int 1 = mono, 0 = normal). 4211 * 4212 * @hide 4213 */ 4214 @UnsupportedAppUsage 4215 public static final String MASTER_MONO = "master_mono"; 4216 4217 /** 4218 * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right). 4219 * 4220 * @hide 4221 */ 4222 public static final String MASTER_BALANCE = "master_balance"; 4223 4224 /** 4225 * Whether the notifications should use the ring volume (value of 1) or 4226 * a separate notification volume (value of 0). In most cases, users 4227 * will have this enabled so the notification and ringer volumes will be 4228 * the same. However, power users can disable this and use the separate 4229 * notification volume control. 4230 * <p> 4231 * Note: This is a one-off setting that will be removed in the future 4232 * when there is profile support. For this reason, it is kept hidden 4233 * from the public APIs. 4234 * 4235 * @hide 4236 * @deprecated 4237 */ 4238 @Deprecated 4239 public static final String NOTIFICATIONS_USE_RING_VOLUME = 4240 "notifications_use_ring_volume"; 4241 4242 /** 4243 * Whether silent mode should allow vibration feedback. This is used 4244 * internally in AudioService and the Sound settings activity to 4245 * coordinate decoupling of vibrate and silent modes. This setting 4246 * will likely be removed in a future release with support for 4247 * audio/vibe feedback profiles. 4248 * 4249 * Not used anymore. On devices with vibrator, the user explicitly selects 4250 * silent or vibrate mode. 4251 * Kept for use by legacy database upgrade code in DatabaseHelper. 4252 * @hide 4253 */ 4254 @UnsupportedAppUsage 4255 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 4256 4257 /** 4258 * The mapping of stream type (integer) to its setting. 4259 * 4260 * @removed Not used by anything since API 2. 4261 */ 4262 public static final String[] VOLUME_SETTINGS = { 4263 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4264 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 4265 }; 4266 4267 /** 4268 * @hide 4269 * The mapping of stream type (integer) to its setting. 4270 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as 4271 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes 4272 * are never persisted. 4273 */ 4274 public static final String[] VOLUME_SETTINGS_INT = { 4275 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4276 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, 4277 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, 4278 "" /*STREAM_DTMF, no setting for this stream*/, 4279 "" /*STREAM_TTS, no setting for this stream*/, 4280 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT 4281 }; 4282 4283 /** 4284 * Appended to various volume related settings to record the previous 4285 * values before they the settings were affected by a silent/vibrate 4286 * ringer mode change. 4287 * 4288 * @removed Not used by anything since API 2. 4289 */ 4290 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 4291 4292 /** 4293 * Persistent store for the system-wide default ringtone URI. 4294 * <p> 4295 * If you need to play the default ringtone at any given time, it is recommended 4296 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 4297 * to the set default ringtone at the time of playing. 4298 * 4299 * @see #DEFAULT_RINGTONE_URI 4300 */ 4301 public static final String RINGTONE = "ringtone"; 4302 4303 /** 4304 * A {@link Uri} that will point to the current default ringtone at any 4305 * given time. 4306 * <p> 4307 * If the current default ringtone is in the DRM provider and the caller 4308 * does not have permission, the exception will be a 4309 * FileNotFoundException. 4310 */ 4311 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 4312 4313 /** {@hide} */ 4314 public static final String RINGTONE_CACHE = "ringtone_cache"; 4315 /** {@hide} */ 4316 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); 4317 4318 /** 4319 * Persistent store for the system-wide default notification sound. 4320 * 4321 * @see #RINGTONE 4322 * @see #DEFAULT_NOTIFICATION_URI 4323 */ 4324 public static final String NOTIFICATION_SOUND = "notification_sound"; 4325 4326 /** 4327 * A {@link Uri} that will point to the current default notification 4328 * sound at any given time. 4329 * 4330 * @see #DEFAULT_RINGTONE_URI 4331 */ 4332 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 4333 4334 /** {@hide} */ 4335 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; 4336 /** {@hide} */ 4337 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); 4338 4339 /** 4340 * Persistent store for the system-wide default alarm alert. 4341 * 4342 * @see #RINGTONE 4343 * @see #DEFAULT_ALARM_ALERT_URI 4344 */ 4345 public static final String ALARM_ALERT = "alarm_alert"; 4346 4347 /** 4348 * A {@link Uri} that will point to the current default alarm alert at 4349 * any given time. 4350 * 4351 * @see #DEFAULT_ALARM_ALERT_URI 4352 */ 4353 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 4354 4355 /** {@hide} */ 4356 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; 4357 /** {@hide} */ 4358 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); 4359 4360 /** 4361 * Persistent store for the system default media button event receiver. 4362 * 4363 * @hide 4364 */ 4365 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 4366 4367 /** 4368 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 4369 */ 4370 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 4371 4372 /** 4373 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 4374 */ 4375 public static final String TEXT_AUTO_CAPS = "auto_caps"; 4376 4377 /** 4378 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 4379 * feature converts two spaces to a "." and space. 4380 */ 4381 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 4382 4383 /** 4384 * Setting to showing password characters in text editors. 1 = On, 0 = Off 4385 */ 4386 public static final String TEXT_SHOW_PASSWORD = "show_password"; 4387 4388 public static final String SHOW_GTALK_SERVICE_STATUS = 4389 "SHOW_GTALK_SERVICE_STATUS"; 4390 4391 /** 4392 * Name of activity to use for wallpaper on the home screen. 4393 * 4394 * @deprecated Use {@link WallpaperManager} instead. 4395 */ 4396 @Deprecated 4397 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 4398 4399 /** 4400 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 4401 * instead 4402 */ 4403 @Deprecated 4404 public static final String AUTO_TIME = Global.AUTO_TIME; 4405 4406 /** 4407 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 4408 * instead 4409 */ 4410 @Deprecated 4411 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 4412 4413 /** 4414 * Display times as 12 or 24 hours 4415 * 12 4416 * 24 4417 */ 4418 public static final String TIME_12_24 = "time_12_24"; 4419 4420 /** 4421 * Date format string 4422 * mm/dd/yyyy 4423 * dd/mm/yyyy 4424 * yyyy/mm/dd 4425 */ 4426 public static final String DATE_FORMAT = "date_format"; 4427 4428 /** 4429 * Whether the setup wizard has been run before (on first boot), or if 4430 * it still needs to be run. 4431 * 4432 * nonzero = it has been run in the past 4433 * 0 = it has not been run in the past 4434 */ 4435 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 4436 4437 /** 4438 * Scaling factor for normal window animations. Setting to 0 will disable window 4439 * animations. 4440 * 4441 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 4442 */ 4443 @Deprecated 4444 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 4445 4446 /** 4447 * Scaling factor for activity transition animations. Setting to 0 will disable window 4448 * animations. 4449 * 4450 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 4451 */ 4452 @Deprecated 4453 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 4454 4455 /** 4456 * Scaling factor for Animator-based animations. This affects both the start delay and 4457 * duration of all such animations. Setting to 0 will cause animations to end immediately. 4458 * The default value is 1. 4459 * 4460 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 4461 */ 4462 @Deprecated 4463 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 4464 4465 /** 4466 * Control whether the accelerometer will be used to change screen 4467 * orientation. If 0, it will not be used unless explicitly requested 4468 * by the application; if 1, it will be used by default unless explicitly 4469 * disabled by the application. 4470 */ 4471 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 4472 4473 /** 4474 * Default screen rotation when no other policy applies. 4475 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 4476 * preference, this rotation value will be used. Must be one of the 4477 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 4478 * 4479 * @see Display#getRotation 4480 */ 4481 public static final String USER_ROTATION = "user_rotation"; 4482 4483 /** 4484 * Control whether the rotation lock toggle in the System UI should be hidden. 4485 * Typically this is done for accessibility purposes to make it harder for 4486 * the user to accidentally toggle the rotation lock while the display rotation 4487 * has been locked for accessibility. 4488 * 4489 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 4490 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 4491 * 4492 * @hide 4493 */ 4494 @UnsupportedAppUsage 4495 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 4496 "hide_rotation_lock_toggle_for_accessibility"; 4497 4498 /** 4499 * Whether the phone vibrates when it is ringing due to an incoming call. This will 4500 * be used by Phone and Setting apps; it shouldn't affect other apps. 4501 * The value is boolean (1 or 0). 4502 * 4503 * Note: this is not same as "vibrate on ring", which had been available until ICS. 4504 * It was about AudioManager's setting and thus affected all the applications which 4505 * relied on the setting, while this is purely about the vibration setting for incoming 4506 * calls. 4507 */ 4508 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 4509 4510 /** 4511 * When {@code 1}, Telecom enhanced call blocking functionality is enabled. When 4512 * {@code 0}, enhanced call blocking functionality is disabled. 4513 * @hide 4514 */ 4515 public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING = 4516 "debug.enable_enhanced_calling"; 4517 4518 /** 4519 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 4520 * boolean (1 or 0). 4521 */ 4522 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 4523 4524 /** 4525 * CDMA only settings 4526 * DTMF tone type played by the dialer when dialing. 4527 * 0 = Normal 4528 * 1 = Long 4529 */ 4530 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 4531 4532 /** 4533 * Whether the hearing aid is enabled. The value is 4534 * boolean (1 or 0). 4535 * @hide 4536 */ 4537 @UnsupportedAppUsage 4538 public static final String HEARING_AID = "hearing_aid"; 4539 4540 /** 4541 * CDMA only settings 4542 * TTY Mode 4543 * 0 = OFF 4544 * 1 = FULL 4545 * 2 = VCO 4546 * 3 = HCO 4547 * @hide 4548 */ 4549 @UnsupportedAppUsage 4550 public static final String TTY_MODE = "tty_mode"; 4551 4552 /** 4553 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 4554 * boolean (1 or 0). 4555 */ 4556 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 4557 4558 /** 4559 * Whether haptic feedback (Vibrate on tap) is enabled. The value is 4560 * boolean (1 or 0). 4561 */ 4562 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 4563 4564 /** 4565 * @deprecated Each application that shows web suggestions should have its own 4566 * setting for this. 4567 */ 4568 @Deprecated 4569 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 4570 4571 /** 4572 * Whether the notification LED should repeatedly flash when a notification is 4573 * pending. The value is boolean (1 or 0). 4574 * @hide 4575 */ 4576 @UnsupportedAppUsage 4577 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 4578 4579 /** 4580 * Show pointer location on screen? 4581 * 0 = no 4582 * 1 = yes 4583 * @hide 4584 */ 4585 @UnsupportedAppUsage 4586 public static final String POINTER_LOCATION = "pointer_location"; 4587 4588 /** 4589 * Show touch positions on screen? 4590 * 0 = no 4591 * 1 = yes 4592 * @hide 4593 */ 4594 @UnsupportedAppUsage 4595 public static final String SHOW_TOUCHES = "show_touches"; 4596 4597 /** 4598 * Log raw orientation data from 4599 * {@link com.android.server.policy.WindowOrientationListener} for use with the 4600 * orientationplot.py tool. 4601 * 0 = no 4602 * 1 = yes 4603 * @hide 4604 */ 4605 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 4606 "window_orientation_listener_log"; 4607 4608 /** 4609 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 4610 * instead 4611 * @hide 4612 */ 4613 @Deprecated 4614 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 4615 4616 /** 4617 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 4618 * instead 4619 * @hide 4620 */ 4621 @Deprecated 4622 @UnsupportedAppUsage 4623 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 4624 4625 /** 4626 * Whether to play sounds when the keyguard is shown and dismissed. 4627 * @hide 4628 */ 4629 @UnsupportedAppUsage 4630 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 4631 4632 /** 4633 * Whether the lockscreen should be completely disabled. 4634 * @hide 4635 */ 4636 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 4637 4638 /** 4639 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 4640 * instead 4641 * @hide 4642 */ 4643 @Deprecated 4644 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 4645 4646 /** 4647 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 4648 * instead 4649 * @hide 4650 */ 4651 @Deprecated 4652 @UnsupportedAppUsage 4653 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 4654 4655 /** 4656 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 4657 * instead 4658 * @hide 4659 */ 4660 @Deprecated 4661 @UnsupportedAppUsage 4662 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 4663 4664 /** 4665 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 4666 * instead 4667 * @hide 4668 */ 4669 @Deprecated 4670 @UnsupportedAppUsage 4671 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 4672 4673 /** 4674 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 4675 * instead 4676 * @hide 4677 */ 4678 @Deprecated 4679 @UnsupportedAppUsage 4680 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 4681 4682 /** 4683 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 4684 * instead 4685 * @hide 4686 */ 4687 @Deprecated 4688 @UnsupportedAppUsage 4689 public static final String LOCK_SOUND = Global.LOCK_SOUND; 4690 4691 /** 4692 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 4693 * instead 4694 * @hide 4695 */ 4696 @Deprecated 4697 @UnsupportedAppUsage 4698 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 4699 4700 /** 4701 * Receive incoming SIP calls? 4702 * 0 = no 4703 * 1 = yes 4704 * @hide 4705 */ 4706 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 4707 4708 /** 4709 * Call Preference String. 4710 * "SIP_ALWAYS" : Always use SIP with network access 4711 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 4712 * @hide 4713 */ 4714 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 4715 4716 /** 4717 * One of the sip call options: Always use SIP with network access. 4718 * @hide 4719 */ 4720 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 4721 4722 /** 4723 * One of the sip call options: Only if destination is a SIP address. 4724 * @hide 4725 */ 4726 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 4727 4728 /** 4729 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that 4730 * the user should be prompted each time a call is made whether it should be placed using 4731 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with 4732 * SIP_ADDRESS_ONLY. 4733 * @hide 4734 */ 4735 @Deprecated 4736 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 4737 4738 /** 4739 * Pointer speed setting. 4740 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 4741 * -7 = slowest 4742 * 0 = default speed 4743 * +7 = fastest 4744 * @hide 4745 */ 4746 @UnsupportedAppUsage 4747 public static final String POINTER_SPEED = "pointer_speed"; 4748 4749 /** 4750 * Whether lock-to-app will be triggered by long-press on recents. 4751 * @hide 4752 */ 4753 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; 4754 4755 /** 4756 * I am the lolrus. 4757 * <p> 4758 * Nonzero values indicate that the user has a bukkit. 4759 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 4760 * @hide 4761 */ 4762 public static final String EGG_MODE = "egg_mode"; 4763 4764 /** 4765 * Setting to determine whether or not to show the battery percentage in the status bar. 4766 * 0 - Don't show percentage 4767 * 1 - Show percentage 4768 * @hide 4769 */ 4770 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; 4771 4772 /** 4773 * Whether or not to enable multiple audio focus. 4774 * When enabled, requires more management by user over application playback activity, 4775 * for instance pausing media apps when another starts. 4776 * @hide 4777 */ 4778 public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled"; 4779 4780 /** 4781 * IMPORTANT: If you add a new public settings you also have to add it to 4782 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add 4783 * it to PRIVATE_SETTINGS below. Also add a validator that can validate 4784 * the setting value. See an example above. 4785 */ 4786 4787 /** 4788 * Keys we no longer back up under the current schema, but want to continue to 4789 * process when restoring historical backup datasets. 4790 * 4791 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 4792 * otherwise they won't be restored. 4793 * 4794 * @hide 4795 */ 4796 public static final String[] LEGACY_RESTORE_SETTINGS = { 4797 }; 4798 4799 /** 4800 * These are all public system settings 4801 * 4802 * @hide 4803 */ 4804 @UnsupportedAppUsage 4805 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); 4806 static { 4807 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); 4808 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); 4809 PUBLIC_SETTINGS.add(WIFI_STATIC_IP); 4810 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); 4811 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); 4812 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); 4813 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); 4814 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); 4815 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); 4816 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); 4817 PUBLIC_SETTINGS.add(FONT_SCALE); 4818 PUBLIC_SETTINGS.add(SYSTEM_LOCALES); 4819 PUBLIC_SETTINGS.add(DIM_SCREEN); 4820 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); 4821 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); 4822 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT); 4823 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR); 4824 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT); 4825 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); 4826 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); 4827 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); 4828 PUBLIC_SETTINGS.add(VIBRATE_ON); 4829 PUBLIC_SETTINGS.add(VOLUME_RING); 4830 PUBLIC_SETTINGS.add(VOLUME_SYSTEM); 4831 PUBLIC_SETTINGS.add(VOLUME_VOICE); 4832 PUBLIC_SETTINGS.add(VOLUME_MUSIC); 4833 PUBLIC_SETTINGS.add(VOLUME_ALARM); 4834 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); 4835 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); 4836 PUBLIC_SETTINGS.add(VOLUME_ASSISTANT); 4837 PUBLIC_SETTINGS.add(RINGTONE); 4838 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); 4839 PUBLIC_SETTINGS.add(ALARM_ALERT); 4840 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); 4841 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); 4842 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 4843 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); 4844 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); 4845 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); 4846 PUBLIC_SETTINGS.add(TIME_12_24); 4847 PUBLIC_SETTINGS.add(DATE_FORMAT); 4848 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); 4849 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); 4850 PUBLIC_SETTINGS.add(USER_ROTATION); 4851 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); 4852 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); 4853 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 4854 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); 4855 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); 4856 } 4857 4858 /** 4859 * These are all hidden system settings. 4860 * 4861 * @hide 4862 */ 4863 @UnsupportedAppUsage 4864 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); 4865 static { 4866 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); 4867 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); 4868 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); 4869 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); 4870 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); 4871 PRIVATE_SETTINGS.add(VOLUME_MASTER); 4872 PRIVATE_SETTINGS.add(MASTER_MONO); 4873 PRIVATE_SETTINGS.add(MASTER_BALANCE); 4874 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); 4875 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); 4876 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); 4877 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); 4878 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); 4879 PRIVATE_SETTINGS.add(HEARING_AID); 4880 PRIVATE_SETTINGS.add(TTY_MODE); 4881 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); 4882 PRIVATE_SETTINGS.add(POINTER_LOCATION); 4883 PRIVATE_SETTINGS.add(SHOW_TOUCHES); 4884 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); 4885 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); 4886 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); 4887 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); 4888 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); 4889 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); 4890 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); 4891 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); 4892 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); 4893 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); 4894 PRIVATE_SETTINGS.add(LOCK_SOUND); 4895 PRIVATE_SETTINGS.add(UNLOCK_SOUND); 4896 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); 4897 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); 4898 PRIVATE_SETTINGS.add(SIP_ALWAYS); 4899 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); 4900 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); 4901 PRIVATE_SETTINGS.add(POINTER_SPEED); 4902 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); 4903 PRIVATE_SETTINGS.add(EGG_MODE); 4904 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); 4905 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE); 4906 } 4907 4908 /** 4909 * These entries are considered common between the personal and the managed profile, 4910 * since the managed profile doesn't get to change them. 4911 */ 4912 @UnsupportedAppUsage 4913 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 4914 static { 4915 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); 4916 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); 4917 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); 4918 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); 4919 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); 4920 } 4921 4922 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)4923 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 4924 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 4925 } 4926 4927 /** 4928 * These entries should be cloned from this profile's parent only if the dependency's 4929 * value is true ("1") 4930 * 4931 * Note: the dependencies must be Secure settings 4932 * 4933 * @hide 4934 */ 4935 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); 4936 static { CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)4937 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)4938 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)4939 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); 4940 } 4941 4942 /** @hide */ getCloneFromParentOnValueSettings(Map<String, String> outMap)4943 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { 4944 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); 4945 } 4946 4947 /** 4948 * System settings which can be accessed by instant apps. 4949 * @hide 4950 */ 4951 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 4952 static { 4953 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); 4954 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); 4955 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 4956 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); 4957 INSTANT_APP_SETTINGS.add(DATE_FORMAT); 4958 INSTANT_APP_SETTINGS.add(FONT_SCALE); 4959 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 4960 INSTANT_APP_SETTINGS.add(TIME_12_24); 4961 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); 4962 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); 4963 } 4964 4965 /** 4966 * When to use Wi-Fi calling 4967 * 4968 * @see android.telephony.TelephonyManager.WifiCallingChoices 4969 * @hide 4970 */ 4971 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 4972 4973 // Settings moved to Settings.Secure 4974 4975 /** 4976 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 4977 * instead 4978 */ 4979 @Deprecated 4980 public static final String ADB_ENABLED = Global.ADB_ENABLED; 4981 4982 /** 4983 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 4984 */ 4985 @Deprecated 4986 public static final String ANDROID_ID = Secure.ANDROID_ID; 4987 4988 /** 4989 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 4990 */ 4991 @Deprecated 4992 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 4993 4994 /** 4995 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 4996 */ 4997 @Deprecated 4998 public static final String DATA_ROAMING = Global.DATA_ROAMING; 4999 5000 /** 5001 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 5002 */ 5003 @Deprecated 5004 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 5005 5006 /** 5007 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 5008 */ 5009 @Deprecated 5010 public static final String HTTP_PROXY = Global.HTTP_PROXY; 5011 5012 /** 5013 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 5014 */ 5015 @Deprecated 5016 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 5017 5018 /** 5019 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 5020 * instead 5021 */ 5022 @Deprecated 5023 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 5024 5025 /** 5026 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 5027 */ 5028 @Deprecated 5029 public static final String LOGGING_ID = Secure.LOGGING_ID; 5030 5031 /** 5032 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 5033 */ 5034 @Deprecated 5035 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 5036 5037 /** 5038 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 5039 * instead 5040 */ 5041 @Deprecated 5042 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 5043 5044 /** 5045 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 5046 * instead 5047 */ 5048 @Deprecated 5049 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 5050 5051 /** 5052 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 5053 * instead 5054 */ 5055 @Deprecated 5056 public static final String PARENTAL_CONTROL_REDIRECT_URL = 5057 Secure.PARENTAL_CONTROL_REDIRECT_URL; 5058 5059 /** 5060 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 5061 */ 5062 @Deprecated 5063 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 5064 5065 /** 5066 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 5067 */ 5068 @Deprecated 5069 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 5070 5071 /** 5072 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 5073 */ 5074 @Deprecated 5075 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 5076 5077 /** 5078 * @deprecated Use 5079 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 5080 */ 5081 @Deprecated 5082 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 5083 5084 /** 5085 * @deprecated Use 5086 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 5087 */ 5088 @Deprecated 5089 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 5090 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 5091 5092 /** 5093 * @deprecated Use 5094 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 5095 */ 5096 @Deprecated 5097 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5098 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 5099 5100 /** 5101 * @deprecated Use 5102 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 5103 */ 5104 @Deprecated 5105 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 5106 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 5107 5108 /** 5109 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 5110 * instead 5111 */ 5112 @Deprecated 5113 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 5114 5115 /** 5116 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 5117 */ 5118 @Deprecated 5119 public static final String WIFI_ON = Global.WIFI_ON; 5120 5121 /** 5122 * @deprecated Use 5123 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 5124 * instead 5125 */ 5126 @Deprecated 5127 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 5128 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 5129 5130 /** 5131 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 5132 */ 5133 @Deprecated 5134 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 5135 5136 /** 5137 * @deprecated Use 5138 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 5139 */ 5140 @Deprecated 5141 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 5142 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 5143 5144 /** 5145 * @deprecated Use 5146 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 5147 */ 5148 @Deprecated 5149 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 5150 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 5151 5152 /** 5153 * @deprecated Use 5154 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 5155 * instead 5156 */ 5157 @Deprecated 5158 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 5159 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 5160 5161 /** 5162 * @deprecated Use 5163 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 5164 */ 5165 @Deprecated 5166 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 5167 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 5168 5169 /** 5170 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 5171 * instead 5172 */ 5173 @Deprecated 5174 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 5175 5176 /** 5177 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 5178 */ 5179 @Deprecated 5180 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 5181 5182 /** 5183 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 5184 */ 5185 @Deprecated 5186 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 5187 5188 /** 5189 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 5190 * instead 5191 */ 5192 @Deprecated 5193 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 5194 5195 /** 5196 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 5197 * instead 5198 */ 5199 @Deprecated 5200 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 5201 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 5202 5203 /** 5204 * Checks if the specified app can modify system settings. As of API 5205 * level 23, an app cannot modify system settings unless it declares the 5206 * {@link android.Manifest.permission#WRITE_SETTINGS} 5207 * permission in its manifest, <em>and</em> the user specifically grants 5208 * the app this capability. To prompt the user to grant this approval, 5209 * the app must send an intent with the action {@link 5210 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes 5211 * the system to display a permission management screen. 5212 * 5213 * @param context App context. 5214 * @return true if the calling app can write to system settings, false otherwise 5215 */ canWrite(Context context)5216 public static boolean canWrite(Context context) { 5217 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), 5218 context.getOpPackageName(), false); 5219 } 5220 } 5221 5222 /** 5223 * Secure system settings, containing system preferences that applications 5224 * can read but are not allowed to write. These are for preferences that 5225 * the user must explicitly modify through the UI of a system app. Normal 5226 * applications cannot modify the secure settings database, either directly 5227 * or by calling the "put" methods that this class contains. 5228 */ 5229 public static final class Secure extends NameValueTable { 5230 // NOTE: If you add new settings here, be sure to add them to 5231 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. 5232 5233 /** 5234 * The content:// style URL for this table 5235 */ 5236 public static final Uri CONTENT_URI = 5237 Uri.parse("content://" + AUTHORITY + "/secure"); 5238 5239 @UnsupportedAppUsage 5240 private static final ContentProviderHolder sProviderHolder = 5241 new ContentProviderHolder(CONTENT_URI); 5242 5243 // Populated lazily, guarded by class object: 5244 @UnsupportedAppUsage 5245 private static final NameValueCache sNameValueCache = new NameValueCache( 5246 CONTENT_URI, 5247 CALL_METHOD_GET_SECURE, 5248 CALL_METHOD_PUT_SECURE, 5249 sProviderHolder); 5250 5251 private static ILockSettings sLockSettings = null; 5252 5253 private static boolean sIsSystemProcess; 5254 @UnsupportedAppUsage 5255 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 5256 @UnsupportedAppUsage 5257 private static final HashSet<String> MOVED_TO_GLOBAL; 5258 static { 5259 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); 5260 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 5261 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 5262 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 5263 5264 MOVED_TO_GLOBAL = new HashSet<>(); 5265 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 5266 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 5267 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 5268 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 5269 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 5270 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 5271 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 5272 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 5273 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 5274 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 5275 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 5276 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 5277 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 5278 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 5279 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 5280 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 5281 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 5282 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 5283 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 5284 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 5285 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 5286 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 5287 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 5288 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 5289 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 5290 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 5291 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 5292 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 5293 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 5294 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 5295 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 5296 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 5297 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 5298 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 5299 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 5300 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 5301 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 5302 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 5303 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 5304 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 5305 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 5306 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 5307 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 5308 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 5309 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 5310 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 5311 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 5312 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 5313 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 5314 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 5315 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 5316 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 5317 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 5318 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 5319 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 5320 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 5321 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 5322 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5323 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 5324 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 5325 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 5326 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 5327 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 5328 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); 5329 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 5330 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 5331 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 5332 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 5333 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET); 5334 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5335 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 5336 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 5337 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 5338 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 5339 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 5340 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 5341 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 5342 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 5343 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 5344 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 5345 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 5346 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 5347 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 5348 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 5349 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 5350 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 5351 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 5352 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 5353 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 5354 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 5355 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 5356 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 5357 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 5358 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 5359 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 5360 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 5361 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 5362 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 5363 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 5364 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 5365 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 5366 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 5367 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 5368 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 5369 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 5370 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 5371 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 5372 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 5373 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 5374 } 5375 5376 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)5377 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 5378 outKeySet.addAll(MOVED_TO_GLOBAL); 5379 } 5380 5381 /** @hide */ clearProviderForTest()5382 public static void clearProviderForTest() { 5383 sProviderHolder.clearProviderForTest(); 5384 sNameValueCache.clearGenerationTrackerForTest(); 5385 } 5386 5387 /** 5388 * Look up a name in the database. 5389 * @param resolver to access the database with 5390 * @param name to look up in the table 5391 * @return the corresponding value, or null if not present 5392 */ getString(ContentResolver resolver, String name)5393 public static String getString(ContentResolver resolver, String name) { 5394 return getStringForUser(resolver, name, resolver.getUserId()); 5395 } 5396 5397 /** @hide */ 5398 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)5399 public static String getStringForUser(ContentResolver resolver, String name, 5400 int userHandle) { 5401 if (MOVED_TO_GLOBAL.contains(name)) { 5402 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5403 + " to android.provider.Settings.Global."); 5404 return Global.getStringForUser(resolver, name, userHandle); 5405 } 5406 5407 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 5408 synchronized (Secure.class) { 5409 if (sLockSettings == null) { 5410 sLockSettings = ILockSettings.Stub.asInterface( 5411 (IBinder) ServiceManager.getService("lock_settings")); 5412 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 5413 } 5414 } 5415 if (sLockSettings != null && !sIsSystemProcess) { 5416 // No context; use the ActivityThread's context as an approximation for 5417 // determining the target API level. 5418 Application application = ActivityThread.currentApplication(); 5419 5420 boolean isPreMnc = application != null 5421 && application.getApplicationInfo() != null 5422 && application.getApplicationInfo().targetSdkVersion 5423 <= VERSION_CODES.LOLLIPOP_MR1; 5424 if (isPreMnc) { 5425 try { 5426 return sLockSettings.getString(name, "0", userHandle); 5427 } catch (RemoteException re) { 5428 // Fall through 5429 } 5430 } else { 5431 throw new SecurityException("Settings.Secure." + name 5432 + " is deprecated and no longer accessible." 5433 + " See API documentation for potential replacements."); 5434 } 5435 } 5436 } 5437 5438 return sNameValueCache.getStringForUser(resolver, name, userHandle); 5439 } 5440 5441 /** 5442 * Store a name/value pair into the database. Values written by this method will be 5443 * overridden if a restore happens in the future. 5444 * 5445 * @param resolver to access the database with 5446 * @param name to store 5447 * @param value to associate with the name 5448 * @return true if the value was set, false on database errors 5449 * 5450 * @hide 5451 */ 5452 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)5453 public static boolean putString(ContentResolver resolver, String name, 5454 String value, boolean overrideableByRestore) { 5455 return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false, 5456 resolver.getUserId(), overrideableByRestore); 5457 } 5458 5459 /** 5460 * Store a name/value pair into the database. 5461 * @param resolver to access the database with 5462 * @param name to store 5463 * @param value to associate with the name 5464 * @return true if the value was set, false on database errors 5465 */ putString(ContentResolver resolver, String name, String value)5466 public static boolean putString(ContentResolver resolver, String name, String value) { 5467 return putStringForUser(resolver, name, value, resolver.getUserId()); 5468 } 5469 5470 /** @hide */ 5471 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5472 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 5473 int userHandle) { 5474 return putStringForUser(resolver, name, value, null, false, userHandle, 5475 DEFAULT_OVERRIDEABLE_BY_RESTORE); 5476 } 5477 5478 /** @hide */ 5479 @UnsupportedAppUsage putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)5480 public static boolean putStringForUser(@NonNull ContentResolver resolver, 5481 @NonNull String name, @Nullable String value, @Nullable String tag, 5482 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 5483 if (MOVED_TO_GLOBAL.contains(name)) { 5484 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5485 + " to android.provider.Settings.Global"); 5486 return Global.putStringForUser(resolver, name, value, 5487 tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 5488 } 5489 return sNameValueCache.putStringForUser(resolver, name, value, tag, 5490 makeDefault, userHandle, overrideableByRestore); 5491 } 5492 5493 /** 5494 * Store a name/value pair into the database. 5495 * <p> 5496 * The method takes an optional tag to associate with the setting 5497 * which can be used to clear only settings made by your package and 5498 * associated with this tag by passing the tag to {@link 5499 * #resetToDefaults(ContentResolver, String)}. Anyone can override 5500 * the current tag. Also if another package changes the setting 5501 * then the tag will be set to the one specified in the set call 5502 * which can be null. Also any of the settings setters that do not 5503 * take a tag as an argument effectively clears the tag. 5504 * </p><p> 5505 * For example, if you set settings A and B with tags T1 and T2 and 5506 * another app changes setting A (potentially to the same value), it 5507 * can assign to it a tag T3 (note that now the package that changed 5508 * the setting is not yours). Now if you reset your changes for T1 and 5509 * T2 only setting B will be reset and A not (as it was changed by 5510 * another package) but since A did not change you are in the desired 5511 * initial state. Now if the other app changes the value of A (assuming 5512 * you registered an observer in the beginning) you would detect that 5513 * the setting was changed by another app and handle this appropriately 5514 * (ignore, set back to some value, etc). 5515 * </p><p> 5516 * Also the method takes an argument whether to make the value the 5517 * default for this setting. If the system already specified a default 5518 * value, then the one passed in here will <strong>not</strong> 5519 * be set as the default. 5520 * </p> 5521 * 5522 * @param resolver to access the database with. 5523 * @param name to store. 5524 * @param value to associate with the name. 5525 * @param tag to associate with the setting. 5526 * @param makeDefault whether to make the value the default one. 5527 * @return true if the value was set, false on database errors. 5528 * 5529 * @see #resetToDefaults(ContentResolver, String) 5530 * 5531 * @hide 5532 */ 5533 @SystemApi 5534 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5535 public static boolean putString(@NonNull ContentResolver resolver, 5536 @NonNull String name, @Nullable String value, @Nullable String tag, 5537 boolean makeDefault) { 5538 return putStringForUser(resolver, name, value, tag, makeDefault, 5539 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 5540 } 5541 5542 /** 5543 * Reset the settings to their defaults. This would reset <strong>only</strong> 5544 * settings set by the caller's package. Think of it of a way to undo your own 5545 * changes to the global settings. Passing in the optional tag will reset only 5546 * settings changed by your package and associated with this tag. 5547 * 5548 * @param resolver Handle to the content resolver. 5549 * @param tag Optional tag which should be associated with the settings to reset. 5550 * 5551 * @see #putString(ContentResolver, String, String, String, boolean) 5552 * 5553 * @hide 5554 */ 5555 @SystemApi 5556 @TestApi 5557 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5558 public static void resetToDefaults(@NonNull ContentResolver resolver, 5559 @Nullable String tag) { 5560 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 5561 resolver.getUserId()); 5562 } 5563 5564 /** 5565 * 5566 * Reset the settings to their defaults for a given user with a specific mode. The 5567 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 5568 * allowing resetting the settings made by a package and associated with the tag. 5569 * 5570 * @param resolver Handle to the content resolver. 5571 * @param tag Optional tag which should be associated with the settings to reset. 5572 * @param mode The reset mode. 5573 * @param userHandle The user for which to reset to defaults. 5574 * 5575 * @see #RESET_MODE_PACKAGE_DEFAULTS 5576 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 5577 * @see #RESET_MODE_UNTRUSTED_CHANGES 5578 * @see #RESET_MODE_TRUSTED_DEFAULTS 5579 * 5580 * @hide 5581 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)5582 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 5583 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 5584 try { 5585 Bundle arg = new Bundle(); 5586 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 5587 if (tag != null) { 5588 arg.putString(CALL_METHOD_TAG_KEY, tag); 5589 } 5590 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 5591 IContentProvider cp = sProviderHolder.getProvider(resolver); 5592 cp.call(resolver.getPackageName(), resolver.getAttributionTag(), 5593 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg); 5594 } catch (RemoteException e) { 5595 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 5596 } 5597 } 5598 5599 /** 5600 * Construct the content URI for a particular name/value pair, 5601 * useful for monitoring changes with a ContentObserver. 5602 * @param name to look up in the table 5603 * @return the corresponding content URI, or null if not present 5604 */ getUriFor(String name)5605 public static Uri getUriFor(String name) { 5606 if (MOVED_TO_GLOBAL.contains(name)) { 5607 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5608 + " to android.provider.Settings.Global, returning global URI."); 5609 return Global.getUriFor(Global.CONTENT_URI, name); 5610 } 5611 return getUriFor(CONTENT_URI, name); 5612 } 5613 5614 /** 5615 * Convenience function for retrieving a single secure settings value 5616 * as an integer. Note that internally setting values are always 5617 * stored as strings; this function converts the string to an integer 5618 * for you. The default value will be returned if the setting is 5619 * not defined or not an integer. 5620 * 5621 * @param cr The ContentResolver to access. 5622 * @param name The name of the setting to retrieve. 5623 * @param def Value to return if the setting is not defined. 5624 * 5625 * @return The setting's current value, or 'def' if it is not defined 5626 * or not a valid integer. 5627 */ getInt(ContentResolver cr, String name, int def)5628 public static int getInt(ContentResolver cr, String name, int def) { 5629 return getIntForUser(cr, name, def, cr.getUserId()); 5630 } 5631 5632 /** @hide */ 5633 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)5634 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 5635 String v = getStringForUser(cr, name, userHandle); 5636 try { 5637 return v != null ? Integer.parseInt(v) : def; 5638 } catch (NumberFormatException e) { 5639 return def; 5640 } 5641 } 5642 5643 /** 5644 * Convenience function for retrieving a single secure settings value 5645 * as an integer. Note that internally setting values are always 5646 * stored as strings; this function converts the string to an integer 5647 * for you. 5648 * <p> 5649 * This version does not take a default value. If the setting has not 5650 * been set, or the string value is not a number, 5651 * it throws {@link SettingNotFoundException}. 5652 * 5653 * @param cr The ContentResolver to access. 5654 * @param name The name of the setting to retrieve. 5655 * 5656 * @throws SettingNotFoundException Thrown if a setting by the given 5657 * name can't be found or the setting value is not an integer. 5658 * 5659 * @return The setting's current value. 5660 */ getInt(ContentResolver cr, String name)5661 public static int getInt(ContentResolver cr, String name) 5662 throws SettingNotFoundException { 5663 return getIntForUser(cr, name, cr.getUserId()); 5664 } 5665 5666 /** @hide */ getIntForUser(ContentResolver cr, String name, int userHandle)5667 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 5668 throws SettingNotFoundException { 5669 String v = getStringForUser(cr, name, userHandle); 5670 try { 5671 return Integer.parseInt(v); 5672 } catch (NumberFormatException e) { 5673 throw new SettingNotFoundException(name); 5674 } 5675 } 5676 5677 /** 5678 * Convenience function for updating a single settings value as an 5679 * integer. This will either create a new entry in the table if the 5680 * given name does not exist, or modify the value of the existing row 5681 * with that name. Note that internally setting values are always 5682 * stored as strings, so this function converts the given value to a 5683 * string before storing it. 5684 * 5685 * @param cr The ContentResolver to access. 5686 * @param name The name of the setting to modify. 5687 * @param value The new value for the setting. 5688 * @return true if the value was set, false on database errors 5689 */ putInt(ContentResolver cr, String name, int value)5690 public static boolean putInt(ContentResolver cr, String name, int value) { 5691 return putIntForUser(cr, name, value, cr.getUserId()); 5692 } 5693 5694 /** @hide */ 5695 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)5696 public static boolean putIntForUser(ContentResolver cr, String name, int value, 5697 int userHandle) { 5698 return putStringForUser(cr, name, Integer.toString(value), userHandle); 5699 } 5700 5701 /** 5702 * Convenience function for retrieving a single secure settings value 5703 * as a {@code long}. Note that internally setting values are always 5704 * stored as strings; this function converts the string to a {@code long} 5705 * for you. The default value will be returned if the setting is 5706 * not defined or not a {@code long}. 5707 * 5708 * @param cr The ContentResolver to access. 5709 * @param name The name of the setting to retrieve. 5710 * @param def Value to return if the setting is not defined. 5711 * 5712 * @return The setting's current value, or 'def' if it is not defined 5713 * or not a valid {@code long}. 5714 */ getLong(ContentResolver cr, String name, long def)5715 public static long getLong(ContentResolver cr, String name, long def) { 5716 return getLongForUser(cr, name, def, cr.getUserId()); 5717 } 5718 5719 /** @hide */ 5720 @UnsupportedAppUsage getLongForUser(ContentResolver cr, String name, long def, int userHandle)5721 public static long getLongForUser(ContentResolver cr, String name, long def, 5722 int userHandle) { 5723 String valString = getStringForUser(cr, name, userHandle); 5724 long value; 5725 try { 5726 value = valString != null ? Long.parseLong(valString) : def; 5727 } catch (NumberFormatException e) { 5728 value = def; 5729 } 5730 return value; 5731 } 5732 5733 /** 5734 * Convenience function for retrieving a single secure settings value 5735 * as a {@code long}. Note that internally setting values are always 5736 * stored as strings; this function converts the string to a {@code long} 5737 * for you. 5738 * <p> 5739 * This version does not take a default value. If the setting has not 5740 * been set, or the string value is not a number, 5741 * it throws {@link SettingNotFoundException}. 5742 * 5743 * @param cr The ContentResolver to access. 5744 * @param name The name of the setting to retrieve. 5745 * 5746 * @return The setting's current value. 5747 * @throws SettingNotFoundException Thrown if a setting by the given 5748 * name can't be found or the setting value is not an integer. 5749 */ getLong(ContentResolver cr, String name)5750 public static long getLong(ContentResolver cr, String name) 5751 throws SettingNotFoundException { 5752 return getLongForUser(cr, name, cr.getUserId()); 5753 } 5754 5755 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)5756 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 5757 throws SettingNotFoundException { 5758 String valString = getStringForUser(cr, name, userHandle); 5759 try { 5760 return Long.parseLong(valString); 5761 } catch (NumberFormatException e) { 5762 throw new SettingNotFoundException(name); 5763 } 5764 } 5765 5766 /** 5767 * Convenience function for updating a secure settings value as a long 5768 * integer. This will either create a new entry in the table if the 5769 * given name does not exist, or modify the value of the existing row 5770 * with that name. Note that internally setting values are always 5771 * stored as strings, so this function converts the given value to a 5772 * string before storing it. 5773 * 5774 * @param cr The ContentResolver to access. 5775 * @param name The name of the setting to modify. 5776 * @param value The new value for the setting. 5777 * @return true if the value was set, false on database errors 5778 */ putLong(ContentResolver cr, String name, long value)5779 public static boolean putLong(ContentResolver cr, String name, long value) { 5780 return putLongForUser(cr, name, value, cr.getUserId()); 5781 } 5782 5783 /** @hide */ 5784 @UnsupportedAppUsage putLongForUser(ContentResolver cr, String name, long value, int userHandle)5785 public static boolean putLongForUser(ContentResolver cr, String name, long value, 5786 int userHandle) { 5787 return putStringForUser(cr, name, Long.toString(value), userHandle); 5788 } 5789 5790 /** 5791 * Convenience function for retrieving a single secure settings value 5792 * as a floating point number. Note that internally setting values are 5793 * always stored as strings; this function converts the string to an 5794 * float for you. The default value will be returned if the setting 5795 * is not defined or not a valid float. 5796 * 5797 * @param cr The ContentResolver to access. 5798 * @param name The name of the setting to retrieve. 5799 * @param def Value to return if the setting is not defined. 5800 * 5801 * @return The setting's current value, or 'def' if it is not defined 5802 * or not a valid float. 5803 */ getFloat(ContentResolver cr, String name, float def)5804 public static float getFloat(ContentResolver cr, String name, float def) { 5805 return getFloatForUser(cr, name, def, cr.getUserId()); 5806 } 5807 5808 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)5809 public static float getFloatForUser(ContentResolver cr, String name, float def, 5810 int userHandle) { 5811 String v = getStringForUser(cr, name, userHandle); 5812 try { 5813 return v != null ? Float.parseFloat(v) : def; 5814 } catch (NumberFormatException e) { 5815 return def; 5816 } 5817 } 5818 5819 /** 5820 * Convenience function for retrieving a single secure settings value 5821 * as a float. Note that internally setting values are always 5822 * stored as strings; this function converts the string to a float 5823 * for you. 5824 * <p> 5825 * This version does not take a default value. If the setting has not 5826 * been set, or the string value is not a number, 5827 * it throws {@link SettingNotFoundException}. 5828 * 5829 * @param cr The ContentResolver to access. 5830 * @param name The name of the setting to retrieve. 5831 * 5832 * @throws SettingNotFoundException Thrown if a setting by the given 5833 * name can't be found or the setting value is not a float. 5834 * 5835 * @return The setting's current value. 5836 */ getFloat(ContentResolver cr, String name)5837 public static float getFloat(ContentResolver cr, String name) 5838 throws SettingNotFoundException { 5839 return getFloatForUser(cr, name, cr.getUserId()); 5840 } 5841 5842 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)5843 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 5844 throws SettingNotFoundException { 5845 String v = getStringForUser(cr, name, userHandle); 5846 if (v == null) { 5847 throw new SettingNotFoundException(name); 5848 } 5849 try { 5850 return Float.parseFloat(v); 5851 } catch (NumberFormatException e) { 5852 throw new SettingNotFoundException(name); 5853 } 5854 } 5855 5856 /** 5857 * Convenience function for updating a single settings value as a 5858 * floating point number. This will either create a new entry in the 5859 * table if the given name does not exist, or modify the value of the 5860 * existing row with that name. Note that internally setting values 5861 * are always stored as strings, so this function converts the given 5862 * value to a string before storing it. 5863 * 5864 * @param cr The ContentResolver to access. 5865 * @param name The name of the setting to modify. 5866 * @param value The new value for the setting. 5867 * @return true if the value was set, false on database errors 5868 */ putFloat(ContentResolver cr, String name, float value)5869 public static boolean putFloat(ContentResolver cr, String name, float value) { 5870 return putFloatForUser(cr, name, value, cr.getUserId()); 5871 } 5872 5873 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)5874 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 5875 int userHandle) { 5876 return putStringForUser(cr, name, Float.toString(value), userHandle); 5877 } 5878 5879 /** 5880 * Control whether to enable adaptive sleep mode. 5881 * @hide 5882 */ 5883 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 5884 5885 /** 5886 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 5887 * instead 5888 */ 5889 @Deprecated 5890 public static final String DEVELOPMENT_SETTINGS_ENABLED = 5891 Global.DEVELOPMENT_SETTINGS_ENABLED; 5892 5893 /** 5894 * When the user has enable the option to have a "bug report" command 5895 * in the power menu. 5896 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 5897 * @hide 5898 */ 5899 @Deprecated 5900 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 5901 5902 /** 5903 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 5904 */ 5905 @Deprecated 5906 public static final String ADB_ENABLED = Global.ADB_ENABLED; 5907 5908 /** 5909 * Setting to allow mock locations and location provider status to be injected into the 5910 * LocationManager service for testing purposes during application development. These 5911 * locations and status values override actual location and status information generated 5912 * by network, gps, or other location providers. 5913 * 5914 * @deprecated This settings is not used anymore. 5915 */ 5916 @Deprecated 5917 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 5918 5919 /** 5920 * Setting to indicate that on device captions are enabled. 5921 * 5922 * @hide 5923 */ 5924 @SystemApi 5925 public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled"; 5926 5927 /** 5928 * On Android 8.0 (API level 26) and higher versions of the platform, 5929 * a 64-bit number (expressed as a hexadecimal string), unique to 5930 * each combination of app-signing key, user, and device. 5931 * Values of {@code ANDROID_ID} are scoped by signing key and user. 5932 * The value may change if a factory reset is performed on the 5933 * device or if an APK signing key changes. 5934 * 5935 * For more information about how the platform handles {@code ANDROID_ID} 5936 * in Android 8.0 (API level 26) and higher, see <a 5937 * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all"> 5938 * Android 8.0 Behavior Changes</a>. 5939 * 5940 * <p class="note"><strong>Note:</strong> For apps that were installed 5941 * prior to updating the device to a version of Android 8.0 5942 * (API level 26) or higher, the value of {@code ANDROID_ID} changes 5943 * if the app is uninstalled and then reinstalled after the OTA. 5944 * To preserve values across uninstalls after an OTA to Android 8.0 5945 * or higher, developers can use 5946 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> 5947 * Key/Value Backup</a>.</p> 5948 * 5949 * <p>In versions of the platform lower than Android 8.0 (API level 26), 5950 * a 64-bit number (expressed as a hexadecimal string) that is randomly 5951 * generated when the user first sets up the device and should remain 5952 * constant for the lifetime of the user's device. 5953 * 5954 * On devices that have 5955 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> 5956 * multiple users</a>, each user appears as a 5957 * completely separate device, so the {@code ANDROID_ID} value is 5958 * unique to each user.</p> 5959 * 5960 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped 5961 * to the Instant App, it is generated when the Instant App is first installed and reset if 5962 * the user clears the Instant App. 5963 */ 5964 public static final String ANDROID_ID = "android_id"; 5965 5966 /** 5967 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 5968 */ 5969 @Deprecated 5970 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 5971 5972 /** 5973 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 5974 */ 5975 @Deprecated 5976 public static final String DATA_ROAMING = Global.DATA_ROAMING; 5977 5978 /** 5979 * Setting to record the input method used by default, holding the ID 5980 * of the desired method. 5981 */ 5982 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 5983 5984 /** 5985 * Setting to record the input method subtype used by default, holding the ID 5986 * of the desired method. 5987 */ 5988 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 5989 "selected_input_method_subtype"; 5990 5991 /** 5992 * Setting to record the history of input method subtype, holding the pair of ID of IME 5993 * and its last used subtype. 5994 * @hide 5995 */ 5996 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 5997 "input_methods_subtype_history"; 5998 5999 /** 6000 * Setting to record the visibility of input method selector 6001 */ 6002 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 6003 "input_method_selector_visibility"; 6004 6005 /** 6006 * The currently selected voice interaction service flattened ComponentName. 6007 * @hide 6008 */ 6009 @TestApi 6010 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 6011 6012 /** 6013 * The currently selected autofill service flattened ComponentName. 6014 * @hide 6015 */ 6016 @TestApi 6017 public static final String AUTOFILL_SERVICE = "autofill_service"; 6018 6019 /** 6020 * Boolean indicating if Autofill supports field classification. 6021 * 6022 * @see android.service.autofill.AutofillService 6023 * 6024 * @hide 6025 */ 6026 @SystemApi 6027 @TestApi 6028 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = 6029 "autofill_field_classification"; 6030 6031 /** 6032 * Boolean indicating if the dark mode dialog shown on first toggle has been seen. 6033 * 6034 * @hide 6035 */ 6036 public static final String DARK_MODE_DIALOG_SEEN = 6037 "dark_mode_dialog_seen"; 6038 6039 /** 6040 * Custom time when Dark theme is scheduled to activate. 6041 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6042 * @hide 6043 */ 6044 public static final String DARK_THEME_CUSTOM_START_TIME = 6045 "dark_theme_custom_start_time"; 6046 6047 /** 6048 * Custom time when Dark theme is scheduled to deactivate. 6049 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6050 * @hide 6051 */ 6052 public static final String DARK_THEME_CUSTOM_END_TIME = 6053 "dark_theme_custom_end_time"; 6054 6055 /** 6056 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. 6057 * 6058 * @hide 6059 */ 6060 @SystemApi 6061 @TestApi 6062 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = 6063 "autofill_user_data_max_user_data_size"; 6064 6065 /** 6066 * Defines value returned by 6067 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. 6068 * 6069 * @hide 6070 */ 6071 @SystemApi 6072 @TestApi 6073 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = 6074 "autofill_user_data_max_field_classification_size"; 6075 6076 /** 6077 * Defines value returned by 6078 * {@link android.service.autofill.UserData#getMaxCategoryCount()}. 6079 * 6080 * @hide 6081 */ 6082 @SystemApi 6083 @TestApi 6084 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = 6085 "autofill_user_data_max_category_count"; 6086 6087 /** 6088 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. 6089 * 6090 * @hide 6091 */ 6092 @SystemApi 6093 @TestApi 6094 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = 6095 "autofill_user_data_max_value_length"; 6096 6097 /** 6098 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. 6099 * 6100 * @hide 6101 */ 6102 @SystemApi 6103 @TestApi 6104 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = 6105 "autofill_user_data_min_value_length"; 6106 6107 /** 6108 * Defines whether Content Capture is enabled for the user. 6109 * 6110 * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled). 6111 * <p>Default: enabled 6112 * 6113 * @hide 6114 */ 6115 @TestApi 6116 public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled"; 6117 6118 /** 6119 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 6120 */ 6121 @Deprecated 6122 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 6123 6124 /** 6125 * Indicates whether a DPC has been downloaded during provisioning. 6126 * 6127 * <p>Type: int (0 for false, 1 for true) 6128 * 6129 * <p>If this is true, then any attempts to begin setup again should result in factory reset 6130 * 6131 * @hide 6132 */ 6133 public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED = 6134 "managed_provisioning_dpc_downloaded"; 6135 6136 /** 6137 * Indicates whether the device is under restricted secure FRP mode. 6138 * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge, 6139 * device is removed from this mode. 6140 * <p> 6141 * Type: int (0 for false, 1 for true) 6142 */ 6143 public static final String SECURE_FRP_MODE = "secure_frp_mode"; 6144 6145 /** 6146 * Indicates whether the current user has completed setup via the setup wizard. 6147 * <p> 6148 * Type: int (0 for false, 1 for true) 6149 * 6150 * @hide 6151 */ 6152 @SystemApi 6153 @TestApi 6154 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 6155 6156 /** 6157 * Indicates that the user has not started setup personalization. 6158 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6159 * 6160 * @hide 6161 */ 6162 @SystemApi 6163 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; 6164 6165 /** 6166 * Indicates that the user has not yet completed setup personalization. 6167 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6168 * 6169 * @hide 6170 */ 6171 @SystemApi 6172 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; 6173 6174 /** 6175 * Indicates that the user has snoozed personalization and will complete it later. 6176 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6177 * 6178 * @hide 6179 */ 6180 @SystemApi 6181 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; 6182 6183 /** 6184 * Indicates that the user has completed setup personalization. 6185 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6186 * 6187 * @hide 6188 */ 6189 @SystemApi 6190 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; 6191 6192 /** @hide */ 6193 @Retention(RetentionPolicy.SOURCE) 6194 @IntDef({ 6195 USER_SETUP_PERSONALIZATION_NOT_STARTED, 6196 USER_SETUP_PERSONALIZATION_STARTED, 6197 USER_SETUP_PERSONALIZATION_PAUSED, 6198 USER_SETUP_PERSONALIZATION_COMPLETE 6199 }) 6200 public @interface UserSetupPersonalization {} 6201 6202 /** 6203 * Defines the user's current state of device personalization. 6204 * The possible states are defined in {@link UserSetupPersonalization}. 6205 * 6206 * @hide 6207 */ 6208 @SystemApi 6209 public static final String USER_SETUP_PERSONALIZATION_STATE = 6210 "user_setup_personalization_state"; 6211 6212 /** 6213 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 6214 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 6215 * in case SetupWizard has been re-enabled on TV devices. 6216 * 6217 * @hide 6218 */ 6219 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; 6220 6221 /** 6222 * The prefix for a category name that indicates whether a suggested action from that 6223 * category was marked as completed. 6224 * <p> 6225 * Type: int (0 for false, 1 for true) 6226 * 6227 * @hide 6228 */ 6229 @SystemApi 6230 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; 6231 6232 /** 6233 * List of input methods that are currently enabled. This is a string 6234 * containing the IDs of all enabled input methods, each ID separated 6235 * by ':'. 6236 * 6237 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" 6238 * where imeId is ComponentName and subtype is int32. 6239 */ 6240 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 6241 6242 /** 6243 * List of system input methods that are currently disabled. This is a string 6244 * containing the IDs of all disabled input methods, each ID separated 6245 * by ':'. 6246 * @hide 6247 */ 6248 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 6249 6250 /** 6251 * Whether to show the IME when a hard keyboard is connected. This is a boolean that 6252 * determines if the IME should be shown when a hard keyboard is attached. 6253 * @hide 6254 */ 6255 @TestApi 6256 @SuppressLint("NoSettingsProvider") 6257 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; 6258 6259 /** 6260 * Host name and port for global http proxy. Uses ':' seperator for 6261 * between host and port. 6262 * 6263 * @deprecated Use {@link Global#HTTP_PROXY} 6264 */ 6265 @Deprecated 6266 public static final String HTTP_PROXY = Global.HTTP_PROXY; 6267 6268 /** 6269 * Package designated as always-on VPN provider. 6270 * 6271 * @hide 6272 */ 6273 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; 6274 6275 /** 6276 * Whether to block networking outside of VPN connections while always-on is set. 6277 * @see #ALWAYS_ON_VPN_APP 6278 * 6279 * @hide 6280 */ 6281 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; 6282 6283 /** 6284 * Comma separated list of packages that are allowed to access the network when VPN is in 6285 * lockdown mode but not running. 6286 * @see #ALWAYS_ON_VPN_LOCKDOWN 6287 * 6288 * @hide 6289 */ 6290 public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST = 6291 "always_on_vpn_lockdown_whitelist"; 6292 6293 /** 6294 * Whether applications can be installed for this user via the system's 6295 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 6296 * 6297 * <p>1 = permit app installation via the system package installer intent 6298 * <p>0 = do not allow use of the package installer 6299 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use 6300 * {@link PackageManager#canRequestPackageInstalls()} 6301 * @see PackageManager#canRequestPackageInstalls() 6302 */ 6303 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 6304 6305 /** 6306 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that 6307 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it 6308 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} 6309 * on behalf of the profile owner if needed to make the change transparent for profile 6310 * owners. 6311 * 6312 * @hide 6313 */ 6314 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = 6315 "unknown_sources_default_reversed"; 6316 6317 /** 6318 * Comma-separated list of location providers that are enabled. Do not rely on this value 6319 * being present or correct, or on ContentObserver notifications on the corresponding Uri. 6320 * 6321 * @deprecated The preferred methods for checking provider status and listening for changes 6322 * are via {@link LocationManager#isProviderEnabled(String)} and 6323 * {@link LocationManager#PROVIDERS_CHANGED_ACTION}. 6324 */ 6325 @Deprecated 6326 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 6327 6328 /** 6329 * The current location mode of the device. Do not rely on this value being present or on 6330 * ContentObserver notifications on the corresponding Uri. 6331 * 6332 * @deprecated The preferred methods for checking location mode and listening for changes 6333 * are via {@link LocationManager#isLocationEnabled()} and 6334 * {@link LocationManager#MODE_CHANGED_ACTION}. 6335 */ 6336 @Deprecated 6337 public static final String LOCATION_MODE = "location_mode"; 6338 6339 /** 6340 * The App or module that changes the location mode. 6341 * @hide 6342 */ 6343 public static final String LOCATION_CHANGER = "location_changer"; 6344 6345 /** 6346 * The location changer is unknown or unable to detect. 6347 * @hide 6348 */ 6349 public static final int LOCATION_CHANGER_UNKNOWN = 0; 6350 6351 /** 6352 * Location settings in system settings. 6353 * @hide 6354 */ 6355 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; 6356 6357 /** 6358 * The location icon in drop down notification drawer. 6359 * @hide 6360 */ 6361 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; 6362 6363 /** 6364 * Location mode is off. 6365 */ 6366 public static final int LOCATION_MODE_OFF = 0; 6367 6368 /** 6369 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6370 * on. 6371 * 6372 * @deprecated See {@link #LOCATION_MODE}. 6373 */ 6374 @Deprecated 6375 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 6376 6377 /** 6378 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6379 * on. 6380 * 6381 * @deprecated See {@link #LOCATION_MODE}. 6382 */ 6383 @Deprecated 6384 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 6385 6386 /** 6387 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6388 * on. 6389 * 6390 * @deprecated See {@link #LOCATION_MODE}. 6391 */ 6392 @Deprecated 6393 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 6394 6395 /** 6396 * Location mode is on. 6397 * 6398 * @hide 6399 */ 6400 @SystemApi 6401 public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY; 6402 6403 /** 6404 * The accuracy in meters used for coarsening location for clients with only the coarse 6405 * location permission. 6406 * 6407 * @hide 6408 */ 6409 public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy"; 6410 6411 /** 6412 * A flag containing settings used for biometric weak 6413 * @hide 6414 */ 6415 @Deprecated 6416 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 6417 "lock_biometric_weak_flags"; 6418 6419 /** 6420 * Whether lock-to-app will lock the keyguard when exiting. 6421 * @hide 6422 */ 6423 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 6424 6425 /** 6426 * Whether autolock is enabled (0 = false, 1 = true) 6427 * 6428 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security 6429 * level of the keyguard. Accessing this setting from an app that is targeting 6430 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6431 */ 6432 @Deprecated 6433 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 6434 6435 /** 6436 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 6437 * 6438 * @deprecated Accessing this setting from an app that is targeting 6439 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6440 */ 6441 @Deprecated 6442 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 6443 6444 /** 6445 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 6446 * true) 6447 * 6448 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 6449 * lockscreen uses 6450 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 6451 * Accessing this setting from an app that is targeting 6452 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6453 */ 6454 @Deprecated 6455 public static final String 6456 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 6457 6458 /** 6459 * This preference allows the device to be locked given time after screen goes off, 6460 * subject to current DeviceAdmin policy limits. 6461 * @hide 6462 */ 6463 @UnsupportedAppUsage 6464 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 6465 6466 6467 /** 6468 * This preference contains the string that shows for owner info on LockScreen. 6469 * @hide 6470 * @deprecated 6471 */ 6472 @Deprecated 6473 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 6474 6475 /** 6476 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 6477 * @hide 6478 */ 6479 @Deprecated 6480 public static final String LOCK_SCREEN_APPWIDGET_IDS = 6481 "lock_screen_appwidget_ids"; 6482 6483 /** 6484 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 6485 * @hide 6486 */ 6487 @Deprecated 6488 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 6489 "lock_screen_fallback_appwidget_id"; 6490 6491 /** 6492 * Index of the lockscreen appwidget to restore, -1 if none. 6493 * @hide 6494 */ 6495 @Deprecated 6496 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 6497 "lock_screen_sticky_appwidget"; 6498 6499 /** 6500 * This preference enables showing the owner info on LockScreen. 6501 * @hide 6502 * @deprecated 6503 */ 6504 @Deprecated 6505 @UnsupportedAppUsage 6506 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 6507 "lock_screen_owner_info_enabled"; 6508 6509 /** 6510 * Indicates whether the user has allowed notifications to be shown atop a securely locked 6511 * screen in their full "private" form (same as when the device is unlocked). 6512 * <p> 6513 * Type: int (0 for false, 1 for true) 6514 * 6515 * @hide 6516 */ 6517 @SystemApi 6518 @TestApi 6519 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 6520 "lock_screen_allow_private_notifications"; 6521 6522 /** 6523 * When set by a user, allows notification remote input atop a securely locked screen 6524 * without having to unlock 6525 * @hide 6526 */ 6527 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = 6528 "lock_screen_allow_remote_input"; 6529 6530 /** 6531 * Indicates which clock face to show on lock screen and AOD formatted as a serialized 6532 * {@link org.json.JSONObject} with the format: 6533 * {"clock": id, "_applied_timestamp": timestamp} 6534 * @hide 6535 */ 6536 public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face"; 6537 6538 /** 6539 * Indicates which clock face to show on lock screen and AOD while docked. 6540 * @hide 6541 */ 6542 public static final String DOCKED_CLOCK_FACE = "docked_clock_face"; 6543 6544 /** 6545 * Set by the system to track if the user needs to see the call to action for 6546 * the lockscreen notification policy. 6547 * @hide 6548 */ 6549 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = 6550 "show_note_about_notification_hiding"; 6551 6552 /** 6553 * Set to 1 by the system after trust agents have been initialized. 6554 * @hide 6555 */ 6556 public static final String TRUST_AGENTS_INITIALIZED = 6557 "trust_agents_initialized"; 6558 6559 /** 6560 * The Logging ID (a unique 64-bit value) as a hex string. 6561 * Used as a pseudonymous identifier for logging. 6562 * @deprecated This identifier is poorly initialized and has 6563 * many collisions. It should not be used. 6564 */ 6565 @Deprecated 6566 public static final String LOGGING_ID = "logging_id"; 6567 6568 /** 6569 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 6570 */ 6571 @Deprecated 6572 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 6573 6574 /** 6575 * No longer supported. 6576 */ 6577 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 6578 6579 /** 6580 * No longer supported. 6581 */ 6582 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 6583 6584 /** 6585 * No longer supported. 6586 */ 6587 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 6588 6589 /** 6590 * Settings classname to launch when Settings is clicked from All 6591 * Applications. Needed because of user testing between the old 6592 * and new Settings apps. 6593 */ 6594 // TODO: 881807 6595 public static final String SETTINGS_CLASSNAME = "settings_classname"; 6596 6597 /** 6598 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 6599 */ 6600 @Deprecated 6601 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 6602 6603 /** 6604 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 6605 */ 6606 @Deprecated 6607 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 6608 6609 /** 6610 * If accessibility is enabled. 6611 */ 6612 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 6613 6614 /** 6615 * Setting specifying if the accessibility shortcut is enabled. 6616 * @hide 6617 */ 6618 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = 6619 "accessibility_shortcut_on_lock_screen"; 6620 6621 /** 6622 * Setting specifying if the accessibility shortcut dialog has been shown to this user. 6623 * @hide 6624 */ 6625 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = 6626 "accessibility_shortcut_dialog_shown"; 6627 6628 /** 6629 * Setting specifying the accessibility services, accessibility shortcut targets, 6630 * or features to be toggled via the accessibility shortcut. 6631 * 6632 * <p> This is a colon-separated string list which contains the flattened 6633 * {@link ComponentName} and the class name of a system class implementing a supported 6634 * accessibility feature. 6635 * @hide 6636 */ 6637 @UnsupportedAppUsage 6638 @TestApi 6639 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 6640 "accessibility_shortcut_target_service"; 6641 6642 /** 6643 * Setting specifying the accessibility service or feature to be toggled via the 6644 * accessibility button in the navigation bar. This is either a flattened 6645 * {@link ComponentName} or the class name of a system class implementing a supported 6646 * accessibility feature. 6647 * @hide 6648 */ 6649 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = 6650 "accessibility_button_target_component"; 6651 6652 /** 6653 * Setting specifying the accessibility services, accessibility shortcut targets, 6654 * or features to be toggled via the accessibility button in the navigation bar. 6655 * 6656 * <p> This is a colon-separated string list which contains the flattened 6657 * {@link ComponentName} and the class name of a system class implementing a supported 6658 * accessibility feature. 6659 * @hide 6660 */ 6661 public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets"; 6662 6663 /** 6664 * The system class name of magnification controller which is a target to be toggled via 6665 * accessibility shortcut or accessibility button. 6666 * 6667 * @hide 6668 */ 6669 public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER = 6670 "com.android.server.accessibility.MagnificationController"; 6671 6672 /** 6673 * If touch exploration is enabled. 6674 */ 6675 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 6676 6677 /** 6678 * List of the enabled accessibility providers. 6679 */ 6680 public static final String ENABLED_ACCESSIBILITY_SERVICES = 6681 "enabled_accessibility_services"; 6682 6683 /** 6684 * List of the accessibility services to which the user has granted 6685 * permission to put the device into touch exploration mode. 6686 * 6687 * @hide 6688 */ 6689 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 6690 "touch_exploration_granted_accessibility_services"; 6691 6692 /** 6693 * Whether the Global Actions Panel is enabled. 6694 * @hide 6695 */ 6696 public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled"; 6697 6698 /** 6699 * Whether the Global Actions Panel can be toggled on or off in Settings. 6700 * @hide 6701 */ 6702 public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE = 6703 "global_actions_panel_available"; 6704 6705 /** 6706 * Enables debug mode for the Global Actions Panel. 6707 * @hide 6708 */ 6709 public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED = 6710 "global_actions_panel_debug_enabled"; 6711 6712 /** 6713 * Whether the hush gesture has ever been used 6714 * @hide 6715 */ 6716 @SystemApi 6717 public static final String HUSH_GESTURE_USED = "hush_gesture_used"; 6718 6719 /** 6720 * Number of times the user has manually clicked the ringer toggle 6721 * @hide 6722 */ 6723 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count"; 6724 6725 /** 6726 * Whether to play a sound for charging events. 6727 * @hide 6728 */ 6729 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 6730 6731 /** 6732 * Whether to vibrate for charging events. 6733 * @hide 6734 */ 6735 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 6736 6737 /** 6738 * If 0, turning on dnd manually will last indefinitely. 6739 * Else if non-negative, turning on dnd manually will last for this many minutes. 6740 * Else (if negative), turning on dnd manually will surface a dialog that prompts 6741 * user to specify a duration. 6742 * @hide 6743 */ 6744 public static final String ZEN_DURATION = "zen_duration"; 6745 6746 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; 6747 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; 6748 6749 /** 6750 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 6751 * @hide 6752 */ 6753 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 6754 6755 /** 6756 * If nonzero, will show the zen update settings suggestion. 6757 * @hide 6758 */ 6759 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 6760 6761 /** 6762 * If nonzero, zen has not been updated to reflect new changes. 6763 * @hide 6764 */ 6765 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 6766 6767 /** 6768 * If nonzero, zen setting suggestion has been viewed by user 6769 * @hide 6770 */ 6771 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 6772 "zen_settings_suggestion_viewed"; 6773 6774 /** 6775 * Whether the in call notification is enabled to play sound during calls. The value is 6776 * boolean (1 or 0). 6777 * @hide 6778 */ 6779 public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled"; 6780 6781 /** 6782 * Uri of the slice that's presented on the keyguard. 6783 * Defaults to a slice with the date and next alarm. 6784 * 6785 * @hide 6786 */ 6787 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; 6788 6789 /** 6790 * Whether to speak passwords while in accessibility mode. 6791 * 6792 * @deprecated The speaking of passwords is controlled by individual accessibility services. 6793 * Apps should ignore this setting and provide complete information to accessibility 6794 * at all times, which was the behavior when this value was {@code true}. 6795 */ 6796 @Deprecated 6797 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 6798 6799 /** 6800 * Whether to draw text with high contrast while in accessibility mode. 6801 * 6802 * @hide 6803 */ 6804 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 6805 "high_text_contrast_enabled"; 6806 6807 /** 6808 * Setting that specifies whether the display magnification is enabled via a system-wide 6809 * triple tap gesture. Display magnifications allows the user to zoom in the display content 6810 * and is targeted to low vision users. The current magnification scale is controlled by 6811 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 6812 * 6813 * @hide 6814 */ 6815 @UnsupportedAppUsage 6816 @TestApi 6817 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 6818 "accessibility_display_magnification_enabled"; 6819 6820 /** 6821 * Setting that specifies whether the display magnification is enabled via a shortcut 6822 * affordance within the system's navigation area. Display magnifications allows the user to 6823 * zoom in the display content and is targeted to low vision users. The current 6824 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 6825 * 6826 * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead. 6827 * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name 6828 * when navigation bar magnification is enabled. 6829 * @hide 6830 */ 6831 @SystemApi 6832 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = 6833 "accessibility_display_magnification_navbar_enabled"; 6834 6835 /** 6836 * Setting that specifies what the display magnification scale is. 6837 * Display magnifications allows the user to zoom in the display 6838 * content and is targeted to low vision users. Whether a display 6839 * magnification is performed is controlled by 6840 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and 6841 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} 6842 * 6843 * @hide 6844 */ 6845 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 6846 "accessibility_display_magnification_scale"; 6847 6848 /** 6849 * Unused mangnification setting 6850 * 6851 * @hide 6852 * @deprecated 6853 */ 6854 @Deprecated 6855 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 6856 "accessibility_display_magnification_auto_update"; 6857 6858 /** 6859 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be 6860 * modified from an AccessibilityService using the SoftKeyboardController. 6861 * 6862 * @hide 6863 */ 6864 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = 6865 "accessibility_soft_keyboard_mode"; 6866 6867 /** 6868 * Default soft keyboard behavior. 6869 * 6870 * @hide 6871 */ 6872 public static final int SHOW_MODE_AUTO = 0; 6873 6874 /** 6875 * Soft keyboard is never shown. 6876 * 6877 * @hide 6878 */ 6879 public static final int SHOW_MODE_HIDDEN = 1; 6880 6881 /** 6882 * Setting that specifies whether timed text (captions) should be 6883 * displayed in video content. Text display properties are controlled by 6884 * the following settings: 6885 * <ul> 6886 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 6887 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 6888 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 6889 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 6890 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 6891 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 6892 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 6893 * </ul> 6894 * 6895 * @hide 6896 */ 6897 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 6898 "accessibility_captioning_enabled"; 6899 6900 /** 6901 * Setting that specifies the language for captions as a locale string, 6902 * e.g. en_US. 6903 * 6904 * @see java.util.Locale#toString 6905 * @hide 6906 */ 6907 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 6908 "accessibility_captioning_locale"; 6909 6910 /** 6911 * Integer property that specifies the preset style for captions, one 6912 * of: 6913 * <ul> 6914 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 6915 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 6916 * </ul> 6917 * 6918 * @see java.util.Locale#toString 6919 * @hide 6920 */ 6921 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 6922 "accessibility_captioning_preset"; 6923 6924 /** 6925 * Integer property that specifes the background color for captions as a 6926 * packed 32-bit color. 6927 * 6928 * @see android.graphics.Color#argb 6929 * @hide 6930 */ 6931 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 6932 "accessibility_captioning_background_color"; 6933 6934 /** 6935 * Integer property that specifes the foreground color for captions as a 6936 * packed 32-bit color. 6937 * 6938 * @see android.graphics.Color#argb 6939 * @hide 6940 */ 6941 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 6942 "accessibility_captioning_foreground_color"; 6943 6944 /** 6945 * Integer property that specifes the edge type for captions, one of: 6946 * <ul> 6947 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 6948 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 6949 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 6950 * </ul> 6951 * 6952 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 6953 * @hide 6954 */ 6955 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 6956 "accessibility_captioning_edge_type"; 6957 6958 /** 6959 * Integer property that specifes the edge color for captions as a 6960 * packed 32-bit color. 6961 * 6962 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 6963 * @see android.graphics.Color#argb 6964 * @hide 6965 */ 6966 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 6967 "accessibility_captioning_edge_color"; 6968 6969 /** 6970 * Integer property that specifes the window color for captions as a 6971 * packed 32-bit color. 6972 * 6973 * @see android.graphics.Color#argb 6974 * @hide 6975 */ 6976 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 6977 "accessibility_captioning_window_color"; 6978 6979 /** 6980 * String property that specifies the typeface for captions, one of: 6981 * <ul> 6982 * <li>DEFAULT 6983 * <li>MONOSPACE 6984 * <li>SANS_SERIF 6985 * <li>SERIF 6986 * </ul> 6987 * 6988 * @see android.graphics.Typeface 6989 * @hide 6990 */ 6991 @UnsupportedAppUsage 6992 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 6993 "accessibility_captioning_typeface"; 6994 6995 /** 6996 * Floating point property that specifies font scaling for captions. 6997 * 6998 * @hide 6999 */ 7000 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 7001 "accessibility_captioning_font_scale"; 7002 7003 /** 7004 * Setting that specifies whether display color inversion is enabled. 7005 */ 7006 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 7007 "accessibility_display_inversion_enabled"; 7008 7009 /** 7010 * Setting that specifies whether display color space adjustment is 7011 * enabled. 7012 * 7013 * @hide 7014 */ 7015 @UnsupportedAppUsage 7016 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 7017 "accessibility_display_daltonizer_enabled"; 7018 7019 /** 7020 * Integer property that specifies the type of color space adjustment to 7021 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: 7022 * - AccessibilityManager.DALTONIZER_DISABLED = -1 7023 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 7024 * - <item>@string/daltonizer_mode_protanomaly</item> = 11 7025 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and 7026 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 7027 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 7028 * 7029 * @hide 7030 */ 7031 @UnsupportedAppUsage 7032 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 7033 "accessibility_display_daltonizer"; 7034 7035 /** 7036 * Setting that specifies whether automatic click when the mouse pointer stops moving is 7037 * enabled. 7038 * 7039 * @hide 7040 */ 7041 @UnsupportedAppUsage 7042 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = 7043 "accessibility_autoclick_enabled"; 7044 7045 /** 7046 * Integer setting specifying amount of time in ms the mouse pointer has to stay still 7047 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. 7048 * 7049 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED 7050 * @hide 7051 */ 7052 public static final String ACCESSIBILITY_AUTOCLICK_DELAY = 7053 "accessibility_autoclick_delay"; 7054 7055 /** 7056 * Whether or not larger size icons are used for the pointer of mouse/trackpad for 7057 * accessibility. 7058 * (0 = false, 1 = true) 7059 * @hide 7060 */ 7061 @UnsupportedAppUsage 7062 public static final String ACCESSIBILITY_LARGE_POINTER_ICON = 7063 "accessibility_large_pointer_icon"; 7064 7065 /** 7066 * The timeout for considering a press to be a long press in milliseconds. 7067 * @hide 7068 */ 7069 @UnsupportedAppUsage 7070 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 7071 7072 /** 7073 * The duration in milliseconds between the first tap's up event and the second tap's 7074 * down event for an interaction to be considered part of the same multi-press. 7075 * @hide 7076 */ 7077 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; 7078 7079 /** 7080 * Setting that specifies recommended timeout in milliseconds for controls 7081 * which don't need user's interactions. 7082 * 7083 * @hide 7084 */ 7085 public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS = 7086 "accessibility_non_interactive_ui_timeout_ms"; 7087 7088 /** 7089 * Setting that specifies recommended timeout in milliseconds for controls 7090 * which need user's interactions. 7091 * 7092 * @hide 7093 */ 7094 public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS = 7095 "accessibility_interactive_ui_timeout_ms"; 7096 7097 /** 7098 * List of the enabled print services. 7099 * 7100 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade 7101 * from pre-N. 7102 * 7103 * @hide 7104 */ 7105 @UnsupportedAppUsage 7106 public static final String ENABLED_PRINT_SERVICES = 7107 "enabled_print_services"; 7108 7109 /** 7110 * List of the disabled print services. 7111 * 7112 * @hide 7113 */ 7114 @TestApi 7115 public static final String DISABLED_PRINT_SERVICES = 7116 "disabled_print_services"; 7117 7118 /** 7119 * The saved value for WindowManagerService.setForcedDisplayDensity() 7120 * formatted as a single integer representing DPI. If unset, then use 7121 * the real display density. 7122 * 7123 * @hide 7124 */ 7125 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 7126 7127 /** 7128 * Setting to always use the default text-to-speech settings regardless 7129 * of the application settings. 7130 * 1 = override application settings, 7131 * 0 = use application settings (if specified). 7132 * 7133 * @deprecated The value of this setting is no longer respected by 7134 * the framework text to speech APIs as of the Ice Cream Sandwich release. 7135 */ 7136 @Deprecated 7137 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 7138 7139 /** 7140 * Default text-to-speech engine speech rate. 100 = 1x 7141 */ 7142 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 7143 7144 /** 7145 * Default text-to-speech engine pitch. 100 = 1x 7146 */ 7147 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 7148 7149 /** 7150 * Default text-to-speech engine. 7151 */ 7152 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 7153 7154 /** 7155 * Default text-to-speech language. 7156 * 7157 * @deprecated this setting is no longer in use, as of the Ice Cream 7158 * Sandwich release. Apps should never need to read this setting directly, 7159 * instead can query the TextToSpeech framework classes for the default 7160 * locale. {@link TextToSpeech#getLanguage()}. 7161 */ 7162 @Deprecated 7163 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 7164 7165 /** 7166 * Default text-to-speech country. 7167 * 7168 * @deprecated this setting is no longer in use, as of the Ice Cream 7169 * Sandwich release. Apps should never need to read this setting directly, 7170 * instead can query the TextToSpeech framework classes for the default 7171 * locale. {@link TextToSpeech#getLanguage()}. 7172 */ 7173 @Deprecated 7174 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 7175 7176 /** 7177 * Default text-to-speech locale variant. 7178 * 7179 * @deprecated this setting is no longer in use, as of the Ice Cream 7180 * Sandwich release. Apps should never need to read this setting directly, 7181 * instead can query the TextToSpeech framework classes for the 7182 * locale that is in use {@link TextToSpeech#getLanguage()}. 7183 */ 7184 @Deprecated 7185 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 7186 7187 /** 7188 * Stores the default tts locales on a per engine basis. Stored as 7189 * a comma seperated list of values, each value being of the form 7190 * {@code engine_name:locale} for example, 7191 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 7192 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 7193 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 7194 * setting directly, and can query the TextToSpeech framework classes 7195 * for the locale that is in use. 7196 * 7197 * @hide 7198 */ 7199 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 7200 7201 /** 7202 * Space delimited list of plugin packages that are enabled. 7203 */ 7204 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 7205 7206 /** 7207 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 7208 * instead. 7209 */ 7210 @Deprecated 7211 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 7212 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 7213 7214 /** 7215 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 7216 * instead. 7217 */ 7218 @Deprecated 7219 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 7220 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 7221 7222 /** 7223 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 7224 * instead. 7225 */ 7226 @Deprecated 7227 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 7228 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 7229 7230 /** 7231 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 7232 * instead. 7233 */ 7234 @Deprecated 7235 public static final String WIFI_ON = Global.WIFI_ON; 7236 7237 /** 7238 * The acceptable packet loss percentage (range 0 - 100) before trying 7239 * another AP on the same network. 7240 * @deprecated This setting is not used. 7241 */ 7242 @Deprecated 7243 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 7244 "wifi_watchdog_acceptable_packet_loss_percentage"; 7245 7246 /** 7247 * The number of access points required for a network in order for the 7248 * watchdog to monitor it. 7249 * @deprecated This setting is not used. 7250 */ 7251 @Deprecated 7252 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 7253 7254 /** 7255 * The delay between background checks. 7256 * @deprecated This setting is not used. 7257 */ 7258 @Deprecated 7259 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 7260 "wifi_watchdog_background_check_delay_ms"; 7261 7262 /** 7263 * Whether the Wi-Fi watchdog is enabled for background checking even 7264 * after it thinks the user has connected to a good access point. 7265 * @deprecated This setting is not used. 7266 */ 7267 @Deprecated 7268 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 7269 "wifi_watchdog_background_check_enabled"; 7270 7271 /** 7272 * The timeout for a background ping 7273 * @deprecated This setting is not used. 7274 */ 7275 @Deprecated 7276 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 7277 "wifi_watchdog_background_check_timeout_ms"; 7278 7279 /** 7280 * The number of initial pings to perform that *may* be ignored if they 7281 * fail. Again, if these fail, they will *not* be used in packet loss 7282 * calculation. For example, one network always seemed to time out for 7283 * the first couple pings, so this is set to 3 by default. 7284 * @deprecated This setting is not used. 7285 */ 7286 @Deprecated 7287 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 7288 "wifi_watchdog_initial_ignored_ping_count"; 7289 7290 /** 7291 * The maximum number of access points (per network) to attempt to test. 7292 * If this number is reached, the watchdog will no longer monitor the 7293 * initial connection state for the network. This is a safeguard for 7294 * networks containing multiple APs whose DNS does not respond to pings. 7295 * @deprecated This setting is not used. 7296 */ 7297 @Deprecated 7298 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 7299 7300 /** 7301 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 7302 */ 7303 @Deprecated 7304 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 7305 7306 /** 7307 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 7308 * @deprecated This setting is not used. 7309 */ 7310 @Deprecated 7311 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 7312 7313 /** 7314 * The number of pings to test if an access point is a good connection. 7315 * @deprecated This setting is not used. 7316 */ 7317 @Deprecated 7318 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 7319 7320 /** 7321 * The delay between pings. 7322 * @deprecated This setting is not used. 7323 */ 7324 @Deprecated 7325 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 7326 7327 /** 7328 * The timeout per ping. 7329 * @deprecated This setting is not used. 7330 */ 7331 @Deprecated 7332 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 7333 7334 /** 7335 * @deprecated Use 7336 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 7337 */ 7338 @Deprecated 7339 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 7340 7341 /** 7342 * @deprecated Use 7343 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 7344 */ 7345 @Deprecated 7346 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 7347 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 7348 7349 /** 7350 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives 7351 * the receivers of the PendingIntent an opportunity to make a new network request before 7352 * the Network satisfying the request is potentially removed. 7353 * 7354 * @hide 7355 */ 7356 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = 7357 "connectivity_release_pending_intent_delay_ms"; 7358 7359 /** 7360 * Whether background data usage is allowed. 7361 * 7362 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 7363 * availability of background data depends on several 7364 * combined factors. When background data is unavailable, 7365 * {@link ConnectivityManager#getActiveNetworkInfo()} will 7366 * now appear disconnected. 7367 */ 7368 @Deprecated 7369 public static final String BACKGROUND_DATA = "background_data"; 7370 7371 /** 7372 * Origins for which browsers should allow geolocation by default. 7373 * The value is a space-separated list of origins. 7374 */ 7375 public static final String ALLOWED_GEOLOCATION_ORIGINS 7376 = "allowed_geolocation_origins"; 7377 7378 /** 7379 * The preferred TTY mode 0 = TTy Off, CDMA default 7380 * 1 = TTY Full 7381 * 2 = TTY HCO 7382 * 3 = TTY VCO 7383 * @hide 7384 */ 7385 public static final String PREFERRED_TTY_MODE = 7386 "preferred_tty_mode"; 7387 7388 /** 7389 * Whether the enhanced voice privacy mode is enabled. 7390 * 0 = normal voice privacy 7391 * 1 = enhanced voice privacy 7392 * @hide 7393 */ 7394 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 7395 7396 /** 7397 * Whether the TTY mode mode is enabled. 7398 * 0 = disabled 7399 * 1 = enabled 7400 * @hide 7401 */ 7402 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 7403 7404 /** 7405 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT 7406 * calls when supported by the device and carrier. Boolean value. 7407 * 0 = OFF 7408 * 1 = ON 7409 */ 7410 public static final String RTT_CALLING_MODE = "rtt_calling_mode"; 7411 7412 /** 7413 /** 7414 * Controls whether settings backup is enabled. 7415 * Type: int ( 0 = disabled, 1 = enabled ) 7416 * @hide 7417 */ 7418 @UnsupportedAppUsage 7419 public static final String BACKUP_ENABLED = "backup_enabled"; 7420 7421 /** 7422 * Controls whether application data is automatically restored from backup 7423 * at install time. 7424 * Type: int ( 0 = disabled, 1 = enabled ) 7425 * @hide 7426 */ 7427 @UnsupportedAppUsage 7428 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 7429 7430 /** 7431 * Indicates whether settings backup has been fully provisioned. 7432 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 7433 * @hide 7434 */ 7435 @UnsupportedAppUsage 7436 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 7437 7438 /** 7439 * Component of the transport to use for backup/restore. 7440 * @hide 7441 */ 7442 @UnsupportedAppUsage 7443 public static final String BACKUP_TRANSPORT = "backup_transport"; 7444 7445 /** 7446 * Indicates the version for which the setup wizard was last shown. The version gets 7447 * bumped for each release when there is new setup information to show. 7448 * 7449 * @hide 7450 */ 7451 @SystemApi 7452 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 7453 7454 /** 7455 * The interval in milliseconds after which Wi-Fi is considered idle. 7456 * When idle, it is possible for the device to be switched from Wi-Fi to 7457 * the mobile data network. 7458 * @hide 7459 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 7460 * instead. 7461 */ 7462 @Deprecated 7463 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 7464 7465 /** 7466 * The global search provider chosen by the user (if multiple global 7467 * search providers are installed). This will be the provider returned 7468 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 7469 * installed. This setting is stored as a flattened component name as 7470 * per {@link ComponentName#flattenToString()}. 7471 * 7472 * @hide 7473 */ 7474 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 7475 "search_global_search_activity"; 7476 7477 /** 7478 * The number of promoted sources in GlobalSearch. 7479 * @hide 7480 */ 7481 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 7482 /** 7483 * The maximum number of suggestions returned by GlobalSearch. 7484 * @hide 7485 */ 7486 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 7487 /** 7488 * The number of suggestions GlobalSearch will ask each non-web search source for. 7489 * @hide 7490 */ 7491 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 7492 /** 7493 * The number of suggestions the GlobalSearch will ask the web search source for. 7494 * @hide 7495 */ 7496 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 7497 "search_web_results_override_limit"; 7498 /** 7499 * The number of milliseconds that GlobalSearch will wait for suggestions from 7500 * promoted sources before continuing with all other sources. 7501 * @hide 7502 */ 7503 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 7504 "search_promoted_source_deadline_millis"; 7505 /** 7506 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 7507 * @hide 7508 */ 7509 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 7510 /** 7511 * The maximum number of milliseconds that GlobalSearch shows the previous results 7512 * after receiving a new query. 7513 * @hide 7514 */ 7515 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 7516 /** 7517 * The maximum age of log data used for shortcuts in GlobalSearch. 7518 * @hide 7519 */ 7520 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 7521 /** 7522 * The maximum age of log data used for source ranking in GlobalSearch. 7523 * @hide 7524 */ 7525 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 7526 "search_max_source_event_age_millis"; 7527 /** 7528 * The minimum number of impressions needed to rank a source in GlobalSearch. 7529 * @hide 7530 */ 7531 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 7532 "search_min_impressions_for_source_ranking"; 7533 /** 7534 * The minimum number of clicks needed to rank a source in GlobalSearch. 7535 * @hide 7536 */ 7537 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 7538 "search_min_clicks_for_source_ranking"; 7539 /** 7540 * The maximum number of shortcuts shown by GlobalSearch. 7541 * @hide 7542 */ 7543 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 7544 /** 7545 * The size of the core thread pool for suggestion queries in GlobalSearch. 7546 * @hide 7547 */ 7548 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 7549 "search_query_thread_core_pool_size"; 7550 /** 7551 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 7552 * @hide 7553 */ 7554 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 7555 "search_query_thread_max_pool_size"; 7556 /** 7557 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 7558 * @hide 7559 */ 7560 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 7561 "search_shortcut_refresh_core_pool_size"; 7562 /** 7563 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 7564 * @hide 7565 */ 7566 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 7567 "search_shortcut_refresh_max_pool_size"; 7568 /** 7569 * The maximun time that excess threads in the GlobalSeach thread pools will 7570 * wait before terminating. 7571 * @hide 7572 */ 7573 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 7574 "search_thread_keepalive_seconds"; 7575 /** 7576 * The maximum number of concurrent suggestion queries to each source. 7577 * @hide 7578 */ 7579 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 7580 "search_per_source_concurrent_query_limit"; 7581 7582 /** 7583 * Whether or not alert sounds are played on StorageManagerService events. 7584 * (0 = false, 1 = true) 7585 * @hide 7586 */ 7587 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 7588 7589 /** 7590 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 7591 * @hide 7592 */ 7593 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 7594 7595 /** 7596 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 7597 * @hide 7598 */ 7599 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 7600 7601 /** 7602 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 7603 * @hide 7604 */ 7605 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 7606 7607 /** 7608 * If nonzero, ANRs in invisible background processes bring up a dialog. 7609 * Otherwise, the process will be silently killed. 7610 * 7611 * Also prevents ANRs and crash dialogs from being suppressed. 7612 * @hide 7613 */ 7614 @UnsupportedAppUsage 7615 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 7616 7617 /** 7618 * If nonzero, crashes in foreground processes will bring up a dialog. 7619 * Otherwise, the process will be silently killed. 7620 * @hide 7621 */ 7622 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = 7623 "show_first_crash_dialog_dev_option"; 7624 7625 /** 7626 * The {@link ComponentName} string of the service to be used as the voice recognition 7627 * service. 7628 * 7629 * @hide 7630 */ 7631 @UnsupportedAppUsage 7632 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 7633 7634 /** 7635 * The {@link ComponentName} string of the selected spell checker service which is 7636 * one of the services managed by the text service manager. 7637 * 7638 * @hide 7639 */ 7640 @UnsupportedAppUsage 7641 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 7642 7643 /** 7644 * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype 7645 * of the selected spell checker service which is one of the services managed by the text 7646 * service manager. 7647 * 7648 * @hide 7649 */ 7650 @UnsupportedAppUsage 7651 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 7652 "selected_spell_checker_subtype"; 7653 7654 /** 7655 * Whether spell checker is enabled or not. 7656 * 7657 * @hide 7658 */ 7659 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 7660 7661 /** 7662 * What happens when the user presses the Power button while in-call 7663 * and the screen is on.<br/> 7664 * <b>Values:</b><br/> 7665 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 7666 * 2 - The Power button hangs up the current call.<br/> 7667 * 7668 * @hide 7669 */ 7670 @UnsupportedAppUsage 7671 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 7672 7673 /** 7674 * Whether the user allows minimal post processing or not. 7675 * 7676 * <p>Values: 7677 * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing 7678 * API will be ignored. 7679 * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API 7680 * will be respected and the appropriate signals will be sent to display. 7681 * (Default behaviour) 7682 * 7683 * @hide 7684 */ 7685 public static final String MINIMAL_POST_PROCESSING_ALLOWED = 7686 "minimal_post_processing_allowed"; 7687 7688 /** 7689 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 7690 * @hide 7691 */ 7692 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 7693 7694 /** 7695 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 7696 * @hide 7697 */ 7698 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 7699 7700 /** 7701 * INCALL_POWER_BUTTON_BEHAVIOR default value. 7702 * @hide 7703 */ 7704 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 7705 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 7706 7707 /** 7708 * What happens when the user presses the Back button while in-call 7709 * and the screen is on.<br/> 7710 * <b>Values:</b><br/> 7711 * 0 - The Back buttons does nothing different.<br/> 7712 * 1 - The Back button hangs up the current call.<br/> 7713 * 7714 * @hide 7715 */ 7716 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; 7717 7718 /** 7719 * INCALL_BACK_BUTTON_BEHAVIOR value for no action. 7720 * @hide 7721 */ 7722 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; 7723 7724 /** 7725 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". 7726 * @hide 7727 */ 7728 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; 7729 7730 /** 7731 * INCALL_POWER_BUTTON_BEHAVIOR default value. 7732 * @hide 7733 */ 7734 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = 7735 INCALL_BACK_BUTTON_BEHAVIOR_NONE; 7736 7737 /** 7738 * Whether the device should wake when the wake gesture sensor detects motion. 7739 * @hide 7740 */ 7741 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 7742 7743 /** 7744 * Whether the device should doze if configured. 7745 * @hide 7746 */ 7747 @UnsupportedAppUsage 7748 public static final String DOZE_ENABLED = "doze_enabled"; 7749 7750 /** 7751 * Indicates whether doze should be always on. 7752 * <p> 7753 * Type: int (0 for false, 1 for true) 7754 * 7755 * @hide 7756 */ 7757 @SystemApi 7758 @TestApi 7759 public static final String DOZE_ALWAYS_ON = "doze_always_on"; 7760 7761 /** 7762 * Whether the device should pulse on pick up gesture. 7763 * @hide 7764 */ 7765 public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up"; 7766 7767 /** 7768 * Whether the device should pulse on long press gesture. 7769 * @hide 7770 */ 7771 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; 7772 7773 /** 7774 * Whether the device should pulse on double tap gesture. 7775 * @hide 7776 */ 7777 public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap"; 7778 7779 /** 7780 * Whether the device should respond to the SLPI tap gesture. 7781 * @hide 7782 */ 7783 public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture"; 7784 7785 /** 7786 * Gesture that wakes up the display, showing some version of the lock screen. 7787 * @hide 7788 */ 7789 public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture"; 7790 7791 /** 7792 * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and 7793 * {@link Display.STATE_DOZE}. 7794 * @hide 7795 */ 7796 public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture"; 7797 7798 /** 7799 * Whether the device should suppress the current doze configuration and disable dozing. 7800 * @hide 7801 */ 7802 public static final String SUPPRESS_DOZE = "suppress_doze"; 7803 7804 /** 7805 * Gesture that skips media. 7806 * @hide 7807 */ 7808 public static final String SKIP_GESTURE = "skip_gesture"; 7809 7810 /** 7811 * Count of successful gestures. 7812 * @hide 7813 */ 7814 public static final String SKIP_GESTURE_COUNT = "skip_gesture_count"; 7815 7816 /** 7817 * Count of non-gesture interaction. 7818 * @hide 7819 */ 7820 public static final String SKIP_TOUCH_COUNT = "skip_touch_count"; 7821 7822 /** 7823 * Direction to advance media for skip gesture 7824 * @hide 7825 */ 7826 public static final String SKIP_DIRECTION = "skip_gesture_direction"; 7827 7828 /** 7829 * Gesture that silences sound (alarms, notification, calls). 7830 * @hide 7831 */ 7832 public static final String SILENCE_GESTURE = "silence_gesture"; 7833 7834 /** 7835 * Count of successful silence alarms gestures. 7836 * @hide 7837 */ 7838 public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count"; 7839 7840 /** 7841 * Count of successful silence timer gestures. 7842 * @hide 7843 */ 7844 public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count"; 7845 7846 /** 7847 * Count of successful silence call gestures. 7848 * @hide 7849 */ 7850 public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count"; 7851 7852 /** 7853 * Count of non-gesture interaction. 7854 * @hide 7855 */ 7856 public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count"; 7857 7858 /** 7859 * Count of non-gesture interaction. 7860 * @hide 7861 */ 7862 public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count"; 7863 7864 /** 7865 * Count of non-gesture interaction. 7866 * @hide 7867 */ 7868 public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count"; 7869 7870 /** 7871 * Number of successful "Motion Sense" tap gestures to pause media. 7872 * @hide 7873 */ 7874 public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count"; 7875 7876 /** 7877 * Number of touch interactions to pause media when a "Motion Sense" gesture could 7878 * have been used. 7879 * @hide 7880 */ 7881 public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count"; 7882 7883 /** 7884 * The current night mode that has been selected by the user. Owned 7885 * and controlled by UiModeManagerService. Constants are as per 7886 * UiModeManager. 7887 * @hide 7888 */ 7889 public static final String UI_NIGHT_MODE = "ui_night_mode"; 7890 7891 /** 7892 * The current night mode that has been overridden to turn on by the system. Owned 7893 * and controlled by UiModeManagerService. Constants are as per 7894 * UiModeManager. 7895 * @hide 7896 */ 7897 public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on"; 7898 7899 /** 7900 * The current night mode that has been overridden to turn off by the system. Owned 7901 * and controlled by UiModeManagerService. Constants are as per 7902 * UiModeManager. 7903 * @hide 7904 */ 7905 public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off"; 7906 7907 /** 7908 * Whether screensavers are enabled. 7909 * @hide 7910 */ 7911 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 7912 7913 /** 7914 * The user's chosen screensaver components. 7915 * 7916 * These will be launched by the PhoneWindowManager after a timeout when not on 7917 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 7918 * @hide 7919 */ 7920 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 7921 7922 /** 7923 * If screensavers are enabled, whether the screensaver should be automatically launched 7924 * when the device is inserted into a (desk) dock. 7925 * @hide 7926 */ 7927 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 7928 7929 /** 7930 * If screensavers are enabled, whether the screensaver should be automatically launched 7931 * when the screen times out when not on battery. 7932 * @hide 7933 */ 7934 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 7935 7936 /** 7937 * If screensavers are enabled, the default screensaver component. 7938 * @hide 7939 */ 7940 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 7941 7942 /** 7943 * The default NFC payment component 7944 * @hide 7945 */ 7946 @UnsupportedAppUsage 7947 @TestApi 7948 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 7949 7950 /** 7951 * Whether NFC payment is handled by the foreground application or a default. 7952 * @hide 7953 */ 7954 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 7955 7956 /** 7957 * Specifies the package name currently configured to be the primary sms application 7958 * @hide 7959 */ 7960 @UnsupportedAppUsage 7961 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 7962 7963 /** 7964 * Specifies the package name currently configured to be the default dialer application 7965 * @hide 7966 */ 7967 @UnsupportedAppUsage 7968 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; 7969 7970 /** 7971 * Specifies the component name currently configured to be the default call screening 7972 * application 7973 * @hide 7974 */ 7975 public static final String CALL_SCREENING_DEFAULT_COMPONENT = 7976 "call_screening_default_component"; 7977 7978 /** 7979 * Specifies the package name currently configured to be the emergency assistance application 7980 * 7981 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE 7982 * 7983 * @hide 7984 */ 7985 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; 7986 7987 /** 7988 * Specifies whether the current app context on scren (assist data) will be sent to the 7989 * assist application (active voice interaction service). 7990 * 7991 * @hide 7992 */ 7993 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; 7994 7995 /** 7996 * Specifies whether a screenshot of the screen contents will be sent to the assist 7997 * application (active voice interaction service). 7998 * 7999 * @hide 8000 */ 8001 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; 8002 8003 /** 8004 * Specifies whether the screen will show an animation if screen contents are sent to the 8005 * assist application (active voice interaction service). 8006 * 8007 * Note that the disclosure will be forced for third-party assistants or if the device 8008 * does not support disabling it. 8009 * 8010 * @hide 8011 */ 8012 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; 8013 8014 /** 8015 * Control if rotation suggestions are sent to System UI when in rotation locked mode. 8016 * Done to enable screen rotation while the the screen rotation is locked. Enabling will 8017 * poll the accelerometer in rotation locked mode. 8018 * 8019 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. 8020 * 8021 * @hide 8022 */ 8023 8024 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; 8025 8026 /** 8027 * The disabled state of SHOW_ROTATION_SUGGESTIONS. 8028 * @hide 8029 */ 8030 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; 8031 8032 /** 8033 * The enabled state of SHOW_ROTATION_SUGGESTIONS. 8034 * @hide 8035 */ 8036 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; 8037 8038 /** 8039 * The default state of SHOW_ROTATION_SUGGESTIONS. 8040 * @hide 8041 */ 8042 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = 8043 SHOW_ROTATION_SUGGESTIONS_ENABLED; 8044 8045 /** 8046 * The number of accepted rotation suggestions. Used to determine if the user has been 8047 * introduced to rotation suggestions. 8048 * @hide 8049 */ 8050 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = 8051 "num_rotation_suggestions_accepted"; 8052 8053 /** 8054 * Read only list of the service components that the current user has explicitly allowed to 8055 * see and assist with all of the user's notifications. 8056 * 8057 * @deprecated Use 8058 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. 8059 * @hide 8060 */ 8061 @Deprecated 8062 public static final String ENABLED_NOTIFICATION_ASSISTANT = 8063 "enabled_notification_assistant"; 8064 8065 /** 8066 * Read only list of the service components that the current user has explicitly allowed to 8067 * see all of the user's notifications, separated by ':'. 8068 * 8069 * @hide 8070 * @deprecated Use 8071 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. 8072 */ 8073 @Deprecated 8074 @UnsupportedAppUsage 8075 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 8076 8077 /** 8078 * Read only list of the packages that the current user has explicitly allowed to 8079 * manage do not disturb, separated by ':'. 8080 * 8081 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. 8082 * @hide 8083 */ 8084 @Deprecated 8085 @TestApi 8086 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = 8087 "enabled_notification_policy_access_packages"; 8088 8089 /** 8090 * Defines whether managed profile ringtones should be synced from it's parent profile 8091 * <p> 8092 * 0 = ringtones are not synced 8093 * 1 = ringtones are synced from the profile's parent (default) 8094 * <p> 8095 * This value is only used for managed profiles. 8096 * @hide 8097 */ 8098 @TestApi 8099 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 8100 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; 8101 8102 /** 8103 * @hide 8104 */ 8105 @UnsupportedAppUsage 8106 @TestApi 8107 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 8108 8109 /** 8110 * This is the query URI for finding a print service to install. 8111 * 8112 * @hide 8113 */ 8114 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 8115 8116 /** 8117 * This is the query URI for finding a NFC payment service to install. 8118 * 8119 * @hide 8120 */ 8121 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 8122 8123 /** 8124 * This is the query URI for finding a auto fill service to install. 8125 * 8126 * @hide 8127 */ 8128 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; 8129 8130 /** 8131 * If enabled, apps should try to skip any introductory hints on first launch. This might 8132 * apply to users that are already familiar with the environment or temporary users. 8133 * <p> 8134 * Type : int (0 to show hints, 1 to skip showing hints) 8135 */ 8136 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 8137 8138 /** 8139 * Persisted playback time after a user confirmation of an unsafe volume level. 8140 * 8141 * @hide 8142 */ 8143 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; 8144 8145 /** 8146 * Indicates whether notification display on the lock screen is enabled. 8147 * <p> 8148 * Type: int (0 for false, 1 for true) 8149 * 8150 * @hide 8151 */ 8152 @SystemApi 8153 @TestApi 8154 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 8155 "lock_screen_show_notifications"; 8156 8157 /** 8158 * Indicates whether the lock screen should display silent notifications. 8159 * <p> 8160 * Type: int (0 for false, 1 for true) 8161 * 8162 * @hide 8163 */ 8164 public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS = 8165 "lock_screen_show_silent_notifications"; 8166 8167 /** 8168 * Indicates whether snooze options should be shown on notifications 8169 * <p> 8170 * Type: int (0 for false, 1 for true) 8171 * 8172 * @hide 8173 */ 8174 public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze"; 8175 8176 /** 8177 * List of TV inputs that are currently hidden. This is a string 8178 * containing the IDs of all hidden TV inputs. Each ID is encoded by 8179 * {@link android.net.Uri#encode(String)} and separated by ':'. 8180 * @hide 8181 */ 8182 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; 8183 8184 /** 8185 * List of custom TV input labels. This is a string containing <TV input id, custom name> 8186 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} 8187 * and separated by ','. Each pair is separated by ':'. 8188 * @hide 8189 */ 8190 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; 8191 8192 /** 8193 * Whether TV app uses non-system inputs. 8194 * 8195 * <p> 8196 * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed, 8197 * and 0 means non-system TV inputs are not allowed. 8198 * 8199 * <p> 8200 * Devices such as sound bars may have changed the system property allow_third_party_inputs 8201 * to false so the TV Application only uses HDMI and other built in inputs. This setting 8202 * allows user to override the default and have the TV Application use third party TV inputs 8203 * available on play store. 8204 * 8205 * @hide 8206 */ 8207 public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs"; 8208 8209 /** 8210 * Whether automatic routing of system audio to USB audio peripheral is disabled. 8211 * The value is boolean (1 or 0), where 1 means automatic routing is disabled, 8212 * and 0 means automatic routing is enabled. 8213 * 8214 * @hide 8215 */ 8216 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 8217 "usb_audio_automatic_routing_disabled"; 8218 8219 /** 8220 * The timeout in milliseconds before the device fully goes to sleep after 8221 * a period of inactivity. This value sets an upper bound on how long the device 8222 * will stay awake or dreaming without user activity. It should generally 8223 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device 8224 * will sleep before it ever has a chance to dream. 8225 * <p> 8226 * Use -1 to disable this timeout. 8227 * </p> 8228 * 8229 * @hide 8230 */ 8231 public static final String SLEEP_TIMEOUT = "sleep_timeout"; 8232 8233 /** 8234 * The timeout in milliseconds before the device goes to sleep due to user inattentiveness, 8235 * even if the system is holding wakelocks. It should generally be longer than {@code 8236 * config_attentiveWarningDuration}, as otherwise the device will show the attentive 8237 * warning constantly. Small timeouts are discouraged, as they will cause the device to 8238 * go to sleep quickly after waking up. 8239 * <p> 8240 * Use -1 to disable this timeout. 8241 * </p> 8242 * 8243 * @hide 8244 */ 8245 public static final String ATTENTIVE_TIMEOUT = "attentive_timeout"; 8246 8247 /** 8248 * Controls whether double tap to wake is enabled. 8249 * @hide 8250 */ 8251 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; 8252 8253 /** 8254 * The current assistant component. It could be a voice interaction service, 8255 * or an activity that handles ACTION_ASSIST, or empty which means using the default 8256 * handling. 8257 * 8258 * <p>This should be set indirectly by setting the {@link 8259 * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}. 8260 * 8261 * @hide 8262 */ 8263 @UnsupportedAppUsage 8264 public static final String ASSISTANT = "assistant"; 8265 8266 /** 8267 * Whether the camera launch gesture should be disabled. 8268 * 8269 * @hide 8270 */ 8271 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; 8272 8273 /** 8274 * Whether the camera launch gesture to double tap the power button when the screen is off 8275 * should be disabled. 8276 * 8277 * @hide 8278 */ 8279 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = 8280 "camera_double_tap_power_gesture_disabled"; 8281 8282 /** 8283 * Whether the camera double twist gesture to flip between front and back mode should be 8284 * enabled. 8285 * 8286 * @hide 8287 */ 8288 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = 8289 "camera_double_twist_to_flip_enabled"; 8290 8291 /** 8292 * Whether or not the smart camera lift trigger that launches the camera when the user moves 8293 * the phone into a position for taking photos should be enabled. 8294 * 8295 * @hide 8296 */ 8297 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; 8298 8299 /** 8300 * The default enable state of the camera lift trigger. 8301 * 8302 * @hide 8303 */ 8304 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; 8305 8306 /** 8307 * Whether or not the flashlight (camera torch mode) is available required to turn 8308 * on flashlight. 8309 * 8310 * @hide 8311 */ 8312 public static final String FLASHLIGHT_AVAILABLE = "flashlight_available"; 8313 8314 /** 8315 * Whether or not flashlight is enabled. 8316 * 8317 * @hide 8318 */ 8319 public static final String FLASHLIGHT_ENABLED = "flashlight_enabled"; 8320 8321 /** 8322 * Whether or not face unlock is allowed on Keyguard. 8323 * @hide 8324 */ 8325 public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled"; 8326 8327 /** 8328 * Whether or not face unlock dismisses the keyguard. 8329 * @hide 8330 */ 8331 public static final String FACE_UNLOCK_DISMISSES_KEYGUARD = 8332 "face_unlock_dismisses_keyguard"; 8333 8334 /** 8335 * Whether or not media is shown automatically when bypassing as a heads up. 8336 * @hide 8337 */ 8338 public static final String SHOW_MEDIA_WHEN_BYPASSING = 8339 "show_media_when_bypassing"; 8340 8341 /** 8342 * Whether or not face unlock requires attention. This is a cached value, the source of 8343 * truth is obtained through the HAL. 8344 * @hide 8345 */ 8346 public static final String FACE_UNLOCK_ATTENTION_REQUIRED = 8347 "face_unlock_attention_required"; 8348 8349 /** 8350 * Whether or not face unlock requires a diverse set of poses during enrollment. This is a 8351 * cached value, the source of truth is obtained through the HAL. 8352 * @hide 8353 */ 8354 public static final String FACE_UNLOCK_DIVERSITY_REQUIRED = 8355 "face_unlock_diversity_required"; 8356 8357 8358 /** 8359 * Whether or not face unlock is allowed for apps (through BiometricPrompt). 8360 * @hide 8361 */ 8362 public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled"; 8363 8364 /** 8365 * Whether or not face unlock always requires user confirmation, meaning {@link 8366 * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)} 8367 * is always 'true'. This overrides the behavior that apps choose in the 8368 * setConfirmationRequired API. 8369 * @hide 8370 */ 8371 public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION = 8372 "face_unlock_always_require_confirmation"; 8373 8374 /** 8375 * Whether or not a user should re enroll their face. 8376 * 8377 * Face unlock re enroll. 8378 * 0 = No re enrollment. 8379 * 1 = Re enrollment is suggested. 8380 * 2 = Re enrollment is required after a set time period. 8381 * 3 = Re enrollment is required immediately. 8382 * 8383 * @hide 8384 */ 8385 public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll"; 8386 8387 /** 8388 * Whether or not debugging is enabled. 8389 * @hide 8390 */ 8391 public static final String BIOMETRIC_DEBUG_ENABLED = 8392 "biometric_debug_enabled"; 8393 8394 /** 8395 * Whether the assist gesture should be enabled. 8396 * 8397 * @hide 8398 */ 8399 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; 8400 8401 /** 8402 * Sensitivity control for the assist gesture. 8403 * 8404 * @hide 8405 */ 8406 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; 8407 8408 /** 8409 * Whether the assist gesture should silence alerts. 8410 * 8411 * @hide 8412 */ 8413 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = 8414 "assist_gesture_silence_alerts_enabled"; 8415 8416 /** 8417 * Whether the assist gesture should wake the phone. 8418 * 8419 * @hide 8420 */ 8421 public static final String ASSIST_GESTURE_WAKE_ENABLED = 8422 "assist_gesture_wake_enabled"; 8423 8424 /** 8425 * Indicates whether the Assist Gesture Deferred Setup has been completed. 8426 * <p> 8427 * Type: int (0 for false, 1 for true) 8428 * 8429 * @hide 8430 */ 8431 @SystemApi 8432 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; 8433 8434 /** 8435 * Control whether Trust Agents are in active unlock or extend unlock mode. 8436 * @hide 8437 */ 8438 public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock"; 8439 8440 /** 8441 * Control whether the screen locks when trust is lost. 8442 * @hide 8443 */ 8444 public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost"; 8445 8446 /** 8447 * Control whether Night display is currently activated. 8448 * @hide 8449 */ 8450 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; 8451 8452 /** 8453 * Control whether Night display will automatically activate/deactivate. 8454 * @hide 8455 */ 8456 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; 8457 8458 /** 8459 * Control the color temperature of Night Display, represented in Kelvin. 8460 * @hide 8461 */ 8462 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = 8463 "night_display_color_temperature"; 8464 8465 /** 8466 * Custom time when Night display is scheduled to activate. 8467 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 8468 * @hide 8469 */ 8470 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = 8471 "night_display_custom_start_time"; 8472 8473 /** 8474 * Custom time when Night display is scheduled to deactivate. 8475 * Represented as milliseconds from midnight (e.g. 21600000 == 6am). 8476 * @hide 8477 */ 8478 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; 8479 8480 /** 8481 * A String representing the LocalDateTime when Night display was last activated. Use to 8482 * decide whether to apply the current activated state after a reboot or user change. In 8483 * legacy cases, this is represented by the time in milliseconds (since epoch). 8484 * @hide 8485 */ 8486 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = 8487 "night_display_last_activated_time"; 8488 8489 /** 8490 * Control whether display white balance is currently enabled. 8491 * @hide 8492 */ 8493 public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled"; 8494 8495 /** 8496 * Names of the service components that the current user has explicitly allowed to 8497 * be a VR mode listener, separated by ':'. 8498 * 8499 * @hide 8500 */ 8501 @UnsupportedAppUsage 8502 @TestApi 8503 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; 8504 8505 /** 8506 * Behavior of the display while in VR mode. 8507 * 8508 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. 8509 * 8510 * @hide 8511 */ 8512 public static final String VR_DISPLAY_MODE = "vr_display_mode"; 8513 8514 /** 8515 * Lower the display persistence while the system is in VR mode. 8516 * 8517 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 8518 * 8519 * @hide. 8520 */ 8521 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; 8522 8523 /** 8524 * Do not alter the display persistence while the system is in VR mode. 8525 * 8526 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 8527 * 8528 * @hide. 8529 */ 8530 public static final int VR_DISPLAY_MODE_OFF = 1; 8531 8532 /** 8533 * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been 8534 * executed for. 8535 * 8536 * <p>This is used to ensure that we only take one pass which will disable apps that are not 8537 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is 8538 * inserted), to avoid disabling an app that the user might actively be using. 8539 * 8540 * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older 8541 * SDK versions prior to R set 1 for this value. 8542 * 8543 * @hide 8544 */ 8545 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; 8546 8547 /** 8548 * Whether parent user can access remote contact in managed profile. 8549 * 8550 * @hide 8551 */ 8552 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = 8553 "managed_profile_contact_remote_search"; 8554 8555 /** 8556 * Whether parent profile can access remote calendar data in managed profile. 8557 * 8558 * @hide 8559 */ 8560 public static final String CROSS_PROFILE_CALENDAR_ENABLED = 8561 "cross_profile_calendar_enabled"; 8562 8563 /** 8564 * Whether or not the automatic storage manager is enabled and should run on the device. 8565 * 8566 * @hide 8567 */ 8568 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = 8569 "automatic_storage_manager_enabled"; 8570 8571 /** 8572 * How many days of information for the automatic storage manager to retain on the device. 8573 * 8574 * @hide 8575 */ 8576 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = 8577 "automatic_storage_manager_days_to_retain"; 8578 8579 /** 8580 * Default number of days of information for the automatic storage manager to retain. 8581 * 8582 * @hide 8583 */ 8584 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; 8585 8586 /** 8587 * How many bytes the automatic storage manager has cleared out. 8588 * 8589 * @hide 8590 */ 8591 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = 8592 "automatic_storage_manager_bytes_cleared"; 8593 8594 /** 8595 * Last run time for the automatic storage manager. 8596 * 8597 * @hide 8598 */ 8599 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = 8600 "automatic_storage_manager_last_run"; 8601 /** 8602 * If the automatic storage manager has been disabled by policy. Note that this doesn't 8603 * mean that the automatic storage manager is prevented from being re-enabled -- this only 8604 * means that it was turned off by policy at least once. 8605 * 8606 * @hide 8607 */ 8608 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = 8609 "automatic_storage_manager_turned_off_by_policy"; 8610 8611 /** 8612 * Whether SystemUI navigation keys is enabled. 8613 * @hide 8614 */ 8615 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = 8616 "system_navigation_keys_enabled"; 8617 8618 /** 8619 * Holds comma separated list of ordering of QS tiles. 8620 * 8621 * @hide 8622 */ 8623 public static final String QS_TILES = "sysui_qs_tiles"; 8624 8625 /** 8626 * Whether this user has enabled Quick controls. 8627 * 8628 * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as 8629 * enabled. 8630 * 8631 * @hide 8632 */ 8633 public static final String CONTROLS_ENABLED = "controls_enabled"; 8634 8635 /** 8636 * Whether power menu content (cards, passes, controls) will be shown when device is locked. 8637 * 8638 * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide. 8639 * @hide 8640 */ 8641 @TestApi 8642 public static final String POWER_MENU_LOCKED_SHOW_CONTENT = 8643 "power_menu_locked_show_content"; 8644 8645 /** 8646 * Specifies whether the web action API is enabled. 8647 * 8648 * @hide 8649 */ 8650 @SystemApi 8651 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; 8652 8653 /** 8654 * Has this pairable device been paired or upgraded from a previously paired system. 8655 * @hide 8656 */ 8657 public static final String DEVICE_PAIRED = "device_paired"; 8658 8659 /** 8660 * Specifies additional package name for broadcasting the CMAS messages. 8661 * @hide 8662 */ 8663 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; 8664 8665 /** 8666 * Whether the launcher should show any notification badges. 8667 * The value is boolean (1 or 0). 8668 * @hide 8669 */ 8670 @UnsupportedAppUsage 8671 @TestApi 8672 public static final String NOTIFICATION_BADGING = "notification_badging"; 8673 8674 /** 8675 * When enabled the system will maintain a rolling history of received notifications. When 8676 * disabled the history will be disabled and deleted. 8677 * 8678 * The value 1 - enable, 0 - disable 8679 * @hide 8680 */ 8681 public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled"; 8682 8683 /** 8684 * When enabled conversations marked as favorites will be set to bubble. 8685 * 8686 * The value 1 - enable, 0 - disable 8687 * @hide 8688 */ 8689 public static final String BUBBLE_IMPORTANT_CONVERSATIONS 8690 = "bubble_important_conversations"; 8691 8692 /** 8693 * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right 8694 * swipe). 8695 * 8696 * @hide 8697 */ 8698 public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl"; 8699 8700 /** 8701 * Comma separated list of QS tiles that have been auto-added already. 8702 * @hide 8703 */ 8704 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; 8705 8706 /** 8707 * Whether the Lockdown button should be shown in the power menu. 8708 * @hide 8709 */ 8710 public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; 8711 8712 /** 8713 * Backup manager behavioral parameters. 8714 * This is encoded as a key=value list, separated by commas. Ex: 8715 * 8716 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" 8717 * 8718 * The following keys are supported: 8719 * 8720 * <pre> 8721 * key_value_backup_interval_milliseconds (long) 8722 * key_value_backup_fuzz_milliseconds (long) 8723 * key_value_backup_require_charging (boolean) 8724 * key_value_backup_required_network_type (int) 8725 * full_backup_interval_milliseconds (long) 8726 * full_backup_require_charging (boolean) 8727 * full_backup_required_network_type (int) 8728 * backup_finished_notification_receivers (String[]) 8729 * </pre> 8730 * 8731 * backup_finished_notification_receivers uses ":" as delimeter for values. 8732 * 8733 * <p> 8734 * Type: string 8735 * @hide 8736 */ 8737 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; 8738 8739 8740 /** 8741 * Local transport parameters so we can configure it for tests. 8742 * This is encoded as a key=value list, separated by commas. 8743 * 8744 * The following keys are supported: 8745 * 8746 * <pre> 8747 * fake_encryption_flag (boolean) 8748 * </pre> 8749 * 8750 * <p> 8751 * Type: string 8752 * @hide 8753 */ 8754 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = 8755 "backup_local_transport_parameters"; 8756 8757 /** 8758 * Flag to set if the system should predictively attempt to re-enable Bluetooth while 8759 * the user is driving. 8760 * @hide 8761 */ 8762 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; 8763 8764 /** 8765 * What behavior should be invoked when the volume hush gesture is triggered 8766 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. 8767 * 8768 * @hide 8769 */ 8770 @SystemApi 8771 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; 8772 8773 /** @hide */ 8774 @SystemApi 8775 public static final int VOLUME_HUSH_OFF = 0; 8776 /** @hide */ 8777 @SystemApi 8778 public static final int VOLUME_HUSH_VIBRATE = 1; 8779 /** @hide */ 8780 @SystemApi 8781 public static final int VOLUME_HUSH_MUTE = 2; 8782 8783 /** 8784 * The number of times (integer) the user has manually enabled battery saver. 8785 * @hide 8786 */ 8787 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = 8788 "low_power_manual_activation_count"; 8789 8790 /** 8791 * Whether the "first time battery saver warning" dialog needs to be shown (0: default) 8792 * or not (1). 8793 * 8794 * @hide 8795 */ 8796 public static final String LOW_POWER_WARNING_ACKNOWLEDGED = 8797 "low_power_warning_acknowledged"; 8798 8799 /** 8800 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been 8801 * suppressed. 8802 * @hide 8803 */ 8804 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = 8805 "suppress_auto_battery_saver_suggestion"; 8806 8807 /** 8808 * List of packages, which data need to be unconditionally cleared before full restore. 8809 * Type: string 8810 * @hide 8811 */ 8812 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = 8813 "packages_to_clear_data_before_full_restore"; 8814 8815 /** 8816 * Setting to determine whether to use the new notification priority handling features. 8817 * @hide 8818 */ 8819 public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model"; 8820 8821 /** 8822 * How often to check for location access. 8823 * @hide 8824 */ 8825 @SystemApi 8826 @TestApi 8827 public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = 8828 "location_access_check_interval_millis"; 8829 8830 /** 8831 * Delay between granting location access and checking it. 8832 * @hide 8833 */ 8834 @SystemApi 8835 @TestApi 8836 public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = 8837 "location_access_check_delay_millis"; 8838 8839 /** 8840 * @deprecated This setting does not have any effect anymore 8841 * @hide 8842 */ 8843 @SystemApi 8844 @Deprecated 8845 public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = 8846 "location_permissions_upgrade_to_q_mode"; 8847 8848 /** 8849 * Whether or not the system Auto Revoke feature is disabled. 8850 * @hide 8851 */ 8852 @SystemApi 8853 public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled"; 8854 8855 /** 8856 * Map of android.theme.customization.* categories to the enabled overlay package for that 8857 * category, formatted as a serialized {@link org.json.JSONObject}. If there is no 8858 * corresponding package included for a category, then all overlay packages in that 8859 * category must be disabled. 8860 * @hide 8861 */ 8862 @SystemApi 8863 public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES = 8864 "theme_customization_overlay_packages"; 8865 8866 /** 8867 * Navigation bar mode. 8868 * 0 = 3 button 8869 * 1 = 2 button 8870 * 2 = fully gestural 8871 * @hide 8872 */ 8873 public static final String NAVIGATION_MODE = 8874 "navigation_mode"; 8875 8876 /** 8877 * Scale factor for the back gesture inset size on the left side of the screen. 8878 * @hide 8879 */ 8880 public static final String BACK_GESTURE_INSET_SCALE_LEFT = 8881 "back_gesture_inset_scale_left"; 8882 8883 /** 8884 * Scale factor for the back gesture inset size on the right side of the screen. 8885 * @hide 8886 */ 8887 public static final String BACK_GESTURE_INSET_SCALE_RIGHT = 8888 "back_gesture_inset_scale_right"; 8889 8890 /** 8891 * Current provider of proximity-based sharing services. 8892 * Default value in @string/config_defaultNearbySharingComponent. 8893 * No VALIDATOR as this setting will not be backed up. 8894 * @hide 8895 */ 8896 public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component"; 8897 8898 /** 8899 * Controls whether aware is enabled. 8900 * @hide 8901 */ 8902 public static final String AWARE_ENABLED = "aware_enabled"; 8903 8904 /** 8905 * Controls whether aware_lock is enabled. 8906 * @hide 8907 */ 8908 public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled"; 8909 8910 /** 8911 * Controls whether tap gesture is enabled. 8912 * @hide 8913 */ 8914 public static final String TAP_GESTURE = "tap_gesture"; 8915 8916 /** 8917 * Controls whether the people strip is enabled. 8918 * @hide 8919 */ 8920 public static final String PEOPLE_STRIP = "people_strip"; 8921 8922 /** 8923 * Whether or not to enable media resumption 8924 * When enabled, media controls in quick settings will populate on boot and persist if 8925 * resumable via a MediaBrowserService. 8926 * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS 8927 * @hide 8928 */ 8929 public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption"; 8930 8931 /** 8932 * Controls if window magnification is enabled. 8933 * @hide 8934 */ 8935 public static final String WINDOW_MAGNIFICATION = "window_magnification"; 8936 8937 /** 8938 * Controls magnification mode when magnification is enabled via a system-wide 8939 * triple tap gesture or the accessibility shortcut. 8940 * 8941 * @see#ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN 8942 * @see#ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW 8943 * @hide 8944 */ 8945 public static final String ACCESSIBILITY_MAGNIFICATION_MODE = 8946 "accessibility_magnification_mode"; 8947 8948 /** 8949 * Magnification mode value that magnifies whole display. 8950 * @hide 8951 */ 8952 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1; 8953 8954 /** 8955 * Magnification mode value that magnifies magnify particular region in a window 8956 * @hide 8957 */ 8958 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2; 8959 8960 /** 8961 * Keys we no longer back up under the current schema, but want to continue to 8962 * process when restoring historical backup datasets. 8963 * 8964 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 8965 * otherwise they won't be restored. 8966 * 8967 * @hide 8968 */ 8969 public static final String[] LEGACY_RESTORE_SETTINGS = { 8970 ENABLED_NOTIFICATION_LISTENERS, 8971 ENABLED_NOTIFICATION_ASSISTANT, 8972 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES 8973 }; 8974 8975 /** 8976 * These entries are considered common between the personal and the managed profile, 8977 * since the managed profile doesn't get to change them. 8978 */ 8979 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 8980 8981 static { 8982 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); 8983 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); 8984 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); 8985 CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED); 8986 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); 8987 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); 8988 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); 8989 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); 8990 CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD); 8991 } 8992 8993 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)8994 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 8995 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 8996 } 8997 8998 /** 8999 * Secure settings which can be accessed by instant apps. 9000 * @hide 9001 */ 9002 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 9003 static { 9004 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); 9005 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); 9006 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); 9007 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); 9008 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); 9009 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); 9010 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); 9011 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); 9012 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); 9013 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); 9014 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); 9015 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); 9016 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); 9017 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); 9018 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); 9019 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); 9020 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); 9021 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); 9022 9023 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); 9024 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); 9025 9026 INSTANT_APP_SETTINGS.add(ANDROID_ID); 9027 9028 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); 9029 } 9030 9031 /** 9032 * Helper method for determining if a location provider is enabled. 9033 * 9034 * @param cr the content resolver to use 9035 * @param provider the location provider to query 9036 * @return true if the provider is enabled 9037 * 9038 * @deprecated use {@link LocationManager#isProviderEnabled(String)} 9039 */ 9040 @Deprecated isLocationProviderEnabled(ContentResolver cr, String provider)9041 public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 9042 String allowedProviders = Settings.Secure.getStringForUser(cr, 9043 LOCATION_PROVIDERS_ALLOWED, cr.getUserId()); 9044 return TextUtils.delimitedStringContains(allowedProviders, ',', provider); 9045 } 9046 9047 /** 9048 * Thread-safe method for enabling or disabling a single location provider. This will have 9049 * no effect on Android Q and above. 9050 * @param cr the content resolver to use 9051 * @param provider the location provider to enable or disable 9052 * @param enabled true if the provider should be enabled 9053 * @deprecated This API is deprecated 9054 */ 9055 @Deprecated setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)9056 public static void setLocationProviderEnabled(ContentResolver cr, 9057 String provider, boolean enabled) { 9058 } 9059 } 9060 9061 /** 9062 * Global system settings, containing preferences that always apply identically 9063 * to all defined users. Applications can read these but are not allowed to write; 9064 * like the "Secure" settings, these are for preferences that the user must 9065 * explicitly modify through the system UI or specialized APIs for those values. 9066 */ 9067 public static final class Global extends NameValueTable { 9068 // NOTE: If you add new settings here, be sure to add them to 9069 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. 9070 9071 /** 9072 * The content:// style URL for global secure settings items. Not public. 9073 */ 9074 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 9075 9076 /** 9077 * Whether the notification bubbles are globally enabled 9078 * The value is boolean (1 or 0). 9079 * @hide 9080 */ 9081 @TestApi 9082 public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; 9083 9084 /** 9085 * Whether users are allowed to add more users or guest from lockscreen. 9086 * <p> 9087 * Type: int 9088 * @hide 9089 */ 9090 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; 9091 9092 /** 9093 * Whether applying ramping ringer on incoming phone call ringtone. 9094 * <p>1 = apply ramping ringer 9095 * <p>0 = do not apply ramping ringer 9096 */ 9097 public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer"; 9098 9099 /** 9100 * Setting whether the global gesture for enabling accessibility is enabled. 9101 * If this gesture is enabled the user will be able to perfrom it to enable 9102 * the accessibility state without visiting the settings app. 9103 * 9104 * @hide 9105 * No longer used. Should be removed once all dependencies have been updated. 9106 */ 9107 @UnsupportedAppUsage 9108 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 9109 "enable_accessibility_global_gesture_enabled"; 9110 9111 /** 9112 * Whether Airplane Mode is on. 9113 */ 9114 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 9115 9116 /** 9117 * Whether Theater Mode is on. 9118 * {@hide} 9119 */ 9120 @SystemApi 9121 public static final String THEATER_MODE_ON = "theater_mode_on"; 9122 9123 /** 9124 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 9125 */ 9126 public static final String RADIO_BLUETOOTH = "bluetooth"; 9127 9128 /** 9129 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 9130 */ 9131 public static final String RADIO_WIFI = "wifi"; 9132 9133 /** 9134 * {@hide} 9135 */ 9136 public static final String RADIO_WIMAX = "wimax"; 9137 /** 9138 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 9139 */ 9140 public static final String RADIO_CELL = "cell"; 9141 9142 /** 9143 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 9144 */ 9145 public static final String RADIO_NFC = "nfc"; 9146 9147 /** 9148 * A comma separated list of radios that need to be disabled when airplane mode 9149 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 9150 * included in the comma separated list. 9151 */ 9152 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 9153 9154 /** 9155 * A comma separated list of radios that should to be disabled when airplane mode 9156 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 9157 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 9158 * will be turned off when entering airplane mode, but the user will be able to reenable 9159 * Wifi in the Settings app. 9160 * @hide 9161 */ 9162 @SystemApi 9163 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 9164 9165 /** 9166 * An integer representing the Bluetooth Class of Device (CoD). 9167 * 9168 * @hide 9169 */ 9170 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; 9171 9172 /** 9173 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. 9174 * See {@link android.bluetooth.BluetoothProfile}. 9175 * {@hide} 9176 */ 9177 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; 9178 9179 /** 9180 * A semi-colon separated list of Bluetooth interoperability workarounds. 9181 * Each entry is a partial Bluetooth device address string and an integer representing 9182 * the feature to be disabled, separated by a comma. The integer must correspond 9183 * to a interoperability feature as defined in "interop.h" in /system/bt. 9184 * <p> 9185 * Example: <br/> 9186 * "00:11:22,0;01:02:03:04,2" 9187 * @hide 9188 */ 9189 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; 9190 9191 /** 9192 * The policy for deciding when Wi-Fi should go to sleep (which will in 9193 * turn switch to using the mobile data as an Internet connection). 9194 * <p> 9195 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 9196 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 9197 * {@link #WIFI_SLEEP_POLICY_NEVER}. 9198 * @deprecated This is no longer used or set by the platform. 9199 */ 9200 @Deprecated 9201 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 9202 9203 /** 9204 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 9205 * policy, which is to sleep shortly after the turning off 9206 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 9207 * @deprecated This is no longer used by the platform. 9208 */ 9209 @Deprecated 9210 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 9211 9212 /** 9213 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 9214 * the device is on battery, and never go to sleep when the device is 9215 * plugged in. 9216 * @deprecated This is no longer used by the platform. 9217 */ 9218 @Deprecated 9219 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 9220 9221 /** 9222 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 9223 * @deprecated This is no longer used by the platform. 9224 */ 9225 @Deprecated 9226 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 9227 9228 /** 9229 * Value to specify if the user prefers the date, time and time zone 9230 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 9231 */ 9232 public static final String AUTO_TIME = "auto_time"; 9233 9234 /** 9235 * Value to specify if the user prefers the time zone 9236 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 9237 */ 9238 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 9239 9240 /** 9241 * URI for the car dock "in" event sound. 9242 * @hide 9243 */ 9244 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 9245 9246 /** 9247 * URI for the car dock "out" event sound. 9248 * @hide 9249 */ 9250 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 9251 9252 /** 9253 * URI for the desk dock "in" event sound. 9254 * @hide 9255 */ 9256 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 9257 9258 /** 9259 * URI for the desk dock "out" event sound. 9260 * @hide 9261 */ 9262 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 9263 9264 /** 9265 * Whether to play a sound for dock events. 9266 * @hide 9267 */ 9268 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 9269 9270 /** 9271 * Whether to play a sound for dock events, only when an accessibility service is on. 9272 * @hide 9273 */ 9274 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; 9275 9276 /** 9277 * URI for the "device locked" (keyguard shown) sound. 9278 * @hide 9279 */ 9280 public static final String LOCK_SOUND = "lock_sound"; 9281 9282 /** 9283 * URI for the "device unlocked" sound. 9284 * @hide 9285 */ 9286 public static final String UNLOCK_SOUND = "unlock_sound"; 9287 9288 /** 9289 * URI for the "device is trusted" sound, which is played when the device enters the trusted 9290 * state without unlocking. 9291 * @hide 9292 */ 9293 public static final String TRUSTED_SOUND = "trusted_sound"; 9294 9295 /** 9296 * URI for the low battery sound file. 9297 * @hide 9298 */ 9299 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 9300 9301 /** 9302 * Whether to play a sound for low-battery alerts. 9303 * @hide 9304 */ 9305 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 9306 9307 /** 9308 * URI for the "wireless charging started" sound. 9309 * @hide 9310 */ 9311 public static final String WIRELESS_CHARGING_STARTED_SOUND = 9312 "wireless_charging_started_sound"; 9313 9314 /** 9315 * URI for "wired charging started" sound. 9316 * @hide 9317 */ 9318 public static final String CHARGING_STARTED_SOUND = "charging_started_sound"; 9319 9320 /** 9321 * Whether to play a sound for charging events. 9322 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead 9323 * @hide 9324 */ 9325 @Deprecated 9326 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 9327 9328 /** 9329 * Whether to vibrate for wireless charging events. 9330 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED} 9331 * @hide 9332 */ 9333 @Deprecated 9334 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 9335 9336 /** 9337 * Whether we keep the device on while the device is plugged in. 9338 * Supported values are: 9339 * <ul> 9340 * <li>{@code 0} to never stay on while plugged in</li> 9341 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 9342 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 9343 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 9344 * </ul> 9345 * These values can be OR-ed together. 9346 */ 9347 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 9348 9349 /** 9350 * When the user has enable the option to have a "bug report" command 9351 * in the power menu. 9352 * @hide 9353 */ 9354 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 9355 9356 /** 9357 * The package name for the custom bugreport handler app. This app must be whitelisted. 9358 * This is currently used only by Power Menu short press. 9359 * 9360 * @hide 9361 */ 9362 public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app"; 9363 9364 /** 9365 * The user id for the custom bugreport handler app. This is currently used only by Power 9366 * Menu short press. 9367 * 9368 * @hide 9369 */ 9370 public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user"; 9371 9372 /** 9373 * Whether ADB over USB is enabled. 9374 */ 9375 public static final String ADB_ENABLED = "adb_enabled"; 9376 9377 /** 9378 * Whether ADB over Wifi is enabled. 9379 * @hide 9380 */ 9381 public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled"; 9382 9383 /** 9384 * Whether Views are allowed to save their attribute data. 9385 * @hide 9386 */ 9387 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 9388 9389 /** 9390 * Which application package is allowed to save View attribute data. 9391 * @hide 9392 */ 9393 public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE = 9394 "debug_view_attributes_application_package"; 9395 9396 /** 9397 * Whether assisted GPS should be enabled or not. 9398 * @hide 9399 */ 9400 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 9401 9402 /** 9403 * Whether bluetooth is enabled/disabled 9404 * 0=disabled. 1=enabled. 9405 */ 9406 public static final String BLUETOOTH_ON = "bluetooth_on"; 9407 9408 /** 9409 * CDMA Cell Broadcast SMS 9410 * 0 = CDMA Cell Broadcast SMS disabled 9411 * 1 = CDMA Cell Broadcast SMS enabled 9412 * @hide 9413 */ 9414 public static final String CDMA_CELL_BROADCAST_SMS = 9415 "cdma_cell_broadcast_sms"; 9416 9417 /** 9418 * The CDMA roaming mode 0 = Home Networks, CDMA default 9419 * 1 = Roaming on Affiliated networks 9420 * 2 = Roaming on any networks 9421 * @hide 9422 */ 9423 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 9424 9425 /** 9426 * The CDMA subscription mode 0 = RUIM/SIM (default) 9427 * 1 = NV 9428 * @hide 9429 */ 9430 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 9431 9432 /** 9433 * The default value for whether background data is enabled or not. 9434 * 9435 * Used by {@code NetworkPolicyManagerService}. 9436 * 9437 * @hide 9438 */ 9439 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = 9440 "default_restrict_background_data"; 9441 9442 /** Inactivity timeout to track mobile data activity. 9443 * 9444 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 9445 * infer the data activity of mobile network. After a period of no activity on mobile 9446 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 9447 * intent is fired to indicate a transition of network status from "active" to "idle". Any 9448 * subsequent activity on mobile networks triggers the firing of {@code 9449 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 9450 * 9451 * Network activity refers to transmitting or receiving data on the network interfaces. 9452 * 9453 * Tracking is disabled if set to zero or negative value. 9454 * 9455 * @hide 9456 */ 9457 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 9458 9459 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 9460 * but for Wifi network. 9461 * @hide 9462 */ 9463 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 9464 9465 /** 9466 * Whether or not data roaming is enabled. (0 = false, 1 = true) 9467 */ 9468 public static final String DATA_ROAMING = "data_roaming"; 9469 9470 /** 9471 * The value passed to a Mobile DataConnection via bringUp which defines the 9472 * number of retries to preform when setting up the initial connection. The default 9473 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 9474 * @hide 9475 */ 9476 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 9477 9478 /** 9479 * Whether any package can be on external storage. When this is true, any 9480 * package, regardless of manifest values, is a candidate for installing 9481 * or moving onto external storage. (0 = false, 1 = true) 9482 * @hide 9483 */ 9484 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 9485 9486 /** 9487 * The default SM-DP+ configured for this device. 9488 * 9489 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to 9490 * download profiles. If this value is set, the LPA will query this server for any profiles 9491 * available to this device. If any are available, they may be downloaded during device 9492 * provisioning or in settings without needing the user to enter an activation code. 9493 * 9494 * @see android.service.euicc.EuiccService 9495 * @hide 9496 */ 9497 @SystemApi 9498 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; 9499 9500 /** 9501 * Whether any profile has ever been downloaded onto a eUICC on the device. 9502 * 9503 * <p>Used to hide eUICC UI from users who have never made use of it and would only be 9504 * confused by seeing references to it in settings. 9505 * (0 = false, 1 = true) 9506 * @hide 9507 */ 9508 @SystemApi 9509 public static final String EUICC_PROVISIONED = "euicc_provisioned"; 9510 9511 /** 9512 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated 9513 * by comma. 9514 * 9515 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 9516 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 9517 * 9518 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 9519 * support eUICC. 9520 * 9521 * @hide 9522 */ 9523 @SystemApi 9524 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries"; 9525 9526 /** 9527 * List of ISO country codes in which eUICC UI is not shown. Country codes should be 9528 * separated by comma. 9529 * 9530 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 9531 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 9532 * 9533 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 9534 * support eUICC. 9535 * 9536 * @hide 9537 */ 9538 @SystemApi 9539 public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries"; 9540 9541 /** 9542 * Whether any activity can be resized. When this is true, any 9543 * activity, regardless of manifest values, can be resized for multi-window. 9544 * (0 = false, 1 = true) 9545 * @hide 9546 */ 9547 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES 9548 = "force_resizable_activities"; 9549 9550 /** 9551 * Whether to enable experimental freeform support for windows. 9552 * @hide 9553 */ 9554 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT 9555 = "enable_freeform_support"; 9556 9557 /** 9558 * Whether to enable experimental desktop mode on secondary displays. 9559 * @hide 9560 */ 9561 public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS = 9562 "force_desktop_mode_on_external_displays"; 9563 9564 /** 9565 * Whether to allow non-resizable apps to be freeform. 9566 * @hide 9567 */ 9568 public static final String DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM = 9569 "enable_sizecompat_freeform"; 9570 9571 /** 9572 * If true, shadows drawn around the window will be rendered by the system compositor. If 9573 * false, shadows will be drawn by the client by setting an elevation on the root view and 9574 * the contents will be inset by the surface insets. 9575 * (0 = false, 1 = true) 9576 * @hide 9577 */ 9578 public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR = 9579 "render_shadows_in_compositor"; 9580 9581 /** 9582 * Whether user has enabled development settings. 9583 */ 9584 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 9585 9586 /** 9587 * Whether the device has been provisioned (0 = false, 1 = true). 9588 * <p>On a multiuser device with a separate system user, the screen may be locked 9589 * as soon as this is set to true and further activities cannot be launched on the 9590 * system user unless they are marked to show over keyguard. 9591 */ 9592 public static final String DEVICE_PROVISIONED = "device_provisioned"; 9593 9594 /** 9595 * Indicates whether mobile data should be allowed while the device is being provisioned. 9596 * This allows the provisioning process to turn off mobile data before the user 9597 * has an opportunity to set things up, preventing other processes from burning 9598 * precious bytes before wifi is setup. 9599 * <p> 9600 * Type: int (0 for false, 1 for true) 9601 * 9602 * @hide 9603 */ 9604 @SystemApi 9605 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = 9606 "device_provisioning_mobile_data"; 9607 9608 /** 9609 * The saved value for WindowManagerService.setForcedDisplaySize(). 9610 * Two integers separated by a comma. If unset, then use the real display size. 9611 * @hide 9612 */ 9613 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 9614 9615 /** 9616 * The saved value for WindowManagerService.setForcedDisplayScalingMode(). 9617 * 0 or unset if scaling is automatic, 1 if scaling is disabled. 9618 * @hide 9619 */ 9620 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; 9621 9622 /** 9623 * The maximum size, in bytes, of a download that the download manager will transfer over 9624 * a non-wifi connection. 9625 * @hide 9626 */ 9627 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 9628 "download_manager_max_bytes_over_mobile"; 9629 9630 /** 9631 * The recommended maximum size, in bytes, of a download that the download manager should 9632 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 9633 * have the option to start the download over the mobile connection anyway. 9634 * @hide 9635 */ 9636 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 9637 "download_manager_recommended_max_bytes_over_mobile"; 9638 9639 /** 9640 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 9641 */ 9642 @Deprecated 9643 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 9644 9645 /** 9646 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 9647 * sent or processed. (0 = false, 1 = true) 9648 * @hide 9649 */ 9650 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 9651 9652 /** 9653 * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 = 9654 * true). 9655 * 9656 * <p>Effects on different device types: 9657 * <table> 9658 * <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr> 9659 * <tr> 9660 * <td>TV (type: 0)</td> 9661 * <td>Per CEC specification.</td> 9662 * <td>TV changes system volume. TV no longer reacts to incoming volume changes 9663 * via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio 9664 * Status>}.</td> 9665 * </tr> 9666 * <tr> 9667 * <td>Playback device (type: 4)</td> 9668 * <td>Device sends volume commands to TV/Audio system via {@code <User Control 9669 * Pressed>}</td> 9670 * <td>Device does not send volume commands via {@code <User Control Pressed>}.</td> 9671 * </tr> 9672 * <tr> 9673 * <td>Audio device (type: 5)</td> 9674 * <td>Full "System Audio Control" capabilities.</td> 9675 * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} 9676 * volume commands. Audio device no longer reports volume changes via {@code 9677 * <Report Audio Status>}.</td> 9678 * </tr> 9679 * </table> 9680 * 9681 * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. 9682 * 9683 * @hide 9684 * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean) 9685 */ 9686 public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED = 9687 "hdmi_control_volume_control_enabled"; 9688 9689 /** 9690 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on 9691 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will 9692 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be 9693 * activated. 9694 * @hide 9695 */ 9696 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = 9697 "hdmi_system_audio_control_enabled"; 9698 9699 /** 9700 * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will 9701 * route to the correct input source on receiving Routing Control related messages. If 9702 * disabled, you can only switch the input via controls on this device. 9703 * @hide 9704 */ 9705 public static final String HDMI_CEC_SWITCH_ENABLED = 9706 "hdmi_cec_switch_enabled"; 9707 9708 /** 9709 * Whether TV will automatically turn on upon reception of the CEC command 9710 * <Text View On> or <Image View On>. (0 = false, 1 = true) 9711 * 9712 * @hide 9713 */ 9714 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 9715 "hdmi_control_auto_wakeup_enabled"; 9716 9717 /** 9718 * Whether TV will also turn off other CEC devices when it goes to standby mode. 9719 * (0 = false, 1 = true) 9720 * 9721 * @hide 9722 */ 9723 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 9724 "hdmi_control_auto_device_off_enabled"; 9725 9726 /** 9727 * Whether or not media is shown automatically when bypassing as a heads up. 9728 * @hide 9729 */ 9730 public static final String SHOW_MEDIA_ON_QUICK_SETTINGS = 9731 "qs_media_player"; 9732 9733 /** 9734 * The interval in milliseconds at which location requests will be throttled when they are 9735 * coming from the background. 9736 * 9737 * @hide 9738 */ 9739 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = 9740 "location_background_throttle_interval_ms"; 9741 9742 /** 9743 * Most frequent location update interval in milliseconds that proximity alert is allowed 9744 * to request. 9745 * @hide 9746 */ 9747 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = 9748 "location_background_throttle_proximity_alert_interval_ms"; 9749 9750 /** 9751 * Packages that are whitelisted for background throttling (throttling will not be applied). 9752 * @hide 9753 */ 9754 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = 9755 "location_background_throttle_package_whitelist"; 9756 9757 /** 9758 * Packages that are whitelisted for ignoring location settings (may retrieve location even 9759 * when user location settings are off), for emergency purposes. 9760 * @hide 9761 */ 9762 @TestApi 9763 public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST = 9764 "location_ignore_settings_package_whitelist"; 9765 9766 /** 9767 * Whether TV will switch to MHL port when a mobile device is plugged in. 9768 * (0 = false, 1 = true) 9769 * @hide 9770 */ 9771 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 9772 9773 /** 9774 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 9775 * @hide 9776 */ 9777 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 9778 9779 /** 9780 * Whether mobile data connections are allowed by the user. See 9781 * ConnectivityManager for more info. 9782 * @hide 9783 */ 9784 @UnsupportedAppUsage 9785 public static final String MOBILE_DATA = "mobile_data"; 9786 9787 /** 9788 * Whether the mobile data connection should remain active even when higher 9789 * priority networks like WiFi are active, to help make network switching faster. 9790 * 9791 * See ConnectivityService for more info. 9792 * 9793 * (0 = disabled, 1 = enabled) 9794 * @hide 9795 */ 9796 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 9797 9798 /** 9799 * Whether the wifi data connection should remain active even when higher 9800 * priority networks like Ethernet are active, to keep both networks. 9801 * In the case where higher priority networks are connected, wifi will be 9802 * unused unless an application explicitly requests to use it. 9803 * 9804 * See ConnectivityService for more info. 9805 * 9806 * (0 = disabled, 1 = enabled) 9807 * @hide 9808 */ 9809 public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested"; 9810 9811 /** 9812 * Size of the event buffer for IP connectivity metrics. 9813 * @hide 9814 */ 9815 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = 9816 "connectivity_metrics_buffer_size"; 9817 9818 /** {@hide} */ 9819 public static final String NETSTATS_ENABLED = "netstats_enabled"; 9820 /** {@hide} */ 9821 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 9822 /** {@hide} */ 9823 @Deprecated 9824 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 9825 /** {@hide} */ 9826 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 9827 /** {@hide} */ 9828 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 9829 /** {@hide} */ 9830 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; 9831 /** {@hide} */ 9832 public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED = "netstats_combine_subtype_enabled"; 9833 9834 /** {@hide} */ 9835 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 9836 /** {@hide} */ 9837 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 9838 /** {@hide} */ 9839 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 9840 /** {@hide} */ 9841 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 9842 9843 /** {@hide} */ 9844 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 9845 /** {@hide} */ 9846 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 9847 /** {@hide} */ 9848 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 9849 /** {@hide} */ 9850 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 9851 9852 /** {@hide} */ 9853 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; 9854 /** {@hide} */ 9855 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; 9856 /** {@hide} */ 9857 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 9858 /** {@hide} */ 9859 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 9860 9861 /** {@hide} */ 9862 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled"; 9863 /** {@hide} */ 9864 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited"; 9865 /** {@hide} */ 9866 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited"; 9867 /** {@hide} */ 9868 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs"; 9869 /** {@hide} */ 9870 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath"; 9871 9872 /** {@hide} */ 9873 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled"; 9874 9875 /** 9876 * User preference for which network(s) should be used. Only the 9877 * connectivity service should touch this. 9878 */ 9879 public static final String NETWORK_PREFERENCE = "network_preference"; 9880 9881 /** 9882 * Which package name to use for network scoring. If null, or if the package is not a valid 9883 * scorer app, external network scores will neither be requested nor accepted. 9884 * @hide 9885 */ 9886 @UnsupportedAppUsage 9887 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 9888 9889 /** 9890 * Whether night display forced auto mode is available. 9891 * 0 = unavailable, 1 = available. 9892 * @hide 9893 */ 9894 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = 9895 "night_display_forced_auto_mode_available"; 9896 9897 /** 9898 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 9899 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 9900 * exceeded. 9901 * @hide 9902 */ 9903 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 9904 9905 /** 9906 * The length of time in milli-seconds that automatic small adjustments to 9907 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 9908 * @hide 9909 */ 9910 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 9911 9912 /** Preferred NTP server. {@hide} */ 9913 public static final String NTP_SERVER = "ntp_server"; 9914 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 9915 public static final String NTP_TIMEOUT = "ntp_timeout"; 9916 9917 /** {@hide} */ 9918 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; 9919 9920 /** 9921 * Whether or not Settings should enable psd API. 9922 * {@hide} 9923 */ 9924 public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api"; 9925 9926 /** 9927 * Whether or not Settings should enable external provider API. 9928 * {@hide} 9929 */ 9930 public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API = 9931 "settings_use_external_provider_api"; 9932 9933 /** 9934 * Sample validity in seconds to configure for the system DNS resolver. 9935 * {@hide} 9936 */ 9937 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = 9938 "dns_resolver_sample_validity_seconds"; 9939 9940 /** 9941 * Success threshold in percent for use with the system DNS resolver. 9942 * {@hide} 9943 */ 9944 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = 9945 "dns_resolver_success_threshold_percent"; 9946 9947 /** 9948 * Minimum number of samples needed for statistics to be considered meaningful in the 9949 * system DNS resolver. 9950 * {@hide} 9951 */ 9952 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; 9953 9954 /** 9955 * Maximum number taken into account for statistics purposes in the system DNS resolver. 9956 * {@hide} 9957 */ 9958 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; 9959 9960 /** 9961 * Whether to disable the automatic scheduling of system updates. 9962 * 1 = system updates won't be automatically scheduled (will always 9963 * present notification instead). 9964 * 0 = system updates will be automatically scheduled. (default) 9965 * @hide 9966 */ 9967 @SystemApi 9968 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; 9969 9970 /** Timeout for package verification. 9971 * @hide */ 9972 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 9973 9974 /** Timeout for app integrity verification. 9975 * @hide */ 9976 public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT = 9977 "app_integrity_verification_timeout"; 9978 9979 /** Default response code for package verification. 9980 * @hide */ 9981 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 9982 9983 /** 9984 * Show package verification setting in the Settings app. 9985 * 1 = show (default) 9986 * 0 = hide 9987 * @hide 9988 */ 9989 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 9990 9991 /** 9992 * Run package verification on apps installed through ADB/ADT/USB 9993 * 1 = perform package verification on ADB installs (default) 9994 * 0 = bypass package verification on ADB installs 9995 * @hide 9996 */ 9997 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 9998 9999 /** 10000 * Run integrity checks for integrity rule providers. 10001 * 0 = bypass integrity verification on installs from rule providers (default) 10002 * 1 = perform integrity verification on installs from rule providers 10003 * @hide 10004 */ 10005 public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER = 10006 "verify_integrity_for_rule_provider"; 10007 10008 /** 10009 * Time since last fstrim (milliseconds) after which we force one to happen 10010 * during device startup. If unset, the default is 3 days. 10011 * @hide 10012 */ 10013 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; 10014 10015 /** 10016 * The interval in milliseconds at which to check packet counts on the 10017 * mobile data interface when screen is on, to detect possible data 10018 * connection problems. 10019 * @hide 10020 */ 10021 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 10022 "pdp_watchdog_poll_interval_ms"; 10023 10024 /** 10025 * The interval in milliseconds at which to check packet counts on the 10026 * mobile data interface when screen is off, to detect possible data 10027 * connection problems. 10028 * @hide 10029 */ 10030 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 10031 "pdp_watchdog_long_poll_interval_ms"; 10032 10033 /** 10034 * The interval in milliseconds at which to check packet counts on the 10035 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 10036 * outgoing packets has been reached without incoming packets. 10037 * @hide 10038 */ 10039 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 10040 "pdp_watchdog_error_poll_interval_ms"; 10041 10042 /** 10043 * The number of outgoing packets sent without seeing an incoming packet 10044 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 10045 * device is logged to the event log 10046 * @hide 10047 */ 10048 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 10049 "pdp_watchdog_trigger_packet_count"; 10050 10051 /** 10052 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 10053 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 10054 * attempting data connection recovery. 10055 * @hide 10056 */ 10057 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 10058 "pdp_watchdog_error_poll_count"; 10059 10060 /** 10061 * The number of failed PDP reset attempts before moving to something more 10062 * drastic: re-registering to the network. 10063 * @hide 10064 */ 10065 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 10066 "pdp_watchdog_max_pdp_reset_fail_count"; 10067 10068 /** 10069 * URL to open browser on to allow user to manage a prepay account 10070 * @hide 10071 */ 10072 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 10073 "setup_prepaid_data_service_url"; 10074 10075 /** 10076 * URL to attempt a GET on to see if this is a prepay device 10077 * @hide 10078 */ 10079 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 10080 "setup_prepaid_detection_target_url"; 10081 10082 /** 10083 * Host to check for a redirect to after an attempt to GET 10084 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 10085 * this is a prepaid device with zero balance.) 10086 * @hide 10087 */ 10088 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 10089 "setup_prepaid_detection_redir_host"; 10090 10091 /** 10092 * The interval in milliseconds at which to check the number of SMS sent out without asking 10093 * for use permit, to limit the un-authorized SMS usage. 10094 * 10095 * @hide 10096 */ 10097 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 10098 "sms_outgoing_check_interval_ms"; 10099 10100 /** 10101 * The number of outgoing SMS sent without asking for user permit (of {@link 10102 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 10103 * 10104 * @hide 10105 */ 10106 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 10107 "sms_outgoing_check_max_count"; 10108 10109 /** 10110 * Used to disable SMS short code confirmation - defaults to true. 10111 * True indcates we will do the check, etc. Set to false to disable. 10112 * @see com.android.internal.telephony.SmsUsageMonitor 10113 * @hide 10114 */ 10115 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 10116 10117 /** 10118 * Used to select which country we use to determine premium sms codes. 10119 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 10120 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 10121 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 10122 * @hide 10123 */ 10124 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 10125 10126 /** 10127 * Used to select TCP's default initial receiver window size in segments - defaults to a 10128 * build config value. 10129 * @hide 10130 */ 10131 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 10132 10133 /** 10134 * Used to disable Tethering on a device - defaults to true. 10135 * @hide 10136 */ 10137 @SystemApi 10138 public static final String TETHER_SUPPORTED = "tether_supported"; 10139 10140 /** 10141 * Used to require DUN APN on the device or not - defaults to a build config value 10142 * which defaults to false. 10143 * @hide 10144 */ 10145 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 10146 10147 /** 10148 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 10149 * corresponding build config values are set it will override the APN DB 10150 * values. 10151 * Consists of a comma separated list of strings: 10152 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 10153 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN" 10154 * @hide 10155 */ 10156 public static final String TETHER_DUN_APN = "tether_dun_apn"; 10157 10158 /** 10159 * Used to disable trying to talk to any available tethering offload HAL. 10160 * 10161 * Integer values are interpreted as boolean, and the absence of an explicit setting 10162 * is interpreted as |false|. 10163 * @hide 10164 */ 10165 @SystemApi 10166 @TestApi 10167 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; 10168 10169 /** 10170 * Use the old dnsmasq DHCP server for tethering instead of the framework implementation. 10171 * 10172 * Integer values are interpreted as boolean, and the absence of an explicit setting 10173 * is interpreted as |false|. 10174 * @hide 10175 */ 10176 public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER = 10177 "tether_enable_legacy_dhcp_server"; 10178 10179 /** 10180 * List of certificate (hex string representation of the application's certificate - SHA-1 10181 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for 10182 * install when a sim card with matching UICC carrier privilege rules is inserted. The 10183 * certificate is used as a key, so the certificate encoding here must be the same as the 10184 * certificate encoding used on the SIM. 10185 * 10186 * The value is "cert1:package1;cert2:package2;..." 10187 * @hide 10188 */ 10189 @SystemApi 10190 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; 10191 10192 /** 10193 * Map of package name to application names. The application names cannot and will not be 10194 * localized. App names may not contain colons or semicolons. 10195 * 10196 * The value is "packageName1:appName1;packageName2:appName2;..." 10197 * @hide 10198 */ 10199 @SystemApi 10200 public static final String CARRIER_APP_NAMES = "carrier_app_names"; 10201 10202 /** 10203 * USB Mass Storage Enabled 10204 */ 10205 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 10206 10207 /** 10208 * If this setting is set (to anything), then all references 10209 * to Gmail on the device must change to Google Mail. 10210 */ 10211 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 10212 10213 /** 10214 * Whether or not switching/creating users is enabled by user. 10215 * @hide 10216 */ 10217 public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled"; 10218 10219 /** 10220 * Webview Data reduction proxy key. 10221 * @hide 10222 */ 10223 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 10224 "webview_data_reduction_proxy_key"; 10225 10226 /** 10227 * Whether or not the WebView fallback mechanism should be enabled. 10228 * 0=disabled, 1=enabled. 10229 * @hide 10230 */ 10231 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = 10232 "webview_fallback_logic_enabled"; 10233 10234 /** 10235 * Name of the package used as WebView provider (if unset the provider is instead determined 10236 * by the system). 10237 * @hide 10238 */ 10239 @UnsupportedAppUsage 10240 public static final String WEBVIEW_PROVIDER = "webview_provider"; 10241 10242 /** 10243 * Developer setting to enable WebView multiprocess rendering. 10244 * @hide 10245 */ 10246 @SystemApi 10247 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; 10248 10249 /** 10250 * The maximum number of notifications shown in 24 hours when switching networks. 10251 * @hide 10252 */ 10253 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = 10254 "network_switch_notification_daily_limit"; 10255 10256 /** 10257 * The minimum time in milliseconds between notifications when switching networks. 10258 * @hide 10259 */ 10260 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = 10261 "network_switch_notification_rate_limit_millis"; 10262 10263 /** 10264 * Whether to automatically switch away from wifi networks that lose Internet access. 10265 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always 10266 * avoids such networks. Valid values are: 10267 * 10268 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. 10269 * null: Ask the user whether to switch away from bad wifi. 10270 * 1: Avoid bad wifi. 10271 * 10272 * @hide 10273 */ 10274 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; 10275 10276 /** 10277 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be 10278 * overridden by the system based on device or application state. If null, the value 10279 * specified by config_networkMeteredMultipathPreference is used. 10280 * 10281 * @hide 10282 */ 10283 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = 10284 "network_metered_multipath_preference"; 10285 10286 /** 10287 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() 10288 * on metered networks. This default quota is only used if quota could not be determined 10289 * from data plan or data limit/warning set by the user. 10290 * @hide 10291 */ 10292 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = 10293 "network_default_daily_multipath_quota_bytes"; 10294 10295 /** 10296 * Network watchlist last report time. 10297 * @hide 10298 */ 10299 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = 10300 "network_watchlist_last_report_time"; 10301 10302 /** 10303 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of 10304 * colon-delimited key-value pairs. The key is the badging enum value defined in 10305 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in 10306 * kbps required for the badge. For example: "10:3000,20:5000,30:25000" 10307 * 10308 * @hide 10309 */ 10310 @SystemApi 10311 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; 10312 10313 /** 10314 * Whether Wifi display is enabled/disabled 10315 * 0=disabled. 1=enabled. 10316 * @hide 10317 */ 10318 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 10319 10320 /** 10321 * Whether Wifi display certification mode is enabled/disabled 10322 * 0=disabled. 1=enabled. 10323 * @hide 10324 */ 10325 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 10326 "wifi_display_certification_on"; 10327 10328 /** 10329 * WPS Configuration method used by Wifi display, this setting only 10330 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 10331 * 10332 * Possible values are: 10333 * 10334 * WpsInfo.INVALID: use default WPS method chosen by framework 10335 * WpsInfo.PBC : use Push button 10336 * WpsInfo.KEYPAD : use Keypad 10337 * WpsInfo.DISPLAY: use Display 10338 * @hide 10339 */ 10340 public static final String WIFI_DISPLAY_WPS_CONFIG = 10341 "wifi_display_wps_config"; 10342 10343 /** 10344 * Whether to notify the user of open networks. 10345 * <p> 10346 * If not connected and the scan results have an open network, we will 10347 * put this notification up. If we attempt to connect to a network or 10348 * the open network(s) disappear, we remove the notification. When we 10349 * show the notification, we will not show it again for 10350 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 10351 * 10352 * @deprecated This feature is no longer controlled by this setting in 10353 * {@link android.os.Build.VERSION_CODES#O}. 10354 */ 10355 @Deprecated 10356 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 10357 "wifi_networks_available_notification_on"; 10358 10359 /** 10360 * {@hide} 10361 */ 10362 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 10363 "wimax_networks_available_notification_on"; 10364 10365 /** 10366 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 10367 * Connecting to a network will reset the timer. 10368 * @deprecated This is no longer used or set by the platform. 10369 */ 10370 @Deprecated 10371 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 10372 "wifi_networks_available_repeat_delay"; 10373 10374 /** 10375 * 802.11 country code in ISO 3166 format 10376 * @hide 10377 */ 10378 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 10379 10380 /** 10381 * The interval in milliseconds to issue wake up scans when wifi needs 10382 * to connect. This is necessary to connect to an access point when 10383 * device is on the move and the screen is off. 10384 * @hide 10385 */ 10386 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 10387 "wifi_framework_scan_interval_ms"; 10388 10389 /** 10390 * The interval in milliseconds after which Wi-Fi is considered idle. 10391 * When idle, it is possible for the device to be switched from Wi-Fi to 10392 * the mobile data network. 10393 * @hide 10394 */ 10395 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 10396 10397 /** 10398 * When the number of open networks exceeds this number, the 10399 * least-recently-used excess networks will be removed. 10400 * @deprecated This is no longer used or set by the platform. 10401 */ 10402 @Deprecated 10403 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 10404 10405 /** 10406 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 10407 */ 10408 public static final String WIFI_ON = "wifi_on"; 10409 10410 /** 10411 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 10412 * @hide 10413 * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for 10414 * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query. 10415 */ 10416 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 10417 "wifi_scan_always_enabled"; 10418 10419 /** 10420 * Indicate whether factory reset request is pending. 10421 * 10422 * Type: int (0 for false, 1 for true) 10423 * @hide 10424 * @deprecated To be removed. 10425 */ 10426 public static final String WIFI_P2P_PENDING_FACTORY_RESET = 10427 "wifi_p2p_pending_factory_reset"; 10428 10429 /** 10430 * Whether soft AP will shut down after a timeout period when no devices are connected. 10431 * 10432 * Type: int (0 for false, 1 for true) 10433 * @hide 10434 * @deprecated To be removed. Use {@link SoftApConfiguration.Builder# 10435 * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration# 10436 * isAutoShutdownEnabled()} for query. 10437 */ 10438 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; 10439 10440 /** 10441 * Value to specify if Wi-Fi Wakeup feature is enabled. 10442 * 10443 * Type: int (0 for false, 1 for true) 10444 * @hide 10445 * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value 10446 * and {@link WifiManager#isAutoWakeupEnabled()} for query. 10447 */ 10448 @Deprecated 10449 @SystemApi 10450 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; 10451 10452 /** 10453 * Value to specify if wifi settings migration is complete or not. 10454 * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class. 10455 * 10456 * Type: int (0 for false, 1 for true) 10457 * @hide 10458 */ 10459 public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed"; 10460 10461 /** 10462 * Value to specify whether network quality scores and badging should be shown in the UI. 10463 * 10464 * Type: int (0 for false, 1 for true) 10465 * @hide 10466 */ 10467 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; 10468 10469 /** 10470 * Value to specify how long in milliseconds to retain seen score cache curves to be used 10471 * when generating SSID only bases score curves. 10472 * 10473 * Type: long 10474 * @hide 10475 */ 10476 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = 10477 "speed_label_cache_eviction_age_millis"; 10478 10479 /** 10480 * Value to specify if network recommendations from 10481 * {@link com.android.server.NetworkScoreService} are enabled. 10482 * 10483 * Type: int 10484 * Valid values: 10485 * -1 = Forced off 10486 * 0 = Disabled 10487 * 1 = Enabled 10488 * 10489 * Most readers of this setting should simply check if value == 1 to determined the 10490 * enabled state. 10491 * @hide 10492 * @deprecated To be removed. 10493 */ 10494 public static final String NETWORK_RECOMMENDATIONS_ENABLED = 10495 "network_recommendations_enabled"; 10496 10497 /** 10498 * Which package name to use for network recommendations. If null, network recommendations 10499 * will neither be requested nor accepted. 10500 * 10501 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and 10502 * {@link NetworkScoreManager#setActiveScorer(String)} to write it. 10503 * 10504 * Type: string - package name 10505 * @hide 10506 */ 10507 public static final String NETWORK_RECOMMENDATIONS_PACKAGE = 10508 "network_recommendations_package"; 10509 10510 /** 10511 * The package name of the application that connect and secures high quality open wifi 10512 * networks automatically. 10513 * 10514 * Type: string package name or null if the feature is either not provided or disabled. 10515 * @hide 10516 */ 10517 @TestApi 10518 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; 10519 10520 /** 10521 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in 10522 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. 10523 * 10524 * Type: long 10525 * @hide 10526 */ 10527 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = 10528 "recommended_network_evaluator_cache_expiry_ms"; 10529 10530 /** 10531 * Whether wifi scan throttle is enabled or not. 10532 * 10533 * Type: int (0 for false, 1 for true) 10534 * @hide 10535 * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value 10536 * and {@link WifiManager#isScanThrottleEnabled()} for query. 10537 */ 10538 public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled"; 10539 10540 /** 10541 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for 10542 * connectivity. 10543 * @hide 10544 */ 10545 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; 10546 10547 /** 10548 * The length in milliseconds of a BLE scan window in a low-power scan mode. 10549 * @hide 10550 */ 10551 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; 10552 10553 /** 10554 * The length in milliseconds of a BLE scan window in a balanced scan mode. 10555 * @hide 10556 */ 10557 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; 10558 10559 /** 10560 * The length in milliseconds of a BLE scan window in a low-latency scan mode. 10561 * @hide 10562 */ 10563 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = 10564 "ble_scan_low_latency_window_ms"; 10565 10566 /** 10567 * The length in milliseconds of a BLE scan interval in a low-power scan mode. 10568 * @hide 10569 */ 10570 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = 10571 "ble_scan_low_power_interval_ms"; 10572 10573 /** 10574 * The length in milliseconds of a BLE scan interval in a balanced scan mode. 10575 * @hide 10576 */ 10577 public static final String BLE_SCAN_BALANCED_INTERVAL_MS = 10578 "ble_scan_balanced_interval_ms"; 10579 10580 /** 10581 * The length in milliseconds of a BLE scan interval in a low-latency scan mode. 10582 * @hide 10583 */ 10584 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = 10585 "ble_scan_low_latency_interval_ms"; 10586 10587 /** 10588 * The mode that BLE scanning clients will be moved to when in the background. 10589 * @hide 10590 */ 10591 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; 10592 10593 /** 10594 * The interval in milliseconds to scan as used by the wifi supplicant 10595 * @hide 10596 */ 10597 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 10598 "wifi_supplicant_scan_interval_ms"; 10599 10600 /** 10601 * whether frameworks handles wifi auto-join 10602 * @hide 10603 */ 10604 public static final String WIFI_ENHANCED_AUTO_JOIN = 10605 "wifi_enhanced_auto_join"; 10606 10607 /** 10608 * whether settings show RSSI 10609 * @hide 10610 */ 10611 public static final String WIFI_NETWORK_SHOW_RSSI = 10612 "wifi_network_show_rssi"; 10613 10614 /** 10615 * The interval in milliseconds to scan at supplicant when p2p is connected 10616 * @hide 10617 */ 10618 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 10619 "wifi_scan_interval_p2p_connected_ms"; 10620 10621 /** 10622 * Whether the Wi-Fi watchdog is enabled. 10623 */ 10624 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 10625 10626 /** 10627 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 10628 * the setting needs to be set to 0 to disable it. 10629 * @hide 10630 */ 10631 @UnsupportedAppUsage 10632 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 10633 "wifi_watchdog_poor_network_test_enabled"; 10634 10635 /** 10636 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 10637 * will enable it. In the future, additional values may be supported. 10638 * @hide 10639 * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the 10640 * value and {@link WifiManager#isVerboseLoggingEnabled()} for query. 10641 */ 10642 public static final String WIFI_VERBOSE_LOGGING_ENABLED = 10643 "wifi_verbose_logging_enabled"; 10644 10645 /** 10646 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and 10647 * setting to 1 will enable it. In the future, additional values may be supported. 10648 * @deprecated MAC randomization is now a per-network setting 10649 * @hide 10650 */ 10651 @Deprecated 10652 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = 10653 "wifi_connected_mac_randomization_enabled"; 10654 10655 /** 10656 * Parameters to adjust the performance of framework wifi scoring methods. 10657 * <p> 10658 * Encoded as a comma-separated key=value list, for example: 10659 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" 10660 * This is intended for experimenting with new parameter values, 10661 * and is normally unset or empty. The example does not include all 10662 * parameters that may be honored. 10663 * Default values are provided by code or device configurations. 10664 * Errors in the parameters will cause the entire setting to be ignored. 10665 * @hide 10666 * @deprecated This is no longer used or set by the platform. 10667 */ 10668 public static final String WIFI_SCORE_PARAMS = 10669 "wifi_score_params"; 10670 10671 /** 10672 * The maximum number of times we will retry a connection to an access 10673 * point for which we have failed in acquiring an IP address from DHCP. 10674 * A value of N means that we will make N+1 connection attempts in all. 10675 */ 10676 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 10677 10678 /** 10679 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 10680 * data connectivity to be established after a disconnect from Wi-Fi. 10681 */ 10682 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 10683 "wifi_mobile_data_transition_wakelock_timeout_ms"; 10684 10685 /** 10686 * This setting controls whether WiFi configurations created by a Device Owner app 10687 * should be locked down (that is, be editable or removable only by the Device Owner App, 10688 * not even by Settings app). 10689 * This setting takes integer values. Non-zero values mean DO created configurations 10690 * are locked down. Value of zero means they are not. Default value in the absence of 10691 * actual value to this setting is 0. 10692 */ 10693 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = 10694 "wifi_device_owner_configs_lockdown"; 10695 10696 /** 10697 * The operational wifi frequency band 10698 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 10699 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 10700 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 10701 * 10702 * @hide 10703 */ 10704 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 10705 10706 /** 10707 * The Wi-Fi peer-to-peer device name 10708 * @hide 10709 * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String, 10710 * WifiP2pManager.ActionListener)} for setting the value and 10711 * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query. 10712 */ 10713 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 10714 10715 /** 10716 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect 10717 * from an ephemeral network if there is no BSSID for that network with a non-null score that 10718 * has been seen in this time period. 10719 * 10720 * If this is less than or equal to zero, we use a more conservative behavior and only check 10721 * for a non-null score from the currently connected or target BSSID. 10722 * @hide 10723 */ 10724 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = 10725 "wifi_ephemeral_out_of_range_timeout_ms"; 10726 10727 /** 10728 * The number of milliseconds to delay when checking for data stalls during 10729 * non-aggressive detection. (screen is turned off.) 10730 * @hide 10731 */ 10732 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 10733 "data_stall_alarm_non_aggressive_delay_in_ms"; 10734 10735 /** 10736 * The number of milliseconds to delay when checking for data stalls during 10737 * aggressive detection. (screen on or suspected data stall) 10738 * @hide 10739 */ 10740 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 10741 "data_stall_alarm_aggressive_delay_in_ms"; 10742 10743 /** 10744 * The number of milliseconds to allow the provisioning apn to remain active 10745 * @hide 10746 */ 10747 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 10748 "provisioning_apn_alarm_delay_in_ms"; 10749 10750 /** 10751 * The interval in milliseconds at which to check gprs registration 10752 * after the first registration mismatch of gprs and voice service, 10753 * to detect possible data network registration problems. 10754 * 10755 * @hide 10756 */ 10757 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 10758 "gprs_register_check_period_ms"; 10759 10760 /** 10761 * Nonzero causes Log.wtf() to crash. 10762 * @hide 10763 */ 10764 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 10765 10766 /** 10767 * Ringer mode. This is used internally, changing this value will not 10768 * change the ringer mode. See AudioManager. 10769 */ 10770 public static final String MODE_RINGER = "mode_ringer"; 10771 10772 /** 10773 * Specifies whether Enhanced Connectivity is enabled or not. This setting allows the 10774 * Connectivity Thermal Power Manager to actively help the device to save power in 5G 10775 * scenarios 10776 * Type: int 1 is enabled, 0 is disabled 10777 * 10778 * @hide 10779 */ 10780 public static final String ENHANCED_CONNECTIVITY_ENABLED = 10781 "enhanced_connectivity_enable"; 10782 10783 /** 10784 * Overlay display devices setting. 10785 * The associated value is a specially formatted string that describes the 10786 * size and density of simulated secondary display devices. 10787 * <p> 10788 * Format: 10789 * <pre> 10790 * [display1];[display2];... 10791 * </pre> 10792 * with each display specified as: 10793 * <pre> 10794 * [mode1]|[mode2]|...,[flag1],[flag2],... 10795 * </pre> 10796 * with each mode specified as: 10797 * <pre> 10798 * [width]x[height]/[densityDpi] 10799 * </pre> 10800 * Supported flags: 10801 * <ul> 10802 * <li><pre>secure</pre>: creates a secure display</li> 10803 * <li><pre>own_content_only</pre>: only shows this display's own content</li> 10804 * <li><pre>should_show_system_decorations</pre>: supports system decorations</li> 10805 * </ul> 10806 * </p><p> 10807 * Example: 10808 * <ul> 10809 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 10810 * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at 10811 * 1080p and secure; the second at 720p.</li> 10812 * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at 10813 * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the 10814 * display device allows.</li> 10815 * <li>If the value is empty, then no overlay display devices are created.</li> 10816 * </ul></p> 10817 * 10818 * @hide 10819 */ 10820 @UnsupportedAppUsage 10821 @TestApi 10822 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 10823 10824 /** 10825 * Threshold values for the duration and level of a discharge cycle, 10826 * under which we log discharge cycle info. 10827 * 10828 * @hide 10829 */ 10830 public static final String 10831 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 10832 10833 /** @hide */ 10834 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 10835 10836 /** 10837 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 10838 * intents on application crashes and ANRs. If this is disabled, the 10839 * crash/ANR dialog will never display the "Report" button. 10840 * <p> 10841 * Type: int (0 = disallow, 1 = allow) 10842 * 10843 * @hide 10844 */ 10845 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 10846 10847 /** 10848 * Maximum age of entries kept by {@link DropBoxManager}. 10849 * 10850 * @hide 10851 */ 10852 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 10853 10854 /** 10855 * Maximum number of entry files which {@link DropBoxManager} will keep 10856 * around. 10857 * 10858 * @hide 10859 */ 10860 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 10861 10862 /** 10863 * Maximum amount of disk space used by {@link DropBoxManager} no matter 10864 * what. 10865 * 10866 * @hide 10867 */ 10868 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 10869 10870 /** 10871 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 10872 * will use. 10873 * 10874 * @hide 10875 */ 10876 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 10877 10878 /** 10879 * Percent of total disk which {@link DropBoxManager} will never dip 10880 * into. 10881 * 10882 * @hide 10883 */ 10884 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 10885 10886 /** 10887 * Prefix for per-tag dropbox disable/enable settings. 10888 * 10889 * @hide 10890 */ 10891 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 10892 10893 /** 10894 * Lines of logcat to include with system crash/ANR/etc. reports, as a 10895 * prefix of the dropbox tag of the report type. For example, 10896 * "logcat_for_system_server_anr" controls the lines of logcat captured 10897 * with system server ANR reports. 0 to disable. 10898 * 10899 * @hide 10900 */ 10901 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 10902 10903 /** 10904 * Maximum number of bytes of a system crash/ANR/etc. report that 10905 * ActivityManagerService should send to DropBox, as a prefix of the 10906 * dropbox tag of the report type. For example, 10907 * "max_error_bytes_for_system_server_anr" controls the maximum 10908 * number of bytes captured with system server ANR reports. 10909 * <p> 10910 * Type: int (max size in bytes) 10911 * 10912 * @hide 10913 */ 10914 public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_"; 10915 10916 /** 10917 * The interval in minutes after which the amount of free storage left 10918 * on the device is logged to the event log 10919 * 10920 * @hide 10921 */ 10922 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 10923 10924 /** 10925 * Threshold for the amount of change in disk free space required to 10926 * report the amount of free space. Used to prevent spamming the logs 10927 * when the disk free space isn't changing frequently. 10928 * 10929 * @hide 10930 */ 10931 public static final String 10932 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 10933 10934 /** 10935 * Minimum percentage of free storage on the device that is used to 10936 * determine if the device is running low on storage. The default is 10. 10937 * <p> 10938 * Say this value is set to 10, the device is considered running low on 10939 * storage if 90% or more of the device storage is filled up. 10940 * 10941 * @hide 10942 */ 10943 public static final String 10944 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 10945 10946 /** 10947 * Maximum byte size of the low storage threshold. This is to ensure 10948 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 10949 * overly large threshold for large storage devices. Currently this must 10950 * be less than 2GB. This default is 500MB. 10951 * 10952 * @hide 10953 */ 10954 public static final String 10955 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 10956 10957 /** 10958 * Minimum bytes of free storage on the device before the data partition 10959 * is considered full. By default, 1 MB is reserved to avoid system-wide 10960 * SQLite disk full exceptions. 10961 * 10962 * @hide 10963 */ 10964 public static final String 10965 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 10966 10967 /** 10968 * Minimum percentage of storage on the device that is reserved for 10969 * cached data. 10970 * 10971 * @hide 10972 */ 10973 public static final String 10974 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; 10975 10976 /** 10977 * Maximum bytes of storage on the device that is reserved for cached 10978 * data. 10979 * 10980 * @hide 10981 */ 10982 public static final String 10983 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; 10984 10985 /** 10986 * The maximum reconnect delay for short network outages or when the 10987 * network is suspended due to phone use. 10988 * 10989 * @hide 10990 */ 10991 public static final String 10992 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 10993 10994 /** 10995 * The number of milliseconds to delay before sending out 10996 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. 10997 * 10998 * @hide 10999 */ 11000 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 11001 11002 11003 /** 11004 * Network sampling interval, in seconds. We'll generate link information 11005 * about bytes/packets sent and error rates based on data sampled in this interval 11006 * 11007 * @hide 11008 */ 11009 11010 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 11011 "connectivity_sampling_interval_in_seconds"; 11012 11013 /** 11014 * The series of successively longer delays used in retrying to download PAC file. 11015 * Last delay is used between successful PAC downloads. 11016 * 11017 * @hide 11018 */ 11019 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 11020 11021 /** 11022 * Don't attempt to detect captive portals. 11023 * 11024 * @hide 11025 */ 11026 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; 11027 11028 /** 11029 * When detecting a captive portal, display a notification that 11030 * prompts the user to sign in. 11031 * 11032 * @hide 11033 */ 11034 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; 11035 11036 /** 11037 * When detecting a captive portal, immediately disconnect from the 11038 * network and do not reconnect to that network in the future. 11039 * 11040 * @hide 11041 */ 11042 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; 11043 11044 /** 11045 * What to do when connecting a network that presents a captive portal. 11046 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. 11047 * 11048 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. 11049 * @hide 11050 */ 11051 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; 11052 11053 /** 11054 * Setting to turn off captive portal detection. Feature is enabled by 11055 * default and the setting needs to be set to 0 to disable it. 11056 * 11057 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection 11058 * @hide 11059 */ 11060 @Deprecated 11061 public static final String 11062 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 11063 11064 /** 11065 * The server used for captive portal detection upon a new conection. A 11066 * 204 response code from the server is used for validation. 11067 * TODO: remove this deprecated symbol. 11068 * 11069 * @hide 11070 */ 11071 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 11072 11073 /** 11074 * The URL used for HTTPS captive portal detection upon a new connection. 11075 * A 204 response code from the server is used for validation. 11076 * 11077 * @hide 11078 */ 11079 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; 11080 11081 /** 11082 * The URL used for HTTP captive portal detection upon a new connection. 11083 * A 204 response code from the server is used for validation. 11084 * 11085 * @hide 11086 */ 11087 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; 11088 11089 /** 11090 * The URL used for fallback HTTP captive portal detection when previous HTTP 11091 * and HTTPS captive portal detection attemps did not return a conclusive answer. 11092 * 11093 * @hide 11094 */ 11095 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; 11096 11097 /** 11098 * A comma separated list of URLs used for captive portal detection in addition to the 11099 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. 11100 * 11101 * @hide 11102 */ 11103 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = 11104 "captive_portal_other_fallback_urls"; 11105 11106 /** 11107 * A list of captive portal detection specifications used in addition to the fallback URLs. 11108 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated 11109 * by "@@,@@". 11110 * @hide 11111 */ 11112 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = 11113 "captive_portal_fallback_probe_specs"; 11114 11115 /** 11116 * Whether to use HTTPS for network validation. This is enabled by default and the setting 11117 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals 11118 * don't actually use HTTPS, but it's consistent with the other settings. 11119 * 11120 * @hide 11121 */ 11122 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; 11123 11124 /** 11125 * Which User-Agent string to use in the header of the captive portal detection probes. 11126 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). 11127 * 11128 * @hide 11129 */ 11130 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; 11131 11132 /** 11133 * Whether to try cellular data recovery when a bad network is reported. 11134 * 11135 * @hide 11136 */ 11137 public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK = 11138 "data_stall_recovery_on_bad_network"; 11139 11140 /** 11141 * Minumim duration in millisecodns between cellular data recovery attempts 11142 * 11143 * @hide 11144 */ 11145 public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS = 11146 "min_duration_between_recovery_steps"; 11147 /** 11148 * Whether network service discovery is enabled. 11149 * 11150 * @hide 11151 */ 11152 public static final String NSD_ON = "nsd_on"; 11153 11154 /** 11155 * Let user pick default install location. 11156 * 11157 * @hide 11158 */ 11159 public static final String SET_INSTALL_LOCATION = "set_install_location"; 11160 11161 /** 11162 * Default install location value. 11163 * 0 = auto, let system decide 11164 * 1 = internal 11165 * 2 = sdcard 11166 * @hide 11167 */ 11168 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 11169 11170 /** 11171 * ms during which to consume extra events related to Inet connection 11172 * condition after a transtion to fully-connected 11173 * 11174 * @hide 11175 */ 11176 public static final String 11177 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 11178 11179 /** 11180 * ms during which to consume extra events related to Inet connection 11181 * condtion after a transtion to partly-connected 11182 * 11183 * @hide 11184 */ 11185 public static final String 11186 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 11187 11188 /** {@hide} */ 11189 public static final String 11190 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 11191 11192 /** 11193 * Host name and port for global http proxy. Uses ':' seperator for 11194 * between host and port. 11195 */ 11196 public static final String HTTP_PROXY = "http_proxy"; 11197 11198 /** 11199 * Host name for global http proxy. Set via ConnectivityManager. 11200 * 11201 * @hide 11202 */ 11203 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 11204 11205 /** 11206 * Integer host port for global http proxy. Set via ConnectivityManager. 11207 * 11208 * @hide 11209 */ 11210 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 11211 11212 /** 11213 * Exclusion list for global proxy. This string contains a list of 11214 * comma-separated domains where the global proxy does not apply. 11215 * Domains should be listed in a comma- separated list. Example of 11216 * acceptable formats: ".domain1.com,my.domain2.com" Use 11217 * ConnectivityManager to set/get. 11218 * 11219 * @hide 11220 */ 11221 public static final String 11222 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 11223 11224 /** 11225 * The location PAC File for the proxy. 11226 * @hide 11227 */ 11228 public static final String 11229 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 11230 11231 /** 11232 * Enables the UI setting to allow the user to specify the global HTTP 11233 * proxy and associated exclusion list. 11234 * 11235 * @hide 11236 */ 11237 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 11238 11239 /** 11240 * Setting for default DNS in case nobody suggests one 11241 * 11242 * @hide 11243 */ 11244 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 11245 11246 /** 11247 * The requested Private DNS mode (string), and an accompanying specifier (string). 11248 * 11249 * Currently, the specifier holds the chosen provider name when the mode requests 11250 * a specific provider. It may be used to store the provider name even when the 11251 * mode changes so that temporarily disabling and re-enabling the specific 11252 * provider mode does not necessitate retyping the provider hostname. 11253 * 11254 * @hide 11255 */ 11256 public static final String PRIVATE_DNS_MODE = "private_dns_mode"; 11257 11258 /** 11259 * @hide 11260 */ 11261 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; 11262 11263 /** 11264 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic"). 11265 * This allows changing the default mode without effectively disabling other modes, 11266 * all of which require explicit user action to enable/configure. See also b/79719289. 11267 * 11268 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above. 11269 * 11270 * {@hide} 11271 */ 11272 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode"; 11273 11274 11275 /** {@hide} */ 11276 public static final String 11277 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode"; 11278 /** {@hide} */ 11279 public static final String 11280 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 11281 /** {@hide} */ 11282 public static final String 11283 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 11284 /** {@hide} */ 11285 public static final String 11286 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; 11287 /** {@hide} */ 11288 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = 11289 "bluetooth_a2dp_supports_optional_codecs_"; 11290 /** {@hide} */ 11291 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = 11292 "bluetooth_a2dp_optional_codecs_enabled_"; 11293 /** {@hide} */ 11294 public static final String 11295 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 11296 /** {@hide} */ 11297 public static final String 11298 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 11299 /** {@hide} */ 11300 public static final String 11301 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; 11302 /** {@hide} */ 11303 public static final String 11304 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; 11305 /** {@hide} */ 11306 public static final String 11307 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; 11308 /** {@hide} */ 11309 public static final String 11310 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; 11311 /** {@hide} */ 11312 public static final String 11313 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; 11314 11315 /** 11316 * Enable/disable radio bug detection 11317 * 11318 * {@hide} 11319 */ 11320 public static final String 11321 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection"; 11322 11323 /** 11324 * Count threshold of RIL wakelock timeout for radio bug detection 11325 * 11326 * {@hide} 11327 */ 11328 public static final String 11329 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD = 11330 "radio_bug_wakelock_timeout_count_threshold"; 11331 11332 /** 11333 * Count threshold of RIL system error for radio bug detection 11334 * 11335 * {@hide} 11336 */ 11337 public static final String 11338 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD = 11339 "radio_bug_system_error_count_threshold"; 11340 11341 /** 11342 * Activity manager specific settings. 11343 * This is encoded as a key=value list, separated by commas. Ex: 11344 * 11345 * "gc_timeout=5000,max_cached_processes=24" 11346 * 11347 * The following keys are supported: 11348 * 11349 * <pre> 11350 * max_cached_processes (int) 11351 * background_settle_time (long) 11352 * fgservice_min_shown_time (long) 11353 * fgservice_min_report_time (long) 11354 * fgservice_screen_on_before_time (long) 11355 * fgservice_screen_on_after_time (long) 11356 * content_provider_retain_time (long) 11357 * gc_timeout (long) 11358 * gc_min_interval (long) 11359 * full_pss_min_interval (long) 11360 * full_pss_lowered_interval (long) 11361 * power_check_interval (long) 11362 * power_check_max_cpu_1 (int) 11363 * power_check_max_cpu_2 (int) 11364 * power_check_max_cpu_3 (int) 11365 * power_check_max_cpu_4 (int) 11366 * service_usage_interaction_time (long) 11367 * usage_stats_interaction_interval (long) 11368 * service_restart_duration (long) 11369 * service_reset_run_duration (long) 11370 * service_restart_duration_factor (int) 11371 * service_min_restart_time_between (long) 11372 * service_max_inactivity (long) 11373 * service_bg_start_timeout (long) 11374 * service_bg_activity_start_timeout (long) 11375 * process_start_async (boolean) 11376 * </pre> 11377 * 11378 * <p> 11379 * Type: string 11380 * @hide 11381 * @see com.android.server.am.ActivityManagerConstants 11382 */ 11383 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; 11384 11385 /** 11386 * Feature flag to enable or disable the activity starts logging feature. 11387 * Type: int (0 for false, 1 for true) 11388 * Default: 1 11389 * @hide 11390 */ 11391 public static final String ACTIVITY_STARTS_LOGGING_ENABLED 11392 = "activity_starts_logging_enabled"; 11393 11394 /** 11395 * Feature flag to enable or disable the foreground service starts logging feature. 11396 * Type: int (0 for false, 1 for true) 11397 * Default: 1 11398 * @hide 11399 */ 11400 public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED = 11401 "foreground_service_starts_logging_enabled"; 11402 11403 /** 11404 * @hide 11405 * @see com.android.server.appbinding.AppBindingConstants 11406 */ 11407 public static final String APP_BINDING_CONSTANTS = "app_binding_constants"; 11408 11409 /** 11410 * App ops specific settings. 11411 * This is encoded as a key=value list, separated by commas. Ex: 11412 * 11413 * "state_settle_time=10000" 11414 * 11415 * The following keys are supported: 11416 * 11417 * <pre> 11418 * top_state_settle_time (long) 11419 * fg_service_state_settle_time (long) 11420 * bg_state_settle_time (long) 11421 * </pre> 11422 * 11423 * <p> 11424 * Type: string 11425 * @hide 11426 * @see com.android.server.AppOpsService.Constants 11427 */ 11428 @TestApi 11429 public static final String APP_OPS_CONSTANTS = "app_ops_constants"; 11430 11431 /** 11432 * Device Idle (Doze) specific settings. 11433 * This is encoded as a key=value list, separated by commas. Ex: 11434 * 11435 * "inactive_to=60000,sensing_to=400000" 11436 * 11437 * The following keys are supported: 11438 * 11439 * <pre> 11440 * inactive_to (long) 11441 * sensing_to (long) 11442 * motion_inactive_to (long) 11443 * idle_after_inactive_to (long) 11444 * idle_pending_to (long) 11445 * max_idle_pending_to (long) 11446 * idle_pending_factor (float) 11447 * quick_doze_delay_to (long) 11448 * idle_to (long) 11449 * max_idle_to (long) 11450 * idle_factor (float) 11451 * min_time_to_alarm (long) 11452 * max_temp_app_whitelist_duration (long) 11453 * notification_whitelist_duration (long) 11454 * </pre> 11455 * 11456 * <p> 11457 * Type: string 11458 * @hide 11459 * @see com.android.server.DeviceIdleController.Constants 11460 */ 11461 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; 11462 11463 /** 11464 * Battery Saver specific settings 11465 * This is encoded as a key=value list, separated by commas. Ex: 11466 * 11467 * "vibration_disabled=true,adjust_brightness_factor=0.5" 11468 * 11469 * The following keys are supported: 11470 * 11471 * <pre> 11472 * advertise_is_enabled (boolean) 11473 * datasaver_disabled (boolean) 11474 * enable_night_mode (boolean) 11475 * launch_boost_disabled (boolean) 11476 * vibration_disabled (boolean) 11477 * animation_disabled (boolean) 11478 * soundtrigger_disabled (boolean) 11479 * fullbackup_deferred (boolean) 11480 * keyvaluebackup_deferred (boolean) 11481 * firewall_disabled (boolean) 11482 * gps_mode (int) 11483 * adjust_brightness_disabled (boolean) 11484 * adjust_brightness_factor (float) 11485 * force_all_apps_standby (boolean) 11486 * force_background_check (boolean) 11487 * optional_sensors_disabled (boolean) 11488 * aod_disabled (boolean) 11489 * quick_doze_enabled (boolean) 11490 * </pre> 11491 * @hide 11492 * @see com.android.server.power.batterysaver.BatterySaverPolicy 11493 */ 11494 @UnsupportedAppUsage 11495 @TestApi 11496 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; 11497 11498 /** 11499 * Battery Saver device specific settings 11500 * This is encoded as a key=value list, separated by commas. 11501 * 11502 * The following keys are supported: 11503 * 11504 * <pre> 11505 * cpufreq-i (list of "core-number:frequency" pairs concatenated with /) 11506 * cpufreq-n (list of "core-number:frequency" pairs concatenated with /) 11507 * </pre> 11508 * 11509 * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details. 11510 * 11511 * @hide 11512 */ 11513 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = 11514 "battery_saver_device_specific_constants"; 11515 11516 /** 11517 * Settings for adaptive Battery Saver mode. Uses the same flags as 11518 * {@link #BATTERY_SAVER_CONSTANTS}. 11519 * 11520 * @hide 11521 */ 11522 public static final String BATTERY_SAVER_ADAPTIVE_CONSTANTS = 11523 "battery_saver_adaptive_constants"; 11524 11525 /** 11526 * Device specific settings for adaptive Battery Saver mode. Uses the same flags as 11527 * {@link #BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS}. 11528 * 11529 * @hide 11530 */ 11531 public static final String BATTERY_SAVER_ADAPTIVE_DEVICE_SPECIFIC_CONSTANTS = 11532 "battery_saver_adaptive_device_specific_constants"; 11533 11534 /** 11535 * Battery tip specific settings 11536 * This is encoded as a key=value list, separated by commas. Ex: 11537 * 11538 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," 11539 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," 11540 * "high_usage_battery_draining=25,high_usage_period_ms=3000" 11541 * 11542 * The following keys are supported: 11543 * 11544 * <pre> 11545 * battery_tip_enabled (boolean) 11546 * summary_enabled (boolean) 11547 * battery_saver_tip_enabled (boolean) 11548 * high_usage_enabled (boolean) 11549 * high_usage_app_count (int) 11550 * high_usage_period_ms (long) 11551 * high_usage_battery_draining (int) 11552 * app_restriction_enabled (boolean) 11553 * reduced_battery_enabled (boolean) 11554 * reduced_battery_percent (int) 11555 * low_battery_enabled (boolean) 11556 * low_battery_hour (int) 11557 * </pre> 11558 * @hide 11559 */ 11560 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; 11561 11562 /** 11563 * Battery anomaly detection specific settings 11564 * This is encoded as a key=value list, separated by commas. 11565 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via 11566 * {@link Uri#encode(String)}, separated by colons. Ex: 11567 * 11568 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," 11569 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" 11570 * 11571 * The following keys are supported: 11572 * 11573 * <pre> 11574 * anomaly_detection_enabled (boolean) 11575 * wakelock_enabled (boolean) 11576 * wakelock_threshold (long) 11577 * wakeup_alarm_enabled (boolean) 11578 * wakeup_alarm_threshold (long) 11579 * wakeup_blacklisted_tags (string) 11580 * bluetooth_scan_enabled (boolean) 11581 * bluetooth_scan_threshold (long) 11582 * </pre> 11583 * @hide 11584 */ 11585 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; 11586 11587 /** 11588 * An integer to show the version of the anomaly config. Ex: 1, which means 11589 * current version is 1. 11590 * @hide 11591 */ 11592 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; 11593 11594 /** 11595 * A base64-encoded string represents anomaly stats config, used for 11596 * {@link android.app.StatsManager}. 11597 * @hide 11598 */ 11599 public static final String ANOMALY_CONFIG = "anomaly_config"; 11600 11601 /** 11602 * Always on display(AOD) specific settings 11603 * This is encoded as a key=value list, separated by commas. Ex: 11604 * 11605 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" 11606 * 11607 * The following keys are supported: 11608 * 11609 * <pre> 11610 * screen_brightness_array (int[]) 11611 * dimming_scrim_array (int[]) 11612 * prox_screen_off_delay (long) 11613 * prox_cooldown_trigger (long) 11614 * prox_cooldown_period (long) 11615 * </pre> 11616 * @hide 11617 */ 11618 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; 11619 11620 /** 11621 * System VDSO global setting. This links to the "sys.vdso" system property. 11622 * The following values are supported: 11623 * false -> both 32 and 64 bit vdso disabled 11624 * 32 -> 32 bit vdso enabled 11625 * 64 -> 64 bit vdso enabled 11626 * Any other value defaults to both 32 bit and 64 bit true. 11627 * @hide 11628 */ 11629 public static final String SYS_VDSO = "sys_vdso"; 11630 11631 /** 11632 * UidCpuPower global setting. This links the sys.uidcpupower system property. 11633 * The following values are supported: 11634 * 0 -> /proc/uid_cpupower/* are disabled 11635 * 1 -> /proc/uid_cpupower/* are enabled 11636 * Any other value defaults to enabled. 11637 * @hide 11638 */ 11639 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; 11640 11641 /** 11642 * traced global setting. This controls weather the deamons: traced and 11643 * traced_probes run. This links the sys.traced system property. 11644 * The following values are supported: 11645 * 0 -> traced and traced_probes are disabled 11646 * 1 -> traced and traced_probes are enabled 11647 * Any other value defaults to disabled. 11648 * @hide 11649 */ 11650 public static final String SYS_TRACED = "sys_traced"; 11651 11652 /** 11653 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the 11654 * device for this setting to take full effect. 11655 * 11656 * @hide 11657 */ 11658 public static final String FPS_DEVISOR = "fps_divisor"; 11659 11660 /** 11661 * Flag to enable or disable display panel low power mode (lpm) 11662 * false -> Display panel power saving mode is disabled. 11663 * true -> Display panel power saving mode is enabled. 11664 * 11665 * @hide 11666 */ 11667 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; 11668 11669 /** 11670 * App time limit usage source setting. 11671 * This controls which app in a task will be considered the source of usage when 11672 * calculating app usage time limits. 11673 * 11674 * 1 -> task root app 11675 * 2 -> current app 11676 * Any other value defaults to task root app. 11677 * 11678 * Need to reboot the device for this setting to take effect. 11679 * @hide 11680 */ 11681 public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source"; 11682 11683 /** 11684 * App standby (app idle) specific settings. 11685 * This is encoded as a key=value list, separated by commas. Ex: 11686 * <p> 11687 * "idle_duration=5000,prediction_timeout=4500,screen_thresholds=0/0/60000/120000" 11688 * <p> 11689 * All durations are in millis. 11690 * Array values are separated by forward slashes 11691 * The following keys are supported: 11692 * 11693 * <pre> 11694 * screen_thresholds (long[4]) 11695 * elapsed_thresholds (long[4]) 11696 * strong_usage_duration (long) 11697 * notification_seen_duration (long) 11698 * system_update_usage_duration (long) 11699 * prediction_timeout (long) 11700 * sync_adapter_duration (long) 11701 * exempted_sync_duration (long) 11702 * system_interaction_duration (long) 11703 * initial_foreground_service_start_duration (long) 11704 * cross_profile_apps_share_standby_buckets (boolean) 11705 * </pre> 11706 * 11707 * <p> 11708 * Type: string 11709 * @hide 11710 * @see com.android.server.usage.AppStandbyController 11711 */ 11712 public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; 11713 11714 /** 11715 * Enable ART bytecode verification verifications for debuggable apps. 11716 * 0 = disable, 1 = enable. 11717 * @hide 11718 */ 11719 public static final String ART_VERIFIER_VERIFY_DEBUGGABLE = 11720 "art_verifier_verify_debuggable"; 11721 11722 /** 11723 * Power manager specific settings. 11724 * This is encoded as a key=value list, separated by commas. Ex: 11725 * 11726 * "no_cached_wake_locks=1" 11727 * 11728 * The following keys are supported: 11729 * 11730 * <pre> 11731 * no_cached_wake_locks (boolean) 11732 * </pre> 11733 * 11734 * <p> 11735 * Type: string 11736 * @hide 11737 * @see com.android.server.power.PowerManagerConstants 11738 */ 11739 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; 11740 11741 /** 11742 * Alarm manager specific settings. 11743 * This is encoded as a key=value list, separated by commas. Ex: 11744 * 11745 * "min_futurity=5000,allow_while_idle_short_time=4500" 11746 * 11747 * The following keys are supported: 11748 * 11749 * <pre> 11750 * min_futurity (long) 11751 * min_interval (long) 11752 * allow_while_idle_short_time (long) 11753 * allow_while_idle_long_time (long) 11754 * allow_while_idle_whitelist_duration (long) 11755 * </pre> 11756 * 11757 * <p> 11758 * Type: string 11759 * @hide 11760 * @see com.android.server.AlarmManagerService.Constants 11761 */ 11762 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; 11763 11764 /** 11765 * Job scheduler specific settings. 11766 * This is encoded as a key=value list, separated by commas. Ex: 11767 * 11768 * "min_ready_jobs_count=2,moderate_use_factor=.5" 11769 * 11770 * The following keys are supported: 11771 * 11772 * <pre> 11773 * min_idle_count (int) 11774 * min_charging_count (int) 11775 * min_connectivity_count (int) 11776 * min_content_count (int) 11777 * min_ready_jobs_count (int) 11778 * heavy_use_factor (float) 11779 * moderate_use_factor (float) 11780 * fg_job_count (int) 11781 * bg_normal_job_count (int) 11782 * bg_moderate_job_count (int) 11783 * bg_low_job_count (int) 11784 * bg_critical_job_count (int) 11785 * </pre> 11786 * 11787 * <p> 11788 * Type: string 11789 * @hide 11790 * @see com.android.server.job.JobSchedulerService.Constants 11791 */ 11792 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; 11793 11794 /** 11795 * Job scheduler QuotaController specific settings. 11796 * This is encoded as a key=value list, separated by commas. Ex: 11797 * 11798 * "max_job_count_working=5,max_job_count_rare=2" 11799 * 11800 * <p> 11801 * Type: string 11802 * 11803 * @hide 11804 * @see com.android.server.job.JobSchedulerService.Constants 11805 */ 11806 public static final String JOB_SCHEDULER_QUOTA_CONTROLLER_CONSTANTS = 11807 "job_scheduler_quota_controller_constants"; 11808 11809 /** 11810 * Job scheduler TimeController specific settings. 11811 * This is encoded as a key=value list, separated by commas. Ex: 11812 * 11813 * "skip_not_ready_jobs=true5,other_key=2" 11814 * 11815 * <p> 11816 * Type: string 11817 * 11818 * @hide 11819 * @see com.android.server.job.JobSchedulerService.Constants 11820 */ 11821 public static final String JOB_SCHEDULER_TIME_CONTROLLER_CONSTANTS = 11822 "job_scheduler_time_controller_constants"; 11823 11824 /** 11825 * ShortcutManager specific settings. 11826 * This is encoded as a key=value list, separated by commas. Ex: 11827 * 11828 * "reset_interval_sec=86400,max_updates_per_interval=1" 11829 * 11830 * The following keys are supported: 11831 * 11832 * <pre> 11833 * reset_interval_sec (long) 11834 * max_updates_per_interval (int) 11835 * max_icon_dimension_dp (int, DP) 11836 * max_icon_dimension_dp_lowram (int, DP) 11837 * max_shortcuts (int) 11838 * icon_quality (int, 0-100) 11839 * icon_format (String) 11840 * </pre> 11841 * 11842 * <p> 11843 * Type: string 11844 * @hide 11845 * @see com.android.server.pm.ShortcutService.ConfigConstants 11846 */ 11847 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; 11848 11849 /** 11850 * DevicePolicyManager specific settings. 11851 * This is encoded as a key=value list, separated by commas. Ex: 11852 * 11853 * <pre> 11854 * das_died_service_reconnect_backoff_sec (long) 11855 * das_died_service_reconnect_backoff_increase (float) 11856 * das_died_service_reconnect_max_backoff_sec (long) 11857 * </pre> 11858 * 11859 * <p> 11860 * Type: string 11861 * @hide 11862 * see also com.android.server.devicepolicy.DevicePolicyConstants 11863 */ 11864 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; 11865 11866 /** 11867 * TextClassifier specific settings. 11868 * This is encoded as a key=value list, separated by commas. String[] types like 11869 * entity_list_default use ":" as delimiter for values. Ex: 11870 * 11871 * <pre> 11872 * classify_text_max_range_length (int) 11873 * detect_language_from_text_enabled (boolean) 11874 * entity_list_default (String[]) 11875 * entity_list_editable (String[]) 11876 * entity_list_not_editable (String[]) 11877 * generate_links_log_sample_rate (int) 11878 * generate_links_max_text_length (int) 11879 * in_app_conversation_action_types_default (String[]) 11880 * lang_id_context_settings (float[]) 11881 * lang_id_threshold_override (float) 11882 * local_textclassifier_enabled (boolean) 11883 * model_dark_launch_enabled (boolean) 11884 * notification_conversation_action_types_default (String[]) 11885 * smart_linkify_enabled (boolean) 11886 * smart_select_animation_enabled (boolean) 11887 * smart_selection_enabled (boolean) 11888 * smart_text_share_enabled (boolean) 11889 * suggest_selection_max_range_length (int) 11890 * system_textclassifier_enabled (boolean) 11891 * template_intent_factory_enabled (boolean) 11892 * translate_in_classification_enabled (boolean) 11893 * </pre> 11894 * 11895 * <p> 11896 * Type: string 11897 * @hide 11898 * see also android.view.textclassifier.TextClassificationConstants 11899 */ 11900 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; 11901 11902 /** 11903 * BatteryStats specific settings. 11904 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 11905 * 11906 * The following keys are supported: 11907 * <pre> 11908 * track_cpu_times_by_proc_state (boolean) 11909 * track_cpu_active_cluster_time (boolean) 11910 * read_binary_cpu_time (boolean) 11911 * proc_state_cpu_times_read_delay_ms (long) 11912 * external_stats_collection_rate_limit_ms (long) 11913 * battery_level_collection_delay_ms (long) 11914 * max_history_files (int) 11915 * max_history_buffer_kb (int) 11916 * battery_charged_delay_ms (int) 11917 * </pre> 11918 * 11919 * <p> 11920 * Type: string 11921 * @hide 11922 * see also com.android.internal.os.BatteryStatsImpl.Constants 11923 */ 11924 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; 11925 11926 /** 11927 * SyncManager specific settings. 11928 * 11929 * <p> 11930 * Type: string 11931 * @hide 11932 * @see com.android.server.content.SyncManagerConstants 11933 */ 11934 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; 11935 11936 /** 11937 * Broadcast dispatch tuning parameters specific to foreground broadcasts. 11938 * 11939 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 11940 * 11941 * The following keys are supported: 11942 * <pre> 11943 * bcast_timeout (long) 11944 * bcast_slow_time (long) 11945 * bcast_deferral (long) 11946 * bcast_deferral_decay_factor (float) 11947 * bcast_deferral_floor (long) 11948 * bcast_allow_bg_activity_start_timeout (long) 11949 * </pre> 11950 * 11951 * @hide 11952 */ 11953 public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants"; 11954 11955 /** 11956 * Broadcast dispatch tuning parameters specific to background broadcasts. 11957 * 11958 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 11959 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 11960 * 11961 * @hide 11962 */ 11963 public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants"; 11964 11965 /** 11966 * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts. 11967 * 11968 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 11969 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 11970 * 11971 * @hide 11972 */ 11973 public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants"; 11974 11975 /** 11976 * Whether or not App Standby feature is enabled by system. This controls throttling of apps 11977 * based on usage patterns and predictions. Platform will turn on this feature if both this 11978 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. 11979 * Type: int (0 for false, 1 for true) 11980 * Default: 1 11981 * @hide 11982 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED 11983 */ 11984 @SystemApi 11985 public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; 11986 11987 /** 11988 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this 11989 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on. 11990 * Type: int (0 for false, 1 for true) 11991 * Default: 1 11992 * @hide 11993 * @see #APP_STANDBY_ENABLED 11994 */ 11995 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED = 11996 "adaptive_battery_management_enabled"; 11997 11998 /** 11999 * Whether or not apps are allowed into the 12000 * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket. 12001 * Type: int (0 for false, 1 for true) 12002 * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET} 12003 * 12004 * @hide 12005 */ 12006 public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket"; 12007 12008 /** 12009 * @see #ENABLE_RESTRICTED_BUCKET 12010 * @hide 12011 */ 12012 public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 0; 12013 12014 /** 12015 * Whether or not app auto restriction is enabled. When it is enabled, settings app will 12016 * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time). 12017 * 12018 * Type: boolean (0 for false, 1 for true) 12019 * Default: 1 12020 * 12021 * @hide 12022 */ 12023 public static final String APP_AUTO_RESTRICTION_ENABLED = 12024 "app_auto_restriction_enabled"; 12025 12026 /** 12027 * Feature flag to enable or disable the Forced App Standby feature. 12028 * Type: int (0 for false, 1 for true) 12029 * Default: 1 12030 * @hide 12031 */ 12032 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; 12033 12034 /** 12035 * Whether or not to enable Forced App Standby on small battery devices. 12036 * Type: int (0 for false, 1 for true) 12037 * Default: 0 12038 * @hide 12039 */ 12040 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED 12041 = "forced_app_standby_for_small_battery_enabled"; 12042 12043 /** 12044 * Whether or not to enable the User Absent, Radios Off feature on small battery devices. 12045 * Type: int (0 for false, 1 for true) 12046 * Default: 0 12047 * @hide 12048 */ 12049 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED 12050 = "user_absent_radios_off_for_small_battery_enabled"; 12051 12052 /** 12053 * Whether or not to enable the User Absent, Touch Off feature on small battery devices. 12054 * Type: int (0 for false, 1 for true) 12055 * Default: 0 12056 * @hide 12057 */ 12058 public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED 12059 = "user_absent_touch_off_for_small_battery_enabled"; 12060 12061 /** 12062 * Whether or not to turn on Wifi when proxy is disconnected. 12063 * Type: int (0 for false, 1 for true) 12064 * Default: 1 12065 * @hide 12066 */ 12067 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED 12068 = "wifi_on_when_proxy_disconnected"; 12069 12070 /** 12071 * Time Only Mode specific settings. 12072 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 12073 * 12074 * The following keys are supported: 12075 * 12076 * <pre> 12077 * enabled (boolean) 12078 * disable_home (boolean) 12079 * disable_tilt_to_wake (boolean) 12080 * disable_touch_to_wake (boolean) 12081 * </pre> 12082 * Type: string 12083 * @hide 12084 */ 12085 public static final String TIME_ONLY_MODE_CONSTANTS 12086 = "time_only_mode_constants"; 12087 12088 /** 12089 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on 12090 * watch type devices. 12091 * Type: int (0 for false, 1 for true) 12092 * Default: 0 12093 * @hide 12094 */ 12095 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled"; 12096 12097 /** 12098 * Whether or not Network Watchlist feature is enabled. 12099 * Type: int (0 for false, 1 for true) 12100 * Default: 0 12101 * @hide 12102 */ 12103 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; 12104 12105 /** 12106 * Whether or not show hidden launcher icon apps feature is enabled. 12107 * Type: int (0 for false, 1 for true) 12108 * Default: 1 12109 * @hide 12110 */ 12111 public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED = 12112 "show_hidden_icon_apps_enabled"; 12113 12114 /** 12115 * Whether or not show new app installed notification is enabled. 12116 * Type: int (0 for false, 1 for true) 12117 * Default: 0 12118 * @hide 12119 */ 12120 public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED = 12121 "show_new_app_installed_notification_enabled"; 12122 12123 /** 12124 * Flag to keep background restricted profiles running after exiting. If disabled, 12125 * the restricted profile can be put into stopped state as soon as the user leaves it. 12126 * Type: int (0 for false, 1 for true) 12127 * 12128 * Overridden by the system based on device information. If null, the value specified 12129 * by {@code config_keepRestrictedProfilesInBackground} is used. 12130 * 12131 * @hide 12132 */ 12133 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; 12134 12135 /** 12136 * The default time in ms within which a subsequent connection from an always allowed system 12137 * is allowed to reconnect without user interaction. 12138 * 12139 * @hide 12140 */ 12141 public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000; 12142 12143 /** 12144 * When the user first connects their device to a system a prompt is displayed to allow 12145 * the adb connection with an option to 'Always allow' connections from this system. If the 12146 * user selects this always allow option then the connection time is stored for the system. 12147 * This setting is the time in ms within which a subsequent connection from an always 12148 * allowed system is allowed to reconnect without user interaction. 12149 * 12150 * Type: long 12151 * 12152 * @hide 12153 */ 12154 public static final String ADB_ALLOWED_CONNECTION_TIME = 12155 "adb_allowed_connection_time"; 12156 12157 /** 12158 * Scaling factor for normal window animations. Setting to 0 will 12159 * disable window animations. 12160 */ 12161 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 12162 12163 /** 12164 * Scaling factor for activity transition animations. Setting to 0 will 12165 * disable window animations. 12166 */ 12167 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 12168 12169 /** 12170 * Scaling factor for Animator-based animations. This affects both the 12171 * start delay and duration of all such animations. Setting to 0 will 12172 * cause animations to end immediately. The default value is 1. 12173 */ 12174 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 12175 12176 /** 12177 * Scaling factor for normal window animations. Setting to 0 will 12178 * disable window animations. 12179 * 12180 * @hide 12181 */ 12182 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 12183 12184 /** 12185 * If 0, the compatibility mode is off for all applications. 12186 * If 1, older applications run under compatibility mode. 12187 * TODO: remove this settings before code freeze (bug/1907571) 12188 * @hide 12189 */ 12190 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 12191 12192 /** 12193 * CDMA only settings 12194 * Emergency Tone 0 = Off 12195 * 1 = Alert 12196 * 2 = Vibrate 12197 * @hide 12198 */ 12199 public static final String EMERGENCY_TONE = "emergency_tone"; 12200 12201 /** 12202 * CDMA only settings 12203 * Whether the auto retry is enabled. The value is 12204 * boolean (1 or 0). 12205 * @hide 12206 */ 12207 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 12208 12209 /** 12210 * A setting that can be read whether the emergency affordance is currently needed. 12211 * The value is a boolean (1 or 0). 12212 * @hide 12213 */ 12214 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; 12215 12216 /** 12217 * Whether to enable automatic system server heap dumps. This only works on userdebug or 12218 * eng builds, not on user builds. This is set by the user and overrides the config value. 12219 * 1 means enable, 0 means disable. 12220 * 12221 * @hide 12222 */ 12223 public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS = 12224 "enable_automatic_system_server_heap_dumps"; 12225 12226 /** 12227 * See RIL_PreferredNetworkType in ril.h 12228 * @hide 12229 */ 12230 @UnsupportedAppUsage 12231 public static final String PREFERRED_NETWORK_MODE = 12232 "preferred_network_mode"; 12233 12234 /** 12235 * Name of an application package to be debugged. 12236 */ 12237 public static final String DEBUG_APP = "debug_app"; 12238 12239 /** 12240 * If 1, when launching DEBUG_APP it will wait for the debugger before 12241 * starting user code. If 0, it will run normally. 12242 */ 12243 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 12244 12245 /** 12246 * Allow GPU debug layers? 12247 * 0 = no 12248 * 1 = yes 12249 * @hide 12250 */ 12251 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; 12252 12253 /** 12254 * App allowed to load GPU debug layers 12255 * @hide 12256 */ 12257 public static final String GPU_DEBUG_APP = "gpu_debug_app"; 12258 12259 /** 12260 * Package containing ANGLE libraries other than system, which are only available 12261 * to dumpable apps that opt-in. 12262 * @hide 12263 */ 12264 public static final String GLOBAL_SETTINGS_ANGLE_DEBUG_PACKAGE = 12265 "angle_debug_package"; 12266 12267 /** 12268 * Force all PKGs to use ANGLE, regardless of any other settings 12269 * The value is a boolean (1 or 0). 12270 * @hide 12271 */ 12272 public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_ALL_ANGLE = 12273 "angle_gl_driver_all_angle"; 12274 12275 /** 12276 * List of PKGs that have an OpenGL driver selected 12277 * @hide 12278 */ 12279 public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_PKGS = 12280 "angle_gl_driver_selection_pkgs"; 12281 12282 /** 12283 * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS 12284 * @hide 12285 */ 12286 public static final String GLOBAL_SETTINGS_ANGLE_GL_DRIVER_SELECTION_VALUES = 12287 "angle_gl_driver_selection_values"; 12288 12289 /** 12290 * List of package names that should check ANGLE rules 12291 * @hide 12292 */ 12293 public static final String GLOBAL_SETTINGS_ANGLE_WHITELIST = 12294 "angle_whitelist"; 12295 12296 /** 12297 * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver. 12298 * The value is a boolean (1 or 0). 12299 * @hide 12300 */ 12301 public static final String GLOBAL_SETTINGS_SHOW_ANGLE_IN_USE_DIALOG_BOX = 12302 "show_angle_in_use_dialog_box"; 12303 12304 /** 12305 * Game Driver global preference for all Apps. 12306 * 0 = Default 12307 * 1 = All Apps use Game Driver 12308 * 2 = All Apps use system graphics driver 12309 * @hide 12310 */ 12311 public static final String GAME_DRIVER_ALL_APPS = "game_driver_all_apps"; 12312 12313 /** 12314 * List of Apps selected to use Game Driver. 12315 * i.e. <pkg1>,<pkg2>,...,<pkgN> 12316 * @hide 12317 */ 12318 public static final String GAME_DRIVER_OPT_IN_APPS = "game_driver_opt_in_apps"; 12319 12320 /** 12321 * List of Apps selected to use prerelease Game Driver. 12322 * i.e. <pkg1>,<pkg2>,...,<pkgN> 12323 * @hide 12324 */ 12325 public static final String GAME_DRIVER_PRERELEASE_OPT_IN_APPS = 12326 "game_driver_prerelease_opt_in_apps"; 12327 12328 /** 12329 * List of Apps selected not to use Game Driver. 12330 * i.e. <pkg1>,<pkg2>,...,<pkgN> 12331 * @hide 12332 */ 12333 public static final String GAME_DRIVER_OPT_OUT_APPS = "game_driver_opt_out_apps"; 12334 12335 /** 12336 * Apps on the blacklist that are forbidden to use Game Driver. 12337 * @hide 12338 */ 12339 public static final String GAME_DRIVER_BLACKLIST = "game_driver_blacklist"; 12340 12341 /** 12342 * List of blacklists, each blacklist is a blacklist for a specific version of Game Driver. 12343 * @hide 12344 */ 12345 public static final String GAME_DRIVER_BLACKLISTS = "game_driver_blacklists"; 12346 12347 /** 12348 * Apps on the whitelist that are allowed to use Game Driver. 12349 * The string is a list of application package names, seperated by comma. 12350 * i.e. <apk1>,<apk2>,...,<apkN> 12351 * @hide 12352 */ 12353 public static final String GAME_DRIVER_WHITELIST = "game_driver_whitelist"; 12354 12355 /** 12356 * List of libraries in sphal accessible by Game Driver 12357 * The string is a list of library names, separated by colon. 12358 * i.e. <lib1>:<lib2>:...:<libN> 12359 * @hide 12360 */ 12361 public static final String GAME_DRIVER_SPHAL_LIBRARIES = "game_driver_sphal_libraries"; 12362 12363 /** 12364 * Ordered GPU debug layer list for Vulkan 12365 * i.e. <layer1>:<layer2>:...:<layerN> 12366 * @hide 12367 */ 12368 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; 12369 12370 /** 12371 * Ordered GPU debug layer list for GLES 12372 * i.e. <layer1>:<layer2>:...:<layerN> 12373 * @hide 12374 */ 12375 public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles"; 12376 12377 /** 12378 * Addition app for GPU layer discovery 12379 * @hide 12380 */ 12381 public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app"; 12382 12383 /** 12384 * Control whether the process CPU usage meter should be shown. 12385 * 12386 * @deprecated This functionality is no longer available as of 12387 * {@link android.os.Build.VERSION_CODES#N_MR1}. 12388 */ 12389 @Deprecated 12390 public static final String SHOW_PROCESSES = "show_processes"; 12391 12392 /** 12393 * If 1 low power mode (aka battery saver) is enabled. 12394 * @hide 12395 */ 12396 @TestApi 12397 public static final String LOW_POWER_MODE = "low_power"; 12398 12399 /** 12400 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device 12401 * is unplugged from a charger or rebooted. 12402 * @hide 12403 */ 12404 @TestApi 12405 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; 12406 12407 /** 12408 * When a device is unplugged from a changer (or is rebooted), do not re-activate battery 12409 * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or 12410 * above this threshold. 12411 * 12412 * @hide 12413 */ 12414 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL = 12415 "low_power_sticky_auto_disable_level"; 12416 12417 /** 12418 * Whether sticky battery saver should be deactivated once the battery level has reached the 12419 * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}. 12420 * 12421 * @hide 12422 */ 12423 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED = 12424 "low_power_sticky_auto_disable_enabled"; 12425 12426 /** 12427 * Battery level [1-100] at which low power mode automatically turns on. 12428 * If 0, it will not automatically turn on. For Q and newer, it will only automatically 12429 * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE} 12430 * setting is also set to 12431 * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}. 12432 * @see #AUTOMATIC_POWER_SAVE_MODE 12433 * @see android.os.PowerManager#getPowerSaveModeTrigger() 12434 * @hide 12435 */ 12436 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 12437 12438 /** 12439 * Whether battery saver is currently set to trigger based on percentage, dynamic power 12440 * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for 12441 * accepted values. 12442 * 12443 * @hide 12444 */ 12445 @TestApi 12446 public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode"; 12447 12448 /** 12449 * The setting that backs the disable threshold for the setPowerSavingsWarning api in 12450 * PowerManager 12451 * 12452 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 12453 * @hide 12454 */ 12455 @TestApi 12456 public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD = 12457 "dynamic_power_savings_disable_threshold"; 12458 12459 /** 12460 * The setting which backs the setDynamicPowerSaveHint api in PowerManager. 12461 * 12462 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 12463 * @hide 12464 */ 12465 @TestApi 12466 public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled"; 12467 12468 /** 12469 * A long value indicating how much longer the system battery is estimated to last in 12470 * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value 12471 * was updated. 12472 * 12473 * @hide 12474 */ 12475 public static final String TIME_REMAINING_ESTIMATE_MILLIS = 12476 "time_remaining_estimate_millis"; 12477 12478 /** 12479 * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is based customized 12480 * to the devices usage or using global models. See 12481 * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated. 12482 * 12483 * @hide 12484 */ 12485 public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE = 12486 "time_remaining_estimate_based_on_usage"; 12487 12488 /** 12489 * A long value indicating how long the system battery takes to deplete from 100% to 0% on 12490 * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} 12491 * for the last time this value was updated. 12492 * 12493 * @hide 12494 */ 12495 public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge"; 12496 12497 /** 12498 * A long indicating the epoch time in milliseconds when 12499 * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE}, 12500 * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated. 12501 * 12502 * @hide 12503 */ 12504 public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME = 12505 "battery_estimates_last_update_time"; 12506 12507 /** 12508 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set 12509 * or the value is 0, the default max will be used. 12510 * 12511 * @hide 12512 */ 12513 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; 12514 12515 /** 12516 * See com.android.settingslib.fuelgauge.BatterySaverUtils. 12517 * @hide 12518 */ 12519 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = 12520 "low_power_mode_suggestion_params"; 12521 12522 /** 12523 * If not 0, the activity manager will aggressively finish activities and 12524 * processes as soon as they are no longer needed. If 0, the normal 12525 * extended lifetime is used. 12526 */ 12527 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; 12528 12529 /** 12530 * If nonzero, all system error dialogs will be hidden. For example, the 12531 * crash and ANR dialogs will not be shown, and the system will just proceed 12532 * as if they had been accepted by the user. 12533 * @hide 12534 */ 12535 @TestApi 12536 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs"; 12537 12538 /** 12539 * Use Dock audio output for media: 12540 * 0 = disabled 12541 * 1 = enabled 12542 * @hide 12543 */ 12544 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 12545 12546 /** 12547 * The surround sound formats AC3, DTS or IEC61937 are 12548 * available for use if they are detected. 12549 * This is the default mode. 12550 * 12551 * Note that AUTO is equivalent to ALWAYS for Android TVs and other 12552 * devices that have an S/PDIF output. This is because S/PDIF 12553 * is unidirectional and the TV cannot know if a decoder is 12554 * connected. So it assumes they are always available. 12555 * @hide 12556 */ 12557 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; 12558 12559 /** 12560 * AC3, DTS or IEC61937 are NEVER available, even if they 12561 * are detected by the hardware. Those formats will not be 12562 * reported. 12563 * 12564 * An example use case would be an AVR reports that it is capable of 12565 * surround sound decoding but is broken. If NEVER is chosen 12566 * then apps must use PCM output instead of encoded output. 12567 * @hide 12568 */ 12569 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; 12570 12571 /** 12572 * AC3, DTS or IEC61937 are ALWAYS available, even if they 12573 * are not detected by the hardware. Those formats will be 12574 * reported as part of the HDMI output capability. Applications 12575 * are then free to use either PCM or encoded output. 12576 * 12577 * An example use case would be a when TV was connected over 12578 * TOS-link to an AVR. But the TV could not see it because TOS-link 12579 * is unidirectional. 12580 * @hide 12581 */ 12582 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; 12583 12584 /** 12585 * Surround sound formats are available according to the choice 12586 * of user, even if they are not detected by the hardware. Those 12587 * formats will be reported as part of the HDMI output capability. 12588 * Applications are then free to use either PCM or encoded output. 12589 * 12590 * An example use case would be an AVR that doesn't report a surround 12591 * format while the user knows the AVR does support it. 12592 * @hide 12593 */ 12594 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3; 12595 12596 /** 12597 * Set to ENCODED_SURROUND_OUTPUT_AUTO, 12598 * ENCODED_SURROUND_OUTPUT_NEVER, 12599 * ENCODED_SURROUND_OUTPUT_ALWAYS or 12600 * ENCODED_SURROUND_OUTPUT_MANUAL 12601 * @hide 12602 */ 12603 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; 12604 12605 /** 12606 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to 12607 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values 12608 * are the format constants defined in AudioFormat.java. Ex: 12609 * 12610 * "5,6" 12611 * 12612 * @hide 12613 */ 12614 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS = 12615 "encoded_surround_output_enabled_formats"; 12616 12617 /** 12618 * Persisted safe headphone volume management state by AudioService 12619 * @hide 12620 */ 12621 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 12622 12623 /** 12624 * URL for tzinfo (time zone) updates 12625 * @hide 12626 */ 12627 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 12628 12629 /** 12630 * URL for tzinfo (time zone) update metadata 12631 * @hide 12632 */ 12633 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 12634 12635 /** 12636 * URL for selinux (mandatory access control) updates 12637 * @hide 12638 */ 12639 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 12640 12641 /** 12642 * URL for selinux (mandatory access control) update metadata 12643 * @hide 12644 */ 12645 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 12646 12647 /** 12648 * URL for sms short code updates 12649 * @hide 12650 */ 12651 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 12652 "sms_short_codes_content_url"; 12653 12654 /** 12655 * URL for sms short code update metadata 12656 * @hide 12657 */ 12658 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 12659 "sms_short_codes_metadata_url"; 12660 12661 /** 12662 * URL for apn_db updates 12663 * @hide 12664 */ 12665 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; 12666 12667 /** 12668 * URL for apn_db update metadata 12669 * @hide 12670 */ 12671 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; 12672 12673 /** 12674 * URL for cert pinlist updates 12675 * @hide 12676 */ 12677 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 12678 12679 /** 12680 * URL for cert pinlist updates 12681 * @hide 12682 */ 12683 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 12684 12685 /** 12686 * URL for intent firewall updates 12687 * @hide 12688 */ 12689 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 12690 "intent_firewall_content_url"; 12691 12692 /** 12693 * URL for intent firewall update metadata 12694 * @hide 12695 */ 12696 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 12697 "intent_firewall_metadata_url"; 12698 12699 /** 12700 * URL for lang id model updates 12701 * @hide 12702 */ 12703 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; 12704 12705 /** 12706 * URL for lang id model update metadata 12707 * @hide 12708 */ 12709 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; 12710 12711 /** 12712 * URL for smart selection model updates 12713 * @hide 12714 */ 12715 public static final String SMART_SELECTION_UPDATE_CONTENT_URL = 12716 "smart_selection_content_url"; 12717 12718 /** 12719 * URL for smart selection model update metadata 12720 * @hide 12721 */ 12722 public static final String SMART_SELECTION_UPDATE_METADATA_URL = 12723 "smart_selection_metadata_url"; 12724 12725 /** 12726 * URL for conversation actions model updates 12727 * @hide 12728 */ 12729 public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL = 12730 "conversation_actions_content_url"; 12731 12732 /** 12733 * URL for conversation actions model update metadata 12734 * @hide 12735 */ 12736 public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL = 12737 "conversation_actions_metadata_url"; 12738 12739 /** 12740 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 12741 * @hide 12742 */ 12743 public static final String SELINUX_STATUS = "selinux_status"; 12744 12745 /** 12746 * Developer setting to force RTL layout. 12747 * @hide 12748 */ 12749 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 12750 12751 /** 12752 * Milliseconds after screen-off after which low battery sounds will be silenced. 12753 * 12754 * If zero, battery sounds will always play. 12755 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 12756 * 12757 * @hide 12758 */ 12759 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 12760 12761 /** 12762 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 12763 * the caller is done with this, they should call {@link ContentResolver#delete} to 12764 * clean up any value that they may have written. 12765 * 12766 * @hide 12767 */ 12768 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 12769 12770 /** 12771 * Defines global runtime overrides to window policy. 12772 * 12773 * See {@link com.android.server.wm.PolicyControl} for value format. 12774 * 12775 * @hide 12776 */ 12777 public static final String POLICY_CONTROL = "policy_control"; 12778 12779 /** 12780 * {@link android.view.DisplayCutout DisplayCutout} emulation mode. 12781 * 12782 * @hide 12783 */ 12784 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; 12785 12786 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; 12787 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; 12788 12789 /** 12790 * A colon separated list of keys for Settings Slices. 12791 * 12792 * @hide 12793 */ 12794 public static final String BLOCKED_SLICES = "blocked_slices"; 12795 12796 /** 12797 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 12798 * or ZEN_MODE_NO_INTERRUPTIONS. 12799 * 12800 * @hide 12801 */ 12802 @UnsupportedAppUsage 12803 public static final String ZEN_MODE = "zen_mode"; 12804 12805 /** @hide */ 12806 @UnsupportedAppUsage 12807 public static final int ZEN_MODE_OFF = 0; 12808 /** @hide */ 12809 @UnsupportedAppUsage 12810 public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 12811 /** @hide */ 12812 @UnsupportedAppUsage 12813 public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 12814 /** @hide */ 12815 @UnsupportedAppUsage 12816 public static final int ZEN_MODE_ALARMS = 3; 12817 zenModeToString(int mode)12818 /** @hide */ public static String zenModeToString(int mode) { 12819 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 12820 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; 12821 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 12822 return "ZEN_MODE_OFF"; 12823 } 12824 isValidZenMode(int value)12825 /** @hide */ public static boolean isValidZenMode(int value) { 12826 switch (value) { 12827 case Global.ZEN_MODE_OFF: 12828 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: 12829 case Global.ZEN_MODE_ALARMS: 12830 case Global.ZEN_MODE_NO_INTERRUPTIONS: 12831 return true; 12832 default: 12833 return false; 12834 } 12835 } 12836 12837 /** 12838 * Value of the ringer before entering zen mode. 12839 * 12840 * @hide 12841 */ 12842 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; 12843 12844 /** 12845 * Opaque value, changes when persisted zen mode configuration changes. 12846 * 12847 * @hide 12848 */ 12849 @UnsupportedAppUsage 12850 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 12851 12852 /** 12853 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead 12854 * @hide 12855 */ 12856 @Deprecated 12857 public static final String ZEN_DURATION = "zen_duration"; 12858 12859 /** 12860 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead 12861 * @hide 12862 */ 12863 @Deprecated 12864 public static final int ZEN_DURATION_PROMPT = -1; 12865 12866 /** 12867 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead 12868 * @hide 12869 */ 12870 @Deprecated 12871 public static final int ZEN_DURATION_FOREVER = 0; 12872 12873 /** 12874 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 12875 * 12876 * @hide 12877 */ 12878 @UnsupportedAppUsage 12879 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 12880 "heads_up_notifications_enabled"; 12881 12882 /** @hide */ 12883 @UnsupportedAppUsage 12884 public static final int HEADS_UP_OFF = 0; 12885 /** @hide */ 12886 @UnsupportedAppUsage 12887 public static final int HEADS_UP_ON = 1; 12888 12889 /** 12890 * The name of the device 12891 */ 12892 public static final String DEVICE_NAME = "device_name"; 12893 12894 /** 12895 * Whether the NetworkScoringService has been first initialized. 12896 * <p> 12897 * Type: int (0 for false, 1 for true) 12898 * @hide 12899 */ 12900 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; 12901 12902 /** 12903 * Indicates whether the user wants to be prompted for password to decrypt the device on 12904 * boot. This only matters if the storage is encrypted. 12905 * <p> 12906 * Type: int (0 for false, 1 for true) 12907 * 12908 * @hide 12909 */ 12910 @SystemApi 12911 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; 12912 12913 /** 12914 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config 12915 * value 12916 * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}. 12917 * <p> 12918 * Type: int (0 for false, 1 for true) 12919 * @hide 12920 * @deprecated Use 12921 * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead. 12922 */ 12923 @Deprecated 12924 public static final String ENHANCED_4G_MODE_ENABLED = 12925 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED; 12926 12927 /** 12928 * Whether VT (Video Telephony over IMS) is enabled 12929 * <p> 12930 * Type: int (0 for false, 1 for true) 12931 * 12932 * @hide 12933 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead. 12934 */ 12935 @Deprecated 12936 public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED; 12937 12938 /** 12939 * Whether WFC is enabled 12940 * <p> 12941 * Type: int (0 for false, 1 for true) 12942 * 12943 * @hide 12944 * @deprecated Use 12945 * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead. 12946 */ 12947 @Deprecated 12948 public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED; 12949 12950 /** 12951 * WFC mode on home/non-roaming network. 12952 * <p> 12953 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only 12954 * 12955 * @hide 12956 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead. 12957 */ 12958 @Deprecated 12959 public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE; 12960 12961 /** 12962 * WFC mode on roaming network. 12963 * <p> 12964 * Type: int - see {@link #WFC_IMS_MODE} for values 12965 * 12966 * @hide 12967 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE} 12968 * instead. 12969 */ 12970 @Deprecated 12971 public static final String WFC_IMS_ROAMING_MODE = 12972 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE; 12973 12974 /** 12975 * Whether WFC roaming is enabled 12976 * <p> 12977 * Type: int (0 for false, 1 for true) 12978 * 12979 * @hide 12980 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED} 12981 * instead 12982 */ 12983 @Deprecated 12984 public static final String WFC_IMS_ROAMING_ENABLED = 12985 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED; 12986 12987 /** 12988 * Whether user can enable/disable LTE as a preferred network. A carrier might control 12989 * this via gservices, OMA-DM, carrier app, etc. 12990 * <p> 12991 * Type: int (0 for false, 1 for true) 12992 * @hide 12993 */ 12994 public static final String LTE_SERVICE_FORCED = "lte_service_forced"; 12995 12996 12997 /** 12998 * Specifies the behaviour the lid triggers when closed 12999 * <p> 13000 * See WindowManagerPolicy.WindowManagerFuncs 13001 * @hide 13002 */ 13003 public static final String LID_BEHAVIOR = "lid_behavior"; 13004 13005 /** 13006 * Ephemeral app cookie max size in bytes. 13007 * <p> 13008 * Type: int 13009 * @hide 13010 */ 13011 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 13012 "ephemeral_cookie_max_size_bytes"; 13013 13014 /** 13015 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is 13016 * enabled. Set to zero to disable. 13017 * <p> 13018 * Type: int (0 for false, 1 for true) 13019 * 13020 * @hide 13021 */ 13022 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; 13023 13024 /** 13025 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt 13026 * to be disabled. 13027 * <p> 13028 * Type: int (0 to disable, 1 to enable) 13029 * 13030 * @hide 13031 */ 13032 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; 13033 13034 /** 13035 * The min period for caching installed instant apps in milliseconds. 13036 * <p> 13037 * Type: long 13038 * @hide 13039 */ 13040 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 13041 "installed_instant_app_min_cache_period"; 13042 13043 /** 13044 * The max period for caching installed instant apps in milliseconds. 13045 * <p> 13046 * Type: long 13047 * @hide 13048 */ 13049 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 13050 "installed_instant_app_max_cache_period"; 13051 13052 /** 13053 * The min period for caching uninstalled instant apps in milliseconds. 13054 * <p> 13055 * Type: long 13056 * @hide 13057 */ 13058 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 13059 "uninstalled_instant_app_min_cache_period"; 13060 13061 /** 13062 * The max period for caching uninstalled instant apps in milliseconds. 13063 * <p> 13064 * Type: long 13065 * @hide 13066 */ 13067 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 13068 "uninstalled_instant_app_max_cache_period"; 13069 13070 /** 13071 * The min period for caching unused static shared libs in milliseconds. 13072 * <p> 13073 * Type: long 13074 * @hide 13075 */ 13076 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = 13077 "unused_static_shared_lib_min_cache_period"; 13078 13079 /** 13080 * Allows switching users when system user is locked. 13081 * <p> 13082 * Type: int 13083 * @hide 13084 */ 13085 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = 13086 "allow_user_switching_when_system_user_locked"; 13087 13088 /** 13089 * Boot count since the device starts running API level 24. 13090 * <p> 13091 * Type: int 13092 */ 13093 public static final String BOOT_COUNT = "boot_count"; 13094 13095 /** 13096 * Whether the safe boot is disallowed. 13097 * 13098 * <p>This setting should have the identical value as the corresponding user restriction. 13099 * The purpose of the setting is to make the restriction available in early boot stages 13100 * before the user restrictions are loaded. 13101 * @hide 13102 */ 13103 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; 13104 13105 /** 13106 * Indicates whether this device is currently in retail demo mode. If true, the device 13107 * usage is severely limited. 13108 * <p> 13109 * Type: int (0 for false, 1 for true) 13110 * 13111 * @hide 13112 */ 13113 @SystemApi 13114 public static final String DEVICE_DEMO_MODE = "device_demo_mode"; 13115 13116 /** 13117 * Indicates the maximum time that an app is blocked for the network rules to get updated. 13118 * 13119 * Type: long 13120 * 13121 * @hide 13122 */ 13123 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; 13124 13125 /** 13126 * The reason for the settings database being downgraded. This is only for 13127 * troubleshooting purposes and its value should not be interpreted in any way. 13128 * 13129 * Type: string 13130 * 13131 * @hide 13132 */ 13133 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; 13134 13135 /** 13136 * The build id of when the settings database was first created (or re-created due it 13137 * being missing). 13138 * 13139 * Type: string 13140 * 13141 * @hide 13142 */ 13143 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; 13144 13145 /** 13146 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by 13147 * default. Set to 0 to disable. 13148 * 13149 * @hide 13150 */ 13151 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; 13152 13153 /** 13154 * Flag to enable the link to location permissions in location setting. Set to 0 to disable. 13155 * 13156 * @hide 13157 */ 13158 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = 13159 "location_settings_link_to_permissions_enabled"; 13160 13161 /** 13162 * Flag to set the waiting time for removing invisible euicc profiles inside System > 13163 * Settings. 13164 * Type: long 13165 * 13166 * @hide 13167 */ 13168 public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS = 13169 "euicc_removing_invisible_profiles_timeout_millis"; 13170 13171 /** 13172 * Flag to set the waiting time for euicc factory reset inside System > Settings 13173 * Type: long 13174 * 13175 * @hide 13176 */ 13177 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = 13178 "euicc_factory_reset_timeout_millis"; 13179 13180 /** 13181 * Flag to set the timeout for when to refresh the storage settings cached data. 13182 * Type: long 13183 * 13184 * @hide 13185 */ 13186 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = 13187 "storage_settings_clobber_threshold"; 13188 13189 /** 13190 * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} 13191 * temporarily for all users. 13192 * 13193 * @hide 13194 */ 13195 @TestApi 13196 public static final String LOCATION_GLOBAL_KILL_SWITCH = 13197 "location_global_kill_switch"; 13198 13199 /** 13200 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored 13201 * and restoring to lower version of platform API will be skipped. 13202 * 13203 * @hide 13204 */ 13205 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = 13206 "override_settings_provider_restore_any_version"; 13207 /** 13208 * Flag to toggle whether system services report attribution chains when they attribute 13209 * battery use via a {@code WorkSource}. 13210 * 13211 * Type: int (0 to disable, 1 to enable) 13212 * 13213 * @hide 13214 */ 13215 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = 13216 "chained_battery_attribution_enabled"; 13217 13218 /** 13219 * Toggle to enable/disable the incremental ADB installation by default. 13220 * If not set, default adb installations are incremental; set to zero to use full ones. 13221 * Note: only ADB uses it, no usages in the Framework code. 13222 * <p> 13223 * Type: int (0 to disable, 1 to enable) 13224 * 13225 * @hide 13226 */ 13227 public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT = 13228 "enable_adb_incremental_install_default"; 13229 13230 /** 13231 * The packages whitelisted to be run in autofill compatibility mode. The list 13232 * of packages is {@code ":"} colon delimited, and each entry has the name of the 13233 * package and an optional list of url bar resource ids (the list is delimited by 13234 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). 13235 * 13236 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where 13237 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } 13238 * have 2 ids {@code url_foo} and {@code url_bas}) would be 13239 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} 13240 * 13241 * @hide 13242 */ 13243 @SystemApi 13244 @TestApi 13245 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = 13246 "autofill_compat_mode_allowed_packages"; 13247 13248 /** 13249 * Level of autofill logging. 13250 * 13251 * <p>Valid values are 13252 * {@link android.view.autofill.AutofillManager#NO_LOGGING}, 13253 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or 13254 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}. 13255 * 13256 * @hide 13257 */ 13258 public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level"; 13259 13260 /** 13261 * Maximum number of partitions that can be allowed in an autofill session. 13262 * 13263 * @hide 13264 */ 13265 public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size"; 13266 13267 /** 13268 * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use 13269 * the default value from resources. 13270 * 13271 * @hide 13272 */ 13273 public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets"; 13274 13275 /** 13276 * Exemptions to the hidden API blacklist. 13277 * 13278 * @hide 13279 */ 13280 @TestApi 13281 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = 13282 "hidden_api_blacklist_exemptions"; 13283 13284 /** 13285 * Hidden API enforcement policy for apps. 13286 * 13287 * Values correspond to @{@link 13288 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} 13289 * 13290 * @hide 13291 */ 13292 public static final String HIDDEN_API_POLICY = "hidden_api_policy"; 13293 13294 /** 13295 * Current version of signed configuration applied. 13296 * 13297 * @hide 13298 */ 13299 public static final String SIGNED_CONFIG_VERSION = "signed_config_version"; 13300 13301 /** 13302 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} 13303 * operation (in ms). 13304 * 13305 * @hide 13306 */ 13307 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = 13308 "sound_trigger_detection_service_op_timeout"; 13309 13310 /** 13311 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} 13312 * operations per day. 13313 * 13314 * @hide 13315 */ 13316 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = 13317 "max_sound_trigger_detection_service_ops_per_day"; 13318 13319 /** {@hide} */ 13320 public static final String ISOLATED_STORAGE_LOCAL = "isolated_storage_local"; 13321 /** {@hide} */ 13322 public static final String ISOLATED_STORAGE_REMOTE = "isolated_storage_remote"; 13323 13324 /** 13325 * Indicates whether aware is available in the current location. 13326 * @hide 13327 */ 13328 public static final String AWARE_ALLOWED = "aware_allowed"; 13329 13330 /** 13331 * Overrides internal R.integer.config_longPressOnPowerBehavior. 13332 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 13333 * Used by PhoneWindowManager. 13334 * @hide 13335 */ 13336 public static final String POWER_BUTTON_LONG_PRESS = 13337 "power_button_long_press"; 13338 13339 /** 13340 * Overrides internal R.integer.config_veryLongPressOnPowerBehavior. 13341 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 13342 * Used by PhoneWindowManager. 13343 * @hide 13344 */ 13345 public static final String POWER_BUTTON_VERY_LONG_PRESS = 13346 "power_button_very_long_press"; 13347 13348 /** 13349 * Global settings that shouldn't be persisted. 13350 * 13351 * @hide 13352 */ 13353 public static final String[] TRANSIENT_SETTINGS = { 13354 LOCATION_GLOBAL_KILL_SWITCH, 13355 }; 13356 13357 /** 13358 * Keys we no longer back up under the current schema, but want to continue to 13359 * process when restoring historical backup datasets. 13360 * 13361 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 13362 * otherwise they won't be restored. 13363 * 13364 * @hide 13365 */ 13366 public static final String[] LEGACY_RESTORE_SETTINGS = { 13367 }; 13368 13369 @UnsupportedAppUsage 13370 private static final ContentProviderHolder sProviderHolder = 13371 new ContentProviderHolder(CONTENT_URI); 13372 13373 // Populated lazily, guarded by class object: 13374 @UnsupportedAppUsage 13375 private static final NameValueCache sNameValueCache = new NameValueCache( 13376 CONTENT_URI, 13377 CALL_METHOD_GET_GLOBAL, 13378 CALL_METHOD_PUT_GLOBAL, 13379 sProviderHolder); 13380 13381 // Certain settings have been moved from global to the per-user secure namespace 13382 @UnsupportedAppUsage 13383 private static final HashSet<String> MOVED_TO_SECURE; 13384 static { 13385 MOVED_TO_SECURE = new HashSet<>(8); 13386 MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS); 13387 MOVED_TO_SECURE.add(Global.ZEN_DURATION); 13388 MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION); 13389 MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION); 13390 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED); 13391 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED); 13392 MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED); 13393 MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED); 13394 13395 } 13396 13397 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)13398 public static void getMovedToSecureSettings(Set<String> outKeySet) { 13399 outKeySet.addAll(MOVED_TO_SECURE); 13400 } 13401 13402 /** @hide */ clearProviderForTest()13403 public static void clearProviderForTest() { 13404 sProviderHolder.clearProviderForTest(); 13405 sNameValueCache.clearGenerationTrackerForTest(); 13406 } 13407 13408 /** 13409 * Look up a name in the database. 13410 * @param resolver to access the database with 13411 * @param name to look up in the table 13412 * @return the corresponding value, or null if not present 13413 */ getString(ContentResolver resolver, String name)13414 public static String getString(ContentResolver resolver, String name) { 13415 return getStringForUser(resolver, name, resolver.getUserId()); 13416 } 13417 13418 /** @hide */ 13419 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)13420 public static String getStringForUser(ContentResolver resolver, String name, 13421 int userHandle) { 13422 if (MOVED_TO_SECURE.contains(name)) { 13423 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 13424 + " to android.provider.Settings.Secure, returning read-only value."); 13425 return Secure.getStringForUser(resolver, name, userHandle); 13426 } 13427 return sNameValueCache.getStringForUser(resolver, name, userHandle); 13428 } 13429 13430 /** 13431 * Store a name/value pair into the database. 13432 * @param resolver to access the database with 13433 * @param name to store 13434 * @param value to associate with the name 13435 * @return true if the value was set, false on database errors 13436 */ putString(ContentResolver resolver, String name, String value)13437 public static boolean putString(ContentResolver resolver, 13438 String name, String value) { 13439 return putStringForUser(resolver, name, value, null, false, resolver.getUserId(), 13440 DEFAULT_OVERRIDEABLE_BY_RESTORE); 13441 } 13442 13443 /** 13444 * Store a name/value pair into the database. 13445 * 13446 * @param resolver to access the database with 13447 * @param name to store 13448 * @param value to associate with the name 13449 * @param tag to associated with the setting. 13450 * @param makeDefault whether to make the value the default one. 13451 * @param overrideableByRestore whether restore can override this value 13452 * @return true if the value was set, false on database errors 13453 * 13454 * @hide 13455 */ 13456 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, boolean overrideableByRestore)13457 public static boolean putString(@NonNull ContentResolver resolver, 13458 @NonNull String name, @Nullable String value, @Nullable String tag, 13459 boolean makeDefault, boolean overrideableByRestore) { 13460 return putStringForUser(resolver, name, value, tag, makeDefault, 13461 resolver.getUserId(), overrideableByRestore); 13462 } 13463 13464 /** 13465 * Store a name/value pair into the database. 13466 * <p> 13467 * The method takes an optional tag to associate with the setting 13468 * which can be used to clear only settings made by your package and 13469 * associated with this tag by passing the tag to {@link 13470 * #resetToDefaults(ContentResolver, String)}. Anyone can override 13471 * the current tag. Also if another package changes the setting 13472 * then the tag will be set to the one specified in the set call 13473 * which can be null. Also any of the settings setters that do not 13474 * take a tag as an argument effectively clears the tag. 13475 * </p><p> 13476 * For example, if you set settings A and B with tags T1 and T2 and 13477 * another app changes setting A (potentially to the same value), it 13478 * can assign to it a tag T3 (note that now the package that changed 13479 * the setting is not yours). Now if you reset your changes for T1 and 13480 * T2 only setting B will be reset and A not (as it was changed by 13481 * another package) but since A did not change you are in the desired 13482 * initial state. Now if the other app changes the value of A (assuming 13483 * you registered an observer in the beginning) you would detect that 13484 * the setting was changed by another app and handle this appropriately 13485 * (ignore, set back to some value, etc). 13486 * </p><p> 13487 * Also the method takes an argument whether to make the value the 13488 * default for this setting. If the system already specified a default 13489 * value, then the one passed in here will <strong>not</strong> 13490 * be set as the default. 13491 * </p> 13492 * 13493 * @param resolver to access the database with. 13494 * @param name to store. 13495 * @param value to associate with the name. 13496 * @param tag to associated with the setting. 13497 * @param makeDefault whether to make the value the default one. 13498 * @return true if the value was set, false on database errors. 13499 * 13500 * @see #resetToDefaults(ContentResolver, String) 13501 * 13502 * @hide 13503 */ 13504 @SystemApi 13505 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)13506 public static boolean putString(@NonNull ContentResolver resolver, 13507 @NonNull String name, @Nullable String value, @Nullable String tag, 13508 boolean makeDefault) { 13509 return putStringForUser(resolver, name, value, tag, makeDefault, 13510 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 13511 } 13512 13513 /** 13514 * Reset the settings to their defaults. This would reset <strong>only</strong> 13515 * settings set by the caller's package. Think of it of a way to undo your own 13516 * changes to the secure settings. Passing in the optional tag will reset only 13517 * settings changed by your package and associated with this tag. 13518 * 13519 * @param resolver Handle to the content resolver. 13520 * @param tag Optional tag which should be associated with the settings to reset. 13521 * 13522 * @see #putString(ContentResolver, String, String, String, boolean) 13523 * 13524 * @hide 13525 */ 13526 @SystemApi 13527 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)13528 public static void resetToDefaults(@NonNull ContentResolver resolver, 13529 @Nullable String tag) { 13530 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 13531 resolver.getUserId()); 13532 } 13533 13534 /** 13535 * Reset the settings to their defaults for a given user with a specific mode. The 13536 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 13537 * allowing resetting the settings made by a package and associated with the tag. 13538 * 13539 * @param resolver Handle to the content resolver. 13540 * @param tag Optional tag which should be associated with the settings to reset. 13541 * @param mode The reset mode. 13542 * @param userHandle The user for which to reset to defaults. 13543 * 13544 * @see #RESET_MODE_PACKAGE_DEFAULTS 13545 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 13546 * @see #RESET_MODE_UNTRUSTED_CHANGES 13547 * @see #RESET_MODE_TRUSTED_DEFAULTS 13548 * 13549 * @hide 13550 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)13551 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 13552 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 13553 try { 13554 Bundle arg = new Bundle(); 13555 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 13556 if (tag != null) { 13557 arg.putString(CALL_METHOD_TAG_KEY, tag); 13558 } 13559 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 13560 IContentProvider cp = sProviderHolder.getProvider(resolver); 13561 cp.call(resolver.getPackageName(), resolver.getAttributionTag(), 13562 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg); 13563 } catch (RemoteException e) { 13564 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 13565 } 13566 } 13567 13568 /** @hide */ 13569 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)13570 public static boolean putStringForUser(ContentResolver resolver, 13571 String name, String value, int userHandle) { 13572 return putStringForUser(resolver, name, value, null, false, userHandle, 13573 DEFAULT_OVERRIDEABLE_BY_RESTORE); 13574 } 13575 13576 /** @hide */ putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)13577 public static boolean putStringForUser(@NonNull ContentResolver resolver, 13578 @NonNull String name, @Nullable String value, @Nullable String tag, 13579 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 13580 if (LOCAL_LOGV) { 13581 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 13582 + " for " + userHandle); 13583 } 13584 // Global and Secure have the same access policy so we can forward writes 13585 if (MOVED_TO_SECURE.contains(name)) { 13586 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 13587 + " to android.provider.Settings.Secure, value is unchanged."); 13588 return Secure.putStringForUser(resolver, name, value, tag, 13589 makeDefault, userHandle, overrideableByRestore); 13590 } 13591 return sNameValueCache.putStringForUser(resolver, name, value, tag, 13592 makeDefault, userHandle, overrideableByRestore); 13593 } 13594 13595 /** 13596 * Construct the content URI for a particular name/value pair, 13597 * useful for monitoring changes with a ContentObserver. 13598 * @param name to look up in the table 13599 * @return the corresponding content URI, or null if not present 13600 */ getUriFor(String name)13601 public static Uri getUriFor(String name) { 13602 return getUriFor(CONTENT_URI, name); 13603 } 13604 13605 /** 13606 * Convenience function for retrieving a single secure settings value 13607 * as an integer. Note that internally setting values are always 13608 * stored as strings; this function converts the string to an integer 13609 * for you. The default value will be returned if the setting is 13610 * not defined or not an integer. 13611 * 13612 * @param cr The ContentResolver to access. 13613 * @param name The name of the setting to retrieve. 13614 * @param def Value to return if the setting is not defined. 13615 * 13616 * @return The setting's current value, or 'def' if it is not defined 13617 * or not a valid integer. 13618 */ getInt(ContentResolver cr, String name, int def)13619 public static int getInt(ContentResolver cr, String name, int def) { 13620 String v = getString(cr, name); 13621 try { 13622 return v != null ? Integer.parseInt(v) : def; 13623 } catch (NumberFormatException e) { 13624 return def; 13625 } 13626 } 13627 13628 /** 13629 * Convenience function for retrieving a single secure settings value 13630 * as an integer. Note that internally setting values are always 13631 * stored as strings; this function converts the string to an integer 13632 * for you. 13633 * <p> 13634 * This version does not take a default value. If the setting has not 13635 * been set, or the string value is not a number, 13636 * it throws {@link SettingNotFoundException}. 13637 * 13638 * @param cr The ContentResolver to access. 13639 * @param name The name of the setting to retrieve. 13640 * 13641 * @throws SettingNotFoundException Thrown if a setting by the given 13642 * name can't be found or the setting value is not an integer. 13643 * 13644 * @return The setting's current value. 13645 */ getInt(ContentResolver cr, String name)13646 public static int getInt(ContentResolver cr, String name) 13647 throws SettingNotFoundException { 13648 String v = getString(cr, name); 13649 try { 13650 return Integer.parseInt(v); 13651 } catch (NumberFormatException e) { 13652 throw new SettingNotFoundException(name); 13653 } 13654 } 13655 13656 /** 13657 * Convenience function for updating a single settings value as an 13658 * integer. This will either create a new entry in the table if the 13659 * given name does not exist, or modify the value of the existing row 13660 * with that name. Note that internally setting values are always 13661 * stored as strings, so this function converts the given value to a 13662 * string before storing it. 13663 * 13664 * @param cr The ContentResolver to access. 13665 * @param name The name of the setting to modify. 13666 * @param value The new value for the setting. 13667 * @return true if the value was set, false on database errors 13668 */ putInt(ContentResolver cr, String name, int value)13669 public static boolean putInt(ContentResolver cr, String name, int value) { 13670 return putString(cr, name, Integer.toString(value)); 13671 } 13672 13673 /** 13674 * Convenience function for retrieving a single secure settings value 13675 * as a {@code long}. Note that internally setting values are always 13676 * stored as strings; this function converts the string to a {@code long} 13677 * for you. The default value will be returned if the setting is 13678 * not defined or not a {@code long}. 13679 * 13680 * @param cr The ContentResolver to access. 13681 * @param name The name of the setting to retrieve. 13682 * @param def Value to return if the setting is not defined. 13683 * 13684 * @return The setting's current value, or 'def' if it is not defined 13685 * or not a valid {@code long}. 13686 */ getLong(ContentResolver cr, String name, long def)13687 public static long getLong(ContentResolver cr, String name, long def) { 13688 String valString = getString(cr, name); 13689 long value; 13690 try { 13691 value = valString != null ? Long.parseLong(valString) : def; 13692 } catch (NumberFormatException e) { 13693 value = def; 13694 } 13695 return value; 13696 } 13697 13698 /** 13699 * Convenience function for retrieving a single secure settings value 13700 * as a {@code long}. Note that internally setting values are always 13701 * stored as strings; this function converts the string to a {@code long} 13702 * for you. 13703 * <p> 13704 * This version does not take a default value. If the setting has not 13705 * been set, or the string value is not a number, 13706 * it throws {@link SettingNotFoundException}. 13707 * 13708 * @param cr The ContentResolver to access. 13709 * @param name The name of the setting to retrieve. 13710 * 13711 * @return The setting's current value. 13712 * @throws SettingNotFoundException Thrown if a setting by the given 13713 * name can't be found or the setting value is not an integer. 13714 */ getLong(ContentResolver cr, String name)13715 public static long getLong(ContentResolver cr, String name) 13716 throws SettingNotFoundException { 13717 String valString = getString(cr, name); 13718 try { 13719 return Long.parseLong(valString); 13720 } catch (NumberFormatException e) { 13721 throw new SettingNotFoundException(name); 13722 } 13723 } 13724 13725 /** 13726 * Convenience function for updating a secure settings value as a long 13727 * integer. This will either create a new entry in the table if the 13728 * given name does not exist, or modify the value of the existing row 13729 * with that name. Note that internally setting values are always 13730 * stored as strings, so this function converts the given value to a 13731 * string before storing it. 13732 * 13733 * @param cr The ContentResolver to access. 13734 * @param name The name of the setting to modify. 13735 * @param value The new value for the setting. 13736 * @return true if the value was set, false on database errors 13737 */ putLong(ContentResolver cr, String name, long value)13738 public static boolean putLong(ContentResolver cr, String name, long value) { 13739 return putString(cr, name, Long.toString(value)); 13740 } 13741 13742 /** 13743 * Convenience function for retrieving a single secure settings value 13744 * as a floating point number. Note that internally setting values are 13745 * always stored as strings; this function converts the string to an 13746 * float for you. The default value will be returned if the setting 13747 * is not defined or not a valid float. 13748 * 13749 * @param cr The ContentResolver to access. 13750 * @param name The name of the setting to retrieve. 13751 * @param def Value to return if the setting is not defined. 13752 * 13753 * @return The setting's current value, or 'def' if it is not defined 13754 * or not a valid float. 13755 */ getFloat(ContentResolver cr, String name, float def)13756 public static float getFloat(ContentResolver cr, String name, float def) { 13757 String v = getString(cr, name); 13758 try { 13759 return v != null ? Float.parseFloat(v) : def; 13760 } catch (NumberFormatException e) { 13761 return def; 13762 } 13763 } 13764 13765 /** 13766 * Convenience function for retrieving a single secure settings value 13767 * as a float. Note that internally setting values are always 13768 * stored as strings; this function converts the string to a float 13769 * for you. 13770 * <p> 13771 * This version does not take a default value. If the setting has not 13772 * been set, or the string value is not a number, 13773 * it throws {@link SettingNotFoundException}. 13774 * 13775 * @param cr The ContentResolver to access. 13776 * @param name The name of the setting to retrieve. 13777 * 13778 * @throws SettingNotFoundException Thrown if a setting by the given 13779 * name can't be found or the setting value is not a float. 13780 * 13781 * @return The setting's current value. 13782 */ getFloat(ContentResolver cr, String name)13783 public static float getFloat(ContentResolver cr, String name) 13784 throws SettingNotFoundException { 13785 String v = getString(cr, name); 13786 if (v == null) { 13787 throw new SettingNotFoundException(name); 13788 } 13789 try { 13790 return Float.parseFloat(v); 13791 } catch (NumberFormatException e) { 13792 throw new SettingNotFoundException(name); 13793 } 13794 } 13795 13796 /** 13797 * Convenience function for updating a single settings value as a 13798 * floating point number. This will either create a new entry in the 13799 * table if the given name does not exist, or modify the value of the 13800 * existing row with that name. Note that internally setting values 13801 * are always stored as strings, so this function converts the given 13802 * value to a string before storing it. 13803 * 13804 * @param cr The ContentResolver to access. 13805 * @param name The name of the setting to modify. 13806 * @param value The new value for the setting. 13807 * @return true if the value was set, false on database errors 13808 */ putFloat(ContentResolver cr, String name, float value)13809 public static boolean putFloat(ContentResolver cr, String name, float value) { 13810 return putString(cr, name, Float.toString(value)); 13811 } 13812 13813 /** 13814 * Subscription Id to be used for voice call on a multi sim device. 13815 * @hide 13816 */ 13817 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 13818 13819 /** 13820 * Used to provide option to user to select subscription during dial. 13821 * The supported values are 0 = disable or 1 = enable prompt. 13822 * @hide 13823 */ 13824 @UnsupportedAppUsage 13825 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 13826 13827 /** 13828 * Subscription Id to be used for data call on a multi sim device. 13829 * @hide 13830 */ 13831 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 13832 13833 /** 13834 * Subscription Id to be used for SMS on a multi sim device. 13835 * @hide 13836 */ 13837 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 13838 13839 /** 13840 * Used to provide option to user to select subscription during send SMS. 13841 * The value 1 - enable, 0 - disable 13842 * @hide 13843 */ 13844 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 13845 13846 /** User preferred subscriptions setting. 13847 * This holds the details of the user selected subscription from the card and 13848 * the activation status. Each settings string have the comma separated values 13849 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 13850 * @hide 13851 */ 13852 @UnsupportedAppUsage 13853 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 13854 "user_preferred_sub2","user_preferred_sub3"}; 13855 13856 /** 13857 * Which subscription is enabled for a physical slot. 13858 * @hide 13859 */ 13860 public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot"; 13861 13862 /** 13863 * Whether corresponding logical modem is enabled for a physical slot. 13864 * The value 1 - enable, 0 - disable 13865 * @hide 13866 */ 13867 public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot"; 13868 13869 /** 13870 * Whether to enable new contacts aggregator or not. 13871 * The value 1 - enable, 0 - disable 13872 * @hide 13873 */ 13874 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; 13875 13876 /** 13877 * Whether to enable contacts metadata syncing or not 13878 * The value 1 - enable, 0 - disable 13879 * 13880 * @removed 13881 */ 13882 @Deprecated 13883 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; 13884 13885 /** 13886 * Whether to enable contacts metadata syncing or not 13887 * The value 1 - enable, 0 - disable 13888 */ 13889 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; 13890 13891 /** 13892 * Whether to enable cellular on boot. 13893 * The value 1 - enable, 0 - disable 13894 * @hide 13895 */ 13896 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; 13897 13898 /** 13899 * The maximum allowed notification enqueue rate in Hertz. 13900 * 13901 * Should be a float, and includes updates only. 13902 * @hide 13903 */ 13904 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; 13905 13906 /** 13907 * Displays toasts when an app posts a notification that does not specify a valid channel. 13908 * 13909 * The value 1 - enable, 0 - disable 13910 * @hide 13911 */ 13912 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = 13913 "show_notification_channel_warnings"; 13914 13915 /** 13916 * Whether cell is enabled/disabled 13917 * @hide 13918 */ 13919 public static final String CELL_ON = "cell_on"; 13920 13921 /** 13922 * Global settings which can be accessed by instant apps. 13923 * @hide 13924 */ 13925 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 13926 static { 13927 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); 13928 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); 13929 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); 13930 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); 13931 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); 13932 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); 13933 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); 13934 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); 13935 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); 13936 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); 13937 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE); 13938 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); 13939 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); 13940 INSTANT_APP_SETTINGS.add(ZEN_MODE); 13941 } 13942 13943 /** 13944 * Whether to show the high temperature warning notification. 13945 * @hide 13946 */ 13947 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; 13948 13949 /** 13950 * Whether to show the usb high temperature alarm notification. 13951 * @hide 13952 */ 13953 public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm"; 13954 13955 /** 13956 * Temperature at which the high temperature warning notification should be shown. 13957 * @hide 13958 */ 13959 public static final String WARNING_TEMPERATURE = "warning_temperature"; 13960 13961 /** 13962 * Whether the diskstats logging task is enabled/disabled. 13963 * @hide 13964 */ 13965 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; 13966 13967 /** 13968 * Whether the cache quota calculation task is enabled/disabled. 13969 * @hide 13970 */ 13971 public static final String ENABLE_CACHE_QUOTA_CALCULATION = 13972 "enable_cache_quota_calculation"; 13973 13974 /** 13975 * Whether the Deletion Helper no threshold toggle is available. 13976 * @hide 13977 */ 13978 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = 13979 "enable_deletion_helper_no_threshold_toggle"; 13980 13981 /** 13982 * The list of snooze options for notifications 13983 * This is encoded as a key=value list, separated by commas. Ex: 13984 * 13985 * "default=60,options_array=15:30:60:120" 13986 * 13987 * The following keys are supported: 13988 * 13989 * <pre> 13990 * default (int) 13991 * options_array (int[]) 13992 * </pre> 13993 * 13994 * All delays in integer minutes. Array order is respected. 13995 * Options will be used in order up to the maximum allowed by the UI. 13996 * @hide 13997 */ 13998 public static final String NOTIFICATION_SNOOZE_OPTIONS = 13999 "notification_snooze_options"; 14000 14001 /** 14002 * Settings key for the ratio of notification dismissals to notification views - one of the 14003 * criteria for showing the notification blocking helper. 14004 * 14005 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive 14006 * the blocking helper will be). 14007 * 14008 * @hide 14009 */ 14010 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT = 14011 "blocking_helper_dismiss_to_view_ratio"; 14012 14013 /** 14014 * Settings key for the longest streak of dismissals - one of the criteria for showing the 14015 * notification blocking helper. 14016 * 14017 * <p>The value is an integer greater than 0. 14018 * 14019 * @hide 14020 */ 14021 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit"; 14022 14023 /** 14024 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated 14025 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF 14026 * 14027 * Supported keys:<br/> 14028 * <li> 14029 * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines 14030 * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag 14031 * and is honoured on Android Q and higher. This flag will be removed in a future release. 14032 * </ul> 14033 * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use 14034 * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the 14035 * obsolete {@code compatibility_wal_supported} flag. 14036 * </ul> 14037 * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the 14038 * WAL journal. 14039 * </ul> 14040 * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether 14041 * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is 14042 * only supported on Android Pie. 14043 * </ul> 14044 * </li> 14045 * 14046 * @hide 14047 */ 14048 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = 14049 "sqlite_compatibility_wal_flags"; 14050 14051 /** 14052 * Enable GNSS Raw Measurements Full Tracking? 14053 * 0 = no 14054 * 1 = yes 14055 * @hide 14056 */ 14057 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = 14058 "enable_gnss_raw_meas_full_tracking"; 14059 14060 /** 14061 * Whether the notification should be ongoing (persistent) when a carrier app install is 14062 * required. 14063 * 14064 * The value is a boolean (1 or 0). 14065 * @hide 14066 */ 14067 @SystemApi 14068 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = 14069 "install_carrier_app_notification_persistent"; 14070 14071 /** 14072 * The amount of time (ms) to hide the install carrier app notification after the user has 14073 * ignored it. After this time passes, the notification will be shown again 14074 * 14075 * The value is a long 14076 * @hide 14077 */ 14078 @SystemApi 14079 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = 14080 "install_carrier_app_notification_sleep_millis"; 14081 14082 /** 14083 * Whether we've enabled zram on this device. Takes effect on 14084 * reboot. The value "1" enables zram; "0" disables it, and 14085 * everything else is unspecified. 14086 * @hide 14087 */ 14088 public static final String ZRAM_ENABLED = 14089 "zram_enabled"; 14090 14091 /** 14092 * Whether the app freezer is enabled on this device. 14093 * The value of "enabled" enables the app freezer, "disabled" disables it and 14094 * "device_default" will let the system decide whether to enable the freezer or not 14095 * @hide 14096 */ 14097 public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer"; 14098 14099 /** 14100 * Configuration flags for smart replies in notifications. 14101 * This is encoded as a key=value list, separated by commas. Ex: 14102 * 14103 * "enabled=1,max_squeeze_remeasure_count=3" 14104 * 14105 * The following keys are supported: 14106 * 14107 * <pre> 14108 * enabled (boolean) 14109 * requires_targeting_p (boolean) 14110 * max_squeeze_remeasure_attempts (int) 14111 * edit_choices_before_sending (boolean) 14112 * show_in_heads_up (boolean) 14113 * min_num_system_generated_replies (int) 14114 * max_num_actions (int) 14115 * </pre> 14116 * @see com.android.systemui.statusbar.policy.SmartReplyConstants 14117 * @hide 14118 */ 14119 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = 14120 "smart_replies_in_notifications_flags"; 14121 14122 /** 14123 * Configuration flags for the automatic generation of smart replies and smart actions in 14124 * notifications. This is encoded as a key=value list, separated by commas. Ex: 14125 * "generate_replies=false,generate_actions=true". 14126 * 14127 * The following keys are supported: 14128 * 14129 * <pre> 14130 * generate_replies (boolean) 14131 * generate_actions (boolean) 14132 * </pre> 14133 * @hide 14134 */ 14135 public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS = 14136 "smart_suggestions_in_notifications_flags"; 14137 14138 /** 14139 * If nonzero, crashes in foreground processes will bring up a dialog. 14140 * Otherwise, the process will be silently killed. 14141 * @hide 14142 */ 14143 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; 14144 14145 /** 14146 * If nonzero, crash dialogs will show an option to restart the app. 14147 * @hide 14148 */ 14149 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; 14150 14151 /** 14152 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for 14153 * this app. 14154 * @hide 14155 */ 14156 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; 14157 14158 14159 /** 14160 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 14161 * @hide 14162 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION} 14163 */ 14164 @Deprecated 14165 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 14166 14167 /** 14168 * If nonzero, will show the zen update settings suggestion. 14169 * @hide 14170 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION} 14171 */ 14172 @Deprecated 14173 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 14174 14175 /** 14176 * If nonzero, zen has not been updated to reflect new changes. 14177 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED} 14178 * @hide 14179 */ 14180 @Deprecated 14181 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 14182 14183 /** 14184 * If nonzero, zen setting suggestion has been viewed by user 14185 * @hide 14186 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED} 14187 */ 14188 @Deprecated 14189 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 14190 "zen_settings_suggestion_viewed"; 14191 14192 /** 14193 * Backup and restore agent timeout parameters. 14194 * These parameters are represented by a comma-delimited key-value list. 14195 * 14196 * The following strings are supported as keys: 14197 * <pre> 14198 * kv_backup_agent_timeout_millis (long) 14199 * full_backup_agent_timeout_millis (long) 14200 * shared_backup_agent_timeout_millis (long) 14201 * restore_agent_timeout_millis (long) 14202 * restore_agent_finished_timeout_millis (long) 14203 * </pre> 14204 * 14205 * They map to milliseconds represented as longs. 14206 * 14207 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" 14208 * 14209 * @hide 14210 */ 14211 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = 14212 "backup_agent_timeout_parameters"; 14213 14214 /** 14215 * Blacklist of GNSS satellites. 14216 * 14217 * This is a list of integers separated by commas to represent pairs of (constellation, 14218 * svid). Thus, the number of integers should be even. 14219 * 14220 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are 14221 * blacklisted. Note that svid=0 denotes all svids in the 14222 * constellation are blacklisted. 14223 * 14224 * @hide 14225 */ 14226 public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist"; 14227 14228 /** 14229 * Duration of updates in millisecond for GNSS location request from HAL to framework. 14230 * 14231 * If zero, the GNSS location request feature is disabled. 14232 * 14233 * The value is a non-negative long. 14234 * 14235 * @hide 14236 */ 14237 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS = 14238 "gnss_hal_location_request_duration_millis"; 14239 14240 /** 14241 * Binder call stats settings. 14242 * 14243 * The following strings are supported as keys: 14244 * <pre> 14245 * enabled (boolean) 14246 * detailed_tracking (boolean) 14247 * upload_data (boolean) 14248 * sampling_interval (int) 14249 * </pre> 14250 * 14251 * @hide 14252 */ 14253 public static final String BINDER_CALLS_STATS = "binder_calls_stats"; 14254 14255 /** 14256 * Looper stats settings. 14257 * 14258 * The following strings are supported as keys: 14259 * <pre> 14260 * enabled (boolean) 14261 * sampling_interval (int) 14262 * </pre> 14263 * 14264 * @hide 14265 */ 14266 public static final String LOOPER_STATS = "looper_stats"; 14267 14268 /** 14269 * Settings for collecting statistics on CPU usage per thread 14270 * 14271 * The following strings are supported as keys: 14272 * <pre> 14273 * num_buckets (int) 14274 * collected_uids (string) 14275 * minimum_total_cpu_usage_millis (int) 14276 * </pre> 14277 * 14278 * @hide 14279 */ 14280 public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader"; 14281 14282 /** 14283 * Whether we've enabled native flags health check on this device. Takes effect on 14284 * reboot. The value "1" enables native flags health check; otherwise it's disabled. 14285 * @hide 14286 */ 14287 public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED = 14288 "native_flags_health_check_enabled"; 14289 14290 /** 14291 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode 14292 * in which the historical registry operates. 14293 * 14294 * @hide 14295 */ 14296 public static final String APPOP_HISTORY_MODE = "mode"; 14297 14298 /** 14299 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long 14300 * is the interval between snapshots in the base case i.e. the most recent 14301 * part of the history. 14302 * 14303 * @hide 14304 */ 14305 public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis"; 14306 14307 /** 14308 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base 14309 * for the logarithmic step when building app op history. 14310 * 14311 * @hide 14312 */ 14313 public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier"; 14314 14315 /** 14316 * Appop history parameters. These parameters are represented by 14317 * a comma-delimited key-value list. 14318 * 14319 * The following strings are supported as keys: 14320 * <pre> 14321 * mode (int) 14322 * baseIntervalMillis (long) 14323 * intervalMultiplier (int) 14324 * </pre> 14325 * 14326 * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10" 14327 * 14328 * @see #APPOP_HISTORY_MODE 14329 * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS 14330 * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER 14331 * 14332 * @hide 14333 */ 14334 public static final String APPOP_HISTORY_PARAMETERS = 14335 "appop_history_parameters"; 14336 14337 /** 14338 * Auto revoke parameters. These parameters are represented by 14339 * a comma-delimited key-value list. 14340 * 14341 * <pre> 14342 * enabledForPreRApps (bolean) 14343 * unusedThresholdMs (long) 14344 * checkFrequencyMs (long) 14345 * </pre> 14346 * 14347 * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000" 14348 * 14349 * @hide 14350 */ 14351 public static final String AUTO_REVOKE_PARAMETERS = 14352 "auto_revoke_parameters"; 14353 14354 /** 14355 * Delay for sending ACTION_CHARGING after device is plugged in. 14356 * This is used as an override for constants defined in BatteryStatsImpl for 14357 * ease of experimentation. 14358 * 14359 * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS 14360 * @hide 14361 */ 14362 public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY = 14363 "battery_charging_state_update_delay"; 14364 14365 /** 14366 * A serialized string of params that will be loaded into a text classifier action model. 14367 * 14368 * @hide 14369 */ 14370 public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS = 14371 "text_classifier_action_model_params"; 14372 14373 /** 14374 * The amount of time to suppress "power-off" from the power button after the device has 14375 * woken due to a gesture (lifting the phone). Since users have learned to hit the power 14376 * button immediately when lifting their device, it can cause the device to turn off if a 14377 * gesture has just woken the device. This value tells us the milliseconds to wait after 14378 * a gesture before "power-off" via power-button is functional again. A value of 0 is no 14379 * delay, and reverts to the old behavior. 14380 * 14381 * @hide 14382 */ 14383 public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE = 14384 "power_button_suppression_delay_after_gesture_wake"; 14385 14386 /** 14387 * The usage amount of advanced battery. The value is 0~100. 14388 * 14389 * @hide 14390 */ 14391 public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount"; 14392 14393 /** 14394 * For 5G NSA capable devices, determines whether NR tracking indications are on 14395 * when the screen is off. 14396 * 14397 * Values are: 14398 * 0: off - All 5G NSA tracking indications are off when the screen is off. 14399 * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as 14400 * the device is camped on 5G NSA (5G icon is showing in status bar). 14401 * If the device is not camped on 5G NSA, tracking indications are off. 14402 * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off. 14403 * @hide 14404 */ 14405 public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE = 14406 "nr_nsa_tracking_screen_off_mode"; 14407 } 14408 14409 /** 14410 * Configuration system settings, containing settings which are applied identically for all 14411 * defined users. Only Android can read these and only a specific configuration service can 14412 * write these. 14413 * 14414 * @hide 14415 */ 14416 public static final class Config extends NameValueTable { 14417 private static final ContentProviderHolder sProviderHolder = 14418 new ContentProviderHolder(DeviceConfig.CONTENT_URI); 14419 14420 // Populated lazily, guarded by class object: 14421 private static final NameValueCache sNameValueCache = new NameValueCache( 14422 DeviceConfig.CONTENT_URI, 14423 CALL_METHOD_GET_CONFIG, 14424 CALL_METHOD_PUT_CONFIG, 14425 CALL_METHOD_LIST_CONFIG, 14426 CALL_METHOD_SET_ALL_CONFIG, 14427 sProviderHolder); 14428 14429 /** 14430 * Look up a name in the database. 14431 * @param resolver to access the database with 14432 * @param name to look up in the table 14433 * @return the corresponding value, or null if not present 14434 * 14435 * @hide 14436 */ 14437 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getString(ContentResolver resolver, String name)14438 static String getString(ContentResolver resolver, String name) { 14439 return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId()); 14440 } 14441 14442 /** 14443 * Look up a list of names in the database, within the specified namespace. 14444 * 14445 * @param resolver to access the database with 14446 * @param namespace to which the names belong 14447 * @param names to look up in the table 14448 * @return a non null, but possibly empty, map from name to value for any of the names that 14449 * were found during lookup. 14450 * 14451 * @hide 14452 */ 14453 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)14454 public static Map<String, String> getStrings(@NonNull ContentResolver resolver, 14455 @NonNull String namespace, @NonNull List<String> names) { 14456 List<String> compositeNames = new ArrayList<>(names.size()); 14457 for (String name : names) { 14458 compositeNames.add(createCompositeName(namespace, name)); 14459 } 14460 14461 String prefix = createPrefix(namespace); 14462 ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix( 14463 resolver, prefix, compositeNames); 14464 int size = rawKeyValues.size(); 14465 int substringLength = prefix.length(); 14466 ArrayMap<String, String> keyValues = new ArrayMap<>(size); 14467 for (int i = 0; i < size; ++i) { 14468 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength), 14469 rawKeyValues.valueAt(i)); 14470 } 14471 return keyValues; 14472 } 14473 14474 /** 14475 * Store a name/value pair into the database within the specified namespace. 14476 * <p> 14477 * Also the method takes an argument whether to make the value the default for this setting. 14478 * If the system already specified a default value, then the one passed in here will 14479 * <strong>not</strong> be set as the default. 14480 * </p> 14481 * 14482 * @param resolver to access the database with. 14483 * @param namespace to store the name/value pair in. 14484 * @param name to store. 14485 * @param value to associate with the name. 14486 * @param makeDefault whether to make the value the default one. 14487 * @return true if the value was set, false on database errors. 14488 * 14489 * @see #resetToDefaults(ContentResolver, int, String) 14490 * 14491 * @hide 14492 */ 14493 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) putString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)14494 static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace, 14495 @NonNull String name, @Nullable String value, boolean makeDefault) { 14496 return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name), 14497 value, null, makeDefault, resolver.getUserId(), 14498 DEFAULT_OVERRIDEABLE_BY_RESTORE); 14499 } 14500 14501 /** 14502 * Clear all name/value pairs for the provided namespace and save new name/value pairs in 14503 * their place. 14504 * 14505 * @param resolver to access the database with. 14506 * @param namespace to which the names should be set. 14507 * @param keyValues map of key names (without the prefix) to values. 14508 * @return 14509 * 14510 * @hide 14511 */ 14512 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)14513 public static boolean setStrings(@NonNull ContentResolver resolver, 14514 @NonNull String namespace, @NonNull Map<String, String> keyValues) 14515 throws DeviceConfig.BadConfigException { 14516 HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size()); 14517 for (Map.Entry<String, String> entry : keyValues.entrySet()) { 14518 compositeKeyValueMap.put( 14519 createCompositeName(namespace, entry.getKey()), entry.getValue()); 14520 } 14521 // If can't set given configuration that means it's bad 14522 if (!sNameValueCache.setStringsForPrefix(resolver, createPrefix(namespace), 14523 compositeKeyValueMap)) { 14524 throw new DeviceConfig.BadConfigException(); 14525 } 14526 return true; 14527 } 14528 14529 /** 14530 * Reset the values to their defaults. 14531 * <p> 14532 * The method accepts an optional prefix parameter. If provided, only pairs with a name that 14533 * starts with the exact prefix will be reset. Otherwise all will be reset. 14534 * 14535 * @param resolver Handle to the content resolver. 14536 * @param resetMode The reset mode to use. 14537 * @param namespace Optionally, to limit which which namespace is reset. 14538 * 14539 * @see #putString(ContentResolver, String, String, String, boolean) 14540 * 14541 * @hide 14542 */ 14543 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String namespace)14544 static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode, 14545 @Nullable String namespace) { 14546 try { 14547 Bundle arg = new Bundle(); 14548 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId()); 14549 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode); 14550 if (namespace != null) { 14551 arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace)); 14552 } 14553 IContentProvider cp = sProviderHolder.getProvider(resolver); 14554 cp.call(resolver.getPackageName(), resolver.getAttributionTag(), 14555 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg); 14556 } catch (RemoteException e) { 14557 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e); 14558 } 14559 } 14560 14561 /** 14562 * Register callback for monitoring Config table. 14563 * 14564 * @param resolver Handle to the content resolver. 14565 * @param callback callback to register 14566 * 14567 * @hide 14568 */ 14569 @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS) registerMonitorCallback(@onNull ContentResolver resolver, @NonNull RemoteCallback callback)14570 public static void registerMonitorCallback(@NonNull ContentResolver resolver, 14571 @NonNull RemoteCallback callback) { 14572 registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback); 14573 } 14574 registerMonitorCallbackAsUser( @onNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull RemoteCallback callback)14575 private static void registerMonitorCallbackAsUser( 14576 @NonNull ContentResolver resolver, @UserIdInt int userHandle, 14577 @NonNull RemoteCallback callback) { 14578 try { 14579 Bundle arg = new Bundle(); 14580 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 14581 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback); 14582 IContentProvider cp = sProviderHolder.getProvider(resolver); 14583 cp.call(resolver.getPackageName(), resolver.getAttributionTag(), 14584 sProviderHolder.mUri.getAuthority(), 14585 CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg); 14586 } catch (RemoteException e) { 14587 Log.w(TAG, "Can't register config monitor callback", e); 14588 } 14589 } 14590 14591 /** @hide */ clearProviderForTest()14592 public static void clearProviderForTest() { 14593 sProviderHolder.clearProviderForTest(); 14594 sNameValueCache.clearGenerationTrackerForTest(); 14595 } 14596 createCompositeName(@onNull String namespace, @NonNull String name)14597 private static String createCompositeName(@NonNull String namespace, @NonNull String name) { 14598 Preconditions.checkNotNull(namespace); 14599 Preconditions.checkNotNull(name); 14600 return createPrefix(namespace) + name; 14601 } 14602 createPrefix(@onNull String namespace)14603 private static String createPrefix(@NonNull String namespace) { 14604 Preconditions.checkNotNull(namespace); 14605 return namespace + "/"; 14606 } 14607 } 14608 14609 /** 14610 * User-defined bookmarks and shortcuts. The target of each bookmark is an 14611 * Intent URL, allowing it to be either a web page or a particular 14612 * application activity. 14613 * 14614 * @hide 14615 */ 14616 public static final class Bookmarks implements BaseColumns 14617 { 14618 private static final String TAG = "Bookmarks"; 14619 14620 /** 14621 * The content:// style URL for this table 14622 */ 14623 @UnsupportedAppUsage 14624 public static final Uri CONTENT_URI = 14625 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 14626 14627 /** 14628 * The row ID. 14629 * <p>Type: INTEGER</p> 14630 */ 14631 public static final String ID = "_id"; 14632 14633 /** 14634 * Descriptive name of the bookmark that can be displayed to the user. 14635 * If this is empty, the title should be resolved at display time (use 14636 * {@link #getTitle(Context, Cursor)} any time you want to display the 14637 * title of a bookmark.) 14638 * <P> 14639 * Type: TEXT 14640 * </P> 14641 */ 14642 public static final String TITLE = "title"; 14643 14644 /** 14645 * Arbitrary string (displayed to the user) that allows bookmarks to be 14646 * organized into categories. There are some special names for 14647 * standard folders, which all start with '@'. The label displayed for 14648 * the folder changes with the locale (via {@link #getLabelForFolder}) but 14649 * the folder name does not change so you can consistently query for 14650 * the folder regardless of the current locale. 14651 * 14652 * <P>Type: TEXT</P> 14653 * 14654 */ 14655 public static final String FOLDER = "folder"; 14656 14657 /** 14658 * The Intent URL of the bookmark, describing what it points to. This 14659 * value is given to {@link android.content.Intent#getIntent} to create 14660 * an Intent that can be launched. 14661 * <P>Type: TEXT</P> 14662 */ 14663 public static final String INTENT = "intent"; 14664 14665 /** 14666 * Optional shortcut character associated with this bookmark. 14667 * <P>Type: INTEGER</P> 14668 */ 14669 public static final String SHORTCUT = "shortcut"; 14670 14671 /** 14672 * The order in which the bookmark should be displayed 14673 * <P>Type: INTEGER</P> 14674 */ 14675 public static final String ORDERING = "ordering"; 14676 14677 private static final String[] sIntentProjection = { INTENT }; 14678 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 14679 private static final String sShortcutSelection = SHORTCUT + "=?"; 14680 14681 /** 14682 * Convenience function to retrieve the bookmarked Intent for a 14683 * particular shortcut key. 14684 * 14685 * @param cr The ContentResolver to query. 14686 * @param shortcut The shortcut key. 14687 * 14688 * @return Intent The bookmarked URL, or null if there is no bookmark 14689 * matching the given shortcut. 14690 */ getIntentForShortcut(ContentResolver cr, char shortcut)14691 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 14692 { 14693 Intent intent = null; 14694 14695 Cursor c = cr.query(CONTENT_URI, 14696 sIntentProjection, sShortcutSelection, 14697 new String[] { String.valueOf((int) shortcut) }, ORDERING); 14698 // Keep trying until we find a valid shortcut 14699 try { 14700 while (intent == null && c.moveToNext()) { 14701 try { 14702 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 14703 intent = Intent.parseUri(intentURI, 0); 14704 } catch (java.net.URISyntaxException e) { 14705 // The stored URL is bad... ignore it. 14706 } catch (IllegalArgumentException e) { 14707 // Column not found 14708 Log.w(TAG, "Intent column not found", e); 14709 } 14710 } 14711 } finally { 14712 if (c != null) c.close(); 14713 } 14714 14715 return intent; 14716 } 14717 14718 /** 14719 * Add a new bookmark to the system. 14720 * 14721 * @param cr The ContentResolver to query. 14722 * @param intent The desired target of the bookmark. 14723 * @param title Bookmark title that is shown to the user; null if none 14724 * or it should be resolved to the intent's title. 14725 * @param folder Folder in which to place the bookmark; null if none. 14726 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 14727 * this is non-zero and there is an existing bookmark entry 14728 * with this same shortcut, then that existing shortcut is 14729 * cleared (the bookmark is not removed). 14730 * @return The unique content URL for the new bookmark entry. 14731 */ 14732 @UnsupportedAppUsage add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)14733 public static Uri add(ContentResolver cr, 14734 Intent intent, 14735 String title, 14736 String folder, 14737 char shortcut, 14738 int ordering) 14739 { 14740 // If a shortcut is supplied, and it is already defined for 14741 // another bookmark, then remove the old definition. 14742 if (shortcut != 0) { 14743 cr.delete(CONTENT_URI, sShortcutSelection, 14744 new String[] { String.valueOf((int) shortcut) }); 14745 } 14746 14747 ContentValues values = new ContentValues(); 14748 if (title != null) values.put(TITLE, title); 14749 if (folder != null) values.put(FOLDER, folder); 14750 values.put(INTENT, intent.toUri(0)); 14751 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 14752 values.put(ORDERING, ordering); 14753 return cr.insert(CONTENT_URI, values); 14754 } 14755 14756 /** 14757 * Return the folder name as it should be displayed to the user. This 14758 * takes care of localizing special folders. 14759 * 14760 * @param r Resources object for current locale; only need access to 14761 * system resources. 14762 * @param folder The value found in the {@link #FOLDER} column. 14763 * 14764 * @return CharSequence The label for this folder that should be shown 14765 * to the user. 14766 */ getLabelForFolder(Resources r, String folder)14767 public static CharSequence getLabelForFolder(Resources r, String folder) { 14768 return folder; 14769 } 14770 14771 /** 14772 * Return the title as it should be displayed to the user. This takes 14773 * care of localizing bookmarks that point to activities. 14774 * 14775 * @param context A context. 14776 * @param cursor A cursor pointing to the row whose title should be 14777 * returned. The cursor must contain at least the {@link #TITLE} 14778 * and {@link #INTENT} columns. 14779 * @return A title that is localized and can be displayed to the user, 14780 * or the empty string if one could not be found. 14781 */ getTitle(Context context, Cursor cursor)14782 public static CharSequence getTitle(Context context, Cursor cursor) { 14783 int titleColumn = cursor.getColumnIndex(TITLE); 14784 int intentColumn = cursor.getColumnIndex(INTENT); 14785 if (titleColumn == -1 || intentColumn == -1) { 14786 throw new IllegalArgumentException( 14787 "The cursor must contain the TITLE and INTENT columns."); 14788 } 14789 14790 String title = cursor.getString(titleColumn); 14791 if (!TextUtils.isEmpty(title)) { 14792 return title; 14793 } 14794 14795 String intentUri = cursor.getString(intentColumn); 14796 if (TextUtils.isEmpty(intentUri)) { 14797 return ""; 14798 } 14799 14800 Intent intent; 14801 try { 14802 intent = Intent.parseUri(intentUri, 0); 14803 } catch (URISyntaxException e) { 14804 return ""; 14805 } 14806 14807 PackageManager packageManager = context.getPackageManager(); 14808 ResolveInfo info = packageManager.resolveActivity(intent, 0); 14809 return info != null ? info.loadLabel(packageManager) : ""; 14810 } 14811 } 14812 14813 /** 14814 * <p> 14815 * A Settings panel is floating UI that contains a fixed subset of settings to address a 14816 * particular user problem. For example, the 14817 * {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to 14818 * connecting to the internet. 14819 * <p> 14820 * Settings panels appear above the calling app to address the problem without 14821 * the user needing to open Settings and thus leave their current screen. 14822 */ 14823 public static final class Panel { Panel()14824 private Panel() { 14825 } 14826 14827 /** 14828 * Activity Action: Show a settings dialog containing settings to enable internet 14829 * connection. 14830 * <p> 14831 * Input: Nothing. 14832 * <p> 14833 * Output: Nothing. 14834 */ 14835 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 14836 public static final String ACTION_INTERNET_CONNECTIVITY = 14837 "android.settings.panel.action.INTERNET_CONNECTIVITY"; 14838 14839 /** 14840 * Activity Action: Show a settings dialog containing NFC-related settings. 14841 * <p> 14842 * Input: Nothing. 14843 * <p> 14844 * Output: Nothing. 14845 */ 14846 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 14847 public static final String ACTION_NFC = 14848 "android.settings.panel.action.NFC"; 14849 14850 /** 14851 * Activity Action: Show a settings dialog containing controls for Wifi. 14852 * <p> 14853 * Input: Nothing. 14854 * <p> 14855 * Output: Nothing. 14856 */ 14857 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 14858 public static final String ACTION_WIFI = 14859 "android.settings.panel.action.WIFI"; 14860 14861 /** 14862 * Activity Action: Show a settings dialog containing all volume streams. 14863 * <p> 14864 * Input: Nothing. 14865 * <p> 14866 * Output: Nothing. 14867 */ 14868 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 14869 public static final String ACTION_VOLUME = 14870 "android.settings.panel.action.VOLUME"; 14871 } 14872 14873 /** 14874 * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's 14875 * saved network list. The app should send a new intent with an extra that holds a maximum 14876 * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the 14877 * networks to be added to the user's database. The Intent should be sent via the 14878 * {@link android.app.Activity#startActivityForResult(Intent, int)} API. 14879 * <p> 14880 * Note: The app sending the Intent to add the credentials doesn't get any ownership over the 14881 * newly added network(s). For the Wi-Fi stack, these networks will look like the user 14882 * manually added them from the Settings UI. 14883 * <p> 14884 * Input: The app should put parcelable array list of 14885 * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST} 14886 * extra. 14887 * <p> 14888 * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the 14889 * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a 14890 * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save 14891 * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate 14892 * that the user rejected the request. Additionally, an integer array list, stored in 14893 * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network. 14894 */ 14895 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 14896 public static final String ACTION_WIFI_ADD_NETWORKS = 14897 "android.settings.WIFI_ADD_NETWORKS"; 14898 14899 /** 14900 * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list 14901 * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the 14902 * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five. 14903 * <p> 14904 * For example: 14905 * To provide credentials for one open and one WPA2 networks: 14906 * 14907 * <pre>{@code 14908 * final WifiNetworkSuggestion suggestion1 = 14909 * new WifiNetworkSuggestion.Builder() 14910 * .setSsid("test111111") 14911 * .build(); 14912 * final WifiNetworkSuggestion suggestion2 = 14913 * new WifiNetworkSuggestion.Builder() 14914 * .setSsid("test222222") 14915 * .setWpa2Passphrase("test123456") 14916 * .build(); 14917 * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>; 14918 * suggestionsList.add(suggestion1); 14919 * suggestionsList.add(suggestion2); 14920 * Bundle bundle = new Bundle(); 14921 * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends 14922 * Parcelable>) suggestionsList); 14923 * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS); 14924 * intent.putExtras(bundle); 14925 * startActivityForResult(intent, 0); 14926 * }</pre> 14927 */ 14928 public static final String EXTRA_WIFI_NETWORK_LIST = 14929 "android.provider.extra.WIFI_NETWORK_LIST"; 14930 14931 /** 14932 * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that 14933 * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}. 14934 * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements 14935 * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks 14936 * request, then its value will be null. 14937 * <p> 14938 * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS}, 14939 * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}. 14940 */ 14941 public static final String EXTRA_WIFI_NETWORK_RESULT_LIST = 14942 "android.provider.extra.WIFI_NETWORK_RESULT_LIST"; 14943 14944 /** @hide */ 14945 @Retention(RetentionPolicy.SOURCE) 14946 @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = { 14947 ADD_WIFI_RESULT_SUCCESS, 14948 ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED, 14949 ADD_WIFI_RESULT_ALREADY_EXISTS 14950 }) 14951 public @interface AddWifiResult { 14952 } 14953 14954 /** 14955 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the 14956 * corresponding Wi-Fi network was successful. 14957 */ 14958 public static final int ADD_WIFI_RESULT_SUCCESS = 0; 14959 14960 /** 14961 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding 14962 * Wi-Fi network failed. 14963 */ 14964 public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1; 14965 14966 /** 14967 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network 14968 * already exists. 14969 */ 14970 public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2; 14971 14972 /** 14973 * Activity Action: Allows user to select current bug report handler. 14974 * <p> 14975 * Input: Nothing. 14976 * <p> 14977 * Output: Nothing. 14978 * 14979 * @hide 14980 */ 14981 @SystemApi 14982 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 14983 public static final String ACTION_BUGREPORT_HANDLER_SETTINGS = 14984 "android.settings.BUGREPORT_HANDLER_SETTINGS"; 14985 14986 private static final String[] PM_WRITE_SETTINGS = { 14987 android.Manifest.permission.WRITE_SETTINGS 14988 }; 14989 private static final String[] PM_CHANGE_NETWORK_STATE = { 14990 android.Manifest.permission.CHANGE_NETWORK_STATE, 14991 android.Manifest.permission.WRITE_SETTINGS 14992 }; 14993 private static final String[] PM_SYSTEM_ALERT_WINDOW = { 14994 android.Manifest.permission.SYSTEM_ALERT_WINDOW 14995 }; 14996 14997 /** 14998 * Activity Action: Show screen for controlling which apps have access to manage external 14999 * storage. 15000 * <p> 15001 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 15002 * <p> 15003 * If you want to control a specific app's access to manage external storage, use 15004 * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead. 15005 * <p> 15006 * Output: Nothing. 15007 * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION 15008 */ 15009 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 15010 public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION = 15011 "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION"; 15012 15013 /** 15014 * Activity Action: Show screen for controlling if the app specified in the data URI of the 15015 * intent can manage external storage. 15016 * <p> 15017 * Launching the corresponding activity requires the permission 15018 * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}. 15019 * <p> 15020 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 15021 * <p> 15022 * Input: The Intent's data URI MUST specify the application package name whose ability of 15023 * managing external storage you want to control. 15024 * For example "package:com.my.app". 15025 * <p> 15026 * Output: Nothing. 15027 * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION 15028 */ 15029 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 15030 public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION = 15031 "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"; 15032 15033 /** 15034 * Performs a strict and comprehensive check of whether a calling package is allowed to 15035 * write/modify system settings, as the condition differs for pre-M, M+, and 15036 * privileged/preinstalled apps. If the provided uid does not match the 15037 * callingPackage, a negative result will be returned. 15038 * @hide 15039 */ 15040 @UnsupportedAppUsage isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)15041 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, 15042 String callingPackage, boolean throwException) { 15043 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 15044 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 15045 PM_WRITE_SETTINGS, false); 15046 } 15047 15048 /** 15049 * Performs a strict and comprehensive check of whether a calling package is allowed to 15050 * write/modify system settings, as the condition differs for pre-M, M+, and 15051 * privileged/preinstalled apps. If the provided uid does not match the 15052 * callingPackage, a negative result will be returned. The caller is expected to have 15053 * the WRITE_SETTINGS permission declared. 15054 * 15055 * Note: if the check is successful, the operation of this app will be updated to the 15056 * current time. 15057 * @hide 15058 */ 15059 @SystemApi checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)15060 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, 15061 @NonNull String callingPackage, boolean throwException) { 15062 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 15063 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 15064 PM_WRITE_SETTINGS, true); 15065 } 15066 15067 /** 15068 * Performs a strict and comprehensive check of whether a calling package is allowed to 15069 * change the state of network, as the condition differs for pre-M, M+, and 15070 * privileged/preinstalled apps. The caller is expected to have either the 15071 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these 15072 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and 15073 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal 15074 * permission and cannot be revoked. See http://b/23597341 15075 * 15076 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation 15077 * of this app will be updated to the current time. 15078 * @hide 15079 */ checkAndNoteChangeNetworkStateOperation(Context context, int uid, String callingPackage, boolean throwException)15080 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, 15081 String callingPackage, boolean throwException) { 15082 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) 15083 == PackageManager.PERMISSION_GRANTED) { 15084 return true; 15085 } 15086 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 15087 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 15088 PM_CHANGE_NETWORK_STATE, true); 15089 } 15090 15091 /** 15092 * Performs a strict and comprehensive check of whether a calling package is allowed to 15093 * draw on top of other apps, as the conditions differs for pre-M, M+, and 15094 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 15095 * a negative result will be returned. 15096 * @hide 15097 */ 15098 @UnsupportedAppUsage isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)15099 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, 15100 String callingPackage, boolean throwException) { 15101 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 15102 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 15103 PM_SYSTEM_ALERT_WINDOW, false); 15104 } 15105 15106 /** 15107 * Performs a strict and comprehensive check of whether a calling package is allowed to 15108 * draw on top of other apps, as the conditions differs for pre-M, M+, and 15109 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 15110 * a negative result will be returned. 15111 * 15112 * Note: if the check is successful, the operation of this app will be updated to the 15113 * current time. 15114 * @hide 15115 */ checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, boolean throwException)15116 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String 15117 callingPackage, boolean throwException) { 15118 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 15119 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 15120 PM_SYSTEM_ALERT_WINDOW, true); 15121 } 15122 15123 /** 15124 * Helper method to perform a general and comprehensive check of whether an operation that is 15125 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and 15126 * OP_WRITE_SETTINGS 15127 * @hide 15128 */ 15129 @UnsupportedAppUsage isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)15130 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 15131 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] 15132 permissions, boolean makeNote) { 15133 if (callingPackage == null) { 15134 return false; 15135 } 15136 15137 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); 15138 int mode = AppOpsManager.MODE_DEFAULT; 15139 if (makeNote) { 15140 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); 15141 } else { 15142 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); 15143 } 15144 15145 switch (mode) { 15146 case AppOpsManager.MODE_ALLOWED: 15147 return true; 15148 15149 case AppOpsManager.MODE_DEFAULT: 15150 // this is the default operating mode after an app's installation 15151 // In this case we will check all associated static permission to see 15152 // if it is granted during install time. 15153 for (String permission : permissions) { 15154 if (context.checkCallingOrSelfPermission(permission) == PackageManager 15155 .PERMISSION_GRANTED) { 15156 // if either of the permissions are granted, we will allow it 15157 return true; 15158 } 15159 } 15160 15161 default: 15162 // this is for all other cases trickled down here... 15163 if (!throwException) { 15164 return false; 15165 } 15166 } 15167 15168 // prepare string to throw SecurityException 15169 StringBuilder exceptionMessage = new StringBuilder(); 15170 exceptionMessage.append(callingPackage); 15171 exceptionMessage.append(" was not granted "); 15172 if (permissions.length > 1) { 15173 exceptionMessage.append(" either of these permissions: "); 15174 } else { 15175 exceptionMessage.append(" this permission: "); 15176 } 15177 for (int i = 0; i < permissions.length; i++) { 15178 exceptionMessage.append(permissions[i]); 15179 exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); 15180 } 15181 15182 throw new SecurityException(exceptionMessage.toString()); 15183 } 15184 15185 /** 15186 * Retrieves a correponding package name for a given uid. It will query all 15187 * packages that are associated with the given uid, but it will return only 15188 * the zeroth result. 15189 * Note: If package could not be found, a null is returned. 15190 * @hide 15191 */ getPackageNameForUid(Context context, int uid)15192 public static String getPackageNameForUid(Context context, int uid) { 15193 String[] packages = context.getPackageManager().getPackagesForUid(uid); 15194 if (packages == null) { 15195 return null; 15196 } 15197 return packages[0]; 15198 } 15199 } 15200