Settings.java revision 8255c2d6c27363daa8bd92f7fcb3302682b9950a
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 17package android.provider; 18 19import static android.provider.SettingsValidators.ANY_INTEGER_VALIDATOR; 20import static android.provider.SettingsValidators.ANY_STRING_VALIDATOR; 21import static android.provider.SettingsValidators.BOOLEAN_VALIDATOR; 22import static android.provider.SettingsValidators.COMPONENT_NAME_VALIDATOR; 23import static android.provider.SettingsValidators.LENIENT_IP_ADDRESS_VALIDATOR; 24import static android.provider.SettingsValidators.LOCALE_VALIDATOR; 25import static android.provider.SettingsValidators.NON_NEGATIVE_INTEGER_VALIDATOR; 26import static android.provider.SettingsValidators.PACKAGE_NAME_VALIDATOR; 27import static android.provider.SettingsValidators.URI_VALIDATOR; 28 29import android.Manifest; 30import android.annotation.IntDef; 31import android.annotation.IntRange; 32import android.annotation.NonNull; 33import android.annotation.Nullable; 34import android.annotation.RequiresPermission; 35import android.annotation.SdkConstant; 36import android.annotation.SdkConstant.SdkConstantType; 37import android.annotation.SystemApi; 38import android.annotation.TestApi; 39import android.annotation.UserIdInt; 40import android.app.ActivityThread; 41import android.app.AppOpsManager; 42import android.app.Application; 43import android.app.NotificationChannel; 44import android.app.NotificationManager; 45import android.app.SearchManager; 46import android.app.WallpaperManager; 47import android.content.ComponentName; 48import android.content.ContentResolver; 49import android.content.ContentValues; 50import android.content.Context; 51import android.content.IContentProvider; 52import android.content.Intent; 53import android.content.pm.ActivityInfo; 54import android.content.pm.PackageManager; 55import android.content.pm.ResolveInfo; 56import android.content.res.Configuration; 57import android.content.res.Resources; 58import android.database.Cursor; 59import android.database.SQLException; 60import android.location.LocationManager; 61import android.media.AudioFormat; 62import android.net.ConnectivityManager; 63import android.net.NetworkScoreManager; 64import android.net.Uri; 65import android.net.wifi.WifiManager; 66import android.os.BatteryManager; 67import android.os.Binder; 68import android.os.Build.VERSION_CODES; 69import android.os.Bundle; 70import android.os.DropBoxManager; 71import android.os.IBinder; 72import android.os.LocaleList; 73import android.os.Process; 74import android.os.RemoteException; 75import android.os.ResultReceiver; 76import android.os.ServiceManager; 77import android.os.UserHandle; 78import android.provider.SettingsValidators.Validator; 79import android.speech.tts.TextToSpeech; 80import android.telephony.SubscriptionManager; 81import android.text.TextUtils; 82import android.util.AndroidException; 83import android.util.ArrayMap; 84import android.util.ArraySet; 85import android.util.Log; 86import android.util.MemoryIntArray; 87import android.view.textservice.TextServicesManager; 88 89import com.android.internal.annotations.GuardedBy; 90import com.android.internal.app.ColorDisplayController; 91import com.android.internal.widget.ILockSettings; 92 93import java.io.IOException; 94import java.lang.annotation.Retention; 95import java.lang.annotation.RetentionPolicy; 96import java.net.URISyntaxException; 97import java.text.SimpleDateFormat; 98import java.util.HashMap; 99import java.util.HashSet; 100import java.util.Locale; 101import java.util.Map; 102import java.util.Set; 103 104/** 105 * The Settings provider contains global system-level device preferences. 106 */ 107public final class Settings { 108 109 // Intent actions for Settings 110 111 /** 112 * Activity Action: Show system settings. 113 * <p> 114 * Input: Nothing. 115 * <p> 116 * Output: Nothing. 117 */ 118 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 119 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 120 121 /** 122 * Activity Action: Show settings to allow configuration of APNs. 123 * <p> 124 * Input: Nothing. 125 * <p> 126 * Output: Nothing. 127 * 128 * <p class="note"> 129 * In some cases, a matching Activity may not exist, so ensure you 130 * safeguard against this. 131 */ 132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 133 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 134 135 /** 136 * Activity Action: Show settings to allow configuration of current location 137 * sources. 138 * <p> 139 * In some cases, a matching Activity may not exist, so ensure you 140 * safeguard against this. 141 * <p> 142 * Input: Nothing. 143 * <p> 144 * Output: Nothing. 145 */ 146 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 147 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 148 "android.settings.LOCATION_SOURCE_SETTINGS"; 149 150 /** 151 * Activity Action: Show scanning settings to allow configuration of Wi-Fi 152 * and Bluetooth scanning settings. 153 * <p> 154 * In some cases, a matching Activity may not exist, so ensure you 155 * safeguard against this. 156 * <p> 157 * Input: Nothing. 158 * <p> 159 * Output: Nothing. 160 * @hide 161 */ 162 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 163 public static final String ACTION_LOCATION_SCANNING_SETTINGS = 164 "android.settings.LOCATION_SCANNING_SETTINGS"; 165 166 /** 167 * Activity Action: Show settings to allow configuration of users. 168 * <p> 169 * In some cases, a matching Activity may not exist, so ensure you 170 * safeguard against this. 171 * <p> 172 * Input: Nothing. 173 * <p> 174 * Output: Nothing. 175 * @hide 176 */ 177 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 178 public static final String ACTION_USER_SETTINGS = 179 "android.settings.USER_SETTINGS"; 180 181 /** 182 * Activity Action: Show settings to allow configuration of wireless controls 183 * such as Wi-Fi, Bluetooth and Mobile networks. 184 * <p> 185 * In some cases, a matching Activity may not exist, so ensure you 186 * safeguard against this. 187 * <p> 188 * Input: Nothing. 189 * <p> 190 * Output: Nothing. 191 */ 192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 193 public static final String ACTION_WIRELESS_SETTINGS = 194 "android.settings.WIRELESS_SETTINGS"; 195 196 /** 197 * Activity Action: Show tether provisioning activity. 198 * 199 * <p> 200 * In some cases, a matching Activity may not exist, so ensure you 201 * safeguard against this. 202 * <p> 203 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type 204 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should 205 * contain a {@link ResultReceiver} which will be called back with a tether result code. 206 * <p> 207 * Output: The result of the provisioning check. 208 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, 209 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. 210 * 211 * @hide 212 */ 213 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 214 public static final String ACTION_TETHER_PROVISIONING = 215 "android.settings.TETHER_PROVISIONING_UI"; 216 217 /** 218 * Activity Action: Show settings to allow entering/exiting airplane mode. 219 * <p> 220 * In some cases, a matching Activity may not exist, so ensure you 221 * safeguard against this. 222 * <p> 223 * Input: Nothing. 224 * <p> 225 * Output: Nothing. 226 */ 227 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 228 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 229 "android.settings.AIRPLANE_MODE_SETTINGS"; 230 231 /** 232 * Activity Action: Show mobile data usage list. 233 * <p> 234 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify 235 * how and what mobile data statistics should be collected. 236 * <p> 237 * Output: Nothing 238 * @hide 239 */ 240 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 241 public static final String ACTION_MOBILE_DATA_USAGE = 242 "android.settings.MOBILE_DATA_USAGE"; 243 244 /** @hide */ 245 public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; 246 247 /** 248 * An int extra specifying a subscription ID. 249 * 250 * @see android.telephony.SubscriptionInfo#getSubscriptionId 251 */ 252 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; 253 254 /** 255 * Activity Action: Modify Airplane mode settings using a voice command. 256 * <p> 257 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 258 * <p> 259 * This intent MUST be started using 260 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 261 * startVoiceActivity}. 262 * <p> 263 * Note: The activity implementing this intent MUST verify that 264 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 265 * modifying the setting. 266 * <p> 267 * Input: To tell which state airplane mode should be set to, add the 268 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. 269 * If the extra is not included, no changes will be made. 270 * <p> 271 * Output: Nothing. 272 */ 273 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 274 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = 275 "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; 276 277 /** 278 * Activity Action: Show settings for accessibility modules. 279 * <p> 280 * In some cases, a matching Activity may not exist, so ensure you 281 * safeguard against this. 282 * <p> 283 * Input: Nothing. 284 * <p> 285 * Output: Nothing. 286 */ 287 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 288 public static final String ACTION_ACCESSIBILITY_SETTINGS = 289 "android.settings.ACCESSIBILITY_SETTINGS"; 290 291 /** 292 * Activity Action: Show settings to control access to usage information. 293 * <p> 294 * In some cases, a matching Activity may not exist, so ensure you 295 * safeguard against this. 296 * <p> 297 * Input: Nothing. 298 * <p> 299 * Output: Nothing. 300 */ 301 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 302 public static final String ACTION_USAGE_ACCESS_SETTINGS = 303 "android.settings.USAGE_ACCESS_SETTINGS"; 304 305 /** 306 * Activity Category: Show application settings related to usage access. 307 * <p> 308 * An activity that provides a user interface for adjusting usage access related 309 * preferences for its containing application. Optional but recommended for apps that 310 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. 311 * <p> 312 * The activity may define meta-data to describe what usage access is 313 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which 314 * will be displayed in Settings. 315 * <p> 316 * Input: Nothing. 317 * <p> 318 * Output: Nothing. 319 */ 320 @SdkConstant(SdkConstantType.INTENT_CATEGORY) 321 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = 322 "android.intent.category.USAGE_ACCESS_CONFIG"; 323 324 /** 325 * Metadata key: Reason for needing usage access. 326 * <p> 327 * A key for metadata attached to an activity that receives action 328 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the 329 * user as description of how the app uses usage access. 330 * <p> 331 */ 332 public static final String METADATA_USAGE_ACCESS_REASON = 333 "android.settings.metadata.USAGE_ACCESS_REASON"; 334 335 /** 336 * Activity Action: Show settings to allow configuration of security and 337 * location privacy. 338 * <p> 339 * In some cases, a matching Activity may not exist, so ensure you 340 * safeguard against this. 341 * <p> 342 * Input: Nothing. 343 * <p> 344 * Output: Nothing. 345 */ 346 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 347 public static final String ACTION_SECURITY_SETTINGS = 348 "android.settings.SECURITY_SETTINGS"; 349 350 /** 351 * Activity Action: Show settings to allow configuration of trusted external sources 352 * 353 * Input: Optionally, the Intent's data URI can specify the application package name to 354 * directly invoke the management GUI specific to the package name. For example 355 * "package:com.my.app". 356 * <p> 357 * Output: Nothing. 358 */ 359 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 360 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = 361 "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; 362 363 /** 364 * Activity Action: Show trusted credentials settings, opening to the user tab, 365 * to allow management of installed credentials. 366 * <p> 367 * In some cases, a matching Activity may not exist, so ensure you 368 * safeguard against this. 369 * <p> 370 * Input: Nothing. 371 * <p> 372 * Output: Nothing. 373 * @hide 374 */ 375 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 376 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 377 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 378 379 /** 380 * Activity Action: Show dialog explaining that an installed CA cert may enable 381 * monitoring of encrypted network traffic. 382 * <p> 383 * In some cases, a matching Activity may not exist, so ensure you 384 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the 385 * number of certificates. 386 * <p> 387 * Input: Nothing. 388 * <p> 389 * Output: Nothing. 390 * @hide 391 */ 392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 393 public static final String ACTION_MONITORING_CERT_INFO = 394 "com.android.settings.MONITORING_CERT_INFO"; 395 396 /** 397 * Activity Action: Show settings to allow configuration of privacy options. 398 * <p> 399 * In some cases, a matching Activity may not exist, so ensure you 400 * safeguard against this. 401 * <p> 402 * Input: Nothing. 403 * <p> 404 * Output: Nothing. 405 */ 406 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 407 public static final String ACTION_PRIVACY_SETTINGS = 408 "android.settings.PRIVACY_SETTINGS"; 409 410 /** 411 * Activity Action: Show settings to allow configuration of VPN. 412 * <p> 413 * In some cases, a matching Activity may not exist, so ensure you 414 * safeguard against this. 415 * <p> 416 * Input: Nothing. 417 * <p> 418 * Output: Nothing. 419 */ 420 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 421 public static final String ACTION_VPN_SETTINGS = 422 "android.settings.VPN_SETTINGS"; 423 424 /** 425 * Activity Action: Show settings to allow configuration of Wi-Fi. 426 * <p> 427 * In some cases, a matching Activity may not exist, so ensure you 428 * safeguard against this. 429 * <p> 430 * Input: Nothing. 431 * <p> 432 * Output: Nothing. 433 */ 434 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 435 public static final String ACTION_WIFI_SETTINGS = 436 "android.settings.WIFI_SETTINGS"; 437 438 /** 439 * Activity Action: Show settings to allow configuration of a static IP 440 * address for Wi-Fi. 441 * <p> 442 * In some cases, a matching Activity may not exist, so ensure you safeguard 443 * against this. 444 * <p> 445 * Input: Nothing. 446 * <p> 447 * Output: Nothing. 448 */ 449 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 450 public static final String ACTION_WIFI_IP_SETTINGS = 451 "android.settings.WIFI_IP_SETTINGS"; 452 453 /** 454 * Activity Action: Show settings to allow configuration of data and view data usage. 455 * <p> 456 * In some cases, a matching Activity may not exist, so ensure you 457 * safeguard against this. 458 * <p> 459 * Input: Nothing. 460 * <p> 461 * Output: Nothing. 462 */ 463 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 464 public static final String ACTION_DATA_USAGE_SETTINGS = 465 "android.settings.DATA_USAGE_SETTINGS"; 466 467 /** 468 * Activity Action: Show settings to allow configuration of Bluetooth. 469 * <p> 470 * In some cases, a matching Activity may not exist, so ensure you 471 * safeguard against this. 472 * <p> 473 * Input: Nothing. 474 * <p> 475 * Output: Nothing. 476 */ 477 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 478 public static final String ACTION_BLUETOOTH_SETTINGS = 479 "android.settings.BLUETOOTH_SETTINGS"; 480 481 /** 482 * Activity Action: Show settings to allow configuration of Assist Gesture. 483 * <p> 484 * In some cases, a matching Activity may not exist, so ensure you 485 * safeguard against this. 486 * <p> 487 * Input: Nothing. 488 * <p> 489 * Output: Nothing. 490 * @hide 491 */ 492 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 493 public static final String ACTION_ASSIST_GESTURE_SETTINGS = 494 "android.settings.ASSIST_GESTURE_SETTINGS"; 495 496 /** 497 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if 498 * necessary. 499 * <p> 500 * Input: Nothing. 501 * <p> 502 * Output: Nothing. 503 */ 504 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 505 public static final String ACTION_FINGERPRINT_ENROLL = 506 "android.settings.FINGERPRINT_ENROLL"; 507 508 /** 509 * Activity Action: Show settings to allow configuration of cast endpoints. 510 * <p> 511 * In some cases, a matching Activity may not exist, so ensure you 512 * safeguard against this. 513 * <p> 514 * Input: Nothing. 515 * <p> 516 * Output: Nothing. 517 */ 518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 519 public static final String ACTION_CAST_SETTINGS = 520 "android.settings.CAST_SETTINGS"; 521 522 /** 523 * Activity Action: Show settings to allow configuration of date and time. 524 * <p> 525 * In some cases, a matching Activity may not exist, so ensure you 526 * safeguard against this. 527 * <p> 528 * Input: Nothing. 529 * <p> 530 * Output: Nothing. 531 */ 532 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 533 public static final String ACTION_DATE_SETTINGS = 534 "android.settings.DATE_SETTINGS"; 535 536 /** 537 * Activity Action: Show settings to allow configuration of sound and volume. 538 * <p> 539 * In some cases, a matching Activity may not exist, so ensure you 540 * safeguard against this. 541 * <p> 542 * Input: Nothing. 543 * <p> 544 * Output: Nothing. 545 */ 546 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 547 public static final String ACTION_SOUND_SETTINGS = 548 "android.settings.SOUND_SETTINGS"; 549 550 /** 551 * Activity Action: Show settings to allow configuration of display. 552 * <p> 553 * In some cases, a matching Activity may not exist, so ensure you 554 * safeguard against this. 555 * <p> 556 * Input: Nothing. 557 * <p> 558 * Output: Nothing. 559 */ 560 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 561 public static final String ACTION_DISPLAY_SETTINGS = 562 "android.settings.DISPLAY_SETTINGS"; 563 564 /** 565 * Activity Action: Show settings to allow configuration of Night display. 566 * <p> 567 * In some cases, a matching Activity may not exist, so ensure you 568 * safeguard against this. 569 * <p> 570 * Input: Nothing. 571 * <p> 572 * Output: Nothing. 573 */ 574 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 575 public static final String ACTION_NIGHT_DISPLAY_SETTINGS = 576 "android.settings.NIGHT_DISPLAY_SETTINGS"; 577 578 /** 579 * Activity Action: Show settings to allow configuration of locale. 580 * <p> 581 * In some cases, a matching Activity may not exist, so ensure you 582 * safeguard against this. 583 * <p> 584 * Input: Nothing. 585 * <p> 586 * Output: Nothing. 587 */ 588 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 589 public static final String ACTION_LOCALE_SETTINGS = 590 "android.settings.LOCALE_SETTINGS"; 591 592 /** 593 * Activity Action: Show settings to configure input methods, in particular 594 * allowing the user to enable input methods. 595 * <p> 596 * In some cases, a matching Activity may not exist, so ensure you 597 * safeguard against this. 598 * <p> 599 * Input: Nothing. 600 * <p> 601 * Output: Nothing. 602 */ 603 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 604 public static final String ACTION_VOICE_INPUT_SETTINGS = 605 "android.settings.VOICE_INPUT_SETTINGS"; 606 607 /** 608 * Activity Action: Show settings to configure input methods, in particular 609 * allowing the user to enable input methods. 610 * <p> 611 * In some cases, a matching Activity may not exist, so ensure you 612 * safeguard against this. 613 * <p> 614 * Input: Nothing. 615 * <p> 616 * Output: Nothing. 617 */ 618 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 619 public static final String ACTION_INPUT_METHOD_SETTINGS = 620 "android.settings.INPUT_METHOD_SETTINGS"; 621 622 /** 623 * Activity Action: Show settings to enable/disable input method subtypes. 624 * <p> 625 * In some cases, a matching Activity may not exist, so ensure you 626 * safeguard against this. 627 * <p> 628 * To tell which input method's subtypes are displayed in the settings, add 629 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 630 * If there is no extra in this Intent, subtypes from all installed input methods 631 * will be displayed in the settings. 632 * 633 * @see android.view.inputmethod.InputMethodInfo#getId 634 * <p> 635 * Input: Nothing. 636 * <p> 637 * Output: Nothing. 638 */ 639 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 640 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 641 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 642 643 /** 644 * Activity Action: Show settings to manage the user input dictionary. 645 * <p> 646 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 647 * it is guaranteed there will always be an appropriate implementation for this Intent action. 648 * In prior releases of the platform this was optional, so ensure you safeguard against it. 649 * <p> 650 * Input: Nothing. 651 * <p> 652 * Output: Nothing. 653 */ 654 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 655 public static final String ACTION_USER_DICTIONARY_SETTINGS = 656 "android.settings.USER_DICTIONARY_SETTINGS"; 657 658 /** 659 * Activity Action: Show settings to configure the hardware keyboard. 660 * <p> 661 * In some cases, a matching Activity may not exist, so ensure you 662 * safeguard against this. 663 * <p> 664 * Input: Nothing. 665 * <p> 666 * Output: Nothing. 667 */ 668 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 669 public static final String ACTION_HARD_KEYBOARD_SETTINGS = 670 "android.settings.HARD_KEYBOARD_SETTINGS"; 671 672 /** 673 * Activity Action: Adds a word to the user dictionary. 674 * <p> 675 * In some cases, a matching Activity may not exist, so ensure you 676 * safeguard against this. 677 * <p> 678 * Input: An extra with key <code>word</code> that contains the word 679 * that should be added to the dictionary. 680 * <p> 681 * Output: Nothing. 682 * 683 * @hide 684 */ 685 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 686 public static final String ACTION_USER_DICTIONARY_INSERT = 687 "com.android.settings.USER_DICTIONARY_INSERT"; 688 689 /** 690 * Activity Action: Show settings to allow configuration of application-related settings. 691 * <p> 692 * In some cases, a matching Activity may not exist, so ensure you 693 * safeguard against this. 694 * <p> 695 * Input: Nothing. 696 * <p> 697 * Output: Nothing. 698 */ 699 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 700 public static final String ACTION_APPLICATION_SETTINGS = 701 "android.settings.APPLICATION_SETTINGS"; 702 703 /** 704 * Activity Action: Show settings to allow configuration of application 705 * development-related settings. As of 706 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 707 * a required part of the platform. 708 * <p> 709 * Input: Nothing. 710 * <p> 711 * Output: Nothing. 712 */ 713 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 714 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 715 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 716 717 /** 718 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 719 * <p> 720 * In some cases, a matching Activity may not exist, so ensure you 721 * safeguard against this. 722 * <p> 723 * Input: Nothing. 724 * <p> 725 * Output: Nothing. 726 */ 727 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 728 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 729 "android.settings.QUICK_LAUNCH_SETTINGS"; 730 731 /** 732 * Activity Action: Show settings to manage installed applications. 733 * <p> 734 * In some cases, a matching Activity may not exist, so ensure you 735 * safeguard against this. 736 * <p> 737 * Input: Nothing. 738 * <p> 739 * Output: Nothing. 740 */ 741 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 742 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 743 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 744 745 /** 746 * Activity Action: Show settings to manage all applications. 747 * <p> 748 * In some cases, a matching Activity may not exist, so ensure you 749 * safeguard against this. 750 * <p> 751 * Input: Nothing. 752 * <p> 753 * Output: Nothing. 754 */ 755 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 756 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 757 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 758 759 /** 760 * Activity Action: Show screen for controlling which apps can draw on top of other apps. 761 * <p> 762 * In some cases, a matching Activity may not exist, so ensure you 763 * safeguard against this. 764 * <p> 765 * Input: Optionally, the Intent's data URI can specify the application package name to 766 * directly invoke the management GUI specific to the package name. For example 767 * "package:com.my.app". 768 * <p> 769 * Output: Nothing. 770 */ 771 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 772 public static final String ACTION_MANAGE_OVERLAY_PERMISSION = 773 "android.settings.action.MANAGE_OVERLAY_PERMISSION"; 774 775 /** 776 * Activity Action: Show screen for controlling which apps are allowed to write/modify 777 * system settings. 778 * <p> 779 * In some cases, a matching Activity may not exist, so ensure you 780 * safeguard against this. 781 * <p> 782 * Input: Optionally, the Intent's data URI can specify the application package name to 783 * directly invoke the management GUI specific to the package name. For example 784 * "package:com.my.app". 785 * <p> 786 * Output: Nothing. 787 */ 788 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 789 public static final String ACTION_MANAGE_WRITE_SETTINGS = 790 "android.settings.action.MANAGE_WRITE_SETTINGS"; 791 792 /** 793 * Activity Action: Show screen of details about a particular application. 794 * <p> 795 * In some cases, a matching Activity may not exist, so ensure you 796 * safeguard against this. 797 * <p> 798 * Input: The Intent's data URI specifies the application package name 799 * to be shown, with the "package" scheme. That is "package:com.my.app". 800 * <p> 801 * Output: Nothing. 802 */ 803 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 804 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 805 "android.settings.APPLICATION_DETAILS_SETTINGS"; 806 807 /** 808 * Activity Action: Show the "Open by Default" page in a particular application's details page. 809 * <p> 810 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 811 * <p> 812 * Input: The Intent's data URI specifies the application package name 813 * to be shown, with the "package" scheme. That is "package:com.my.app". 814 * <p> 815 * Output: Nothing. 816 * @hide 817 */ 818 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 819 public static final String ACTION_APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE = 820 "android.settings.APPLICATION_DETAILS_SETTINGS_OPEN_BY_DEFAULT_PAGE"; 821 822 /** 823 * Activity Action: Show list of applications that have been running 824 * foreground services (to the user "running in the background"). 825 * <p> 826 * Input: Extras "packages" is a string array of package names. 827 * <p> 828 * Output: Nothing. 829 * @hide 830 */ 831 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 832 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = 833 "android.settings.FOREGROUND_SERVICES_SETTINGS"; 834 835 /** 836 * Activity Action: Show screen for controlling which apps can ignore battery optimizations. 837 * <p> 838 * Input: Nothing. 839 * <p> 840 * Output: Nothing. 841 * <p> 842 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 843 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 844 * already ignoring optimizations. You can use 845 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you 846 * on this list. 847 */ 848 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 849 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 850 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; 851 852 /** 853 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, 854 * put them on the whitelist of apps shown by 855 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also 856 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} 857 * permission. 858 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities 859 * provided by the platform for applications to operate correctly in the various power 860 * saving modes. This is only for unusual applications that need to deeply control their own 861 * execution, at the potential expense of the user's battery life. Note that these applications 862 * greatly run the risk of showing to the user as high power consumers on their device.</p> 863 * <p> 864 * Input: The Intent's data URI must specify the application package name 865 * to be shown, with the "package" scheme. That is "package:com.my.app". 866 * <p> 867 * Output: Nothing. 868 * <p> 869 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 870 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 871 * already ignoring optimizations. 872 */ 873 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 874 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 875 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; 876 877 /** 878 * Activity Action: Show screen for controlling background data 879 * restrictions for a particular application. 880 * <p> 881 * Input: Intent's data URI set with an application name, using the 882 * "package" schema (like "package:com.my.app"). 883 * 884 * <p> 885 * Output: Nothing. 886 * <p> 887 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus 888 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the 889 * status of the background data restrictions for them. 890 * 891 * <p class="note"> 892 * In some cases, a matching Activity may not exist, so ensure you 893 * safeguard against this. 894 */ 895 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 896 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 897 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; 898 899 /** 900 * @hide 901 * Activity Action: Show the "app ops" settings screen. 902 * <p> 903 * Input: Nothing. 904 * <p> 905 * Output: Nothing. 906 */ 907 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 908 public static final String ACTION_APP_OPS_SETTINGS = 909 "android.settings.APP_OPS_SETTINGS"; 910 911 /** 912 * Activity Action: Show settings for system update functionality. 913 * <p> 914 * In some cases, a matching Activity may not exist, so ensure you 915 * safeguard against this. 916 * <p> 917 * Input: Nothing. 918 * <p> 919 * Output: Nothing. 920 * 921 * @hide 922 */ 923 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 924 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 925 "android.settings.SYSTEM_UPDATE_SETTINGS"; 926 927 /** 928 * Activity Action: Show settings for managed profile settings. 929 * <p> 930 * In some cases, a matching Activity may not exist, so ensure you 931 * safeguard against this. 932 * <p> 933 * Input: Nothing. 934 * <p> 935 * Output: Nothing. 936 * 937 * @hide 938 */ 939 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 940 public static final String ACTION_MANAGED_PROFILE_SETTINGS = 941 "android.settings.MANAGED_PROFILE_SETTINGS"; 942 943 /** 944 * Activity Action: Show settings to allow configuration of sync settings. 945 * <p> 946 * In some cases, a matching Activity may not exist, so ensure you 947 * safeguard against this. 948 * <p> 949 * The account types available to add via the add account button may be restricted by adding an 950 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 951 * authorities. Only account types which can sync with that content provider will be offered to 952 * the user. 953 * <p> 954 * Input: Nothing. 955 * <p> 956 * Output: Nothing. 957 */ 958 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 959 public static final String ACTION_SYNC_SETTINGS = 960 "android.settings.SYNC_SETTINGS"; 961 962 /** 963 * Activity Action: Show add account screen for creating a new account. 964 * <p> 965 * In some cases, a matching Activity may not exist, so ensure you 966 * safeguard against this. 967 * <p> 968 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 969 * extra to the Intent with one or more syncable content provider's authorities. Only account 970 * types which can sync with that content provider will be offered to the user. 971 * <p> 972 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 973 * Intent with one or more account types. 974 * <p> 975 * Input: Nothing. 976 * <p> 977 * Output: Nothing. 978 */ 979 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 980 public static final String ACTION_ADD_ACCOUNT = 981 "android.settings.ADD_ACCOUNT_SETTINGS"; 982 983 /** 984 * Activity Action: Show settings for selecting the network operator. 985 * <p> 986 * In some cases, a matching Activity may not exist, so ensure you 987 * safeguard against this. 988 * <p> 989 * The subscription ID of the subscription for which available network operators should be 990 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. 991 * <p> 992 * Input: Nothing. 993 * <p> 994 * Output: Nothing. 995 */ 996 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 997 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 998 "android.settings.NETWORK_OPERATOR_SETTINGS"; 999 1000 /** 1001 * Activity Action: Show settings for selection of 2G/3G. 1002 * <p> 1003 * In some cases, a matching Activity may not exist, so ensure you 1004 * safeguard against this. 1005 * <p> 1006 * Input: Nothing. 1007 * <p> 1008 * Output: Nothing. 1009 */ 1010 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1011 public static final String ACTION_DATA_ROAMING_SETTINGS = 1012 "android.settings.DATA_ROAMING_SETTINGS"; 1013 1014 /** 1015 * Activity Action: Show settings for internal storage. 1016 * <p> 1017 * In some cases, a matching Activity may not exist, so ensure you 1018 * safeguard against this. 1019 * <p> 1020 * Input: Nothing. 1021 * <p> 1022 * Output: Nothing. 1023 */ 1024 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1025 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 1026 "android.settings.INTERNAL_STORAGE_SETTINGS"; 1027 /** 1028 * Activity Action: Show settings for memory card storage. 1029 * <p> 1030 * In some cases, a matching Activity may not exist, so ensure you 1031 * safeguard against this. 1032 * <p> 1033 * Input: Nothing. 1034 * <p> 1035 * Output: Nothing. 1036 */ 1037 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1038 public static final String ACTION_MEMORY_CARD_SETTINGS = 1039 "android.settings.MEMORY_CARD_SETTINGS"; 1040 1041 /** 1042 * Activity Action: Show settings for global search. 1043 * <p> 1044 * In some cases, a matching Activity may not exist, so ensure you 1045 * safeguard against this. 1046 * <p> 1047 * Input: Nothing. 1048 * <p> 1049 * Output: Nothing 1050 */ 1051 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1052 public static final String ACTION_SEARCH_SETTINGS = 1053 "android.search.action.SEARCH_SETTINGS"; 1054 1055 /** 1056 * Activity Action: Show general device information settings (serial 1057 * number, software version, phone number, etc.). 1058 * <p> 1059 * In some cases, a matching Activity may not exist, so ensure you 1060 * safeguard against this. 1061 * <p> 1062 * Input: Nothing. 1063 * <p> 1064 * Output: Nothing 1065 */ 1066 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1067 public static final String ACTION_DEVICE_INFO_SETTINGS = 1068 "android.settings.DEVICE_INFO_SETTINGS"; 1069 1070 /** 1071 * Activity Action: Show NFC settings. 1072 * <p> 1073 * This shows UI that allows NFC to be turned on or off. 1074 * <p> 1075 * In some cases, a matching Activity may not exist, so ensure you 1076 * safeguard against this. 1077 * <p> 1078 * Input: Nothing. 1079 * <p> 1080 * Output: Nothing 1081 * @see android.nfc.NfcAdapter#isEnabled() 1082 */ 1083 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1084 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 1085 1086 /** 1087 * Activity Action: Show NFC Sharing settings. 1088 * <p> 1089 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 1090 * off. 1091 * <p> 1092 * In some cases, a matching Activity may not exist, so ensure you 1093 * safeguard against this. 1094 * <p> 1095 * Input: Nothing. 1096 * <p> 1097 * Output: Nothing 1098 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 1099 */ 1100 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1101 public static final String ACTION_NFCSHARING_SETTINGS = 1102 "android.settings.NFCSHARING_SETTINGS"; 1103 1104 /** 1105 * Activity Action: Show NFC Tap & Pay settings 1106 * <p> 1107 * This shows UI that allows the user to configure Tap&Pay 1108 * settings. 1109 * <p> 1110 * In some cases, a matching Activity may not exist, so ensure you 1111 * safeguard against this. 1112 * <p> 1113 * Input: Nothing. 1114 * <p> 1115 * Output: Nothing 1116 */ 1117 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1118 public static final String ACTION_NFC_PAYMENT_SETTINGS = 1119 "android.settings.NFC_PAYMENT_SETTINGS"; 1120 1121 /** 1122 * Activity Action: Show Daydream settings. 1123 * <p> 1124 * In some cases, a matching Activity may not exist, so ensure you 1125 * safeguard against this. 1126 * <p> 1127 * Input: Nothing. 1128 * <p> 1129 * Output: Nothing. 1130 * @see android.service.dreams.DreamService 1131 */ 1132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1133 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 1134 1135 /** 1136 * Activity Action: Show Notification listener settings. 1137 * <p> 1138 * In some cases, a matching Activity may not exist, so ensure you 1139 * safeguard against this. 1140 * <p> 1141 * Input: Nothing. 1142 * <p> 1143 * Output: Nothing. 1144 * @see android.service.notification.NotificationListenerService 1145 */ 1146 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1147 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 1148 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 1149 1150 /** 1151 * Activity Action: Show Do Not Disturb access settings. 1152 * <p> 1153 * Users can grant and deny access to Do Not Disturb configuration from here. 1154 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1155 * details. 1156 * <p> 1157 * Input: Nothing. 1158 * <p> 1159 * Output: Nothing. 1160 * 1161 * <p class="note"> 1162 * In some cases, a matching Activity may not exist, so ensure you 1163 * safeguard against this. 1164 */ 1165 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1166 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS 1167 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; 1168 1169 /** 1170 * @hide 1171 */ 1172 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1173 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 1174 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 1175 1176 /** 1177 * Activity Action: Show settings for video captioning. 1178 * <p> 1179 * In some cases, a matching Activity may not exist, so ensure you safeguard 1180 * against this. 1181 * <p> 1182 * Input: Nothing. 1183 * <p> 1184 * Output: Nothing. 1185 */ 1186 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1187 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 1188 1189 /** 1190 * Activity Action: Show the top level print settings. 1191 * <p> 1192 * In some cases, a matching Activity may not exist, so ensure you 1193 * safeguard against this. 1194 * <p> 1195 * Input: Nothing. 1196 * <p> 1197 * Output: Nothing. 1198 */ 1199 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1200 public static final String ACTION_PRINT_SETTINGS = 1201 "android.settings.ACTION_PRINT_SETTINGS"; 1202 1203 /** 1204 * Activity Action: Show Zen Mode configuration settings. 1205 * 1206 * @hide 1207 */ 1208 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1209 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 1210 1211 /** 1212 * Activity Action: Show Zen Mode visual effects configuration settings. 1213 * 1214 * @hide 1215 */ 1216 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1217 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS = 1218 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS"; 1219 1220 /** 1221 * Activity Action: Show Zen Mode onboarding activity. 1222 * 1223 * @hide 1224 */ 1225 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1226 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING"; 1227 1228 /** 1229 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. 1230 */ 1231 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1232 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS 1233 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; 1234 1235 /** 1236 * Activity Action: Show Zen Mode automation configuration settings. 1237 * 1238 * @hide 1239 */ 1240 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1241 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS 1242 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; 1243 1244 /** 1245 * Activity Action: Modify do not disturb mode settings. 1246 * <p> 1247 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1248 * <p> 1249 * This intent MUST be started using 1250 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1251 * startVoiceActivity}. 1252 * <p> 1253 * Note: The Activity implementing this intent MUST verify that 1254 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. 1255 * returns true before modifying the setting. 1256 * <p> 1257 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate 1258 * how long the user wishes to avoid interruptions for. The optional 1259 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is 1260 * enabling or disabling do not disturb mode. If either extra is not included, the 1261 * user maybe asked to provide the value. 1262 * <p> 1263 * Output: Nothing. 1264 */ 1265 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1266 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 1267 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; 1268 1269 /** 1270 * Activity Action: Show Zen Mode schedule rule configuration settings. 1271 * 1272 * @hide 1273 */ 1274 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1275 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS 1276 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; 1277 1278 /** 1279 * Activity Action: Show Zen Mode event rule configuration settings. 1280 * 1281 * @hide 1282 */ 1283 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1284 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS 1285 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; 1286 1287 /** 1288 * Activity Action: Show Zen Mode external rule configuration settings. 1289 * 1290 * @hide 1291 */ 1292 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1293 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS 1294 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; 1295 1296 /** 1297 * Activity Action: Show the regulatory information screen for the device. 1298 * <p> 1299 * In some cases, a matching Activity may not exist, so ensure you safeguard 1300 * against this. 1301 * <p> 1302 * Input: Nothing. 1303 * <p> 1304 * Output: Nothing. 1305 */ 1306 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1307 public static final String 1308 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 1309 1310 /** 1311 * Activity Action: Show Device Name Settings. 1312 * <p> 1313 * In some cases, a matching Activity may not exist, so ensure you safeguard 1314 * against this. 1315 * 1316 * @hide 1317 */ 1318 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1319 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 1320 1321 /** 1322 * Activity Action: Show pairing settings. 1323 * <p> 1324 * In some cases, a matching Activity may not exist, so ensure you safeguard 1325 * against this. 1326 * 1327 * @hide 1328 */ 1329 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1330 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 1331 1332 /** 1333 * Activity Action: Show battery saver settings. 1334 * <p> 1335 * In some cases, a matching Activity may not exist, so ensure you safeguard 1336 * against this. 1337 */ 1338 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1339 public static final String ACTION_BATTERY_SAVER_SETTINGS 1340 = "android.settings.BATTERY_SAVER_SETTINGS"; 1341 1342 /** 1343 * Activity Action: Modify Battery Saver mode setting using a voice command. 1344 * <p> 1345 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1346 * <p> 1347 * This intent MUST be started using 1348 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1349 * startVoiceActivity}. 1350 * <p> 1351 * Note: The activity implementing this intent MUST verify that 1352 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 1353 * modifying the setting. 1354 * <p> 1355 * Input: To tell which state batter saver mode should be set to, add the 1356 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. 1357 * If the extra is not included, no changes will be made. 1358 * <p> 1359 * Output: Nothing. 1360 */ 1361 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1362 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 1363 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; 1364 1365 /** 1366 * Activity Action: Show Home selection settings. If there are multiple activities 1367 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 1368 * to pick your preferred activity. 1369 */ 1370 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1371 public static final String ACTION_HOME_SETTINGS 1372 = "android.settings.HOME_SETTINGS"; 1373 1374 /** 1375 * Activity Action: Show Default apps settings. 1376 * <p> 1377 * In some cases, a matching Activity may not exist, so ensure you 1378 * safeguard against this. 1379 * <p> 1380 * Input: Nothing. 1381 * <p> 1382 * Output: Nothing. 1383 */ 1384 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1385 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS 1386 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; 1387 1388 /** 1389 * Activity Action: Show notification settings. 1390 * 1391 * @hide 1392 */ 1393 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1394 public static final String ACTION_NOTIFICATION_SETTINGS 1395 = "android.settings.NOTIFICATION_SETTINGS"; 1396 1397 /** 1398 * Activity Action: Show app listing settings, filtered by those that send notifications. 1399 * 1400 * @hide 1401 */ 1402 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1403 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = 1404 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; 1405 1406 /** 1407 * Activity Action: Show notification settings for a single app. 1408 * <p> 1409 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1410 * <p> 1411 * Output: Nothing. 1412 */ 1413 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1414 public static final String ACTION_APP_NOTIFICATION_SETTINGS 1415 = "android.settings.APP_NOTIFICATION_SETTINGS"; 1416 1417 /** 1418 * Activity Action: Show notification settings for a single {@link NotificationChannel}. 1419 * <p> 1420 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1421 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. 1422 * <p> 1423 * Output: Nothing. 1424 */ 1425 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1426 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS 1427 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; 1428 1429 /** 1430 * Activity Extra: The package owner of the notification channel settings to display. 1431 * <p> 1432 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1433 */ 1434 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; 1435 1436 /** 1437 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings 1438 * to display. 1439 * <p> 1440 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1441 */ 1442 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; 1443 1444 /** 1445 * Activity Action: Show notification redaction settings. 1446 * 1447 * @hide 1448 */ 1449 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1450 public static final String ACTION_APP_NOTIFICATION_REDACTION 1451 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; 1452 1453 /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; 1454 1455 /** 1456 * Activity Action: Show a dialog with disabled by policy message. 1457 * <p> If an user action is disabled by policy, this dialog can be triggered to let 1458 * the user know about this. 1459 * <p> 1460 * Input: Nothing. 1461 * <p> 1462 * Output: Nothing. 1463 * 1464 * @hide 1465 */ 1466 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1467 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS 1468 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; 1469 1470 /** 1471 * Activity Action: Show a dialog for remote bugreport flow. 1472 * <p> 1473 * Input: Nothing. 1474 * <p> 1475 * Output: Nothing. 1476 * 1477 * @hide 1478 */ 1479 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1480 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG 1481 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; 1482 1483 /** 1484 * Activity Action: Show VR listener settings. 1485 * <p> 1486 * Input: Nothing. 1487 * <p> 1488 * Output: Nothing. 1489 * 1490 * @see android.service.vr.VrListenerService 1491 */ 1492 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1493 public static final String ACTION_VR_LISTENER_SETTINGS 1494 = "android.settings.VR_LISTENER_SETTINGS"; 1495 1496 /** 1497 * Activity Action: Show Picture-in-picture settings. 1498 * <p> 1499 * Input: Nothing. 1500 * <p> 1501 * Output: Nothing. 1502 * 1503 * @hide 1504 */ 1505 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1506 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS 1507 = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; 1508 1509 /** 1510 * Activity Action: Show Storage Manager settings. 1511 * <p> 1512 * Input: Nothing. 1513 * <p> 1514 * Output: Nothing. 1515 * 1516 * @hide 1517 */ 1518 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1519 public static final String ACTION_STORAGE_MANAGER_SETTINGS 1520 = "android.settings.STORAGE_MANAGER_SETTINGS"; 1521 1522 /** 1523 * Activity Action: Allows user to select current webview implementation. 1524 * <p> 1525 * Input: Nothing. 1526 * <p> 1527 * Output: Nothing. 1528 */ 1529 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1530 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; 1531 1532 /** 1533 * Activity Action: Show enterprise privacy section. 1534 * <p> 1535 * Input: Nothing. 1536 * <p> 1537 * Output: Nothing. 1538 * @hide 1539 */ 1540 @SystemApi 1541 @TestApi 1542 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1543 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS 1544 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; 1545 1546 /** 1547 * Activity Action: Show screen that let user select its Autofill Service. 1548 * <p> 1549 * Input: Intent's data URI set with an application name, using the 1550 * "package" schema (like "package:com.my.app"). 1551 * 1552 * <p> 1553 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging 1554 * to the caller package. 1555 * 1556 * <p> 1557 * <b>NOTE: </b> Applications should call 1558 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and 1559 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action 1560 * to start an activity if they return {@code false} and {@code true} respectively. 1561 */ 1562 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1563 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = 1564 "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; 1565 1566 /** 1567 * Activity Action: Show screen for controlling which apps have access on volume directories. 1568 * <p> 1569 * Input: Nothing. 1570 * <p> 1571 * Output: Nothing. 1572 * <p> 1573 * Applications typically use this action to ask the user to revert the "Do not ask again" 1574 * status of directory access requests made by 1575 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. 1576 */ 1577 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1578 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = 1579 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; 1580 1581 // End of Intent actions for Settings 1582 1583 /** 1584 * @hide - Private call() method on SettingsProvider to read from 'system' table. 1585 */ 1586 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 1587 1588 /** 1589 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 1590 */ 1591 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 1592 1593 /** 1594 * @hide - Private call() method on SettingsProvider to read from 'global' table. 1595 */ 1596 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 1597 1598 /** 1599 * @hide - Specifies that the caller of the fast-path call()-based flow tracks 1600 * the settings generation in order to cache values locally. If this key is 1601 * mapped to a <code>null</code> string extra in the request bundle, the response 1602 * bundle will contain the same key mapped to a parcelable extra which would be 1603 * an {@link android.util.MemoryIntArray}. The response will also contain an 1604 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the 1605 * index in the array clients should use to lookup the generation. For efficiency 1606 * the caller should request the generation tracking memory array only if it 1607 * doesn't already have it. 1608 * 1609 * @see #CALL_METHOD_GENERATION_INDEX_KEY 1610 */ 1611 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; 1612 1613 /** 1614 * @hide Key with the location in the {@link android.util.MemoryIntArray} where 1615 * to look up the generation id of the backing table. The value is an integer. 1616 * 1617 * @see #CALL_METHOD_TRACK_GENERATION_KEY 1618 */ 1619 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; 1620 1621 /** 1622 * @hide Key with the settings table generation. The value is an integer. 1623 * 1624 * @see #CALL_METHOD_TRACK_GENERATION_KEY 1625 */ 1626 public static final String CALL_METHOD_GENERATION_KEY = "_generation"; 1627 1628 /** 1629 * @hide - User handle argument extra to the fast-path call()-based requests 1630 */ 1631 public static final String CALL_METHOD_USER_KEY = "_user"; 1632 1633 /** 1634 * @hide - Boolean argument extra to the fast-path call()-based requests 1635 */ 1636 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; 1637 1638 /** 1639 * @hide - User handle argument extra to the fast-path call()-based requests 1640 */ 1641 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; 1642 1643 /** 1644 * @hide - String argument extra to the fast-path call()-based requests 1645 */ 1646 public static final String CALL_METHOD_TAG_KEY = "_tag"; 1647 1648 /** @hide - Private call() method to write to 'system' table */ 1649 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 1650 1651 /** @hide - Private call() method to write to 'secure' table */ 1652 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 1653 1654 /** @hide - Private call() method to write to 'global' table */ 1655 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 1656 1657 /** @hide - Private call() method to reset to defaults the 'global' table */ 1658 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; 1659 1660 /** @hide - Private call() method to reset to defaults the 'secure' table */ 1661 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; 1662 1663 /** 1664 * Activity Extra: Limit available options in launched activity based on the given authority. 1665 * <p> 1666 * This can be passed as an extra field in an Activity Intent with one or more syncable content 1667 * provider's authorities as a String[]. This field is used by some intents to alter the 1668 * behavior of the called activity. 1669 * <p> 1670 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 1671 * on the authority given. 1672 */ 1673 public static final String EXTRA_AUTHORITIES = "authorities"; 1674 1675 /** 1676 * Activity Extra: Limit available options in launched activity based on the given account 1677 * types. 1678 * <p> 1679 * This can be passed as an extra field in an Activity Intent with one or more account types 1680 * as a String[]. This field is used by some intents to alter the behavior of the called 1681 * activity. 1682 * <p> 1683 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 1684 * list. 1685 */ 1686 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 1687 1688 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 1689 1690 /** 1691 * Activity Extra: The device identifier to act upon. 1692 * <p> 1693 * This can be passed as an extra field in an Activity Intent with a single 1694 * InputDeviceIdentifier. This field is used by some activities to jump straight into the 1695 * settings for the given device. 1696 * <p> 1697 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout 1698 * dialog for the given device. 1699 * @hide 1700 */ 1701 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; 1702 1703 /** 1704 * Activity Extra: Enable or disable Airplane Mode. 1705 * <p> 1706 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} 1707 * intent as a boolean to indicate if it should be enabled. 1708 */ 1709 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; 1710 1711 /** 1712 * Activity Extra: Enable or disable Battery saver mode. 1713 * <p> 1714 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} 1715 * intent as a boolean to indicate if it should be enabled. 1716 */ 1717 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = 1718 "android.settings.extra.battery_saver_mode_enabled"; 1719 1720 /** 1721 * Activity Extra: Enable or disable Do Not Disturb mode. 1722 * <p> 1723 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 1724 * intent as a boolean to indicate if it should be enabled. 1725 */ 1726 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = 1727 "android.settings.extra.do_not_disturb_mode_enabled"; 1728 1729 /** 1730 * Activity Extra: How many minutes to enable do not disturb mode for. 1731 * <p> 1732 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 1733 * intent to indicate how long do not disturb mode should be enabled for. 1734 */ 1735 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = 1736 "android.settings.extra.do_not_disturb_mode_minutes"; 1737 1738 /** 1739 * Reset mode: reset to defaults only settings changed by the 1740 * calling package. If there is a default set the setting 1741 * will be set to it, otherwise the setting will be deleted. 1742 * This is the only type of reset available to non-system clients. 1743 * @hide 1744 */ 1745 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; 1746 1747 /** 1748 * Reset mode: reset all settings set by untrusted packages, which is 1749 * packages that aren't a part of the system, to the current defaults. 1750 * If there is a default set the setting will be set to it, otherwise 1751 * the setting will be deleted. This mode is only available to the system. 1752 * @hide 1753 */ 1754 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; 1755 1756 /** 1757 * Reset mode: delete all settings set by untrusted packages, which is 1758 * packages that aren't a part of the system. If a setting is set by an 1759 * untrusted package it will be deleted if its default is not provided 1760 * by the system, otherwise the setting will be set to its default. 1761 * This mode is only available to the system. 1762 * @hide 1763 */ 1764 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; 1765 1766 /** 1767 * Reset mode: reset all settings to defaults specified by trusted 1768 * packages, which is packages that are a part of the system, and 1769 * delete all settings set by untrusted packages. If a setting has 1770 * a default set by a system package it will be set to the default, 1771 * otherwise the setting will be deleted. This mode is only available 1772 * to the system. 1773 * @hide 1774 */ 1775 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; 1776 1777 /** @hide */ 1778 @Retention(RetentionPolicy.SOURCE) 1779 @IntDef(prefix = { "RESET_MODE_" }, value = { 1780 RESET_MODE_PACKAGE_DEFAULTS, 1781 RESET_MODE_UNTRUSTED_DEFAULTS, 1782 RESET_MODE_UNTRUSTED_CHANGES, 1783 RESET_MODE_TRUSTED_DEFAULTS 1784 }) 1785 public @interface ResetMode{} 1786 1787 1788 /** 1789 * User has not started setup personalization. 1790 * @hide 1791 */ 1792 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; 1793 1794 /** 1795 * User has not yet completed setup personalization. 1796 * @hide 1797 */ 1798 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; 1799 1800 /** 1801 * User has snoozed personalization and will complete it later. 1802 * @hide 1803 */ 1804 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; 1805 1806 /** 1807 * User has completed setup personalization. 1808 * @hide 1809 */ 1810 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; 1811 1812 /** @hide */ 1813 @Retention(RetentionPolicy.SOURCE) 1814 @IntDef({ 1815 USER_SETUP_PERSONALIZATION_NOT_STARTED, 1816 USER_SETUP_PERSONALIZATION_STARTED, 1817 USER_SETUP_PERSONALIZATION_PAUSED, 1818 USER_SETUP_PERSONALIZATION_COMPLETE 1819 }) 1820 public @interface UserSetupPersonalization {} 1821 1822 /** 1823 * Activity Extra: Number of certificates 1824 * <p> 1825 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} 1826 * intent to indicate the number of certificates 1827 * @hide 1828 */ 1829 public static final String EXTRA_NUMBER_OF_CERTIFICATES = 1830 "android.settings.extra.number_of_certificates"; 1831 1832 private static final String JID_RESOURCE_PREFIX = "android"; 1833 1834 public static final String AUTHORITY = "settings"; 1835 1836 private static final String TAG = "Settings"; 1837 private static final boolean LOCAL_LOGV = false; 1838 1839 // Lock ensures that when enabling/disabling the master location switch, we don't end up 1840 // with a partial enable/disable state in multi-threaded situations. 1841 private static final Object mLocationSettingsLock = new Object(); 1842 1843 // Used in system server calling uid workaround in call() 1844 private static boolean sInSystemServer = false; 1845 private static final Object sInSystemServerLock = new Object(); 1846 1847 /** @hide */ 1848 public static void setInSystemServer() { 1849 synchronized (sInSystemServerLock) { 1850 sInSystemServer = true; 1851 } 1852 } 1853 1854 /** @hide */ 1855 public static boolean isInSystemServer() { 1856 synchronized (sInSystemServerLock) { 1857 return sInSystemServer; 1858 } 1859 } 1860 1861 public static class SettingNotFoundException extends AndroidException { 1862 public SettingNotFoundException(String msg) { 1863 super(msg); 1864 } 1865 } 1866 1867 /** 1868 * Common base for tables of name/value settings. 1869 */ 1870 public static class NameValueTable implements BaseColumns { 1871 public static final String NAME = "name"; 1872 public static final String VALUE = "value"; 1873 1874 protected static boolean putString(ContentResolver resolver, Uri uri, 1875 String name, String value) { 1876 // The database will take care of replacing duplicates. 1877 try { 1878 ContentValues values = new ContentValues(); 1879 values.put(NAME, name); 1880 values.put(VALUE, value); 1881 resolver.insert(uri, values); 1882 return true; 1883 } catch (SQLException e) { 1884 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 1885 return false; 1886 } 1887 } 1888 1889 public static Uri getUriFor(Uri uri, String name) { 1890 return Uri.withAppendedPath(uri, name); 1891 } 1892 } 1893 1894 private static final class GenerationTracker { 1895 private final MemoryIntArray mArray; 1896 private final Runnable mErrorHandler; 1897 private final int mIndex; 1898 private int mCurrentGeneration; 1899 1900 public GenerationTracker(@NonNull MemoryIntArray array, int index, 1901 int generation, Runnable errorHandler) { 1902 mArray = array; 1903 mIndex = index; 1904 mErrorHandler = errorHandler; 1905 mCurrentGeneration = generation; 1906 } 1907 1908 public boolean isGenerationChanged() { 1909 final int currentGeneration = readCurrentGeneration(); 1910 if (currentGeneration >= 0) { 1911 if (currentGeneration == mCurrentGeneration) { 1912 return false; 1913 } 1914 mCurrentGeneration = currentGeneration; 1915 } 1916 return true; 1917 } 1918 1919 public int getCurrentGeneration() { 1920 return mCurrentGeneration; 1921 } 1922 1923 private int readCurrentGeneration() { 1924 try { 1925 return mArray.get(mIndex); 1926 } catch (IOException e) { 1927 Log.e(TAG, "Error getting current generation", e); 1928 if (mErrorHandler != null) { 1929 mErrorHandler.run(); 1930 } 1931 } 1932 return -1; 1933 } 1934 1935 public void destroy() { 1936 try { 1937 mArray.close(); 1938 } catch (IOException e) { 1939 Log.e(TAG, "Error closing backing array", e); 1940 if (mErrorHandler != null) { 1941 mErrorHandler.run(); 1942 } 1943 } 1944 } 1945 } 1946 1947 private static final class ContentProviderHolder { 1948 private final Object mLock = new Object(); 1949 1950 @GuardedBy("mLock") 1951 private final Uri mUri; 1952 @GuardedBy("mLock") 1953 private IContentProvider mContentProvider; 1954 1955 public ContentProviderHolder(Uri uri) { 1956 mUri = uri; 1957 } 1958 1959 public IContentProvider getProvider(ContentResolver contentResolver) { 1960 synchronized (mLock) { 1961 if (mContentProvider == null) { 1962 mContentProvider = contentResolver 1963 .acquireProvider(mUri.getAuthority()); 1964 } 1965 return mContentProvider; 1966 } 1967 } 1968 1969 public void clearProviderForTest() { 1970 synchronized (mLock) { 1971 mContentProvider = null; 1972 } 1973 } 1974 } 1975 1976 // Thread-safe. 1977 private static class NameValueCache { 1978 private static final boolean DEBUG = false; 1979 1980 private static final String[] SELECT_VALUE_PROJECTION = new String[] { 1981 Settings.NameValueTable.VALUE 1982 }; 1983 1984 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 1985 1986 // Must synchronize on 'this' to access mValues and mValuesVersion. 1987 private final HashMap<String, String> mValues = new HashMap<>(); 1988 1989 private final Uri mUri; 1990 private final ContentProviderHolder mProviderHolder; 1991 1992 // The method we'll call (or null, to not use) on the provider 1993 // for the fast path of retrieving settings. 1994 private final String mCallGetCommand; 1995 private final String mCallSetCommand; 1996 1997 @GuardedBy("this") 1998 private GenerationTracker mGenerationTracker; 1999 2000 public NameValueCache(Uri uri, String getCommand, String setCommand, 2001 ContentProviderHolder providerHolder) { 2002 mUri = uri; 2003 mCallGetCommand = getCommand; 2004 mCallSetCommand = setCommand; 2005 mProviderHolder = providerHolder; 2006 } 2007 2008 public boolean putStringForUser(ContentResolver cr, String name, String value, 2009 String tag, boolean makeDefault, final int userHandle) { 2010 try { 2011 Bundle arg = new Bundle(); 2012 arg.putString(Settings.NameValueTable.VALUE, value); 2013 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 2014 if (tag != null) { 2015 arg.putString(CALL_METHOD_TAG_KEY, tag); 2016 } 2017 if (makeDefault) { 2018 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); 2019 } 2020 IContentProvider cp = mProviderHolder.getProvider(cr); 2021 cp.call(cr.getPackageName(), mCallSetCommand, name, arg); 2022 } catch (RemoteException e) { 2023 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 2024 return false; 2025 } 2026 return true; 2027 } 2028 2029 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 2030 final boolean isSelf = (userHandle == UserHandle.myUserId()); 2031 int currentGeneration = -1; 2032 if (isSelf) { 2033 synchronized (NameValueCache.this) { 2034 if (mGenerationTracker != null) { 2035 if (mGenerationTracker.isGenerationChanged()) { 2036 if (DEBUG) { 2037 Log.i(TAG, "Generation changed for type:" 2038 + mUri.getPath() + " in package:" 2039 + cr.getPackageName() +" and user:" + userHandle); 2040 } 2041 mValues.clear(); 2042 } else if (mValues.containsKey(name)) { 2043 return mValues.get(name); 2044 } 2045 if (mGenerationTracker != null) { 2046 currentGeneration = mGenerationTracker.getCurrentGeneration(); 2047 } 2048 } 2049 } 2050 } else { 2051 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 2052 + " by user " + UserHandle.myUserId() + " so skipping cache"); 2053 } 2054 2055 IContentProvider cp = mProviderHolder.getProvider(cr); 2056 2057 // Try the fast path first, not using query(). If this 2058 // fails (alternate Settings provider that doesn't support 2059 // this interface?) then we fall back to the query/table 2060 // interface. 2061 if (mCallGetCommand != null) { 2062 try { 2063 Bundle args = null; 2064 if (!isSelf) { 2065 args = new Bundle(); 2066 args.putInt(CALL_METHOD_USER_KEY, userHandle); 2067 } 2068 boolean needsGenerationTracker = false; 2069 synchronized (NameValueCache.this) { 2070 if (isSelf && mGenerationTracker == null) { 2071 needsGenerationTracker = true; 2072 if (args == null) { 2073 args = new Bundle(); 2074 } 2075 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 2076 if (DEBUG) { 2077 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() 2078 + " in package:" + cr.getPackageName() +" and user:" 2079 + userHandle); 2080 } 2081 } 2082 } 2083 Bundle b; 2084 // If we're in system server and in a binder transaction we need to clear the 2085 // calling uid. This works around code in system server that did not call 2086 // clearCallingIdentity, previously this wasn't needed because reading settings 2087 // did not do permission checking but thats no longer the case. 2088 // Long term this should be removed and callers should properly call 2089 // clearCallingIdentity or use a ContentResolver from the caller as needed. 2090 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2091 final long token = Binder.clearCallingIdentity(); 2092 try { 2093 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); 2094 } finally { 2095 Binder.restoreCallingIdentity(token); 2096 } 2097 } else { 2098 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); 2099 } 2100 if (b != null) { 2101 String value = b.getString(Settings.NameValueTable.VALUE); 2102 // Don't update our cache for reads of other users' data 2103 if (isSelf) { 2104 synchronized (NameValueCache.this) { 2105 if (needsGenerationTracker) { 2106 MemoryIntArray array = b.getParcelable( 2107 CALL_METHOD_TRACK_GENERATION_KEY); 2108 final int index = b.getInt( 2109 CALL_METHOD_GENERATION_INDEX_KEY, -1); 2110 if (array != null && index >= 0) { 2111 final int generation = b.getInt( 2112 CALL_METHOD_GENERATION_KEY, 0); 2113 if (DEBUG) { 2114 Log.i(TAG, "Received generation tracker for type:" 2115 + mUri.getPath() + " in package:" 2116 + cr.getPackageName() + " and user:" 2117 + userHandle + " with index:" + index); 2118 } 2119 if (mGenerationTracker != null) { 2120 mGenerationTracker.destroy(); 2121 } 2122 mGenerationTracker = new GenerationTracker(array, index, 2123 generation, () -> { 2124 synchronized (NameValueCache.this) { 2125 Log.e(TAG, "Error accessing generation" 2126 + " tracker - removing"); 2127 if (mGenerationTracker != null) { 2128 GenerationTracker generationTracker = 2129 mGenerationTracker; 2130 mGenerationTracker = null; 2131 generationTracker.destroy(); 2132 mValues.clear(); 2133 } 2134 } 2135 }); 2136 } 2137 } 2138 if (mGenerationTracker != null && currentGeneration == 2139 mGenerationTracker.getCurrentGeneration()) { 2140 mValues.put(name, value); 2141 } 2142 } 2143 } else { 2144 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 2145 + " by " + UserHandle.myUserId() 2146 + " so not updating cache"); 2147 } 2148 return value; 2149 } 2150 // If the response Bundle is null, we fall through 2151 // to the query interface below. 2152 } catch (RemoteException e) { 2153 // Not supported by the remote side? Fall through 2154 // to query(). 2155 } 2156 } 2157 2158 Cursor c = null; 2159 try { 2160 Bundle queryArgs = ContentResolver.createSqlQueryBundle( 2161 NAME_EQ_PLACEHOLDER, new String[]{name}, null); 2162 // Same workaround as above. 2163 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2164 final long token = Binder.clearCallingIdentity(); 2165 try { 2166 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, 2167 null); 2168 } finally { 2169 Binder.restoreCallingIdentity(token); 2170 } 2171 } else { 2172 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, 2173 null); 2174 } 2175 if (c == null) { 2176 Log.w(TAG, "Can't get key " + name + " from " + mUri); 2177 return null; 2178 } 2179 2180 String value = c.moveToNext() ? c.getString(0) : null; 2181 synchronized (NameValueCache.this) { 2182 if(mGenerationTracker != null && 2183 currentGeneration == mGenerationTracker.getCurrentGeneration()) { 2184 mValues.put(name, value); 2185 } 2186 } 2187 if (LOCAL_LOGV) { 2188 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 2189 name + " = " + (value == null ? "(null)" : value)); 2190 } 2191 return value; 2192 } catch (RemoteException e) { 2193 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 2194 return null; // Return null, but don't cache it. 2195 } finally { 2196 if (c != null) c.close(); 2197 } 2198 } 2199 2200 public void clearGenerationTrackerForTest() { 2201 synchronized (NameValueCache.this) { 2202 if (mGenerationTracker != null) { 2203 mGenerationTracker.destroy(); 2204 } 2205 mValues.clear(); 2206 mGenerationTracker = null; 2207 } 2208 } 2209 } 2210 2211 /** 2212 * Checks if the specified context can draw on top of other apps. As of API 2213 * level 23, an app cannot draw on top of other apps unless it declares the 2214 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its 2215 * manifest, <em>and</em> the user specifically grants the app this 2216 * capability. To prompt the user to grant this approval, the app must send an 2217 * intent with the action 2218 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which 2219 * causes the system to display a permission management screen. 2220 * 2221 * @param context App context. 2222 * @return true if the specified context can draw on top of other apps, false otherwise 2223 */ 2224 public static boolean canDrawOverlays(Context context) { 2225 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), 2226 context.getOpPackageName(), false); 2227 } 2228 2229 /** 2230 * System settings, containing miscellaneous system preferences. This 2231 * table holds simple name/value pairs. There are convenience 2232 * functions for accessing individual settings entries. 2233 */ 2234 public static final class System extends NameValueTable { 2235 // NOTE: If you add new settings here, be sure to add them to 2236 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. 2237 2238 private static final float DEFAULT_FONT_SCALE = 1.0f; 2239 2240 /** 2241 * The content:// style URL for this table 2242 */ 2243 public static final Uri CONTENT_URI = 2244 Uri.parse("content://" + AUTHORITY + "/system"); 2245 2246 private static final ContentProviderHolder sProviderHolder = 2247 new ContentProviderHolder(CONTENT_URI); 2248 2249 private static final NameValueCache sNameValueCache = new NameValueCache( 2250 CONTENT_URI, 2251 CALL_METHOD_GET_SYSTEM, 2252 CALL_METHOD_PUT_SYSTEM, 2253 sProviderHolder); 2254 2255 private static final HashSet<String> MOVED_TO_SECURE; 2256 static { 2257 MOVED_TO_SECURE = new HashSet<>(30); 2258 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 2259 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 2260 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 2261 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 2262 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 2263 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 2264 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 2265 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 2266 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 2267 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 2268 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 2269 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 2270 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 2271 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 2272 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 2273 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 2274 MOVED_TO_SECURE.add(Secure.WIFI_ON); 2275 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 2276 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 2277 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 2278 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 2279 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 2280 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 2281 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 2282 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 2283 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 2284 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 2285 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 2286 2287 // At one time in System, then Global, but now back in Secure 2288 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 2289 } 2290 2291 private static final HashSet<String> MOVED_TO_GLOBAL; 2292 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 2293 static { 2294 MOVED_TO_GLOBAL = new HashSet<>(); 2295 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); 2296 2297 // these were originally in system but migrated to secure in the past, 2298 // so are duplicated in the Secure.* namespace 2299 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 2300 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 2301 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 2302 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 2303 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 2304 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 2305 2306 // these are moving directly from system to global 2307 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 2308 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 2309 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 2310 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 2311 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 2312 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 2313 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 2314 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 2315 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 2316 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 2317 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 2318 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 2319 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 2320 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 2321 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 2322 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 2323 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 2324 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 2325 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 2326 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 2327 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 2328 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 2329 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 2330 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 2331 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 2332 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 2333 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 2334 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 2335 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 2336 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 2337 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 2338 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 2339 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 2340 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 2341 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 2342 } 2343 2344 /** @hide */ 2345 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 2346 outKeySet.addAll(MOVED_TO_GLOBAL); 2347 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 2348 } 2349 2350 /** @hide */ 2351 public static void getMovedToSecureSettings(Set<String> outKeySet) { 2352 outKeySet.addAll(MOVED_TO_SECURE); 2353 } 2354 2355 /** @hide */ 2356 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 2357 outKeySet.addAll(MOVED_TO_GLOBAL); 2358 } 2359 2360 /** @hide */ 2361 public static void clearProviderForTest() { 2362 sProviderHolder.clearProviderForTest(); 2363 sNameValueCache.clearGenerationTrackerForTest(); 2364 } 2365 2366 /** 2367 * Look up a name in the database. 2368 * @param resolver to access the database with 2369 * @param name to look up in the table 2370 * @return the corresponding value, or null if not present 2371 */ 2372 public static String getString(ContentResolver resolver, String name) { 2373 return getStringForUser(resolver, name, resolver.getUserId()); 2374 } 2375 2376 /** @hide */ 2377 public static String getStringForUser(ContentResolver resolver, String name, 2378 int userHandle) { 2379 if (MOVED_TO_SECURE.contains(name)) { 2380 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2381 + " to android.provider.Settings.Secure, returning read-only value."); 2382 return Secure.getStringForUser(resolver, name, userHandle); 2383 } 2384 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2385 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2386 + " to android.provider.Settings.Global, returning read-only value."); 2387 return Global.getStringForUser(resolver, name, userHandle); 2388 } 2389 return sNameValueCache.getStringForUser(resolver, name, userHandle); 2390 } 2391 2392 /** 2393 * Store a name/value pair into the database. 2394 * @param resolver to access the database with 2395 * @param name to store 2396 * @param value to associate with the name 2397 * @return true if the value was set, false on database errors 2398 */ 2399 public static boolean putString(ContentResolver resolver, String name, String value) { 2400 return putStringForUser(resolver, name, value, resolver.getUserId()); 2401 } 2402 2403 /** @hide */ 2404 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 2405 int userHandle) { 2406 if (MOVED_TO_SECURE.contains(name)) { 2407 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2408 + " to android.provider.Settings.Secure, value is unchanged."); 2409 return false; 2410 } 2411 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2412 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2413 + " to android.provider.Settings.Global, value is unchanged."); 2414 return false; 2415 } 2416 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); 2417 } 2418 2419 /** 2420 * Construct the content URI for a particular name/value pair, 2421 * useful for monitoring changes with a ContentObserver. 2422 * @param name to look up in the table 2423 * @return the corresponding content URI, or null if not present 2424 */ 2425 public static Uri getUriFor(String name) { 2426 if (MOVED_TO_SECURE.contains(name)) { 2427 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2428 + " to android.provider.Settings.Secure, returning Secure URI."); 2429 return Secure.getUriFor(Secure.CONTENT_URI, name); 2430 } 2431 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2432 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2433 + " to android.provider.Settings.Global, returning read-only global URI."); 2434 return Global.getUriFor(Global.CONTENT_URI, name); 2435 } 2436 return getUriFor(CONTENT_URI, name); 2437 } 2438 2439 /** 2440 * Convenience function for retrieving a single system settings value 2441 * as an integer. Note that internally setting values are always 2442 * stored as strings; this function converts the string to an integer 2443 * for you. The default value will be returned if the setting is 2444 * not defined or not an integer. 2445 * 2446 * @param cr The ContentResolver to access. 2447 * @param name The name of the setting to retrieve. 2448 * @param def Value to return if the setting is not defined. 2449 * 2450 * @return The setting's current value, or 'def' if it is not defined 2451 * or not a valid integer. 2452 */ 2453 public static int getInt(ContentResolver cr, String name, int def) { 2454 return getIntForUser(cr, name, def, cr.getUserId()); 2455 } 2456 2457 /** @hide */ 2458 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 2459 String v = getStringForUser(cr, name, userHandle); 2460 try { 2461 return v != null ? Integer.parseInt(v) : def; 2462 } catch (NumberFormatException e) { 2463 return def; 2464 } 2465 } 2466 2467 /** 2468 * Convenience function for retrieving a single system settings value 2469 * as an integer. Note that internally setting values are always 2470 * stored as strings; this function converts the string to an integer 2471 * for you. 2472 * <p> 2473 * This version does not take a default value. If the setting has not 2474 * been set, or the string value is not a number, 2475 * it throws {@link SettingNotFoundException}. 2476 * 2477 * @param cr The ContentResolver to access. 2478 * @param name The name of the setting to retrieve. 2479 * 2480 * @throws SettingNotFoundException Thrown if a setting by the given 2481 * name can't be found or the setting value is not an integer. 2482 * 2483 * @return The setting's current value. 2484 */ 2485 public static int getInt(ContentResolver cr, String name) 2486 throws SettingNotFoundException { 2487 return getIntForUser(cr, name, cr.getUserId()); 2488 } 2489 2490 /** @hide */ 2491 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 2492 throws SettingNotFoundException { 2493 String v = getStringForUser(cr, name, userHandle); 2494 try { 2495 return Integer.parseInt(v); 2496 } catch (NumberFormatException e) { 2497 throw new SettingNotFoundException(name); 2498 } 2499 } 2500 2501 /** 2502 * Convenience function for updating a single settings value as an 2503 * integer. This will either create a new entry in the table if the 2504 * given name does not exist, or modify the value of the existing row 2505 * with that name. Note that internally setting values are always 2506 * stored as strings, so this function converts the given value to a 2507 * string before storing it. 2508 * 2509 * @param cr The ContentResolver to access. 2510 * @param name The name of the setting to modify. 2511 * @param value The new value for the setting. 2512 * @return true if the value was set, false on database errors 2513 */ 2514 public static boolean putInt(ContentResolver cr, String name, int value) { 2515 return putIntForUser(cr, name, value, cr.getUserId()); 2516 } 2517 2518 /** @hide */ 2519 public static boolean putIntForUser(ContentResolver cr, String name, int value, 2520 int userHandle) { 2521 return putStringForUser(cr, name, Integer.toString(value), userHandle); 2522 } 2523 2524 /** 2525 * Convenience function for retrieving a single system settings value 2526 * as a {@code long}. Note that internally setting values are always 2527 * stored as strings; this function converts the string to a {@code long} 2528 * for you. The default value will be returned if the setting is 2529 * not defined or not a {@code long}. 2530 * 2531 * @param cr The ContentResolver to access. 2532 * @param name The name of the setting to retrieve. 2533 * @param def Value to return if the setting is not defined. 2534 * 2535 * @return The setting's current value, or 'def' if it is not defined 2536 * or not a valid {@code long}. 2537 */ 2538 public static long getLong(ContentResolver cr, String name, long def) { 2539 return getLongForUser(cr, name, def, cr.getUserId()); 2540 } 2541 2542 /** @hide */ 2543 public static long getLongForUser(ContentResolver cr, String name, long def, 2544 int userHandle) { 2545 String valString = getStringForUser(cr, name, userHandle); 2546 long value; 2547 try { 2548 value = valString != null ? Long.parseLong(valString) : def; 2549 } catch (NumberFormatException e) { 2550 value = def; 2551 } 2552 return value; 2553 } 2554 2555 /** 2556 * Convenience function for retrieving a single system settings value 2557 * as a {@code long}. Note that internally setting values are always 2558 * stored as strings; this function converts the string to a {@code long} 2559 * for you. 2560 * <p> 2561 * This version does not take a default value. If the setting has not 2562 * been set, or the string value is not a number, 2563 * it throws {@link SettingNotFoundException}. 2564 * 2565 * @param cr The ContentResolver to access. 2566 * @param name The name of the setting to retrieve. 2567 * 2568 * @return The setting's current value. 2569 * @throws SettingNotFoundException Thrown if a setting by the given 2570 * name can't be found or the setting value is not an integer. 2571 */ 2572 public static long getLong(ContentResolver cr, String name) 2573 throws SettingNotFoundException { 2574 return getLongForUser(cr, name, cr.getUserId()); 2575 } 2576 2577 /** @hide */ 2578 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 2579 throws SettingNotFoundException { 2580 String valString = getStringForUser(cr, name, userHandle); 2581 try { 2582 return Long.parseLong(valString); 2583 } catch (NumberFormatException e) { 2584 throw new SettingNotFoundException(name); 2585 } 2586 } 2587 2588 /** 2589 * Convenience function for updating a single settings value as a long 2590 * integer. This will either create a new entry in the table if the 2591 * given name does not exist, or modify the value of the existing row 2592 * with that name. Note that internally setting values are always 2593 * stored as strings, so this function converts the given value to a 2594 * string before storing it. 2595 * 2596 * @param cr The ContentResolver to access. 2597 * @param name The name of the setting to modify. 2598 * @param value The new value for the setting. 2599 * @return true if the value was set, false on database errors 2600 */ 2601 public static boolean putLong(ContentResolver cr, String name, long value) { 2602 return putLongForUser(cr, name, value, cr.getUserId()); 2603 } 2604 2605 /** @hide */ 2606 public static boolean putLongForUser(ContentResolver cr, String name, long value, 2607 int userHandle) { 2608 return putStringForUser(cr, name, Long.toString(value), userHandle); 2609 } 2610 2611 /** 2612 * Convenience function for retrieving a single system settings value 2613 * as a floating point number. Note that internally setting values are 2614 * always stored as strings; this function converts the string to an 2615 * float for you. The default value will be returned if the setting 2616 * is not defined or not a valid float. 2617 * 2618 * @param cr The ContentResolver to access. 2619 * @param name The name of the setting to retrieve. 2620 * @param def Value to return if the setting is not defined. 2621 * 2622 * @return The setting's current value, or 'def' if it is not defined 2623 * or not a valid float. 2624 */ 2625 public static float getFloat(ContentResolver cr, String name, float def) { 2626 return getFloatForUser(cr, name, def, cr.getUserId()); 2627 } 2628 2629 /** @hide */ 2630 public static float getFloatForUser(ContentResolver cr, String name, float def, 2631 int userHandle) { 2632 String v = getStringForUser(cr, name, userHandle); 2633 try { 2634 return v != null ? Float.parseFloat(v) : def; 2635 } catch (NumberFormatException e) { 2636 return def; 2637 } 2638 } 2639 2640 /** 2641 * Convenience function for retrieving a single system settings value 2642 * as a float. Note that internally setting values are always 2643 * stored as strings; this function converts the string to a float 2644 * for you. 2645 * <p> 2646 * This version does not take a default value. If the setting has not 2647 * been set, or the string value is not a number, 2648 * it throws {@link SettingNotFoundException}. 2649 * 2650 * @param cr The ContentResolver to access. 2651 * @param name The name of the setting to retrieve. 2652 * 2653 * @throws SettingNotFoundException Thrown if a setting by the given 2654 * name can't be found or the setting value is not a float. 2655 * 2656 * @return The setting's current value. 2657 */ 2658 public static float getFloat(ContentResolver cr, String name) 2659 throws SettingNotFoundException { 2660 return getFloatForUser(cr, name, cr.getUserId()); 2661 } 2662 2663 /** @hide */ 2664 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 2665 throws SettingNotFoundException { 2666 String v = getStringForUser(cr, name, userHandle); 2667 if (v == null) { 2668 throw new SettingNotFoundException(name); 2669 } 2670 try { 2671 return Float.parseFloat(v); 2672 } catch (NumberFormatException e) { 2673 throw new SettingNotFoundException(name); 2674 } 2675 } 2676 2677 /** 2678 * Convenience function for updating a single settings value as a 2679 * floating point number. This will either create a new entry in the 2680 * table if the given name does not exist, or modify the value of the 2681 * existing row with that name. Note that internally setting values 2682 * are always stored as strings, so this function converts the given 2683 * value to a string before storing it. 2684 * 2685 * @param cr The ContentResolver to access. 2686 * @param name The name of the setting to modify. 2687 * @param value The new value for the setting. 2688 * @return true if the value was set, false on database errors 2689 */ 2690 public static boolean putFloat(ContentResolver cr, String name, float value) { 2691 return putFloatForUser(cr, name, value, cr.getUserId()); 2692 } 2693 2694 /** @hide */ 2695 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 2696 int userHandle) { 2697 return putStringForUser(cr, name, Float.toString(value), userHandle); 2698 } 2699 2700 /** 2701 * Convenience function to read all of the current 2702 * configuration-related settings into a 2703 * {@link Configuration} object. 2704 * 2705 * @param cr The ContentResolver to access. 2706 * @param outConfig Where to place the configuration settings. 2707 */ 2708 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 2709 adjustConfigurationForUser(cr, outConfig, cr.getUserId(), 2710 false /* updateSettingsIfEmpty */); 2711 } 2712 2713 /** @hide */ 2714 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, 2715 int userHandle, boolean updateSettingsIfEmpty) { 2716 outConfig.fontScale = Settings.System.getFloatForUser( 2717 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); 2718 if (outConfig.fontScale < 0) { 2719 outConfig.fontScale = DEFAULT_FONT_SCALE; 2720 } 2721 2722 final String localeValue = 2723 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); 2724 if (localeValue != null) { 2725 outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); 2726 } else { 2727 // Do not update configuration with emtpy settings since we need to take over the 2728 // locale list of previous user if the settings value is empty. This happens when a 2729 // new user is created. 2730 2731 if (updateSettingsIfEmpty) { 2732 // Make current configuration persistent. This is necessary the first time a 2733 // user log in. At the first login, the configuration settings are empty, so we 2734 // need to store the adjusted configuration as the initial settings. 2735 Settings.System.putStringForUser( 2736 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), 2737 userHandle); 2738 } 2739 } 2740 } 2741 2742 /** 2743 * @hide Erase the fields in the Configuration that should be applied 2744 * by the settings. 2745 */ 2746 public static void clearConfiguration(Configuration inoutConfig) { 2747 inoutConfig.fontScale = 0; 2748 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { 2749 inoutConfig.clearLocales(); 2750 } 2751 } 2752 2753 /** 2754 * Convenience function to write a batch of configuration-related 2755 * settings from a {@link Configuration} object. 2756 * 2757 * @param cr The ContentResolver to access. 2758 * @param config The settings to write. 2759 * @return true if the values were set, false on database errors 2760 */ 2761 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 2762 return putConfigurationForUser(cr, config, cr.getUserId()); 2763 } 2764 2765 /** @hide */ 2766 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 2767 int userHandle) { 2768 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && 2769 Settings.System.putStringForUser( 2770 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); 2771 } 2772 2773 /** @hide */ 2774 public static boolean hasInterestingConfigurationChanges(int changes) { 2775 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || 2776 (changes & ActivityInfo.CONFIG_LOCALE) != 0; 2777 } 2778 2779 /** @deprecated - Do not use */ 2780 @Deprecated 2781 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 2782 return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); 2783 } 2784 2785 /** 2786 * @hide 2787 * @deprecated - Do not use 2788 */ 2789 @Deprecated 2790 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 2791 int userHandle) { 2792 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 2793 } 2794 2795 /** @deprecated - Do not use */ 2796 @Deprecated 2797 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 2798 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); 2799 } 2800 2801 /** 2802 * @hide 2803 * @deprecated - Do not use 2804 */ 2805 @Deprecated 2806 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 2807 int userHandle) { 2808 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 2809 } 2810 2811 /** 2812 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 2813 */ 2814 @Deprecated 2815 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 2816 2817 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { 2818 @Override 2819 public boolean validate(String value) { 2820 try { 2821 int val = Integer.parseInt(value); 2822 return (val == 0) 2823 || (val == BatteryManager.BATTERY_PLUGGED_AC) 2824 || (val == BatteryManager.BATTERY_PLUGGED_USB) 2825 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) 2826 || (val == (BatteryManager.BATTERY_PLUGGED_AC 2827 | BatteryManager.BATTERY_PLUGGED_USB)) 2828 || (val == (BatteryManager.BATTERY_PLUGGED_AC 2829 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 2830 || (val == (BatteryManager.BATTERY_PLUGGED_USB 2831 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 2832 || (val == (BatteryManager.BATTERY_PLUGGED_AC 2833 | BatteryManager.BATTERY_PLUGGED_USB 2834 | BatteryManager.BATTERY_PLUGGED_WIRELESS)); 2835 } catch (NumberFormatException e) { 2836 return false; 2837 } 2838 } 2839 }; 2840 2841 /** 2842 * What happens when the user presses the end call button if they're not 2843 * on a call.<br/> 2844 * <b>Values:</b><br/> 2845 * 0 - The end button does nothing.<br/> 2846 * 1 - The end button goes to the home screen.<br/> 2847 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 2848 * 3 - The end button goes to the home screen. If the user is already on the 2849 * home screen, it puts the device to sleep. 2850 */ 2851 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 2852 2853 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = 2854 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); 2855 2856 /** 2857 * END_BUTTON_BEHAVIOR value for "go home". 2858 * @hide 2859 */ 2860 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 2861 2862 /** 2863 * END_BUTTON_BEHAVIOR value for "go to sleep". 2864 * @hide 2865 */ 2866 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 2867 2868 /** 2869 * END_BUTTON_BEHAVIOR default value. 2870 * @hide 2871 */ 2872 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 2873 2874 /** 2875 * Is advanced settings mode turned on. 0 == no, 1 == yes 2876 * @hide 2877 */ 2878 public static final String ADVANCED_SETTINGS = "advanced_settings"; 2879 2880 private static final Validator ADVANCED_SETTINGS_VALIDATOR = BOOLEAN_VALIDATOR; 2881 2882 /** 2883 * ADVANCED_SETTINGS default value. 2884 * @hide 2885 */ 2886 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 2887 2888 /** 2889 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 2890 */ 2891 @Deprecated 2892 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 2893 2894 /** 2895 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 2896 */ 2897 @Deprecated 2898 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 2899 2900 /** 2901 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 2902 */ 2903 @Deprecated 2904 public static final String RADIO_WIFI = Global.RADIO_WIFI; 2905 2906 /** 2907 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 2908 * {@hide} 2909 */ 2910 @Deprecated 2911 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 2912 2913 /** 2914 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 2915 */ 2916 @Deprecated 2917 public static final String RADIO_CELL = Global.RADIO_CELL; 2918 2919 /** 2920 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 2921 */ 2922 @Deprecated 2923 public static final String RADIO_NFC = Global.RADIO_NFC; 2924 2925 /** 2926 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 2927 */ 2928 @Deprecated 2929 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 2930 2931 /** 2932 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 2933 * 2934 * {@hide} 2935 */ 2936 @Deprecated 2937 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 2938 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 2939 2940 /** 2941 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 2942 */ 2943 @Deprecated 2944 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 2945 2946 /** 2947 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 2948 */ 2949 @Deprecated 2950 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 2951 2952 /** 2953 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 2954 */ 2955 @Deprecated 2956 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 2957 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 2958 2959 /** 2960 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 2961 */ 2962 @Deprecated 2963 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 2964 2965 /** 2966 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 2967 */ 2968 @Deprecated 2969 public static final String MODE_RINGER = Global.MODE_RINGER; 2970 2971 /** 2972 * Whether to use static IP and other static network attributes. 2973 * <p> 2974 * Set to 1 for true and 0 for false. 2975 * 2976 * @deprecated Use {@link WifiManager} instead 2977 */ 2978 @Deprecated 2979 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 2980 2981 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = BOOLEAN_VALIDATOR; 2982 2983 /** 2984 * The static IP address. 2985 * <p> 2986 * Example: "192.168.1.51" 2987 * 2988 * @deprecated Use {@link WifiManager} instead 2989 */ 2990 @Deprecated 2991 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 2992 2993 private static final Validator WIFI_STATIC_IP_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; 2994 2995 /** 2996 * If using static IP, the gateway's IP address. 2997 * <p> 2998 * Example: "192.168.1.1" 2999 * 3000 * @deprecated Use {@link WifiManager} instead 3001 */ 3002 @Deprecated 3003 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 3004 3005 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; 3006 3007 /** 3008 * If using static IP, the net mask. 3009 * <p> 3010 * Example: "255.255.255.0" 3011 * 3012 * @deprecated Use {@link WifiManager} instead 3013 */ 3014 @Deprecated 3015 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 3016 3017 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; 3018 3019 /** 3020 * If using static IP, the primary DNS's IP address. 3021 * <p> 3022 * Example: "192.168.1.1" 3023 * 3024 * @deprecated Use {@link WifiManager} instead 3025 */ 3026 @Deprecated 3027 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 3028 3029 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; 3030 3031 /** 3032 * If using static IP, the secondary DNS's IP address. 3033 * <p> 3034 * Example: "192.168.1.2" 3035 * 3036 * @deprecated Use {@link WifiManager} instead 3037 */ 3038 @Deprecated 3039 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 3040 3041 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = LENIENT_IP_ADDRESS_VALIDATOR; 3042 3043 /** 3044 * Determines whether remote devices may discover and/or connect to 3045 * this device. 3046 * <P>Type: INT</P> 3047 * 2 -- discoverable and connectable 3048 * 1 -- connectable but not discoverable 3049 * 0 -- neither connectable nor discoverable 3050 */ 3051 public static final String BLUETOOTH_DISCOVERABILITY = 3052 "bluetooth_discoverability"; 3053 3054 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = 3055 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); 3056 3057 /** 3058 * Bluetooth discoverability timeout. If this value is nonzero, then 3059 * Bluetooth becomes discoverable for a certain number of seconds, 3060 * after which is becomes simply connectable. The value is in seconds. 3061 */ 3062 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 3063 "bluetooth_discoverability_timeout"; 3064 3065 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = 3066 NON_NEGATIVE_INTEGER_VALIDATOR; 3067 3068 /** 3069 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 3070 * instead 3071 */ 3072 @Deprecated 3073 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 3074 3075 /** 3076 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 3077 * instead 3078 */ 3079 @Deprecated 3080 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 3081 3082 /** 3083 * @deprecated Use 3084 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 3085 * instead 3086 */ 3087 @Deprecated 3088 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 3089 "lock_pattern_tactile_feedback_enabled"; 3090 3091 /** 3092 * A formatted string of the next alarm that is set, or the empty string 3093 * if there is no alarm set. 3094 * 3095 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 3096 */ 3097 @Deprecated 3098 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 3099 3100 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { 3101 private static final int MAX_LENGTH = 1000; 3102 3103 @Override 3104 public boolean validate(String value) { 3105 // TODO: No idea what the correct format is. 3106 return value == null || value.length() < MAX_LENGTH; 3107 } 3108 }; 3109 3110 /** 3111 * Scaling factor for fonts, float. 3112 */ 3113 public static final String FONT_SCALE = "font_scale"; 3114 3115 private static final Validator FONT_SCALE_VALIDATOR = new Validator() { 3116 @Override 3117 public boolean validate(String value) { 3118 try { 3119 return Float.parseFloat(value) >= 0; 3120 } catch (NumberFormatException e) { 3121 return false; 3122 } 3123 } 3124 }; 3125 3126 /** 3127 * The serialized system locale value. 3128 * 3129 * Do not use this value directory. 3130 * To get system locale, use {@link LocaleList#getDefault} instead. 3131 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} 3132 * instead. 3133 * @hide 3134 */ 3135 public static final String SYSTEM_LOCALES = "system_locales"; 3136 3137 3138 /** 3139 * Name of an application package to be debugged. 3140 * 3141 * @deprecated Use {@link Global#DEBUG_APP} instead 3142 */ 3143 @Deprecated 3144 public static final String DEBUG_APP = Global.DEBUG_APP; 3145 3146 /** 3147 * If 1, when launching DEBUG_APP it will wait for the debugger before 3148 * starting user code. If 0, it will run normally. 3149 * 3150 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 3151 */ 3152 @Deprecated 3153 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 3154 3155 /** 3156 * Whether or not to dim the screen. 0=no 1=yes 3157 * @deprecated This setting is no longer used. 3158 */ 3159 @Deprecated 3160 public static final String DIM_SCREEN = "dim_screen"; 3161 3162 private static final Validator DIM_SCREEN_VALIDATOR = BOOLEAN_VALIDATOR; 3163 3164 /** 3165 * The display color mode. 3166 * @hide 3167 */ 3168 public static final String DISPLAY_COLOR_MODE = "display_color_mode"; 3169 3170 private static final Validator DISPLAY_COLOR_MODE_VALIDATOR = 3171 new SettingsValidators.InclusiveIntegerRangeValidator( 3172 ColorDisplayController.COLOR_MODE_NATURAL, 3173 ColorDisplayController.COLOR_MODE_AUTOMATIC); 3174 3175 /** 3176 * The amount of time in milliseconds before the device goes to sleep or begins 3177 * to dream after a period of inactivity. This value is also known as the 3178 * user activity timeout period since the screen isn't necessarily turned off 3179 * when it expires. 3180 * 3181 * <p> 3182 * This value is bounded by maximum timeout set by 3183 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. 3184 */ 3185 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 3186 3187 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = 3188 NON_NEGATIVE_INTEGER_VALIDATOR; 3189 3190 /** 3191 * The screen backlight brightness between 0 and 255. 3192 */ 3193 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 3194 3195 /** 3196 * The screen backlight brightness between 0 and 255. 3197 * @hide 3198 */ 3199 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; 3200 3201 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = 3202 new SettingsValidators.InclusiveIntegerRangeValidator(0, 255); 3203 3204 /** 3205 * Control whether to enable automatic brightness mode. 3206 */ 3207 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 3208 3209 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = BOOLEAN_VALIDATOR; 3210 3211 /** 3212 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 3213 * or less (<0.0 >-1.0) bright. 3214 * @hide 3215 */ 3216 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 3217 3218 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = 3219 new SettingsValidators.InclusiveFloatRangeValidator(-1, 1); 3220 3221 /** 3222 * SCREEN_BRIGHTNESS_MODE value for manual mode. 3223 */ 3224 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 3225 3226 /** 3227 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 3228 */ 3229 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 3230 3231 /** 3232 * Control whether the process CPU usage meter should be shown. 3233 * 3234 * @deprecated This functionality is no longer available as of 3235 * {@link android.os.Build.VERSION_CODES#N_MR1}. 3236 */ 3237 @Deprecated 3238 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 3239 3240 /** 3241 * If 1, the activity manager will aggressively finish activities and 3242 * processes as soon as they are no longer needed. If 0, the normal 3243 * extended lifetime is used. 3244 * 3245 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 3246 */ 3247 @Deprecated 3248 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 3249 3250 /** 3251 * Determines which streams are affected by ringer and zen mode changes. The 3252 * stream type's bit should be set to 1 if it should be muted when going 3253 * into an inaudible ringer mode. 3254 */ 3255 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 3256 3257 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = 3258 NON_NEGATIVE_INTEGER_VALIDATOR; 3259 3260 /** 3261 * Determines which streams are affected by mute. The 3262 * stream type's bit should be set to 1 if it should be muted when a mute request 3263 * is received. 3264 */ 3265 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 3266 3267 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = 3268 NON_NEGATIVE_INTEGER_VALIDATOR; 3269 3270 /** 3271 * Whether vibrate is on for different events. This is used internally, 3272 * changing this value will not change the vibrate. See AudioManager. 3273 */ 3274 public static final String VIBRATE_ON = "vibrate_on"; 3275 3276 private static final Validator VIBRATE_ON_VALIDATOR = BOOLEAN_VALIDATOR; 3277 3278 /** 3279 * If 1, redirects the system vibrator to all currently attached input devices 3280 * that support vibration. If there are no such input devices, then the system 3281 * vibrator is used instead. 3282 * If 0, does not register the system vibrator. 3283 * 3284 * This setting is mainly intended to provide a compatibility mechanism for 3285 * applications that only know about the system vibrator and do not use the 3286 * input device vibrator API. 3287 * 3288 * @hide 3289 */ 3290 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 3291 3292 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = BOOLEAN_VALIDATOR; 3293 3294 /** 3295 * The intensity of notification vibrations, if configurable. 3296 * 3297 * Not all devices are capable of changing their vibration intensity; on these devices 3298 * there will likely be no difference between the various vibration intensities except for 3299 * intensity 0 (off) and the rest. 3300 * 3301 * <b>Values:</b><br/> 3302 * 0 - Vibration is disabled<br/> 3303 * 1 - Weak vibrations<br/> 3304 * 2 - Medium vibrations<br/> 3305 * 3 - Strong vibrations 3306 * @hide 3307 */ 3308 public static final String NOTIFICATION_VIBRATION_INTENSITY = 3309 "notification_vibration_intensity"; 3310 3311 /** 3312 * The intensity of haptic feedback vibrations, if configurable. 3313 * 3314 * Not all devices are capable of changing their feedback intensity; on these devices 3315 * there will likely be no difference between the various vibration intensities except for 3316 * intensity 0 (off) and the rest. 3317 * 3318 * <b>Values:</b><br/> 3319 * 0 - Vibration is disabled<br/> 3320 * 1 - Weak vibrations<br/> 3321 * 2 - Medium vibrations<br/> 3322 * 3 - Strong vibrations 3323 * @hide 3324 */ 3325 public static final String HAPTIC_FEEDBACK_INTENSITY = 3326 "haptic_feedback_intensity"; 3327 3328 private static final Validator VIBRATION_INTENSITY_VALIDATOR = 3329 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); 3330 3331 /** 3332 * Ringer volume. This is used internally, changing this value will not 3333 * change the volume. See AudioManager. 3334 * 3335 * @removed Not used by anything since API 2. 3336 */ 3337 public static final String VOLUME_RING = "volume_ring"; 3338 3339 /** 3340 * System/notifications volume. This is used internally, changing this 3341 * value will not change the volume. See AudioManager. 3342 * 3343 * @removed Not used by anything since API 2. 3344 */ 3345 public static final String VOLUME_SYSTEM = "volume_system"; 3346 3347 /** 3348 * Voice call volume. This is used internally, changing this value will 3349 * not change the volume. See AudioManager. 3350 * 3351 * @removed Not used by anything since API 2. 3352 */ 3353 public static final String VOLUME_VOICE = "volume_voice"; 3354 3355 /** 3356 * Music/media/gaming volume. This is used internally, changing this 3357 * value will not change the volume. See AudioManager. 3358 * 3359 * @removed Not used by anything since API 2. 3360 */ 3361 public static final String VOLUME_MUSIC = "volume_music"; 3362 3363 /** 3364 * Alarm volume. This is used internally, changing this 3365 * value will not change the volume. See AudioManager. 3366 * 3367 * @removed Not used by anything since API 2. 3368 */ 3369 public static final String VOLUME_ALARM = "volume_alarm"; 3370 3371 /** 3372 * Notification volume. This is used internally, changing this 3373 * value will not change the volume. See AudioManager. 3374 * 3375 * @removed Not used by anything since API 2. 3376 */ 3377 public static final String VOLUME_NOTIFICATION = "volume_notification"; 3378 3379 /** 3380 * Bluetooth Headset volume. This is used internally, changing this value will 3381 * not change the volume. See AudioManager. 3382 * 3383 * @removed Not used by anything since API 2. 3384 */ 3385 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 3386 3387 /** 3388 * @hide 3389 * Acessibility volume. This is used internally, changing this 3390 * value will not change the volume. 3391 */ 3392 public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; 3393 3394 /** 3395 * Master volume (float in the range 0.0f to 1.0f). 3396 * 3397 * @hide 3398 */ 3399 public static final String VOLUME_MASTER = "volume_master"; 3400 3401 /** 3402 * Master mono (int 1 = mono, 0 = normal). 3403 * 3404 * @hide 3405 */ 3406 public static final String MASTER_MONO = "master_mono"; 3407 3408 private static final Validator MASTER_MONO_VALIDATOR = BOOLEAN_VALIDATOR; 3409 3410 /** 3411 * Whether the notifications should use the ring volume (value of 1) or 3412 * a separate notification volume (value of 0). In most cases, users 3413 * will have this enabled so the notification and ringer volumes will be 3414 * the same. However, power users can disable this and use the separate 3415 * notification volume control. 3416 * <p> 3417 * Note: This is a one-off setting that will be removed in the future 3418 * when there is profile support. For this reason, it is kept hidden 3419 * from the public APIs. 3420 * 3421 * @hide 3422 * @deprecated 3423 */ 3424 @Deprecated 3425 public static final String NOTIFICATIONS_USE_RING_VOLUME = 3426 "notifications_use_ring_volume"; 3427 3428 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = BOOLEAN_VALIDATOR; 3429 3430 /** 3431 * Whether silent mode should allow vibration feedback. This is used 3432 * internally in AudioService and the Sound settings activity to 3433 * coordinate decoupling of vibrate and silent modes. This setting 3434 * will likely be removed in a future release with support for 3435 * audio/vibe feedback profiles. 3436 * 3437 * Not used anymore. On devices with vibrator, the user explicitly selects 3438 * silent or vibrate mode. 3439 * Kept for use by legacy database upgrade code in DatabaseHelper. 3440 * @hide 3441 */ 3442 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 3443 3444 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = BOOLEAN_VALIDATOR; 3445 3446 /** 3447 * The mapping of stream type (integer) to its setting. 3448 * 3449 * @removed Not used by anything since API 2. 3450 */ 3451 public static final String[] VOLUME_SETTINGS = { 3452 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 3453 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 3454 }; 3455 3456 /** 3457 * @hide 3458 * The mapping of stream type (integer) to its setting. 3459 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as 3460 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes 3461 * are never persisted. 3462 */ 3463 public static final String[] VOLUME_SETTINGS_INT = { 3464 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 3465 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, 3466 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, 3467 "" /*STREAM_DTMF, no setting for this stream*/, 3468 "" /*STREAM_TTS, no setting for this stream*/, 3469 VOLUME_ACCESSIBILITY 3470 }; 3471 3472 /** 3473 * Appended to various volume related settings to record the previous 3474 * values before they the settings were affected by a silent/vibrate 3475 * ringer mode change. 3476 * 3477 * @removed Not used by anything since API 2. 3478 */ 3479 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 3480 3481 /** 3482 * Persistent store for the system-wide default ringtone URI. 3483 * <p> 3484 * If you need to play the default ringtone at any given time, it is recommended 3485 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 3486 * to the set default ringtone at the time of playing. 3487 * 3488 * @see #DEFAULT_RINGTONE_URI 3489 */ 3490 public static final String RINGTONE = "ringtone"; 3491 3492 private static final Validator RINGTONE_VALIDATOR = URI_VALIDATOR; 3493 3494 /** 3495 * A {@link Uri} that will point to the current default ringtone at any 3496 * given time. 3497 * <p> 3498 * If the current default ringtone is in the DRM provider and the caller 3499 * does not have permission, the exception will be a 3500 * FileNotFoundException. 3501 */ 3502 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 3503 3504 /** {@hide} */ 3505 public static final String RINGTONE_CACHE = "ringtone_cache"; 3506 /** {@hide} */ 3507 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); 3508 3509 /** 3510 * Persistent store for the system-wide default notification sound. 3511 * 3512 * @see #RINGTONE 3513 * @see #DEFAULT_NOTIFICATION_URI 3514 */ 3515 public static final String NOTIFICATION_SOUND = "notification_sound"; 3516 3517 private static final Validator NOTIFICATION_SOUND_VALIDATOR = URI_VALIDATOR; 3518 3519 /** 3520 * A {@link Uri} that will point to the current default notification 3521 * sound at any given time. 3522 * 3523 * @see #DEFAULT_RINGTONE_URI 3524 */ 3525 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 3526 3527 /** {@hide} */ 3528 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; 3529 /** {@hide} */ 3530 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); 3531 3532 /** 3533 * Persistent store for the system-wide default alarm alert. 3534 * 3535 * @see #RINGTONE 3536 * @see #DEFAULT_ALARM_ALERT_URI 3537 */ 3538 public static final String ALARM_ALERT = "alarm_alert"; 3539 3540 private static final Validator ALARM_ALERT_VALIDATOR = URI_VALIDATOR; 3541 3542 /** 3543 * A {@link Uri} that will point to the current default alarm alert at 3544 * any given time. 3545 * 3546 * @see #DEFAULT_ALARM_ALERT_URI 3547 */ 3548 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 3549 3550 /** {@hide} */ 3551 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; 3552 /** {@hide} */ 3553 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); 3554 3555 /** 3556 * Persistent store for the system default media button event receiver. 3557 * 3558 * @hide 3559 */ 3560 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 3561 3562 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = COMPONENT_NAME_VALIDATOR; 3563 3564 /** 3565 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 3566 */ 3567 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 3568 3569 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = BOOLEAN_VALIDATOR; 3570 3571 /** 3572 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 3573 */ 3574 public static final String TEXT_AUTO_CAPS = "auto_caps"; 3575 3576 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = BOOLEAN_VALIDATOR; 3577 3578 /** 3579 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 3580 * feature converts two spaces to a "." and space. 3581 */ 3582 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 3583 3584 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = BOOLEAN_VALIDATOR; 3585 3586 /** 3587 * Setting to showing password characters in text editors. 1 = On, 0 = Off 3588 */ 3589 public static final String TEXT_SHOW_PASSWORD = "show_password"; 3590 3591 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; 3592 3593 public static final String SHOW_GTALK_SERVICE_STATUS = 3594 "SHOW_GTALK_SERVICE_STATUS"; 3595 3596 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = BOOLEAN_VALIDATOR; 3597 3598 /** 3599 * Name of activity to use for wallpaper on the home screen. 3600 * 3601 * @deprecated Use {@link WallpaperManager} instead. 3602 */ 3603 @Deprecated 3604 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 3605 3606 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { 3607 private static final int MAX_LENGTH = 1000; 3608 3609 @Override 3610 public boolean validate(String value) { 3611 if (value != null && value.length() > MAX_LENGTH) { 3612 return false; 3613 } 3614 return ComponentName.unflattenFromString(value) != null; 3615 } 3616 }; 3617 3618 /** 3619 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 3620 * instead 3621 */ 3622 @Deprecated 3623 public static final String AUTO_TIME = Global.AUTO_TIME; 3624 3625 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; 3626 3627 /** 3628 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 3629 * instead 3630 */ 3631 @Deprecated 3632 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 3633 3634 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; 3635 3636 /** 3637 * Display times as 12 or 24 hours 3638 * 12 3639 * 24 3640 */ 3641 public static final String TIME_12_24 = "time_12_24"; 3642 3643 /** @hide */ 3644 public static final Validator TIME_12_24_VALIDATOR = 3645 new SettingsValidators.DiscreteValueValidator(new String[] {"12", "24", null}); 3646 3647 /** 3648 * Date format string 3649 * mm/dd/yyyy 3650 * dd/mm/yyyy 3651 * yyyy/mm/dd 3652 */ 3653 public static final String DATE_FORMAT = "date_format"; 3654 3655 /** @hide */ 3656 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { 3657 @Override 3658 public boolean validate(String value) { 3659 try { 3660 new SimpleDateFormat(value); 3661 return true; 3662 } catch (IllegalArgumentException e) { 3663 return false; 3664 } 3665 } 3666 }; 3667 3668 /** 3669 * Whether the setup wizard has been run before (on first boot), or if 3670 * it still needs to be run. 3671 * 3672 * nonzero = it has been run in the past 3673 * 0 = it has not been run in the past 3674 */ 3675 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 3676 3677 /** @hide */ 3678 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = BOOLEAN_VALIDATOR; 3679 3680 /** 3681 * Scaling factor for normal window animations. Setting to 0 will disable window 3682 * animations. 3683 * 3684 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 3685 */ 3686 @Deprecated 3687 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 3688 3689 /** 3690 * Scaling factor for activity transition animations. Setting to 0 will disable window 3691 * animations. 3692 * 3693 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 3694 */ 3695 @Deprecated 3696 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 3697 3698 /** 3699 * Scaling factor for Animator-based animations. This affects both the start delay and 3700 * duration of all such animations. Setting to 0 will cause animations to end immediately. 3701 * The default value is 1. 3702 * 3703 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 3704 */ 3705 @Deprecated 3706 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 3707 3708 /** 3709 * Control whether the accelerometer will be used to change screen 3710 * orientation. If 0, it will not be used unless explicitly requested 3711 * by the application; if 1, it will be used by default unless explicitly 3712 * disabled by the application. 3713 */ 3714 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 3715 3716 /** @hide */ 3717 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = BOOLEAN_VALIDATOR; 3718 3719 /** 3720 * Default screen rotation when no other policy applies. 3721 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 3722 * preference, this rotation value will be used. Must be one of the 3723 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 3724 * 3725 * @see android.view.Display#getRotation 3726 */ 3727 public static final String USER_ROTATION = "user_rotation"; 3728 3729 /** @hide */ 3730 public static final Validator USER_ROTATION_VALIDATOR = 3731 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); 3732 3733 /** 3734 * Control whether the rotation lock toggle in the System UI should be hidden. 3735 * Typically this is done for accessibility purposes to make it harder for 3736 * the user to accidentally toggle the rotation lock while the display rotation 3737 * has been locked for accessibility. 3738 * 3739 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 3740 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 3741 * 3742 * @hide 3743 */ 3744 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 3745 "hide_rotation_lock_toggle_for_accessibility"; 3746 3747 /** @hide */ 3748 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = 3749 BOOLEAN_VALIDATOR; 3750 3751 /** 3752 * Whether the phone vibrates when it is ringing due to an incoming call. This will 3753 * be used by Phone and Setting apps; it shouldn't affect other apps. 3754 * The value is boolean (1 or 0). 3755 * 3756 * Note: this is not same as "vibrate on ring", which had been available until ICS. 3757 * It was about AudioManager's setting and thus affected all the applications which 3758 * relied on the setting, while this is purely about the vibration setting for incoming 3759 * calls. 3760 */ 3761 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 3762 3763 /** @hide */ 3764 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = BOOLEAN_VALIDATOR; 3765 3766 /** 3767 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 3768 * boolean (1 or 0). 3769 */ 3770 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 3771 3772 /** @hide */ 3773 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; 3774 3775 /** 3776 * CDMA only settings 3777 * DTMF tone type played by the dialer when dialing. 3778 * 0 = Normal 3779 * 1 = Long 3780 */ 3781 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 3782 3783 /** @hide */ 3784 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = BOOLEAN_VALIDATOR; 3785 3786 /** 3787 * Whether the hearing aid is enabled. The value is 3788 * boolean (1 or 0). 3789 * @hide 3790 */ 3791 public static final String HEARING_AID = "hearing_aid"; 3792 3793 /** @hide */ 3794 public static final Validator HEARING_AID_VALIDATOR = BOOLEAN_VALIDATOR; 3795 3796 /** 3797 * CDMA only settings 3798 * TTY Mode 3799 * 0 = OFF 3800 * 1 = FULL 3801 * 2 = VCO 3802 * 3 = HCO 3803 * @hide 3804 */ 3805 public static final String TTY_MODE = "tty_mode"; 3806 3807 /** @hide */ 3808 public static final Validator TTY_MODE_VALIDATOR = 3809 new SettingsValidators.InclusiveIntegerRangeValidator(0, 3); 3810 3811 /** 3812 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 3813 * boolean (1 or 0). 3814 */ 3815 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 3816 3817 /** @hide */ 3818 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3819 3820 /** 3821 * Whether haptic feedback (Vibrate on tap) is enabled. The value is 3822 * boolean (1 or 0). 3823 */ 3824 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 3825 3826 /** @hide */ 3827 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3828 3829 /** 3830 * @deprecated Each application that shows web suggestions should have its own 3831 * setting for this. 3832 */ 3833 @Deprecated 3834 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 3835 3836 /** @hide */ 3837 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = BOOLEAN_VALIDATOR; 3838 3839 /** 3840 * Whether the notification LED should repeatedly flash when a notification is 3841 * pending. The value is boolean (1 or 0). 3842 * @hide 3843 */ 3844 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 3845 3846 /** @hide */ 3847 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = BOOLEAN_VALIDATOR; 3848 3849 /** 3850 * Show pointer location on screen? 3851 * 0 = no 3852 * 1 = yes 3853 * @hide 3854 */ 3855 public static final String POINTER_LOCATION = "pointer_location"; 3856 3857 /** @hide */ 3858 public static final Validator POINTER_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; 3859 3860 /** 3861 * Show touch positions on screen? 3862 * 0 = no 3863 * 1 = yes 3864 * @hide 3865 */ 3866 public static final String SHOW_TOUCHES = "show_touches"; 3867 3868 /** @hide */ 3869 public static final Validator SHOW_TOUCHES_VALIDATOR = BOOLEAN_VALIDATOR; 3870 3871 /** 3872 * Log raw orientation data from 3873 * {@link com.android.server.policy.WindowOrientationListener} for use with the 3874 * orientationplot.py tool. 3875 * 0 = no 3876 * 1 = yes 3877 * @hide 3878 */ 3879 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 3880 "window_orientation_listener_log"; 3881 3882 /** @hide */ 3883 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = BOOLEAN_VALIDATOR; 3884 3885 /** 3886 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 3887 * instead 3888 * @hide 3889 */ 3890 @Deprecated 3891 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 3892 3893 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3894 3895 /** 3896 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 3897 * instead 3898 * @hide 3899 */ 3900 @Deprecated 3901 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 3902 3903 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3904 3905 /** 3906 * Whether to play sounds when the keyguard is shown and dismissed. 3907 * @hide 3908 */ 3909 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 3910 3911 /** @hide */ 3912 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3913 3914 /** 3915 * Whether the lockscreen should be completely disabled. 3916 * @hide 3917 */ 3918 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 3919 3920 /** @hide */ 3921 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; 3922 3923 /** 3924 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 3925 * instead 3926 * @hide 3927 */ 3928 @Deprecated 3929 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 3930 3931 /** 3932 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 3933 * instead 3934 * @hide 3935 */ 3936 @Deprecated 3937 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 3938 3939 /** 3940 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 3941 * instead 3942 * @hide 3943 */ 3944 @Deprecated 3945 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 3946 3947 /** 3948 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 3949 * instead 3950 * @hide 3951 */ 3952 @Deprecated 3953 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 3954 3955 /** 3956 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 3957 * instead 3958 * @hide 3959 */ 3960 @Deprecated 3961 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 3962 3963 /** 3964 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 3965 * instead 3966 * @hide 3967 */ 3968 @Deprecated 3969 public static final String LOCK_SOUND = Global.LOCK_SOUND; 3970 3971 /** 3972 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 3973 * instead 3974 * @hide 3975 */ 3976 @Deprecated 3977 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 3978 3979 /** 3980 * Receive incoming SIP calls? 3981 * 0 = no 3982 * 1 = yes 3983 * @hide 3984 */ 3985 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 3986 3987 /** @hide */ 3988 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = BOOLEAN_VALIDATOR; 3989 3990 /** 3991 * Call Preference String. 3992 * "SIP_ALWAYS" : Always use SIP with network access 3993 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 3994 * @hide 3995 */ 3996 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 3997 3998 /** @hide */ 3999 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = 4000 new SettingsValidators.DiscreteValueValidator( 4001 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); 4002 4003 /** 4004 * One of the sip call options: Always use SIP with network access. 4005 * @hide 4006 */ 4007 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 4008 4009 /** @hide */ 4010 public static final Validator SIP_ALWAYS_VALIDATOR = BOOLEAN_VALIDATOR; 4011 4012 /** 4013 * One of the sip call options: Only if destination is a SIP address. 4014 * @hide 4015 */ 4016 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 4017 4018 /** @hide */ 4019 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = BOOLEAN_VALIDATOR; 4020 4021 /** 4022 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that 4023 * the user should be prompted each time a call is made whether it should be placed using 4024 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with 4025 * SIP_ADDRESS_ONLY. 4026 * @hide 4027 */ 4028 @Deprecated 4029 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 4030 4031 /** @hide */ 4032 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = BOOLEAN_VALIDATOR; 4033 4034 /** 4035 * Pointer speed setting. 4036 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 4037 * -7 = slowest 4038 * 0 = default speed 4039 * +7 = fastest 4040 * @hide 4041 */ 4042 public static final String POINTER_SPEED = "pointer_speed"; 4043 4044 /** @hide */ 4045 public static final Validator POINTER_SPEED_VALIDATOR = 4046 new SettingsValidators.InclusiveFloatRangeValidator(-7, 7); 4047 4048 /** 4049 * Whether lock-to-app will be triggered by long-press on recents. 4050 * @hide 4051 */ 4052 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; 4053 4054 /** @hide */ 4055 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 4056 4057 /** 4058 * I am the lolrus. 4059 * <p> 4060 * Nonzero values indicate that the user has a bukkit. 4061 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 4062 * @hide 4063 */ 4064 public static final String EGG_MODE = "egg_mode"; 4065 4066 /** @hide */ 4067 public static final Validator EGG_MODE_VALIDATOR = new Validator() { 4068 @Override 4069 public boolean validate(String value) { 4070 try { 4071 return Long.parseLong(value) >= 0; 4072 } catch (NumberFormatException e) { 4073 return false; 4074 } 4075 } 4076 }; 4077 4078 /** 4079 * Setting to determine whether or not to show the battery percentage in the status bar. 4080 * 0 - Don't show percentage 4081 * 1 - Show percentage 4082 * @hide 4083 */ 4084 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; 4085 4086 /** @hide */ 4087 private static final Validator SHOW_BATTERY_PERCENT_VALIDATOR = BOOLEAN_VALIDATOR; 4088 4089 /** 4090 * IMPORTANT: If you add a new public settings you also have to add it to 4091 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add 4092 * it to PRIVATE_SETTINGS below. Also add a validator that can validate 4093 * the setting value. See an example above. 4094 */ 4095 4096 /** 4097 * Settings to backup. This is here so that it's in the same place as the settings 4098 * keys and easy to update. 4099 * 4100 * NOTE: Settings are backed up and restored in the order they appear 4101 * in this array. If you have one setting depending on another, 4102 * make sure that they are ordered appropriately. 4103 * 4104 * @hide 4105 */ 4106 public static final String[] SETTINGS_TO_BACKUP = { 4107 STAY_ON_WHILE_PLUGGED_IN, // moved to global 4108 WIFI_USE_STATIC_IP, 4109 WIFI_STATIC_IP, 4110 WIFI_STATIC_GATEWAY, 4111 WIFI_STATIC_NETMASK, 4112 WIFI_STATIC_DNS1, 4113 WIFI_STATIC_DNS2, 4114 BLUETOOTH_DISCOVERABILITY, 4115 BLUETOOTH_DISCOVERABILITY_TIMEOUT, 4116 FONT_SCALE, 4117 DIM_SCREEN, 4118 SCREEN_OFF_TIMEOUT, 4119 SCREEN_BRIGHTNESS_MODE, 4120 SCREEN_AUTO_BRIGHTNESS_ADJ, 4121 SCREEN_BRIGHTNESS_FOR_VR, 4122 VIBRATE_INPUT_DEVICES, 4123 MODE_RINGER_STREAMS_AFFECTED, 4124 TEXT_AUTO_REPLACE, 4125 TEXT_AUTO_CAPS, 4126 TEXT_AUTO_PUNCTUATE, 4127 TEXT_SHOW_PASSWORD, 4128 AUTO_TIME, // moved to global 4129 AUTO_TIME_ZONE, // moved to global 4130 TIME_12_24, 4131 DATE_FORMAT, 4132 DTMF_TONE_WHEN_DIALING, 4133 DTMF_TONE_TYPE_WHEN_DIALING, 4134 HEARING_AID, 4135 TTY_MODE, 4136 MASTER_MONO, 4137 SOUND_EFFECTS_ENABLED, 4138 HAPTIC_FEEDBACK_ENABLED, 4139 POWER_SOUNDS_ENABLED, // moved to global 4140 DOCK_SOUNDS_ENABLED, // moved to global 4141 LOCKSCREEN_SOUNDS_ENABLED, 4142 SHOW_WEB_SUGGESTIONS, 4143 SIP_CALL_OPTIONS, 4144 SIP_RECEIVE_CALLS, 4145 POINTER_SPEED, 4146 VIBRATE_WHEN_RINGING, 4147 RINGTONE, 4148 LOCK_TO_APP_ENABLED, 4149 NOTIFICATION_SOUND, 4150 ACCELEROMETER_ROTATION, 4151 SHOW_BATTERY_PERCENT, 4152 NOTIFICATION_VIBRATION_INTENSITY, 4153 HAPTIC_FEEDBACK_INTENSITY, 4154 DISPLAY_COLOR_MODE 4155 }; 4156 4157 /** 4158 * Keys we no longer back up under the current schema, but want to continue to 4159 * process when restoring historical backup datasets. 4160 * 4161 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 4162 * otherwise they won't be restored. 4163 * 4164 * @hide 4165 */ 4166 public static final String[] LEGACY_RESTORE_SETTINGS = { 4167 }; 4168 4169 /** 4170 * These are all public system settings 4171 * 4172 * @hide 4173 */ 4174 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); 4175 static { 4176 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); 4177 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); 4178 PUBLIC_SETTINGS.add(WIFI_STATIC_IP); 4179 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); 4180 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); 4181 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); 4182 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); 4183 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); 4184 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); 4185 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); 4186 PUBLIC_SETTINGS.add(FONT_SCALE); 4187 PUBLIC_SETTINGS.add(DIM_SCREEN); 4188 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); 4189 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); 4190 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR); 4191 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); 4192 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); 4193 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); 4194 PUBLIC_SETTINGS.add(VIBRATE_ON); 4195 PUBLIC_SETTINGS.add(VOLUME_RING); 4196 PUBLIC_SETTINGS.add(VOLUME_SYSTEM); 4197 PUBLIC_SETTINGS.add(VOLUME_VOICE); 4198 PUBLIC_SETTINGS.add(VOLUME_MUSIC); 4199 PUBLIC_SETTINGS.add(VOLUME_ALARM); 4200 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); 4201 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); 4202 PUBLIC_SETTINGS.add(RINGTONE); 4203 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); 4204 PUBLIC_SETTINGS.add(ALARM_ALERT); 4205 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); 4206 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); 4207 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 4208 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); 4209 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); 4210 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); 4211 PUBLIC_SETTINGS.add(TIME_12_24); 4212 PUBLIC_SETTINGS.add(DATE_FORMAT); 4213 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); 4214 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); 4215 PUBLIC_SETTINGS.add(USER_ROTATION); 4216 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); 4217 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); 4218 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 4219 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); 4220 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); 4221 } 4222 4223 /** 4224 * These are all hidden system settings. 4225 * 4226 * @hide 4227 */ 4228 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); 4229 static { 4230 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); 4231 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); 4232 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); 4233 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); 4234 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); 4235 PRIVATE_SETTINGS.add(VOLUME_MASTER); 4236 PRIVATE_SETTINGS.add(MASTER_MONO); 4237 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); 4238 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); 4239 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); 4240 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); 4241 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); 4242 PRIVATE_SETTINGS.add(HEARING_AID); 4243 PRIVATE_SETTINGS.add(TTY_MODE); 4244 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); 4245 PRIVATE_SETTINGS.add(POINTER_LOCATION); 4246 PRIVATE_SETTINGS.add(SHOW_TOUCHES); 4247 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); 4248 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); 4249 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); 4250 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); 4251 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); 4252 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); 4253 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); 4254 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); 4255 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); 4256 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); 4257 PRIVATE_SETTINGS.add(LOCK_SOUND); 4258 PRIVATE_SETTINGS.add(UNLOCK_SOUND); 4259 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); 4260 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); 4261 PRIVATE_SETTINGS.add(SIP_ALWAYS); 4262 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); 4263 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); 4264 PRIVATE_SETTINGS.add(POINTER_SPEED); 4265 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); 4266 PRIVATE_SETTINGS.add(EGG_MODE); 4267 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); 4268 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE); 4269 } 4270 4271 /** 4272 * These are all public system settings 4273 * 4274 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, 4275 * otherwise they won't be restored. 4276 * 4277 * @hide 4278 */ 4279 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); 4280 static { 4281 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); 4282 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); 4283 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); 4284 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); 4285 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, 4286 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); 4287 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); 4288 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); 4289 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); 4290 VALIDATORS.put(DISPLAY_COLOR_MODE, DISPLAY_COLOR_MODE_VALIDATOR); 4291 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); 4292 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); 4293 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); 4294 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); 4295 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); 4296 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); 4297 VALIDATORS.put(NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); 4298 VALIDATORS.put(HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); 4299 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); 4300 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); 4301 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); 4302 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); 4303 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); 4304 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); 4305 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); 4306 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); 4307 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); 4308 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); 4309 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); 4310 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); 4311 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); 4312 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); 4313 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); 4314 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); 4315 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); 4316 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); 4317 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); 4318 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); 4319 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); 4320 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); 4321 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); 4322 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); 4323 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); 4324 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); 4325 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); 4326 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); 4327 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); 4328 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); 4329 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); 4330 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 4331 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); 4332 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); 4333 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); 4334 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); 4335 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); 4336 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); 4337 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); 4338 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); 4339 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, 4340 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); 4341 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); 4342 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); 4343 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); 4344 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); 4345 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); 4346 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); 4347 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); 4348 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); 4349 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); 4350 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); 4351 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); 4352 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); 4353 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); 4354 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); 4355 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); 4356 VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR); 4357 } 4358 4359 /** 4360 * These entries are considered common between the personal and the managed profile, 4361 * since the managed profile doesn't get to change them. 4362 */ 4363 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 4364 static { 4365 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); 4366 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); 4367 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); 4368 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); 4369 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); 4370 } 4371 4372 /** @hide */ 4373 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 4374 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 4375 } 4376 4377 /** 4378 * These entries should be cloned from this profile's parent only if the dependency's 4379 * value is true ("1") 4380 * 4381 * Note: the dependencies must be Secure settings 4382 * 4383 * @hide 4384 */ 4385 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); 4386 static { 4387 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); 4388 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); 4389 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); 4390 } 4391 4392 /** @hide */ 4393 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { 4394 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); 4395 } 4396 4397 /** 4398 * System settings which can be accessed by instant apps. 4399 * @hide 4400 */ 4401 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 4402 static { 4403 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); 4404 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); 4405 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 4406 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); 4407 INSTANT_APP_SETTINGS.add(DATE_FORMAT); 4408 INSTANT_APP_SETTINGS.add(FONT_SCALE); 4409 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 4410 INSTANT_APP_SETTINGS.add(TIME_12_24); 4411 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); 4412 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); 4413 } 4414 4415 /** 4416 * When to use Wi-Fi calling 4417 * 4418 * @see android.telephony.TelephonyManager.WifiCallingChoices 4419 * @hide 4420 */ 4421 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 4422 4423 // Settings moved to Settings.Secure 4424 4425 /** 4426 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 4427 * instead 4428 */ 4429 @Deprecated 4430 public static final String ADB_ENABLED = Global.ADB_ENABLED; 4431 4432 /** 4433 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 4434 */ 4435 @Deprecated 4436 public static final String ANDROID_ID = Secure.ANDROID_ID; 4437 4438 /** 4439 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 4440 */ 4441 @Deprecated 4442 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 4443 4444 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; 4445 4446 /** 4447 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 4448 */ 4449 @Deprecated 4450 public static final String DATA_ROAMING = Global.DATA_ROAMING; 4451 4452 /** 4453 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 4454 */ 4455 @Deprecated 4456 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 4457 4458 /** 4459 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 4460 */ 4461 @Deprecated 4462 public static final String HTTP_PROXY = Global.HTTP_PROXY; 4463 4464 /** 4465 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 4466 */ 4467 @Deprecated 4468 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 4469 4470 /** 4471 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 4472 * instead 4473 */ 4474 @Deprecated 4475 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 4476 4477 /** 4478 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 4479 */ 4480 @Deprecated 4481 public static final String LOGGING_ID = Secure.LOGGING_ID; 4482 4483 /** 4484 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 4485 */ 4486 @Deprecated 4487 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 4488 4489 /** 4490 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 4491 * instead 4492 */ 4493 @Deprecated 4494 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 4495 4496 /** 4497 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 4498 * instead 4499 */ 4500 @Deprecated 4501 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 4502 4503 /** 4504 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 4505 * instead 4506 */ 4507 @Deprecated 4508 public static final String PARENTAL_CONTROL_REDIRECT_URL = 4509 Secure.PARENTAL_CONTROL_REDIRECT_URL; 4510 4511 /** 4512 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 4513 */ 4514 @Deprecated 4515 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 4516 4517 /** 4518 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 4519 */ 4520 @Deprecated 4521 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 4522 4523 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 4524 4525 /** 4526 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 4527 */ 4528 @Deprecated 4529 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 4530 4531 /** 4532 * @deprecated Use 4533 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 4534 */ 4535 @Deprecated 4536 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 4537 4538 /** 4539 * @deprecated Use 4540 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 4541 */ 4542 @Deprecated 4543 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 4544 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 4545 4546 /** 4547 * @deprecated Use 4548 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 4549 */ 4550 @Deprecated 4551 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 4552 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 4553 4554 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = 4555 BOOLEAN_VALIDATOR; 4556 4557 /** 4558 * @deprecated Use 4559 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 4560 */ 4561 @Deprecated 4562 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 4563 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 4564 4565 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = 4566 NON_NEGATIVE_INTEGER_VALIDATOR; 4567 4568 /** 4569 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 4570 * instead 4571 */ 4572 @Deprecated 4573 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 4574 4575 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = 4576 NON_NEGATIVE_INTEGER_VALIDATOR; 4577 4578 /** 4579 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 4580 */ 4581 @Deprecated 4582 public static final String WIFI_ON = Global.WIFI_ON; 4583 4584 /** 4585 * @deprecated Use 4586 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 4587 * instead 4588 */ 4589 @Deprecated 4590 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 4591 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 4592 4593 /** 4594 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 4595 */ 4596 @Deprecated 4597 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 4598 4599 /** 4600 * @deprecated Use 4601 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 4602 */ 4603 @Deprecated 4604 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 4605 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 4606 4607 /** 4608 * @deprecated Use 4609 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 4610 */ 4611 @Deprecated 4612 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 4613 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 4614 4615 /** 4616 * @deprecated Use 4617 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 4618 * instead 4619 */ 4620 @Deprecated 4621 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 4622 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 4623 4624 /** 4625 * @deprecated Use 4626 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 4627 */ 4628 @Deprecated 4629 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 4630 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 4631 4632 /** 4633 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 4634 * instead 4635 */ 4636 @Deprecated 4637 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 4638 4639 /** 4640 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 4641 */ 4642 @Deprecated 4643 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 4644 4645 /** 4646 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 4647 */ 4648 @Deprecated 4649 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 4650 4651 /** 4652 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 4653 * instead 4654 */ 4655 @Deprecated 4656 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 4657 4658 /** 4659 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 4660 * instead 4661 */ 4662 @Deprecated 4663 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 4664 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 4665 4666 /** 4667 * Checks if the specified app can modify system settings. As of API 4668 * level 23, an app cannot modify system settings unless it declares the 4669 * {@link android.Manifest.permission#WRITE_SETTINGS} 4670 * permission in its manifest, <em>and</em> the user specifically grants 4671 * the app this capability. To prompt the user to grant this approval, 4672 * the app must send an intent with the action {@link 4673 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes 4674 * the system to display a permission management screen. 4675 * 4676 * @param context App context. 4677 * @return true if the calling app can write to system settings, false otherwise 4678 */ 4679 public static boolean canWrite(Context context) { 4680 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), 4681 context.getOpPackageName(), false); 4682 } 4683 } 4684 4685 /** 4686 * Secure system settings, containing system preferences that applications 4687 * can read but are not allowed to write. These are for preferences that 4688 * the user must explicitly modify through the system UI or specialized 4689 * APIs for those values, not modified directly by applications. 4690 */ 4691 public static final class Secure extends NameValueTable { 4692 // NOTE: If you add new settings here, be sure to add them to 4693 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. 4694 4695 /** 4696 * The content:// style URL for this table 4697 */ 4698 public static final Uri CONTENT_URI = 4699 Uri.parse("content://" + AUTHORITY + "/secure"); 4700 4701 private static final ContentProviderHolder sProviderHolder = 4702 new ContentProviderHolder(CONTENT_URI); 4703 4704 // Populated lazily, guarded by class object: 4705 private static final NameValueCache sNameValueCache = new NameValueCache( 4706 CONTENT_URI, 4707 CALL_METHOD_GET_SECURE, 4708 CALL_METHOD_PUT_SECURE, 4709 sProviderHolder); 4710 4711 private static ILockSettings sLockSettings = null; 4712 4713 private static boolean sIsSystemProcess; 4714 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 4715 private static final HashSet<String> MOVED_TO_GLOBAL; 4716 static { 4717 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); 4718 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 4719 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 4720 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 4721 4722 MOVED_TO_GLOBAL = new HashSet<>(); 4723 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 4724 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 4725 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 4726 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 4727 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 4728 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 4729 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 4730 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 4731 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 4732 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 4733 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 4734 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 4735 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 4736 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 4737 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 4738 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 4739 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 4740 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 4741 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 4742 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 4743 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 4744 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 4745 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 4746 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 4747 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 4748 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 4749 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 4750 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 4751 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 4752 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 4753 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 4754 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 4755 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 4756 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 4757 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 4758 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 4759 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 4760 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 4761 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 4762 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 4763 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 4764 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 4765 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 4766 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 4767 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 4768 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 4769 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 4770 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 4771 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 4772 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 4773 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 4774 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 4775 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 4776 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 4777 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 4778 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 4779 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 4780 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 4781 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 4782 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 4783 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 4784 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 4785 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); 4786 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 4787 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); 4788 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); 4789 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 4790 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 4791 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 4792 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 4793 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 4794 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); 4795 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 4796 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 4797 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 4798 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 4799 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 4800 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 4801 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 4802 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 4803 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 4804 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 4805 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 4806 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 4807 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 4808 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 4809 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 4810 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 4811 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 4812 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 4813 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 4814 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 4815 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 4816 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 4817 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 4818 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 4819 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 4820 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 4821 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 4822 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 4823 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 4824 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 4825 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 4826 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 4827 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 4828 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 4829 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 4830 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 4831 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 4832 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 4833 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 4834 } 4835 4836 /** @hide */ 4837 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 4838 outKeySet.addAll(MOVED_TO_GLOBAL); 4839 } 4840 4841 /** @hide */ 4842 public static void clearProviderForTest() { 4843 sProviderHolder.clearProviderForTest(); 4844 sNameValueCache.clearGenerationTrackerForTest(); 4845 } 4846 4847 /** 4848 * Look up a name in the database. 4849 * @param resolver to access the database with 4850 * @param name to look up in the table 4851 * @return the corresponding value, or null if not present 4852 */ 4853 public static String getString(ContentResolver resolver, String name) { 4854 return getStringForUser(resolver, name, resolver.getUserId()); 4855 } 4856 4857 /** @hide */ 4858 public static String getStringForUser(ContentResolver resolver, String name, 4859 int userHandle) { 4860 if (MOVED_TO_GLOBAL.contains(name)) { 4861 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 4862 + " to android.provider.Settings.Global."); 4863 return Global.getStringForUser(resolver, name, userHandle); 4864 } 4865 4866 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 4867 synchronized (Secure.class) { 4868 if (sLockSettings == null) { 4869 sLockSettings = ILockSettings.Stub.asInterface( 4870 (IBinder) ServiceManager.getService("lock_settings")); 4871 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 4872 } 4873 } 4874 if (sLockSettings != null && !sIsSystemProcess) { 4875 // No context; use the ActivityThread's context as an approximation for 4876 // determining the target API level. 4877 Application application = ActivityThread.currentApplication(); 4878 4879 boolean isPreMnc = application != null 4880 && application.getApplicationInfo() != null 4881 && application.getApplicationInfo().targetSdkVersion 4882 <= VERSION_CODES.LOLLIPOP_MR1; 4883 if (isPreMnc) { 4884 try { 4885 return sLockSettings.getString(name, "0", userHandle); 4886 } catch (RemoteException re) { 4887 // Fall through 4888 } 4889 } else { 4890 throw new SecurityException("Settings.Secure." + name 4891 + " is deprecated and no longer accessible." 4892 + " See API documentation for potential replacements."); 4893 } 4894 } 4895 } 4896 4897 return sNameValueCache.getStringForUser(resolver, name, userHandle); 4898 } 4899 4900 /** 4901 * Store a name/value pair into the database. 4902 * @param resolver to access the database with 4903 * @param name to store 4904 * @param value to associate with the name 4905 * @return true if the value was set, false on database errors 4906 */ 4907 public static boolean putString(ContentResolver resolver, String name, String value) { 4908 return putStringForUser(resolver, name, value, resolver.getUserId()); 4909 } 4910 4911 /** @hide */ 4912 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 4913 int userHandle) { 4914 return putStringForUser(resolver, name, value, null, false, userHandle); 4915 } 4916 4917 /** @hide */ 4918 public static boolean putStringForUser(@NonNull ContentResolver resolver, 4919 @NonNull String name, @Nullable String value, @Nullable String tag, 4920 boolean makeDefault, @UserIdInt int userHandle) { 4921 if (LOCATION_MODE.equals(name)) { 4922 // Map LOCATION_MODE to underlying location provider storage API 4923 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); 4924 } 4925 if (MOVED_TO_GLOBAL.contains(name)) { 4926 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 4927 + " to android.provider.Settings.Global"); 4928 return Global.putStringForUser(resolver, name, value, 4929 tag, makeDefault, userHandle); 4930 } 4931 return sNameValueCache.putStringForUser(resolver, name, value, tag, 4932 makeDefault, userHandle); 4933 } 4934 4935 /** 4936 * Store a name/value pair into the database. 4937 * <p> 4938 * The method takes an optional tag to associate with the setting 4939 * which can be used to clear only settings made by your package and 4940 * associated with this tag by passing the tag to {@link 4941 * #resetToDefaults(ContentResolver, String)}. Anyone can override 4942 * the current tag. Also if another package changes the setting 4943 * then the tag will be set to the one specified in the set call 4944 * which can be null. Also any of the settings setters that do not 4945 * take a tag as an argument effectively clears the tag. 4946 * </p><p> 4947 * For example, if you set settings A and B with tags T1 and T2 and 4948 * another app changes setting A (potentially to the same value), it 4949 * can assign to it a tag T3 (note that now the package that changed 4950 * the setting is not yours). Now if you reset your changes for T1 and 4951 * T2 only setting B will be reset and A not (as it was changed by 4952 * another package) but since A did not change you are in the desired 4953 * initial state. Now if the other app changes the value of A (assuming 4954 * you registered an observer in the beginning) you would detect that 4955 * the setting was changed by another app and handle this appropriately 4956 * (ignore, set back to some value, etc). 4957 * </p><p> 4958 * Also the method takes an argument whether to make the value the 4959 * default for this setting. If the system already specified a default 4960 * value, then the one passed in here will <strong>not</strong> 4961 * be set as the default. 4962 * </p> 4963 * 4964 * @param resolver to access the database with. 4965 * @param name to store. 4966 * @param value to associate with the name. 4967 * @param tag to associate with the setting. 4968 * @param makeDefault whether to make the value the default one. 4969 * @return true if the value was set, false on database errors. 4970 * 4971 * @see #resetToDefaults(ContentResolver, String) 4972 * 4973 * @hide 4974 */ 4975 @SystemApi 4976 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 4977 public static boolean putString(@NonNull ContentResolver resolver, 4978 @NonNull String name, @Nullable String value, @Nullable String tag, 4979 boolean makeDefault) { 4980 return putStringForUser(resolver, name, value, tag, makeDefault, 4981 resolver.getUserId()); 4982 } 4983 4984 /** 4985 * Reset the settings to their defaults. This would reset <strong>only</strong> 4986 * settings set by the caller's package. Think of it of a way to undo your own 4987 * changes to the global settings. Passing in the optional tag will reset only 4988 * settings changed by your package and associated with this tag. 4989 * 4990 * @param resolver Handle to the content resolver. 4991 * @param tag Optional tag which should be associated with the settings to reset. 4992 * 4993 * @see #putString(ContentResolver, String, String, String, boolean) 4994 * 4995 * @hide 4996 */ 4997 @SystemApi 4998 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 4999 public static void resetToDefaults(@NonNull ContentResolver resolver, 5000 @Nullable String tag) { 5001 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 5002 resolver.getUserId()); 5003 } 5004 5005 /** 5006 * 5007 * Reset the settings to their defaults for a given user with a specific mode. The 5008 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 5009 * allowing resetting the settings made by a package and associated with the tag. 5010 * 5011 * @param resolver Handle to the content resolver. 5012 * @param tag Optional tag which should be associated with the settings to reset. 5013 * @param mode The reset mode. 5014 * @param userHandle The user for which to reset to defaults. 5015 * 5016 * @see #RESET_MODE_PACKAGE_DEFAULTS 5017 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 5018 * @see #RESET_MODE_UNTRUSTED_CHANGES 5019 * @see #RESET_MODE_TRUSTED_DEFAULTS 5020 * 5021 * @hide 5022 */ 5023 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 5024 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 5025 try { 5026 Bundle arg = new Bundle(); 5027 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 5028 if (tag != null) { 5029 arg.putString(CALL_METHOD_TAG_KEY, tag); 5030 } 5031 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 5032 IContentProvider cp = sProviderHolder.getProvider(resolver); 5033 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); 5034 } catch (RemoteException e) { 5035 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 5036 } 5037 } 5038 5039 /** 5040 * Construct the content URI for a particular name/value pair, 5041 * useful for monitoring changes with a ContentObserver. 5042 * @param name to look up in the table 5043 * @return the corresponding content URI, or null if not present 5044 */ 5045 public static Uri getUriFor(String name) { 5046 if (MOVED_TO_GLOBAL.contains(name)) { 5047 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5048 + " to android.provider.Settings.Global, returning global URI."); 5049 return Global.getUriFor(Global.CONTENT_URI, name); 5050 } 5051 return getUriFor(CONTENT_URI, name); 5052 } 5053 5054 /** 5055 * Convenience function for retrieving a single secure settings value 5056 * as an integer. Note that internally setting values are always 5057 * stored as strings; this function converts the string to an integer 5058 * for you. The default value will be returned if the setting is 5059 * not defined or not an integer. 5060 * 5061 * @param cr The ContentResolver to access. 5062 * @param name The name of the setting to retrieve. 5063 * @param def Value to return if the setting is not defined. 5064 * 5065 * @return The setting's current value, or 'def' if it is not defined 5066 * or not a valid integer. 5067 */ 5068 public static int getInt(ContentResolver cr, String name, int def) { 5069 return getIntForUser(cr, name, def, cr.getUserId()); 5070 } 5071 5072 /** @hide */ 5073 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 5074 if (LOCATION_MODE.equals(name)) { 5075 // Map from to underlying location provider storage API to location mode 5076 return getLocationModeForUser(cr, userHandle); 5077 } 5078 String v = getStringForUser(cr, name, userHandle); 5079 try { 5080 return v != null ? Integer.parseInt(v) : def; 5081 } catch (NumberFormatException e) { 5082 return def; 5083 } 5084 } 5085 5086 /** 5087 * Convenience function for retrieving a single secure settings value 5088 * as an integer. Note that internally setting values are always 5089 * stored as strings; this function converts the string to an integer 5090 * for you. 5091 * <p> 5092 * This version does not take a default value. If the setting has not 5093 * been set, or the string value is not a number, 5094 * it throws {@link SettingNotFoundException}. 5095 * 5096 * @param cr The ContentResolver to access. 5097 * @param name The name of the setting to retrieve. 5098 * 5099 * @throws SettingNotFoundException Thrown if a setting by the given 5100 * name can't be found or the setting value is not an integer. 5101 * 5102 * @return The setting's current value. 5103 */ 5104 public static int getInt(ContentResolver cr, String name) 5105 throws SettingNotFoundException { 5106 return getIntForUser(cr, name, cr.getUserId()); 5107 } 5108 5109 /** @hide */ 5110 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 5111 throws SettingNotFoundException { 5112 if (LOCATION_MODE.equals(name)) { 5113 // Map from to underlying location provider storage API to location mode 5114 return getLocationModeForUser(cr, userHandle); 5115 } 5116 String v = getStringForUser(cr, name, userHandle); 5117 try { 5118 return Integer.parseInt(v); 5119 } catch (NumberFormatException e) { 5120 throw new SettingNotFoundException(name); 5121 } 5122 } 5123 5124 /** 5125 * Convenience function for updating a single settings value as an 5126 * integer. This will either create a new entry in the table if the 5127 * given name does not exist, or modify the value of the existing row 5128 * with that name. Note that internally setting values are always 5129 * stored as strings, so this function converts the given value to a 5130 * string before storing it. 5131 * 5132 * @param cr The ContentResolver to access. 5133 * @param name The name of the setting to modify. 5134 * @param value The new value for the setting. 5135 * @return true if the value was set, false on database errors 5136 */ 5137 public static boolean putInt(ContentResolver cr, String name, int value) { 5138 return putIntForUser(cr, name, value, cr.getUserId()); 5139 } 5140 5141 /** @hide */ 5142 public static boolean putIntForUser(ContentResolver cr, String name, int value, 5143 int userHandle) { 5144 return putStringForUser(cr, name, Integer.toString(value), userHandle); 5145 } 5146 5147 /** 5148 * Convenience function for retrieving a single secure settings value 5149 * as a {@code long}. Note that internally setting values are always 5150 * stored as strings; this function converts the string to a {@code long} 5151 * for you. The default value will be returned if the setting is 5152 * not defined or not a {@code long}. 5153 * 5154 * @param cr The ContentResolver to access. 5155 * @param name The name of the setting to retrieve. 5156 * @param def Value to return if the setting is not defined. 5157 * 5158 * @return The setting's current value, or 'def' if it is not defined 5159 * or not a valid {@code long}. 5160 */ 5161 public static long getLong(ContentResolver cr, String name, long def) { 5162 return getLongForUser(cr, name, def, cr.getUserId()); 5163 } 5164 5165 /** @hide */ 5166 public static long getLongForUser(ContentResolver cr, String name, long def, 5167 int userHandle) { 5168 String valString = getStringForUser(cr, name, userHandle); 5169 long value; 5170 try { 5171 value = valString != null ? Long.parseLong(valString) : def; 5172 } catch (NumberFormatException e) { 5173 value = def; 5174 } 5175 return value; 5176 } 5177 5178 /** 5179 * Convenience function for retrieving a single secure settings value 5180 * as a {@code long}. Note that internally setting values are always 5181 * stored as strings; this function converts the string to a {@code long} 5182 * for you. 5183 * <p> 5184 * This version does not take a default value. If the setting has not 5185 * been set, or the string value is not a number, 5186 * it throws {@link SettingNotFoundException}. 5187 * 5188 * @param cr The ContentResolver to access. 5189 * @param name The name of the setting to retrieve. 5190 * 5191 * @return The setting's current value. 5192 * @throws SettingNotFoundException Thrown if a setting by the given 5193 * name can't be found or the setting value is not an integer. 5194 */ 5195 public static long getLong(ContentResolver cr, String name) 5196 throws SettingNotFoundException { 5197 return getLongForUser(cr, name, cr.getUserId()); 5198 } 5199 5200 /** @hide */ 5201 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 5202 throws SettingNotFoundException { 5203 String valString = getStringForUser(cr, name, userHandle); 5204 try { 5205 return Long.parseLong(valString); 5206 } catch (NumberFormatException e) { 5207 throw new SettingNotFoundException(name); 5208 } 5209 } 5210 5211 /** 5212 * Convenience function for updating a secure settings value as a long 5213 * integer. This will either create a new entry in the table if the 5214 * given name does not exist, or modify the value of the existing row 5215 * with that name. Note that internally setting values are always 5216 * stored as strings, so this function converts the given value to a 5217 * string before storing it. 5218 * 5219 * @param cr The ContentResolver to access. 5220 * @param name The name of the setting to modify. 5221 * @param value The new value for the setting. 5222 * @return true if the value was set, false on database errors 5223 */ 5224 public static boolean putLong(ContentResolver cr, String name, long value) { 5225 return putLongForUser(cr, name, value, cr.getUserId()); 5226 } 5227 5228 /** @hide */ 5229 public static boolean putLongForUser(ContentResolver cr, String name, long value, 5230 int userHandle) { 5231 return putStringForUser(cr, name, Long.toString(value), userHandle); 5232 } 5233 5234 /** 5235 * Convenience function for retrieving a single secure settings value 5236 * as a floating point number. Note that internally setting values are 5237 * always stored as strings; this function converts the string to an 5238 * float for you. The default value will be returned if the setting 5239 * is not defined or not a valid float. 5240 * 5241 * @param cr The ContentResolver to access. 5242 * @param name The name of the setting to retrieve. 5243 * @param def Value to return if the setting is not defined. 5244 * 5245 * @return The setting's current value, or 'def' if it is not defined 5246 * or not a valid float. 5247 */ 5248 public static float getFloat(ContentResolver cr, String name, float def) { 5249 return getFloatForUser(cr, name, def, cr.getUserId()); 5250 } 5251 5252 /** @hide */ 5253 public static float getFloatForUser(ContentResolver cr, String name, float def, 5254 int userHandle) { 5255 String v = getStringForUser(cr, name, userHandle); 5256 try { 5257 return v != null ? Float.parseFloat(v) : def; 5258 } catch (NumberFormatException e) { 5259 return def; 5260 } 5261 } 5262 5263 /** 5264 * Convenience function for retrieving a single secure settings value 5265 * as a float. Note that internally setting values are always 5266 * stored as strings; this function converts the string to a float 5267 * for you. 5268 * <p> 5269 * This version does not take a default value. If the setting has not 5270 * been set, or the string value is not a number, 5271 * it throws {@link SettingNotFoundException}. 5272 * 5273 * @param cr The ContentResolver to access. 5274 * @param name The name of the setting to retrieve. 5275 * 5276 * @throws SettingNotFoundException Thrown if a setting by the given 5277 * name can't be found or the setting value is not a float. 5278 * 5279 * @return The setting's current value. 5280 */ 5281 public static float getFloat(ContentResolver cr, String name) 5282 throws SettingNotFoundException { 5283 return getFloatForUser(cr, name, cr.getUserId()); 5284 } 5285 5286 /** @hide */ 5287 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 5288 throws SettingNotFoundException { 5289 String v = getStringForUser(cr, name, userHandle); 5290 if (v == null) { 5291 throw new SettingNotFoundException(name); 5292 } 5293 try { 5294 return Float.parseFloat(v); 5295 } catch (NumberFormatException e) { 5296 throw new SettingNotFoundException(name); 5297 } 5298 } 5299 5300 /** 5301 * Convenience function for updating a single settings value as a 5302 * floating point number. This will either create a new entry in the 5303 * table if the given name does not exist, or modify the value of the 5304 * existing row with that name. Note that internally setting values 5305 * are always stored as strings, so this function converts the given 5306 * value to a string before storing it. 5307 * 5308 * @param cr The ContentResolver to access. 5309 * @param name The name of the setting to modify. 5310 * @param value The new value for the setting. 5311 * @return true if the value was set, false on database errors 5312 */ 5313 public static boolean putFloat(ContentResolver cr, String name, float value) { 5314 return putFloatForUser(cr, name, value, cr.getUserId()); 5315 } 5316 5317 /** @hide */ 5318 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 5319 int userHandle) { 5320 return putStringForUser(cr, name, Float.toString(value), userHandle); 5321 } 5322 5323 /** 5324 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 5325 * instead 5326 */ 5327 @Deprecated 5328 public static final String DEVELOPMENT_SETTINGS_ENABLED = 5329 Global.DEVELOPMENT_SETTINGS_ENABLED; 5330 5331 /** 5332 * When the user has enable the option to have a "bug report" command 5333 * in the power menu. 5334 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 5335 * @hide 5336 */ 5337 @Deprecated 5338 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 5339 5340 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; 5341 5342 /** 5343 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 5344 */ 5345 @Deprecated 5346 public static final String ADB_ENABLED = Global.ADB_ENABLED; 5347 5348 /** 5349 * Setting to allow mock locations and location provider status to be injected into the 5350 * LocationManager service for testing purposes during application development. These 5351 * locations and status values override actual location and status information generated 5352 * by network, gps, or other location providers. 5353 * 5354 * @deprecated This settings is not used anymore. 5355 */ 5356 @Deprecated 5357 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 5358 5359 private static final Validator ALLOW_MOCK_LOCATION_VALIDATOR = BOOLEAN_VALIDATOR; 5360 5361 /** 5362 * On Android 8.0 (API level 26) and higher versions of the platform, 5363 * a 64-bit number (expressed as a hexadecimal string), unique to 5364 * each combination of app-signing key, user, and device. 5365 * Values of {@code ANDROID_ID} are scoped by signing key and user. 5366 * The value may change if a factory reset is performed on the 5367 * device or if an APK signing key changes. 5368 * 5369 * For more information about how the platform handles {@code ANDROID_ID} 5370 * in Android 8.0 (API level 26) and higher, see <a 5371 * href="{@docRoot}preview/behavior-changes.html#privacy-all"> 5372 * Android 8.0 Behavior Changes</a>. 5373 * 5374 * <p class="note"><strong>Note:</strong> For apps that were installed 5375 * prior to updating the device to a version of Android 8.0 5376 * (API level 26) or higher, the value of {@code ANDROID_ID} changes 5377 * if the app is uninstalled and then reinstalled after the OTA. 5378 * To preserve values across uninstalls after an OTA to Android 8.0 5379 * or higher, developers can use 5380 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> 5381 * Key/Value Backup</a>.</p> 5382 * 5383 * <p>In versions of the platform lower than Android 8.0 (API level 26), 5384 * a 64-bit number (expressed as a hexadecimal string) that is randomly 5385 * generated when the user first sets up the device and should remain 5386 * constant for the lifetime of the user's device. 5387 * 5388 * On devices that have 5389 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> 5390 * multiple users</a>, each user appears as a 5391 * completely separate device, so the {@code ANDROID_ID} value is 5392 * unique to each user.</p> 5393 * 5394 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped 5395 * to the Instant App, it is generated when the Instant App is first installed and reset if 5396 * the user clears the Instant App. 5397 */ 5398 public static final String ANDROID_ID = "android_id"; 5399 5400 /** 5401 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 5402 */ 5403 @Deprecated 5404 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 5405 5406 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; 5407 5408 /** 5409 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 5410 */ 5411 @Deprecated 5412 public static final String DATA_ROAMING = Global.DATA_ROAMING; 5413 5414 /** 5415 * Setting to record the input method used by default, holding the ID 5416 * of the desired method. 5417 */ 5418 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 5419 5420 /** 5421 * Setting to record the input method subtype used by default, holding the ID 5422 * of the desired method. 5423 */ 5424 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 5425 "selected_input_method_subtype"; 5426 5427 /** 5428 * Setting to record the history of input method subtype, holding the pair of ID of IME 5429 * and its last used subtype. 5430 * @hide 5431 */ 5432 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 5433 "input_methods_subtype_history"; 5434 5435 /** 5436 * Setting to record the visibility of input method selector 5437 */ 5438 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 5439 "input_method_selector_visibility"; 5440 5441 /** 5442 * The currently selected voice interaction service flattened ComponentName. 5443 * @hide 5444 */ 5445 @TestApi 5446 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 5447 5448 /** 5449 * The currently selected autofill service flattened ComponentName. 5450 * @hide 5451 */ 5452 @TestApi 5453 public static final String AUTOFILL_SERVICE = "autofill_service"; 5454 5455 private static final Validator AUTOFILL_SERVICE_VALIDATOR = COMPONENT_NAME_VALIDATOR; 5456 5457 /** 5458 * Boolean indicating if Autofill supports field classification. 5459 * 5460 * @see android.service.autofill.AutofillService 5461 * 5462 * @hide 5463 */ 5464 @SystemApi 5465 @TestApi 5466 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = 5467 "autofill_field_classification"; 5468 5469 /** 5470 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. 5471 * 5472 * @hide 5473 */ 5474 @SystemApi 5475 @TestApi 5476 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = 5477 "autofill_user_data_max_user_data_size"; 5478 5479 /** 5480 * Defines value returned by 5481 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. 5482 * 5483 * @hide 5484 */ 5485 @SystemApi 5486 @TestApi 5487 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = 5488 "autofill_user_data_max_field_classification_size"; 5489 5490 /** 5491 * Defines value returned by 5492 * {@link android.service.autofill.UserData#getMaxCategoryCount()}. 5493 * 5494 * @hide 5495 */ 5496 @SystemApi 5497 @TestApi 5498 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = 5499 "autofill_user_data_max_category_count"; 5500 5501 /** 5502 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. 5503 * 5504 * @hide 5505 */ 5506 @SystemApi 5507 @TestApi 5508 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = 5509 "autofill_user_data_max_value_length"; 5510 5511 /** 5512 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. 5513 * 5514 * @hide 5515 */ 5516 @SystemApi 5517 @TestApi 5518 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = 5519 "autofill_user_data_min_value_length"; 5520 5521 /** 5522 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 5523 */ 5524 @Deprecated 5525 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 5526 5527 /** 5528 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 5529 * @hide 5530 */ 5531 @TestApi 5532 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 5533 5534 /** 5535 * The current state of device personalization. 5536 * 5537 * @hide 5538 * @see UserSetupPersonalization 5539 */ 5540 public static final String USER_SETUP_PERSONALIZATION_STATE = 5541 "user_setup_personalization_state"; 5542 5543 /** 5544 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 5545 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 5546 * in case SetupWizard has been re-enabled on TV devices. 5547 * 5548 * @hide 5549 */ 5550 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; 5551 5552 /** 5553 * Prefix for category name that marks whether a suggested action from that category was 5554 * completed. 5555 * @hide 5556 */ 5557 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; 5558 5559 /** 5560 * List of input methods that are currently enabled. This is a string 5561 * containing the IDs of all enabled input methods, each ID separated 5562 * by ':'. 5563 * 5564 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" 5565 * where imeId is ComponentName and subtype is int32. 5566 */ 5567 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 5568 5569 /** 5570 * List of system input methods that are currently disabled. This is a string 5571 * containing the IDs of all disabled input methods, each ID separated 5572 * by ':'. 5573 * @hide 5574 */ 5575 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 5576 5577 /** 5578 * Whether to show the IME when a hard keyboard is connected. This is a boolean that 5579 * determines if the IME should be shown when a hard keyboard is attached. 5580 * @hide 5581 */ 5582 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; 5583 5584 private static final Validator SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR = BOOLEAN_VALIDATOR; 5585 5586 /** 5587 * Host name and port for global http proxy. Uses ':' seperator for 5588 * between host and port. 5589 * 5590 * @deprecated Use {@link Global#HTTP_PROXY} 5591 */ 5592 @Deprecated 5593 public static final String HTTP_PROXY = Global.HTTP_PROXY; 5594 5595 /** 5596 * Package designated as always-on VPN provider. 5597 * 5598 * @hide 5599 */ 5600 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; 5601 5602 /** 5603 * Whether to block networking outside of VPN connections while always-on is set. 5604 * @see #ALWAYS_ON_VPN_APP 5605 * 5606 * @hide 5607 */ 5608 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; 5609 5610 /** 5611 * Whether applications can be installed for this user via the system's 5612 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 5613 * 5614 * <p>1 = permit app installation via the system package installer intent 5615 * <p>0 = do not allow use of the package installer 5616 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use 5617 * {@link PackageManager#canRequestPackageInstalls()} 5618 * @see PackageManager#canRequestPackageInstalls() 5619 */ 5620 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 5621 5622 /** 5623 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that 5624 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it 5625 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} 5626 * on behalf of the profile owner if needed to make the change transparent for profile 5627 * owners. 5628 * 5629 * @hide 5630 */ 5631 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = 5632 "unknown_sources_default_reversed"; 5633 5634 /** 5635 * Comma-separated list of location providers that activities may access. Do not rely on 5636 * this value being present in settings.db or on ContentObserver notifications on the 5637 * corresponding Uri. 5638 * 5639 * @deprecated use {@link #LOCATION_MODE} and 5640 * {@link LocationManager#MODE_CHANGED_ACTION} (or 5641 * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) 5642 */ 5643 @Deprecated 5644 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 5645 5646 /** 5647 * The degree of location access enabled by the user. 5648 * <p> 5649 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link 5650 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link 5651 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link 5652 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location 5653 * modes that might be added in the future. 5654 * <p> 5655 * Note: do not rely on this value being present in settings.db or on ContentObserver 5656 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} 5657 * to receive changes in this value. 5658 * 5659 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To 5660 * get the status of a location provider, use 5661 * {@link LocationManager#isProviderEnabled(String)}. 5662 */ 5663 @Deprecated 5664 public static final String LOCATION_MODE = "location_mode"; 5665 5666 /** 5667 * The App or module that changes the location mode. 5668 * @hide 5669 */ 5670 public static final String LOCATION_CHANGER = "location_changer"; 5671 /** 5672 * The location changer is unknown or unable to detect. 5673 * @hide 5674 */ 5675 public static final int LOCATION_CHANGER_UNKNOWN = 0; 5676 /** 5677 * Location settings in system settings. 5678 * @hide 5679 */ 5680 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; 5681 /** 5682 * The location icon in drop down notification drawer. 5683 * @hide 5684 */ 5685 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; 5686 5687 /** 5688 * Location access disabled. 5689 * 5690 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To 5691 * get the status of a location provider, use 5692 * {@link LocationManager#isProviderEnabled(String)}. 5693 */ 5694 @Deprecated 5695 public static final int LOCATION_MODE_OFF = 0; 5696 5697 /** 5698 * Network Location Provider disabled, but GPS and other sensors enabled. 5699 * 5700 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To 5701 * get the status of a location provider, use 5702 * {@link LocationManager#isProviderEnabled(String)}. 5703 */ 5704 @Deprecated 5705 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 5706 5707 /** 5708 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests 5709 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to 5710 * {@link android.location.Criteria#POWER_MEDIUM}. 5711 * 5712 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To 5713 * get the status of a location provider, use 5714 * {@link LocationManager#isProviderEnabled(String)}. 5715 */ 5716 @Deprecated 5717 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 5718 5719 /** 5720 * Best-effort location computation allowed. 5721 * 5722 * @deprecated To check location status, use {@link LocationManager#isLocationEnabled()}. To 5723 * get the status of a location provider, use 5724 * {@link LocationManager#isProviderEnabled(String)}. 5725 */ 5726 @Deprecated 5727 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 5728 5729 /** 5730 * A flag containing settings used for biometric weak 5731 * @hide 5732 */ 5733 @Deprecated 5734 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 5735 "lock_biometric_weak_flags"; 5736 5737 /** 5738 * Whether lock-to-app will lock the keyguard when exiting. 5739 * @hide 5740 */ 5741 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 5742 5743 /** 5744 * Whether autolock is enabled (0 = false, 1 = true) 5745 * 5746 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security 5747 * level of the keyguard. Accessing this setting from an app that is targeting 5748 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5749 */ 5750 @Deprecated 5751 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 5752 5753 /** 5754 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 5755 * 5756 * @deprecated Accessing this setting from an app that is targeting 5757 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5758 */ 5759 @Deprecated 5760 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 5761 5762 /** 5763 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 5764 * true) 5765 * 5766 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 5767 * lockscreen uses 5768 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 5769 * Accessing this setting from an app that is targeting 5770 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5771 */ 5772 @Deprecated 5773 public static final String 5774 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 5775 5776 /** 5777 * This preference allows the device to be locked given time after screen goes off, 5778 * subject to current DeviceAdmin policy limits. 5779 * @hide 5780 */ 5781 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 5782 5783 5784 /** 5785 * This preference contains the string that shows for owner info on LockScreen. 5786 * @hide 5787 * @deprecated 5788 */ 5789 @Deprecated 5790 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 5791 5792 /** 5793 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 5794 * @hide 5795 */ 5796 @Deprecated 5797 public static final String LOCK_SCREEN_APPWIDGET_IDS = 5798 "lock_screen_appwidget_ids"; 5799 5800 /** 5801 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 5802 * @hide 5803 */ 5804 @Deprecated 5805 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 5806 "lock_screen_fallback_appwidget_id"; 5807 5808 /** 5809 * Index of the lockscreen appwidget to restore, -1 if none. 5810 * @hide 5811 */ 5812 @Deprecated 5813 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 5814 "lock_screen_sticky_appwidget"; 5815 5816 /** 5817 * This preference enables showing the owner info on LockScreen. 5818 * @hide 5819 * @deprecated 5820 */ 5821 @Deprecated 5822 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 5823 "lock_screen_owner_info_enabled"; 5824 5825 /** 5826 * When set by a user, allows notifications to be shown atop a securely locked screen 5827 * in their full "private" form (same as when the device is unlocked). 5828 * @hide 5829 */ 5830 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 5831 "lock_screen_allow_private_notifications"; 5832 5833 /** 5834 * When set by a user, allows notification remote input atop a securely locked screen 5835 * without having to unlock 5836 * @hide 5837 */ 5838 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = 5839 "lock_screen_allow_remote_input"; 5840 5841 /** 5842 * Set by the system to track if the user needs to see the call to action for 5843 * the lockscreen notification policy. 5844 * @hide 5845 */ 5846 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = 5847 "show_note_about_notification_hiding"; 5848 5849 /** 5850 * Set to 1 by the system after trust agents have been initialized. 5851 * @hide 5852 */ 5853 public static final String TRUST_AGENTS_INITIALIZED = 5854 "trust_agents_initialized"; 5855 5856 /** 5857 * The Logging ID (a unique 64-bit value) as a hex string. 5858 * Used as a pseudonymous identifier for logging. 5859 * @deprecated This identifier is poorly initialized and has 5860 * many collisions. It should not be used. 5861 */ 5862 @Deprecated 5863 public static final String LOGGING_ID = "logging_id"; 5864 5865 /** 5866 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 5867 */ 5868 @Deprecated 5869 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 5870 5871 /** 5872 * No longer supported. 5873 */ 5874 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 5875 5876 /** 5877 * No longer supported. 5878 */ 5879 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 5880 5881 /** 5882 * No longer supported. 5883 */ 5884 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 5885 5886 /** 5887 * Settings classname to launch when Settings is clicked from All 5888 * Applications. Needed because of user testing between the old 5889 * and new Settings apps. 5890 */ 5891 // TODO: 881807 5892 public static final String SETTINGS_CLASSNAME = "settings_classname"; 5893 5894 /** 5895 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 5896 */ 5897 @Deprecated 5898 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 5899 5900 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 5901 5902 /** 5903 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 5904 */ 5905 @Deprecated 5906 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 5907 5908 /** 5909 * If accessibility is enabled. 5910 */ 5911 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 5912 5913 private static final Validator ACCESSIBILITY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 5914 5915 /** 5916 * Setting specifying if the accessibility shortcut is enabled. 5917 * @hide 5918 */ 5919 public static final String ACCESSIBILITY_SHORTCUT_ENABLED = 5920 "accessibility_shortcut_enabled"; 5921 5922 private static final Validator ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 5923 5924 /** 5925 * Setting specifying if the accessibility shortcut is enabled. 5926 * @hide 5927 */ 5928 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = 5929 "accessibility_shortcut_on_lock_screen"; 5930 5931 private static final Validator ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR = 5932 BOOLEAN_VALIDATOR; 5933 5934 /** 5935 * Setting specifying if the accessibility shortcut dialog has been shown to this user. 5936 * @hide 5937 */ 5938 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = 5939 "accessibility_shortcut_dialog_shown"; 5940 5941 private static final Validator ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR = 5942 BOOLEAN_VALIDATOR; 5943 5944 /** 5945 * Setting specifying the accessibility service to be toggled via the accessibility 5946 * shortcut. Must be its flattened {@link ComponentName}. 5947 * @hide 5948 */ 5949 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 5950 "accessibility_shortcut_target_service"; 5951 5952 private static final Validator ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR = 5953 COMPONENT_NAME_VALIDATOR; 5954 5955 /** 5956 * Setting specifying the accessibility service or feature to be toggled via the 5957 * accessibility button in the navigation bar. This is either a flattened 5958 * {@link ComponentName} or the class name of a system class implementing a supported 5959 * accessibility feature. 5960 * @hide 5961 */ 5962 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = 5963 "accessibility_button_target_component"; 5964 5965 private static final Validator ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR = 5966 new Validator() { 5967 @Override 5968 public boolean validate(String value) { 5969 // technically either ComponentName or class name, but there's proper value 5970 // validation at callsites, so allow any non-null string 5971 return value != null; 5972 } 5973 }; 5974 5975 /** 5976 * If touch exploration is enabled. 5977 */ 5978 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 5979 5980 private static final Validator TOUCH_EXPLORATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 5981 5982 /** 5983 * List of the enabled accessibility providers. 5984 */ 5985 public static final String ENABLED_ACCESSIBILITY_SERVICES = 5986 "enabled_accessibility_services"; 5987 5988 private static final Validator ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR = 5989 new SettingsValidators.ComponentNameListValidator(":"); 5990 5991 /** 5992 * List of the accessibility services to which the user has granted 5993 * permission to put the device into touch exploration mode. 5994 * 5995 * @hide 5996 */ 5997 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 5998 "touch_exploration_granted_accessibility_services"; 5999 6000 private static final Validator TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR = 6001 new SettingsValidators.ComponentNameListValidator(":"); 6002 6003 /** 6004 * Whether the hush gesture has ever been used // TODO: beverlyt 6005 * @hide 6006 */ 6007 public static final String HUSH_GESTURE_USED = "hush_gesture_used"; 6008 6009 private static final Validator HUSH_GESTURE_USED_VALIDATOR = BOOLEAN_VALIDATOR; 6010 6011 /** 6012 * Number of times the user has manually clicked the ringer toggle 6013 * @hide 6014 */ 6015 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count"; 6016 6017 private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR = 6018 NON_NEGATIVE_INTEGER_VALIDATOR; 6019 6020 /** 6021 * Uri of the slice that's presented on the keyguard. 6022 * Defaults to a slice with the date and next alarm. 6023 * 6024 * @hide 6025 */ 6026 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; 6027 6028 /** 6029 * Whether to speak passwords while in accessibility mode. 6030 * 6031 * @deprecated The speaking of passwords is controlled by individual accessibility services. 6032 * Apps should ignore this setting and provide complete information to accessibility 6033 * at all times, which was the behavior when this value was {@code true}. 6034 */ 6035 @Deprecated 6036 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 6037 6038 private static final Validator ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR = BOOLEAN_VALIDATOR; 6039 6040 /** 6041 * Whether to draw text with high contrast while in accessibility mode. 6042 * 6043 * @hide 6044 */ 6045 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 6046 "high_text_contrast_enabled"; 6047 6048 private static final Validator ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR = 6049 BOOLEAN_VALIDATOR; 6050 6051 /** 6052 * Setting that specifies whether the display magnification is enabled via a system-wide 6053 * triple tap gesture. Display magnifications allows the user to zoom in the display content 6054 * and is targeted to low vision users. The current magnification scale is controlled by 6055 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 6056 * 6057 * @hide 6058 */ 6059 @TestApi 6060 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 6061 "accessibility_display_magnification_enabled"; 6062 6063 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR = 6064 BOOLEAN_VALIDATOR; 6065 6066 /** 6067 * Setting that specifies whether the display magnification is enabled via a shortcut 6068 * affordance within the system's navigation area. Display magnifications allows the user to 6069 * zoom in the display content and is targeted to low vision users. The current 6070 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 6071 * 6072 * @hide 6073 */ 6074 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = 6075 "accessibility_display_magnification_navbar_enabled"; 6076 6077 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR 6078 = BOOLEAN_VALIDATOR; 6079 6080 /** 6081 * Setting that specifies what the display magnification scale is. 6082 * Display magnifications allows the user to zoom in the display 6083 * content and is targeted to low vision users. Whether a display 6084 * magnification is performed is controlled by 6085 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and 6086 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} 6087 * 6088 * @hide 6089 */ 6090 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 6091 "accessibility_display_magnification_scale"; 6092 6093 private static final Validator ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR = 6094 new SettingsValidators.InclusiveFloatRangeValidator(1.0f, Float.MAX_VALUE); 6095 6096 /** 6097 * Unused mangnification setting 6098 * 6099 * @hide 6100 * @deprecated 6101 */ 6102 @Deprecated 6103 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 6104 "accessibility_display_magnification_auto_update"; 6105 6106 /** 6107 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be 6108 * modified from an AccessibilityService using the SoftKeyboardController. 6109 * 6110 * @hide 6111 */ 6112 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = 6113 "accessibility_soft_keyboard_mode"; 6114 6115 /** 6116 * Default soft keyboard behavior. 6117 * 6118 * @hide 6119 */ 6120 public static final int SHOW_MODE_AUTO = 0; 6121 6122 /** 6123 * Soft keyboard is never shown. 6124 * 6125 * @hide 6126 */ 6127 public static final int SHOW_MODE_HIDDEN = 1; 6128 6129 /** 6130 * Setting that specifies whether timed text (captions) should be 6131 * displayed in video content. Text display properties are controlled by 6132 * the following settings: 6133 * <ul> 6134 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 6135 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 6136 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 6137 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 6138 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 6139 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 6140 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 6141 * </ul> 6142 * 6143 * @hide 6144 */ 6145 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 6146 "accessibility_captioning_enabled"; 6147 6148 private static final Validator ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR = 6149 BOOLEAN_VALIDATOR; 6150 6151 /** 6152 * Setting that specifies the language for captions as a locale string, 6153 * e.g. en_US. 6154 * 6155 * @see java.util.Locale#toString 6156 * @hide 6157 */ 6158 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 6159 "accessibility_captioning_locale"; 6160 6161 private static final Validator ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR = LOCALE_VALIDATOR; 6162 6163 /** 6164 * Integer property that specifies the preset style for captions, one 6165 * of: 6166 * <ul> 6167 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 6168 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 6169 * </ul> 6170 * 6171 * @see java.util.Locale#toString 6172 * @hide 6173 */ 6174 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 6175 "accessibility_captioning_preset"; 6176 6177 private static final Validator ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR = 6178 new SettingsValidators.DiscreteValueValidator(new String[]{"-1", "0", "1", "2", 6179 "3", "4"}); 6180 6181 /** 6182 * Integer property that specifes the background color for captions as a 6183 * packed 32-bit color. 6184 * 6185 * @see android.graphics.Color#argb 6186 * @hide 6187 */ 6188 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 6189 "accessibility_captioning_background_color"; 6190 6191 private static final Validator ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR = 6192 ANY_INTEGER_VALIDATOR; 6193 6194 /** 6195 * Integer property that specifes the foreground color for captions as a 6196 * packed 32-bit color. 6197 * 6198 * @see android.graphics.Color#argb 6199 * @hide 6200 */ 6201 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 6202 "accessibility_captioning_foreground_color"; 6203 6204 private static final Validator ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR = 6205 ANY_INTEGER_VALIDATOR; 6206 6207 /** 6208 * Integer property that specifes the edge type for captions, one of: 6209 * <ul> 6210 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 6211 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 6212 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 6213 * </ul> 6214 * 6215 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 6216 * @hide 6217 */ 6218 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 6219 "accessibility_captioning_edge_type"; 6220 6221 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR = 6222 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2"}); 6223 6224 /** 6225 * Integer property that specifes the edge color for captions as a 6226 * packed 32-bit color. 6227 * 6228 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 6229 * @see android.graphics.Color#argb 6230 * @hide 6231 */ 6232 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 6233 "accessibility_captioning_edge_color"; 6234 6235 private static final Validator ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR = 6236 ANY_INTEGER_VALIDATOR; 6237 6238 /** 6239 * Integer property that specifes the window color for captions as a 6240 * packed 32-bit color. 6241 * 6242 * @see android.graphics.Color#argb 6243 * @hide 6244 */ 6245 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 6246 "accessibility_captioning_window_color"; 6247 6248 private static final Validator ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR = 6249 ANY_INTEGER_VALIDATOR; 6250 6251 /** 6252 * String property that specifies the typeface for captions, one of: 6253 * <ul> 6254 * <li>DEFAULT 6255 * <li>MONOSPACE 6256 * <li>SANS_SERIF 6257 * <li>SERIF 6258 * </ul> 6259 * 6260 * @see android.graphics.Typeface 6261 * @hide 6262 */ 6263 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 6264 "accessibility_captioning_typeface"; 6265 6266 private static final Validator ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR = 6267 new SettingsValidators.DiscreteValueValidator(new String[]{"DEFAULT", 6268 "MONOSPACE", "SANS_SERIF", "SERIF"}); 6269 6270 /** 6271 * Floating point property that specifies font scaling for captions. 6272 * 6273 * @hide 6274 */ 6275 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 6276 "accessibility_captioning_font_scale"; 6277 6278 private static final Validator ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR = 6279 new SettingsValidators.InclusiveFloatRangeValidator(0.5f, 2.0f); 6280 6281 /** 6282 * Setting that specifies whether display color inversion is enabled. 6283 */ 6284 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 6285 "accessibility_display_inversion_enabled"; 6286 6287 private static final Validator ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR = 6288 BOOLEAN_VALIDATOR; 6289 6290 /** 6291 * Setting that specifies whether display color space adjustment is 6292 * enabled. 6293 * 6294 * @hide 6295 */ 6296 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 6297 "accessibility_display_daltonizer_enabled"; 6298 6299 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR = 6300 BOOLEAN_VALIDATOR; 6301 6302 /** 6303 * Integer property that specifies the type of color space adjustment to 6304 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: 6305 * - AccessibilityManager.DALTONIZER_DISABLED = -1 6306 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 6307 * - <item>@string/daltonizer_mode_protanomaly</item> = 11 6308 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and 6309 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 6310 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 6311 * 6312 * @hide 6313 */ 6314 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 6315 "accessibility_display_daltonizer"; 6316 6317 private static final Validator ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR = 6318 new SettingsValidators.DiscreteValueValidator( 6319 new String[] {"-1", "0", "11", "12", "13"}); 6320 6321 /** 6322 * Setting that specifies whether automatic click when the mouse pointer stops moving is 6323 * enabled. 6324 * 6325 * @hide 6326 */ 6327 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = 6328 "accessibility_autoclick_enabled"; 6329 6330 private static final Validator ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR = 6331 BOOLEAN_VALIDATOR; 6332 6333 /** 6334 * Integer setting specifying amount of time in ms the mouse pointer has to stay still 6335 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. 6336 * 6337 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED 6338 * @hide 6339 */ 6340 public static final String ACCESSIBILITY_AUTOCLICK_DELAY = 6341 "accessibility_autoclick_delay"; 6342 6343 private static final Validator ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR = 6344 NON_NEGATIVE_INTEGER_VALIDATOR; 6345 6346 /** 6347 * Whether or not larger size icons are used for the pointer of mouse/trackpad for 6348 * accessibility. 6349 * (0 = false, 1 = true) 6350 * @hide 6351 */ 6352 public static final String ACCESSIBILITY_LARGE_POINTER_ICON = 6353 "accessibility_large_pointer_icon"; 6354 6355 private static final Validator ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR = 6356 BOOLEAN_VALIDATOR; 6357 6358 /** 6359 * The timeout for considering a press to be a long press in milliseconds. 6360 * @hide 6361 */ 6362 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 6363 6364 private static final Validator LONG_PRESS_TIMEOUT_VALIDATOR = 6365 NON_NEGATIVE_INTEGER_VALIDATOR; 6366 6367 /** 6368 * The duration in milliseconds between the first tap's up event and the second tap's 6369 * down event for an interaction to be considered part of the same multi-press. 6370 * @hide 6371 */ 6372 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; 6373 6374 /** 6375 * List of the enabled print services. 6376 * 6377 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade 6378 * from pre-N. 6379 * 6380 * @hide 6381 */ 6382 public static final String ENABLED_PRINT_SERVICES = 6383 "enabled_print_services"; 6384 6385 /** 6386 * List of the disabled print services. 6387 * 6388 * @hide 6389 */ 6390 @TestApi 6391 public static final String DISABLED_PRINT_SERVICES = 6392 "disabled_print_services"; 6393 6394 /** 6395 * The saved value for WindowManagerService.setForcedDisplayDensity() 6396 * formatted as a single integer representing DPI. If unset, then use 6397 * the real display density. 6398 * 6399 * @hide 6400 */ 6401 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 6402 6403 /** 6404 * Setting to always use the default text-to-speech settings regardless 6405 * of the application settings. 6406 * 1 = override application settings, 6407 * 0 = use application settings (if specified). 6408 * 6409 * @deprecated The value of this setting is no longer respected by 6410 * the framework text to speech APIs as of the Ice Cream Sandwich release. 6411 */ 6412 @Deprecated 6413 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 6414 6415 /** 6416 * Default text-to-speech engine speech rate. 100 = 1x 6417 */ 6418 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 6419 6420 private static final Validator TTS_DEFAULT_RATE_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; 6421 6422 /** 6423 * Default text-to-speech engine pitch. 100 = 1x 6424 */ 6425 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 6426 6427 private static final Validator TTS_DEFAULT_PITCH_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; 6428 6429 /** 6430 * Default text-to-speech engine. 6431 */ 6432 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 6433 6434 private static final Validator TTS_DEFAULT_SYNTH_VALIDATOR = PACKAGE_NAME_VALIDATOR; 6435 6436 /** 6437 * Default text-to-speech language. 6438 * 6439 * @deprecated this setting is no longer in use, as of the Ice Cream 6440 * Sandwich release. Apps should never need to read this setting directly, 6441 * instead can query the TextToSpeech framework classes for the default 6442 * locale. {@link TextToSpeech#getLanguage()}. 6443 */ 6444 @Deprecated 6445 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 6446 6447 /** 6448 * Default text-to-speech country. 6449 * 6450 * @deprecated this setting is no longer in use, as of the Ice Cream 6451 * Sandwich release. Apps should never need to read this setting directly, 6452 * instead can query the TextToSpeech framework classes for the default 6453 * locale. {@link TextToSpeech#getLanguage()}. 6454 */ 6455 @Deprecated 6456 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 6457 6458 /** 6459 * Default text-to-speech locale variant. 6460 * 6461 * @deprecated this setting is no longer in use, as of the Ice Cream 6462 * Sandwich release. Apps should never need to read this setting directly, 6463 * instead can query the TextToSpeech framework classes for the 6464 * locale that is in use {@link TextToSpeech#getLanguage()}. 6465 */ 6466 @Deprecated 6467 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 6468 6469 /** 6470 * Stores the default tts locales on a per engine basis. Stored as 6471 * a comma seperated list of values, each value being of the form 6472 * {@code engine_name:locale} for example, 6473 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 6474 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 6475 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 6476 * setting directly, and can query the TextToSpeech framework classes 6477 * for the locale that is in use. 6478 * 6479 * @hide 6480 */ 6481 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 6482 6483 private static final Validator TTS_DEFAULT_LOCALE_VALIDATOR = new Validator() { 6484 @Override 6485 public boolean validate(String value) { 6486 if (value == null || value.length() == 0) { 6487 return false; 6488 } 6489 String[] ttsLocales = value.split(","); 6490 boolean valid = true; 6491 for (String ttsLocale : ttsLocales) { 6492 String[] parts = ttsLocale.split(":"); 6493 valid |= ((parts.length == 2) 6494 && (parts[0].length() > 0) 6495 && ANY_STRING_VALIDATOR.validate(parts[0]) 6496 && LOCALE_VALIDATOR.validate(parts[1])); 6497 } 6498 return valid; 6499 } 6500 }; 6501 6502 /** 6503 * Space delimited list of plugin packages that are enabled. 6504 */ 6505 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 6506 6507 private static final Validator TTS_ENABLED_PLUGINS_VALIDATOR = 6508 new SettingsValidators.PackageNameListValidator(" "); 6509 6510 /** 6511 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 6512 * instead. 6513 */ 6514 @Deprecated 6515 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 6516 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 6517 6518 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = 6519 BOOLEAN_VALIDATOR; 6520 6521 /** 6522 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 6523 * instead. 6524 */ 6525 @Deprecated 6526 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 6527 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 6528 6529 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = 6530 NON_NEGATIVE_INTEGER_VALIDATOR; 6531 6532 /** 6533 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 6534 * instead. 6535 */ 6536 @Deprecated 6537 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 6538 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 6539 6540 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = 6541 NON_NEGATIVE_INTEGER_VALIDATOR; 6542 6543 /** 6544 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 6545 * instead. 6546 */ 6547 @Deprecated 6548 public static final String WIFI_ON = Global.WIFI_ON; 6549 6550 /** 6551 * The acceptable packet loss percentage (range 0 - 100) before trying 6552 * another AP on the same network. 6553 * @deprecated This setting is not used. 6554 */ 6555 @Deprecated 6556 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 6557 "wifi_watchdog_acceptable_packet_loss_percentage"; 6558 6559 /** 6560 * The number of access points required for a network in order for the 6561 * watchdog to monitor it. 6562 * @deprecated This setting is not used. 6563 */ 6564 @Deprecated 6565 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 6566 6567 /** 6568 * The delay between background checks. 6569 * @deprecated This setting is not used. 6570 */ 6571 @Deprecated 6572 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 6573 "wifi_watchdog_background_check_delay_ms"; 6574 6575 /** 6576 * Whether the Wi-Fi watchdog is enabled for background checking even 6577 * after it thinks the user has connected to a good access point. 6578 * @deprecated This setting is not used. 6579 */ 6580 @Deprecated 6581 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 6582 "wifi_watchdog_background_check_enabled"; 6583 6584 /** 6585 * The timeout for a background ping 6586 * @deprecated This setting is not used. 6587 */ 6588 @Deprecated 6589 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 6590 "wifi_watchdog_background_check_timeout_ms"; 6591 6592 /** 6593 * The number of initial pings to perform that *may* be ignored if they 6594 * fail. Again, if these fail, they will *not* be used in packet loss 6595 * calculation. For example, one network always seemed to time out for 6596 * the first couple pings, so this is set to 3 by default. 6597 * @deprecated This setting is not used. 6598 */ 6599 @Deprecated 6600 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 6601 "wifi_watchdog_initial_ignored_ping_count"; 6602 6603 /** 6604 * The maximum number of access points (per network) to attempt to test. 6605 * If this number is reached, the watchdog will no longer monitor the 6606 * initial connection state for the network. This is a safeguard for 6607 * networks containing multiple APs whose DNS does not respond to pings. 6608 * @deprecated This setting is not used. 6609 */ 6610 @Deprecated 6611 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 6612 6613 /** 6614 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 6615 */ 6616 @Deprecated 6617 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 6618 6619 /** 6620 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 6621 * @deprecated This setting is not used. 6622 */ 6623 @Deprecated 6624 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 6625 6626 /** 6627 * The number of pings to test if an access point is a good connection. 6628 * @deprecated This setting is not used. 6629 */ 6630 @Deprecated 6631 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 6632 6633 /** 6634 * The delay between pings. 6635 * @deprecated This setting is not used. 6636 */ 6637 @Deprecated 6638 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 6639 6640 /** 6641 * The timeout per ping. 6642 * @deprecated This setting is not used. 6643 */ 6644 @Deprecated 6645 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 6646 6647 /** 6648 * @deprecated Use 6649 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 6650 */ 6651 @Deprecated 6652 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 6653 6654 /** 6655 * @deprecated Use 6656 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 6657 */ 6658 @Deprecated 6659 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 6660 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 6661 6662 /** 6663 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives 6664 * the receivers of the PendingIntent an opportunity to make a new network request before 6665 * the Network satisfying the request is potentially removed. 6666 * 6667 * @hide 6668 */ 6669 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = 6670 "connectivity_release_pending_intent_delay_ms"; 6671 6672 /** 6673 * Whether background data usage is allowed. 6674 * 6675 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 6676 * availability of background data depends on several 6677 * combined factors. When background data is unavailable, 6678 * {@link ConnectivityManager#getActiveNetworkInfo()} will 6679 * now appear disconnected. 6680 */ 6681 @Deprecated 6682 public static final String BACKGROUND_DATA = "background_data"; 6683 6684 /** 6685 * Origins for which browsers should allow geolocation by default. 6686 * The value is a space-separated list of origins. 6687 */ 6688 public static final String ALLOWED_GEOLOCATION_ORIGINS 6689 = "allowed_geolocation_origins"; 6690 6691 /** 6692 * The preferred TTY mode 0 = TTy Off, CDMA default 6693 * 1 = TTY Full 6694 * 2 = TTY HCO 6695 * 3 = TTY VCO 6696 * @hide 6697 */ 6698 public static final String PREFERRED_TTY_MODE = 6699 "preferred_tty_mode"; 6700 6701 private static final Validator PREFERRED_TTY_MODE_VALIDATOR = 6702 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1", "2", "3"}); 6703 6704 /** 6705 * Whether the enhanced voice privacy mode is enabled. 6706 * 0 = normal voice privacy 6707 * 1 = enhanced voice privacy 6708 * @hide 6709 */ 6710 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 6711 6712 private static final Validator ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 6713 6714 /** 6715 * Whether the TTY mode mode is enabled. 6716 * 0 = disabled 6717 * 1 = enabled 6718 * @hide 6719 */ 6720 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 6721 6722 private static final Validator TTY_MODE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 6723 6724 /** 6725 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT 6726 * calls when supported by the device and carrier. Boolean value. 6727 * 0 = OFF 6728 * 1 = ON 6729 */ 6730 public static final String RTT_CALLING_MODE = "rtt_calling_mode"; 6731 6732 private static final Validator RTT_CALLING_MODE_VALIDATOR = BOOLEAN_VALIDATOR; 6733 6734 /** 6735 /** 6736 * Controls whether settings backup is enabled. 6737 * Type: int ( 0 = disabled, 1 = enabled ) 6738 * @hide 6739 */ 6740 public static final String BACKUP_ENABLED = "backup_enabled"; 6741 6742 /** 6743 * Controls whether application data is automatically restored from backup 6744 * at install time. 6745 * Type: int ( 0 = disabled, 1 = enabled ) 6746 * @hide 6747 */ 6748 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 6749 6750 /** 6751 * Indicates whether settings backup has been fully provisioned. 6752 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 6753 * @hide 6754 */ 6755 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 6756 6757 /** 6758 * Component of the transport to use for backup/restore. 6759 * @hide 6760 */ 6761 public static final String BACKUP_TRANSPORT = "backup_transport"; 6762 6763 /** 6764 * Version for which the setup wizard was last shown. Bumped for 6765 * each release when there is new setup information to show. 6766 * @hide 6767 */ 6768 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 6769 6770 /** 6771 * The interval in milliseconds after which Wi-Fi is considered idle. 6772 * When idle, it is possible for the device to be switched from Wi-Fi to 6773 * the mobile data network. 6774 * @hide 6775 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 6776 * instead. 6777 */ 6778 @Deprecated 6779 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 6780 6781 /** 6782 * The global search provider chosen by the user (if multiple global 6783 * search providers are installed). This will be the provider returned 6784 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 6785 * installed. This setting is stored as a flattened component name as 6786 * per {@link ComponentName#flattenToString()}. 6787 * 6788 * @hide 6789 */ 6790 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 6791 "search_global_search_activity"; 6792 6793 /** 6794 * The number of promoted sources in GlobalSearch. 6795 * @hide 6796 */ 6797 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 6798 /** 6799 * The maximum number of suggestions returned by GlobalSearch. 6800 * @hide 6801 */ 6802 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 6803 /** 6804 * The number of suggestions GlobalSearch will ask each non-web search source for. 6805 * @hide 6806 */ 6807 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 6808 /** 6809 * The number of suggestions the GlobalSearch will ask the web search source for. 6810 * @hide 6811 */ 6812 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 6813 "search_web_results_override_limit"; 6814 /** 6815 * The number of milliseconds that GlobalSearch will wait for suggestions from 6816 * promoted sources before continuing with all other sources. 6817 * @hide 6818 */ 6819 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 6820 "search_promoted_source_deadline_millis"; 6821 /** 6822 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 6823 * @hide 6824 */ 6825 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 6826 /** 6827 * The maximum number of milliseconds that GlobalSearch shows the previous results 6828 * after receiving a new query. 6829 * @hide 6830 */ 6831 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 6832 /** 6833 * The maximum age of log data used for shortcuts in GlobalSearch. 6834 * @hide 6835 */ 6836 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 6837 /** 6838 * The maximum age of log data used for source ranking in GlobalSearch. 6839 * @hide 6840 */ 6841 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 6842 "search_max_source_event_age_millis"; 6843 /** 6844 * The minimum number of impressions needed to rank a source in GlobalSearch. 6845 * @hide 6846 */ 6847 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 6848 "search_min_impressions_for_source_ranking"; 6849 /** 6850 * The minimum number of clicks needed to rank a source in GlobalSearch. 6851 * @hide 6852 */ 6853 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 6854 "search_min_clicks_for_source_ranking"; 6855 /** 6856 * The maximum number of shortcuts shown by GlobalSearch. 6857 * @hide 6858 */ 6859 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 6860 /** 6861 * The size of the core thread pool for suggestion queries in GlobalSearch. 6862 * @hide 6863 */ 6864 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 6865 "search_query_thread_core_pool_size"; 6866 /** 6867 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 6868 * @hide 6869 */ 6870 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 6871 "search_query_thread_max_pool_size"; 6872 /** 6873 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 6874 * @hide 6875 */ 6876 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 6877 "search_shortcut_refresh_core_pool_size"; 6878 /** 6879 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 6880 * @hide 6881 */ 6882 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 6883 "search_shortcut_refresh_max_pool_size"; 6884 /** 6885 * The maximun time that excess threads in the GlobalSeach thread pools will 6886 * wait before terminating. 6887 * @hide 6888 */ 6889 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 6890 "search_thread_keepalive_seconds"; 6891 /** 6892 * The maximum number of concurrent suggestion queries to each source. 6893 * @hide 6894 */ 6895 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 6896 "search_per_source_concurrent_query_limit"; 6897 6898 /** 6899 * Whether or not alert sounds are played on StorageManagerService events. 6900 * (0 = false, 1 = true) 6901 * @hide 6902 */ 6903 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 6904 6905 private static final Validator MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR = BOOLEAN_VALIDATOR; 6906 6907 /** 6908 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 6909 * @hide 6910 */ 6911 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 6912 6913 private static final Validator MOUNT_UMS_AUTOSTART_VALIDATOR = BOOLEAN_VALIDATOR; 6914 6915 /** 6916 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 6917 * @hide 6918 */ 6919 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 6920 6921 private static final Validator MOUNT_UMS_PROMPT_VALIDATOR = BOOLEAN_VALIDATOR; 6922 6923 /** 6924 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 6925 * @hide 6926 */ 6927 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 6928 6929 private static final Validator MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 6930 6931 /** 6932 * If nonzero, ANRs in invisible background processes bring up a dialog. 6933 * Otherwise, the process will be silently killed. 6934 * 6935 * Also prevents ANRs and crash dialogs from being suppressed. 6936 * @hide 6937 */ 6938 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 6939 6940 /** 6941 * If nonzero, crashes in foreground processes will bring up a dialog. 6942 * Otherwise, the process will be silently killed. 6943 * @hide 6944 */ 6945 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = 6946 "show_first_crash_dialog_dev_option"; 6947 6948 private static final Validator SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR = 6949 BOOLEAN_VALIDATOR; 6950 6951 /** 6952 * The {@link ComponentName} string of the service to be used as the voice recognition 6953 * service. 6954 * 6955 * @hide 6956 */ 6957 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 6958 6959 /** 6960 * Stores whether an user has consented to have apps verified through PAM. 6961 * The value is boolean (1 or 0). 6962 * 6963 * @hide 6964 */ 6965 public static final String PACKAGE_VERIFIER_USER_CONSENT = 6966 "package_verifier_user_consent"; 6967 6968 /** 6969 * The {@link ComponentName} string of the selected spell checker service which is 6970 * one of the services managed by the text service manager. 6971 * 6972 * @hide 6973 */ 6974 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 6975 6976 private static final Validator SELECTED_SPELL_CHECKER_VALIDATOR = COMPONENT_NAME_VALIDATOR; 6977 6978 /** 6979 * The {@link ComponentName} string of the selected subtype of the selected spell checker 6980 * service which is one of the services managed by the text service manager. 6981 * 6982 * @hide 6983 */ 6984 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 6985 "selected_spell_checker_subtype"; 6986 6987 private static final Validator SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR = 6988 COMPONENT_NAME_VALIDATOR; 6989 6990 /** 6991 * Whether spell checker is enabled or not. 6992 * 6993 * @hide 6994 */ 6995 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 6996 6997 private static final Validator SPELL_CHECKER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 6998 6999 /** 7000 * What happens when the user presses the Power button while in-call 7001 * and the screen is on.<br/> 7002 * <b>Values:</b><br/> 7003 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 7004 * 2 - The Power button hangs up the current call.<br/> 7005 * 7006 * @hide 7007 */ 7008 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 7009 7010 private static final Validator INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR = 7011 new SettingsValidators.DiscreteValueValidator(new String[]{"1", "2"}); 7012 7013 /** 7014 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 7015 * @hide 7016 */ 7017 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 7018 7019 /** 7020 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 7021 * @hide 7022 */ 7023 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 7024 7025 /** 7026 * INCALL_POWER_BUTTON_BEHAVIOR default value. 7027 * @hide 7028 */ 7029 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 7030 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 7031 7032 /** 7033 * What happens when the user presses the Back button while in-call 7034 * and the screen is on.<br/> 7035 * <b>Values:</b><br/> 7036 * 0 - The Back buttons does nothing different.<br/> 7037 * 1 - The Back button hangs up the current call.<br/> 7038 * 7039 * @hide 7040 */ 7041 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; 7042 7043 /** 7044 * INCALL_BACK_BUTTON_BEHAVIOR value for no action. 7045 * @hide 7046 */ 7047 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; 7048 7049 /** 7050 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". 7051 * @hide 7052 */ 7053 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; 7054 7055 /** 7056 * INCALL_POWER_BUTTON_BEHAVIOR default value. 7057 * @hide 7058 */ 7059 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = 7060 INCALL_BACK_BUTTON_BEHAVIOR_NONE; 7061 7062 /** 7063 * Whether the device should wake when the wake gesture sensor detects motion. 7064 * @hide 7065 */ 7066 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 7067 7068 private static final Validator WAKE_GESTURE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 7069 7070 /** 7071 * Whether the device should doze if configured. 7072 * @hide 7073 */ 7074 public static final String DOZE_ENABLED = "doze_enabled"; 7075 7076 private static final Validator DOZE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 7077 7078 /** 7079 * Whether doze should be always on. 7080 * @hide 7081 */ 7082 public static final String DOZE_ALWAYS_ON = "doze_always_on"; 7083 7084 /** 7085 * Whether the device should pulse on pick up gesture. 7086 * @hide 7087 */ 7088 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; 7089 7090 private static final Validator DOZE_PULSE_ON_PICK_UP_VALIDATOR = BOOLEAN_VALIDATOR; 7091 7092 /** 7093 * Whether the device should pulse on long press gesture. 7094 * @hide 7095 */ 7096 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; 7097 7098 /** 7099 * Whether the device should pulse on double tap gesture. 7100 * @hide 7101 */ 7102 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; 7103 7104 private static final Validator DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR = BOOLEAN_VALIDATOR; 7105 7106 /** 7107 * The current night mode that has been selected by the user. Owned 7108 * and controlled by UiModeManagerService. Constants are as per 7109 * UiModeManager. 7110 * @hide 7111 */ 7112 public static final String UI_NIGHT_MODE = "ui_night_mode"; 7113 7114 /** 7115 * Whether screensavers are enabled. 7116 * @hide 7117 */ 7118 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 7119 7120 private static final Validator SCREENSAVER_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 7121 7122 /** 7123 * The user's chosen screensaver components. 7124 * 7125 * These will be launched by the PhoneWindowManager after a timeout when not on 7126 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 7127 * @hide 7128 */ 7129 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 7130 7131 private static final Validator SCREENSAVER_COMPONENTS_VALIDATOR = 7132 new SettingsValidators.ComponentNameListValidator(","); 7133 7134 /** 7135 * If screensavers are enabled, whether the screensaver should be automatically launched 7136 * when the device is inserted into a (desk) dock. 7137 * @hide 7138 */ 7139 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 7140 7141 private static final Validator SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR = BOOLEAN_VALIDATOR; 7142 7143 /** 7144 * If screensavers are enabled, whether the screensaver should be automatically launched 7145 * when the screen times out when not on battery. 7146 * @hide 7147 */ 7148 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 7149 7150 private static final Validator SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR; 7151 7152 /** 7153 * If screensavers are enabled, the default screensaver component. 7154 * @hide 7155 */ 7156 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 7157 7158 /** 7159 * The default NFC payment component 7160 * @hide 7161 */ 7162 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 7163 7164 private static final Validator NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR = 7165 COMPONENT_NAME_VALIDATOR; 7166 7167 /** 7168 * Whether NFC payment is handled by the foreground application or a default. 7169 * @hide 7170 */ 7171 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 7172 7173 /** 7174 * Specifies the package name currently configured to be the primary sms application 7175 * @hide 7176 */ 7177 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 7178 7179 /** 7180 * Specifies the package name currently configured to be the default dialer application 7181 * @hide 7182 */ 7183 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; 7184 7185 /** 7186 * Specifies the package name currently configured to be the emergency assistance application 7187 * 7188 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE 7189 * 7190 * @hide 7191 */ 7192 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; 7193 7194 /** 7195 * Specifies whether the current app context on scren (assist data) will be sent to the 7196 * assist application (active voice interaction service). 7197 * 7198 * @hide 7199 */ 7200 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; 7201 7202 /** 7203 * Specifies whether a screenshot of the screen contents will be sent to the assist 7204 * application (active voice interaction service). 7205 * 7206 * @hide 7207 */ 7208 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; 7209 7210 /** 7211 * Specifies whether the screen will show an animation if screen contents are sent to the 7212 * assist application (active voice interaction service). 7213 * 7214 * Note that the disclosure will be forced for third-party assistants or if the device 7215 * does not support disabling it. 7216 * 7217 * @hide 7218 */ 7219 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; 7220 7221 /** 7222 * Control if rotation suggestions are sent to System UI when in rotation locked mode. 7223 * Done to enable screen rotation while the the screen rotation is locked. Enabling will 7224 * poll the accelerometer in rotation locked mode. 7225 * 7226 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. 7227 * 7228 * @hide 7229 */ 7230 7231 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; 7232 7233 /** 7234 * The disabled state of SHOW_ROTATION_SUGGESTIONS. 7235 * @hide 7236 */ 7237 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; 7238 7239 /** 7240 * The enabled state of SHOW_ROTATION_SUGGESTIONS. 7241 * @hide 7242 */ 7243 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; 7244 7245 /** 7246 * The default state of SHOW_ROTATION_SUGGESTIONS. 7247 * @hide 7248 */ 7249 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = 7250 SHOW_ROTATION_SUGGESTIONS_ENABLED; 7251 7252 /** 7253 * The number of accepted rotation suggestions. Used to determine if the user has been 7254 * introduced to rotation suggestions. 7255 * @hide 7256 */ 7257 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = 7258 "num_rotation_suggestions_accepted"; 7259 7260 /** 7261 * Read only list of the service components that the current user has explicitly allowed to 7262 * see and assist with all of the user's notifications. 7263 * 7264 * @deprecated Use 7265 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. 7266 * @hide 7267 */ 7268 @Deprecated 7269 public static final String ENABLED_NOTIFICATION_ASSISTANT = 7270 "enabled_notification_assistant"; 7271 7272 private static final Validator ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR = 7273 new SettingsValidators.ComponentNameListValidator(":"); 7274 7275 /** 7276 * Read only list of the service components that the current user has explicitly allowed to 7277 * see all of the user's notifications, separated by ':'. 7278 * 7279 * @hide 7280 * @deprecated Use 7281 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. 7282 */ 7283 @Deprecated 7284 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 7285 7286 private static final Validator ENABLED_NOTIFICATION_LISTENERS_VALIDATOR = 7287 new SettingsValidators.ComponentNameListValidator(":"); 7288 7289 /** 7290 * Read only list of the packages that the current user has explicitly allowed to 7291 * manage do not disturb, separated by ':'. 7292 * 7293 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. 7294 * @hide 7295 */ 7296 @Deprecated 7297 @TestApi 7298 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = 7299 "enabled_notification_policy_access_packages"; 7300 7301 private static final Validator ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR = 7302 new SettingsValidators.PackageNameListValidator(":"); 7303 7304 /** 7305 * Defines whether managed profile ringtones should be synced from it's parent profile 7306 * <p> 7307 * 0 = ringtones are not synced 7308 * 1 = ringtones are synced from the profile's parent (default) 7309 * <p> 7310 * This value is only used for managed profiles. 7311 * @hide 7312 */ 7313 @TestApi 7314 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 7315 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; 7316 7317 private static final Validator SYNC_PARENT_SOUNDS_VALIDATOR = BOOLEAN_VALIDATOR; 7318 7319 /** @hide */ 7320 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 7321 7322 /** 7323 * This is the query URI for finding a print service to install. 7324 * 7325 * @hide 7326 */ 7327 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 7328 7329 /** 7330 * This is the query URI for finding a NFC payment service to install. 7331 * 7332 * @hide 7333 */ 7334 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 7335 7336 /** 7337 * This is the query URI for finding a auto fill service to install. 7338 * 7339 * @hide 7340 */ 7341 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; 7342 7343 /** 7344 * If enabled, apps should try to skip any introductory hints on first launch. This might 7345 * apply to users that are already familiar with the environment or temporary users. 7346 * <p> 7347 * Type : int (0 to show hints, 1 to skip showing hints) 7348 */ 7349 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 7350 7351 /** 7352 * Persisted playback time after a user confirmation of an unsafe volume level. 7353 * 7354 * @hide 7355 */ 7356 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; 7357 7358 /** 7359 * This preference enables notification display on the lockscreen. 7360 * @hide 7361 */ 7362 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 7363 "lock_screen_show_notifications"; 7364 7365 /** 7366 * List of TV inputs that are currently hidden. This is a string 7367 * containing the IDs of all hidden TV inputs. Each ID is encoded by 7368 * {@link android.net.Uri#encode(String)} and separated by ':'. 7369 * @hide 7370 */ 7371 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; 7372 7373 /** 7374 * List of custom TV input labels. This is a string containing <TV input id, custom name> 7375 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} 7376 * and separated by ','. Each pair is separated by ':'. 7377 * @hide 7378 */ 7379 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; 7380 7381 /** 7382 * Whether automatic routing of system audio to USB audio peripheral is disabled. 7383 * The value is boolean (1 or 0), where 1 means automatic routing is disabled, 7384 * and 0 means automatic routing is enabled. 7385 * 7386 * @hide 7387 */ 7388 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 7389 "usb_audio_automatic_routing_disabled"; 7390 7391 /** 7392 * The timeout in milliseconds before the device fully goes to sleep after 7393 * a period of inactivity. This value sets an upper bound on how long the device 7394 * will stay awake or dreaming without user activity. It should generally 7395 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device 7396 * will sleep before it ever has a chance to dream. 7397 * <p> 7398 * Use -1 to disable this timeout. 7399 * </p> 7400 * 7401 * @hide 7402 */ 7403 public static final String SLEEP_TIMEOUT = "sleep_timeout"; 7404 7405 private static final Validator SLEEP_TIMEOUT_VALIDATOR = 7406 new SettingsValidators.InclusiveIntegerRangeValidator(-1, Integer.MAX_VALUE); 7407 7408 /** 7409 * Controls whether double tap to wake is enabled. 7410 * @hide 7411 */ 7412 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; 7413 7414 private static final Validator DOUBLE_TAP_TO_WAKE_VALIDATOR = BOOLEAN_VALIDATOR; 7415 7416 /** 7417 * The current assistant component. It could be a voice interaction service, 7418 * or an activity that handles ACTION_ASSIST, or empty which means using the default 7419 * handling. 7420 * 7421 * @hide 7422 */ 7423 public static final String ASSISTANT = "assistant"; 7424 7425 /** 7426 * Whether the camera launch gesture should be disabled. 7427 * 7428 * @hide 7429 */ 7430 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; 7431 7432 private static final Validator CAMERA_GESTURE_DISABLED_VALIDATOR = BOOLEAN_VALIDATOR; 7433 7434 /** 7435 * Whether the camera launch gesture to double tap the power button when the screen is off 7436 * should be disabled. 7437 * 7438 * @hide 7439 */ 7440 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = 7441 "camera_double_tap_power_gesture_disabled"; 7442 7443 private static final Validator CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR = 7444 BOOLEAN_VALIDATOR; 7445 7446 /** 7447 * Whether the camera double twist gesture to flip between front and back mode should be 7448 * enabled. 7449 * 7450 * @hide 7451 */ 7452 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = 7453 "camera_double_twist_to_flip_enabled"; 7454 7455 private static final Validator CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR = 7456 BOOLEAN_VALIDATOR; 7457 7458 /** 7459 * Whether the swipe up gesture to switch apps should be enabled. 7460 * 7461 * @hide 7462 */ 7463 public static final String SWIPE_UP_TO_SWITCH_APPS_ENABLED = 7464 "swipe_up_to_switch_apps_enabled"; 7465 7466 private static final Validator SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR = 7467 BOOLEAN_VALIDATOR; 7468 7469 /** 7470 * Whether or not the smart camera lift trigger that launches the camera when the user moves 7471 * the phone into a position for taking photos should be enabled. 7472 * 7473 * @hide 7474 */ 7475 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; 7476 7477 /** 7478 * The default enable state of the camera lift trigger. 7479 * 7480 * @hide 7481 */ 7482 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; 7483 7484 /** 7485 * Whether the assist gesture should be enabled. 7486 * 7487 * @hide 7488 */ 7489 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; 7490 7491 private static final Validator ASSIST_GESTURE_ENABLED_VALIDATOR = 7492 BOOLEAN_VALIDATOR; 7493 7494 /** 7495 * Sensitivity control for the assist gesture. 7496 * 7497 * @hide 7498 */ 7499 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; 7500 7501 private static final Validator ASSIST_GESTURE_SENSITIVITY_VALIDATOR = 7502 new SettingsValidators.InclusiveFloatRangeValidator(0.0f, 1.0f); 7503 7504 /** 7505 * Whether the assist gesture should silence alerts. 7506 * 7507 * @hide 7508 */ 7509 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = 7510 "assist_gesture_silence_alerts_enabled"; 7511 7512 private static final Validator ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR = 7513 BOOLEAN_VALIDATOR; 7514 7515 /** 7516 * Whether the assist gesture should wake the phone. 7517 * 7518 * @hide 7519 */ 7520 public static final String ASSIST_GESTURE_WAKE_ENABLED = 7521 "assist_gesture_wake_enabled"; 7522 7523 private static final Validator ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR = 7524 BOOLEAN_VALIDATOR; 7525 7526 /** 7527 * Whether Assist Gesture Deferred Setup has been completed 7528 * 7529 * @hide 7530 */ 7531 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; 7532 7533 private static final Validator ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR = BOOLEAN_VALIDATOR; 7534 7535 /** 7536 * Control whether Night display is currently activated. 7537 * @hide 7538 */ 7539 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; 7540 7541 /** 7542 * Control whether Night display will automatically activate/deactivate. 7543 * @hide 7544 */ 7545 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; 7546 7547 private static final Validator NIGHT_DISPLAY_AUTO_MODE_VALIDATOR = 7548 new SettingsValidators.InclusiveIntegerRangeValidator(0, 2); 7549 7550 /** 7551 * Control the color temperature of Night Display, represented in Kelvin. 7552 * @hide 7553 */ 7554 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = 7555 "night_display_color_temperature"; 7556 7557 private static final Validator NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR = 7558 NON_NEGATIVE_INTEGER_VALIDATOR; 7559 7560 /** 7561 * Custom time when Night display is scheduled to activate. 7562 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 7563 * @hide 7564 */ 7565 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = 7566 "night_display_custom_start_time"; 7567 7568 private static final Validator NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR = 7569 NON_NEGATIVE_INTEGER_VALIDATOR; 7570 7571 /** 7572 * Custom time when Night display is scheduled to deactivate. 7573 * Represented as milliseconds from midnight (e.g. 21600000 == 6am). 7574 * @hide 7575 */ 7576 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; 7577 7578 private static final Validator NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR = 7579 NON_NEGATIVE_INTEGER_VALIDATOR; 7580 7581 /** 7582 * A String representing the LocalDateTime when Night display was last activated. Use to 7583 * decide whether to apply the current activated state after a reboot or user change. In 7584 * legacy cases, this is represented by the time in milliseconds (since epoch). 7585 * @hide 7586 */ 7587 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = 7588 "night_display_last_activated_time"; 7589 7590 /** 7591 * Names of the service components that the current user has explicitly allowed to 7592 * be a VR mode listener, separated by ':'. 7593 * 7594 * @hide 7595 */ 7596 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; 7597 7598 private static final Validator ENABLED_VR_LISTENERS_VALIDATOR = 7599 new SettingsValidators.ComponentNameListValidator(":"); 7600 7601 /** 7602 * Behavior of the display while in VR mode. 7603 * 7604 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. 7605 * 7606 * @hide 7607 */ 7608 public static final String VR_DISPLAY_MODE = "vr_display_mode"; 7609 7610 private static final Validator VR_DISPLAY_MODE_VALIDATOR = 7611 new SettingsValidators.DiscreteValueValidator(new String[]{"0", "1"}); 7612 7613 /** 7614 * Lower the display persistence while the system is in VR mode. 7615 * 7616 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 7617 * 7618 * @hide. 7619 */ 7620 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; 7621 7622 /** 7623 * Do not alter the display persistence while the system is in VR mode. 7624 * 7625 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 7626 * 7627 * @hide. 7628 */ 7629 public static final int VR_DISPLAY_MODE_OFF = 1; 7630 7631 /** 7632 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least 7633 * once. 7634 * 7635 * <p>This is used to ensure that we only take one pass which will disable apps that are not 7636 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is 7637 * inserted), to avoid disabling an app that the user might actively be using. 7638 * 7639 * <p>Will be set to 1 once executed. 7640 * 7641 * @hide 7642 */ 7643 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; 7644 7645 /** 7646 * Whether parent user can access remote contact in managed profile. 7647 * 7648 * @hide 7649 */ 7650 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = 7651 "managed_profile_contact_remote_search"; 7652 7653 /** 7654 * Whether or not the automatic storage manager is enabled and should run on the device. 7655 * 7656 * @hide 7657 */ 7658 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = 7659 "automatic_storage_manager_enabled"; 7660 7661 /** 7662 * How many days of information for the automatic storage manager to retain on the device. 7663 * 7664 * @hide 7665 */ 7666 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = 7667 "automatic_storage_manager_days_to_retain"; 7668 7669 private static final Validator AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR = 7670 NON_NEGATIVE_INTEGER_VALIDATOR; 7671 7672 /** 7673 * Default number of days of information for the automatic storage manager to retain. 7674 * 7675 * @hide 7676 */ 7677 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; 7678 7679 /** 7680 * How many bytes the automatic storage manager has cleared out. 7681 * 7682 * @hide 7683 */ 7684 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = 7685 "automatic_storage_manager_bytes_cleared"; 7686 7687 7688 /** 7689 * Last run time for the automatic storage manager. 7690 * 7691 * @hide 7692 */ 7693 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = 7694 "automatic_storage_manager_last_run"; 7695 7696 /** 7697 * If the automatic storage manager has been disabled by policy. Note that this doesn't 7698 * mean that the automatic storage manager is prevented from being re-enabled -- this only 7699 * means that it was turned off by policy at least once. 7700 * 7701 * @hide 7702 */ 7703 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = 7704 "automatic_storage_manager_turned_off_by_policy"; 7705 7706 /** 7707 * Whether SystemUI navigation keys is enabled. 7708 * @hide 7709 */ 7710 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = 7711 "system_navigation_keys_enabled"; 7712 7713 private static final Validator SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 7714 7715 /** 7716 * Holds comma separated list of ordering of QS tiles. 7717 * @hide 7718 */ 7719 public static final String QS_TILES = "sysui_qs_tiles"; 7720 7721 private static final Validator QS_TILES_VALIDATOR = new Validator() { 7722 @Override 7723 public boolean validate(String value) { 7724 if (value == null) { 7725 return false; 7726 } 7727 String[] tiles = value.split(","); 7728 boolean valid = true; 7729 for (String tile : tiles) { 7730 // tile can be any non-empty string as specified by OEM 7731 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); 7732 } 7733 return valid; 7734 } 7735 }; 7736 7737 /** 7738 * Specifies whether the web action API is enabled. 7739 * 7740 * @hide 7741 */ 7742 @SystemApi 7743 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; 7744 7745 /** 7746 * Has this pairable device been paired or upgraded from a previously paired system. 7747 * @hide 7748 */ 7749 public static final String DEVICE_PAIRED = "device_paired"; 7750 7751 /** 7752 * Integer state indicating whether package verifier is enabled. 7753 * TODO(b/34259924): Remove this setting. 7754 * 7755 * @hide 7756 */ 7757 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; 7758 7759 /** 7760 * Specifies additional package name for broadcasting the CMAS messages. 7761 * @hide 7762 */ 7763 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; 7764 7765 /** 7766 * Whether the launcher should show any notification badges. 7767 * The value is boolean (1 or 0). 7768 * @hide 7769 */ 7770 public static final String NOTIFICATION_BADGING = "notification_badging"; 7771 7772 private static final Validator NOTIFICATION_BADGING_VALIDATOR = BOOLEAN_VALIDATOR; 7773 7774 /** 7775 * Comma separated list of QS tiles that have been auto-added already. 7776 * @hide 7777 */ 7778 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; 7779 7780 private static final Validator QS_AUTO_ADDED_TILES_VALIDATOR = new Validator() { 7781 @Override 7782 public boolean validate(String value) { 7783 if (value == null) { 7784 return false; 7785 } 7786 String[] tiles = value.split(","); 7787 boolean valid = true; 7788 for (String tile : tiles) { 7789 // tile can be any non-empty string as specified by OEM 7790 valid |= ((tile.length() > 0) && ANY_STRING_VALIDATOR.validate(tile)); 7791 } 7792 return valid; 7793 } 7794 }; 7795 7796 /** 7797 * Whether the Lockdown button should be shown in the power menu. 7798 * @hide 7799 */ 7800 public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; 7801 7802 private static final Validator LOCKDOWN_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; 7803 7804 /** 7805 * Backup manager behavioral parameters. 7806 * This is encoded as a key=value list, separated by commas. Ex: 7807 * 7808 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" 7809 * 7810 * The following keys are supported: 7811 * 7812 * <pre> 7813 * key_value_backup_interval_milliseconds (long) 7814 * key_value_backup_fuzz_milliseconds (long) 7815 * key_value_backup_require_charging (boolean) 7816 * key_value_backup_required_network_type (int) 7817 * full_backup_interval_milliseconds (long) 7818 * full_backup_require_charging (boolean) 7819 * full_backup_required_network_type (int) 7820 * backup_finished_notification_receivers (String[]) 7821 * </pre> 7822 * 7823 * backup_finished_notification_receivers uses ":" as delimeter for values. 7824 * 7825 * <p> 7826 * Type: string 7827 * @hide 7828 */ 7829 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; 7830 7831 7832 /** 7833 * Local transport parameters so we can configure it for tests. 7834 * This is encoded as a key=value list, separated by commas. 7835 * 7836 * The following keys are supported: 7837 * 7838 * <pre> 7839 * fake_encryption_flag (boolean) 7840 * </pre> 7841 * 7842 * <p> 7843 * Type: string 7844 * @hide 7845 */ 7846 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = 7847 "backup_local_transport_parameters"; 7848 7849 /** 7850 * Flag to set if the system should predictively attempt to re-enable Bluetooth while 7851 * the user is driving. 7852 * @hide 7853 */ 7854 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; 7855 7856 /** 7857 * What behavior should be invoked when the volume hush gesture is triggered 7858 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. 7859 * 7860 * @hide 7861 */ 7862 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; 7863 7864 /** @hide */ public static final int VOLUME_HUSH_OFF = 0; 7865 /** @hide */ public static final int VOLUME_HUSH_VIBRATE = 1; 7866 /** @hide */ public static final int VOLUME_HUSH_MUTE = 2; 7867 7868 private static final Validator VOLUME_HUSH_GESTURE_VALIDATOR = 7869 NON_NEGATIVE_INTEGER_VALIDATOR; 7870 7871 /** 7872 * The number of times (integer) the user has manually enabled battery saver. 7873 * @hide 7874 */ 7875 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = 7876 "low_power_manual_activation_count"; 7877 7878 /** 7879 * Whether the "first time battery saver warning" dialog needs to be shown (0: default) 7880 * or not (1). 7881 * 7882 * @hide 7883 */ 7884 public static final String LOW_POWER_WARNING_ACKNOWLEDGED = 7885 "low_power_warning_acknowledged"; 7886 7887 /** 7888 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been 7889 * suppressed. 7890 * @hide 7891 */ 7892 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = 7893 "suppress_auto_battery_saver_suggestion"; 7894 7895 /** 7896 * List of packages, which data need to be unconditionally cleared before full restore. 7897 * Type: string 7898 * @hide 7899 */ 7900 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = 7901 "packages_to_clear_data_before_full_restore"; 7902 7903 /** 7904 * This are the settings to be backed up. 7905 * 7906 * NOTE: Settings are backed up and restored in the order they appear 7907 * in this array. If you have one setting depending on another, 7908 * make sure that they are ordered appropriately. 7909 * 7910 * @hide 7911 */ 7912 public static final String[] SETTINGS_TO_BACKUP = { 7913 BUGREPORT_IN_POWER_MENU, // moved to global 7914 ALLOW_MOCK_LOCATION, 7915 USB_MASS_STORAGE_ENABLED, // moved to global 7916 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 7917 ACCESSIBILITY_DISPLAY_DALTONIZER, 7918 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 7919 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 7920 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, 7921 AUTOFILL_SERVICE, 7922 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, 7923 ENABLED_ACCESSIBILITY_SERVICES, 7924 ENABLED_VR_LISTENERS, 7925 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, 7926 TOUCH_EXPLORATION_ENABLED, 7927 ACCESSIBILITY_ENABLED, 7928 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, 7929 ACCESSIBILITY_BUTTON_TARGET_COMPONENT, 7930 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, 7931 ACCESSIBILITY_SHORTCUT_ENABLED, 7932 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, 7933 ACCESSIBILITY_SPEAK_PASSWORD, 7934 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, 7935 ACCESSIBILITY_CAPTIONING_PRESET, 7936 ACCESSIBILITY_CAPTIONING_ENABLED, 7937 ACCESSIBILITY_CAPTIONING_LOCALE, 7938 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, 7939 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, 7940 ACCESSIBILITY_CAPTIONING_EDGE_TYPE, 7941 ACCESSIBILITY_CAPTIONING_EDGE_COLOR, 7942 ACCESSIBILITY_CAPTIONING_TYPEFACE, 7943 ACCESSIBILITY_CAPTIONING_FONT_SCALE, 7944 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, 7945 TTS_DEFAULT_RATE, 7946 TTS_DEFAULT_PITCH, 7947 TTS_DEFAULT_SYNTH, 7948 TTS_ENABLED_PLUGINS, 7949 TTS_DEFAULT_LOCALE, 7950 SHOW_IME_WITH_HARD_KEYBOARD, 7951 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global 7952 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global 7953 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global 7954 SELECTED_SPELL_CHECKER, 7955 SELECTED_SPELL_CHECKER_SUBTYPE, 7956 SPELL_CHECKER_ENABLED, 7957 MOUNT_PLAY_NOTIFICATION_SND, 7958 MOUNT_UMS_AUTOSTART, 7959 MOUNT_UMS_PROMPT, 7960 MOUNT_UMS_NOTIFY_ENABLED, 7961 SLEEP_TIMEOUT, 7962 DOUBLE_TAP_TO_WAKE, 7963 WAKE_GESTURE_ENABLED, 7964 LONG_PRESS_TIMEOUT, 7965 CAMERA_GESTURE_DISABLED, 7966 ACCESSIBILITY_AUTOCLICK_ENABLED, 7967 ACCESSIBILITY_AUTOCLICK_DELAY, 7968 ACCESSIBILITY_LARGE_POINTER_ICON, 7969 PREFERRED_TTY_MODE, 7970 ENHANCED_VOICE_PRIVACY_ENABLED, 7971 TTY_MODE_ENABLED, 7972 RTT_CALLING_MODE, 7973 INCALL_POWER_BUTTON_BEHAVIOR, 7974 NIGHT_DISPLAY_CUSTOM_START_TIME, 7975 NIGHT_DISPLAY_CUSTOM_END_TIME, 7976 NIGHT_DISPLAY_COLOR_TEMPERATURE, 7977 NIGHT_DISPLAY_AUTO_MODE, 7978 SYNC_PARENT_SOUNDS, 7979 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, 7980 SWIPE_UP_TO_SWITCH_APPS_ENABLED, 7981 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 7982 SYSTEM_NAVIGATION_KEYS_ENABLED, 7983 QS_TILES, 7984 DOZE_ENABLED, 7985 DOZE_PULSE_ON_PICK_UP, 7986 DOZE_PULSE_ON_DOUBLE_TAP, 7987 NFC_PAYMENT_DEFAULT_COMPONENT, 7988 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, 7989 ASSIST_GESTURE_ENABLED, 7990 ASSIST_GESTURE_SENSITIVITY, 7991 ASSIST_GESTURE_SETUP_COMPLETE, 7992 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 7993 ASSIST_GESTURE_WAKE_ENABLED, 7994 VR_DISPLAY_MODE, 7995 NOTIFICATION_BADGING, 7996 QS_AUTO_ADDED_TILES, 7997 SCREENSAVER_ENABLED, 7998 SCREENSAVER_COMPONENTS, 7999 SCREENSAVER_ACTIVATE_ON_DOCK, 8000 SCREENSAVER_ACTIVATE_ON_SLEEP, 8001 LOCKDOWN_IN_POWER_MENU, 8002 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, 8003 VOLUME_HUSH_GESTURE, 8004 MANUAL_RINGER_TOGGLE_COUNT, 8005 HUSH_GESTURE_USED, 8006 }; 8007 8008 /** 8009 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, 8010 * otherwise they won't be restored. 8011 * 8012 * @hide 8013 */ 8014 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); 8015 static { 8016 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); 8017 VALIDATORS.put(ALLOW_MOCK_LOCATION, ALLOW_MOCK_LOCATION_VALIDATOR); 8018 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); 8019 VALIDATORS.put(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 8020 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED_VALIDATOR); 8021 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER, 8022 ACCESSIBILITY_DISPLAY_DALTONIZER_VALIDATOR); 8023 VALIDATORS.put(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 8024 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED_VALIDATOR); 8025 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 8026 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED_VALIDATOR); 8027 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, 8028 ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED_VALIDATOR); 8029 VALIDATORS.put(AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR); 8030 VALIDATORS.put(ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, 8031 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE_VALIDATOR); 8032 VALIDATORS.put(ENABLED_ACCESSIBILITY_SERVICES, 8033 ENABLED_ACCESSIBILITY_SERVICES_VALIDATOR); 8034 VALIDATORS.put(ENABLED_VR_LISTENERS, ENABLED_VR_LISTENERS_VALIDATOR); 8035 VALIDATORS.put(TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, 8036 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES_VALIDATOR); 8037 VALIDATORS.put(TOUCH_EXPLORATION_ENABLED, TOUCH_EXPLORATION_ENABLED_VALIDATOR); 8038 VALIDATORS.put(ACCESSIBILITY_ENABLED, ACCESSIBILITY_ENABLED_VALIDATOR); 8039 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, 8040 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE_VALIDATOR); 8041 VALIDATORS.put(ACCESSIBILITY_BUTTON_TARGET_COMPONENT, 8042 ACCESSIBILITY_BUTTON_TARGET_COMPONENT_VALIDATOR); 8043 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, 8044 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN_VALIDATOR); 8045 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ENABLED, 8046 ACCESSIBILITY_SHORTCUT_ENABLED_VALIDATOR); 8047 VALIDATORS.put(ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN, 8048 ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN_VALIDATOR); 8049 VALIDATORS.put(ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_SPEAK_PASSWORD_VALIDATOR); 8050 VALIDATORS.put(ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, 8051 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_VALIDATOR); 8052 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_PRESET, 8053 ACCESSIBILITY_CAPTIONING_PRESET_VALIDATOR); 8054 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_ENABLED, 8055 ACCESSIBILITY_CAPTIONING_ENABLED_VALIDATOR); 8056 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_LOCALE, 8057 ACCESSIBILITY_CAPTIONING_LOCALE_VALIDATOR); 8058 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, 8059 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR_VALIDATOR); 8060 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, 8061 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR_VALIDATOR); 8062 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_TYPE, 8063 ACCESSIBILITY_CAPTIONING_EDGE_TYPE_VALIDATOR); 8064 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_EDGE_COLOR, 8065 ACCESSIBILITY_CAPTIONING_EDGE_COLOR_VALIDATOR); 8066 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_TYPEFACE, 8067 ACCESSIBILITY_CAPTIONING_TYPEFACE_VALIDATOR); 8068 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_FONT_SCALE, 8069 ACCESSIBILITY_CAPTIONING_FONT_SCALE_VALIDATOR); 8070 VALIDATORS.put(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, 8071 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR_VALIDATOR); 8072 VALIDATORS.put(TTS_DEFAULT_RATE, TTS_DEFAULT_RATE_VALIDATOR); 8073 VALIDATORS.put(TTS_DEFAULT_PITCH, TTS_DEFAULT_PITCH_VALIDATOR); 8074 VALIDATORS.put(TTS_DEFAULT_SYNTH, TTS_DEFAULT_SYNTH_VALIDATOR); 8075 VALIDATORS.put(TTS_ENABLED_PLUGINS, TTS_ENABLED_PLUGINS_VALIDATOR); 8076 VALIDATORS.put(TTS_DEFAULT_LOCALE, TTS_DEFAULT_LOCALE_VALIDATOR); 8077 VALIDATORS.put(SHOW_IME_WITH_HARD_KEYBOARD, SHOW_IME_WITH_HARD_KEYBOARD_VALIDATOR); 8078 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 8079 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); 8080 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 8081 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR); 8082 VALIDATORS.put(WIFI_NUM_OPEN_NETWORKS_KEPT, WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR); 8083 VALIDATORS.put(SELECTED_SPELL_CHECKER, SELECTED_SPELL_CHECKER_VALIDATOR); 8084 VALIDATORS.put(SELECTED_SPELL_CHECKER_SUBTYPE, 8085 SELECTED_SPELL_CHECKER_SUBTYPE_VALIDATOR); 8086 VALIDATORS.put(SPELL_CHECKER_ENABLED, SPELL_CHECKER_ENABLED_VALIDATOR); 8087 VALIDATORS.put(MOUNT_PLAY_NOTIFICATION_SND, MOUNT_PLAY_NOTIFICATION_SND_VALIDATOR); 8088 VALIDATORS.put(MOUNT_UMS_AUTOSTART, MOUNT_UMS_AUTOSTART_VALIDATOR); 8089 VALIDATORS.put(MOUNT_UMS_PROMPT, MOUNT_UMS_PROMPT_VALIDATOR); 8090 VALIDATORS.put(MOUNT_UMS_NOTIFY_ENABLED, MOUNT_UMS_NOTIFY_ENABLED_VALIDATOR); 8091 VALIDATORS.put(SLEEP_TIMEOUT, SLEEP_TIMEOUT_VALIDATOR); 8092 VALIDATORS.put(DOUBLE_TAP_TO_WAKE, DOUBLE_TAP_TO_WAKE_VALIDATOR); 8093 VALIDATORS.put(WAKE_GESTURE_ENABLED, WAKE_GESTURE_ENABLED_VALIDATOR); 8094 VALIDATORS.put(LONG_PRESS_TIMEOUT, LONG_PRESS_TIMEOUT_VALIDATOR); 8095 VALIDATORS.put(CAMERA_GESTURE_DISABLED, CAMERA_GESTURE_DISABLED_VALIDATOR); 8096 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_ENABLED, 8097 ACCESSIBILITY_AUTOCLICK_ENABLED_VALIDATOR); 8098 VALIDATORS.put(ACCESSIBILITY_AUTOCLICK_DELAY, ACCESSIBILITY_AUTOCLICK_DELAY_VALIDATOR); 8099 VALIDATORS.put(ACCESSIBILITY_LARGE_POINTER_ICON, 8100 ACCESSIBILITY_LARGE_POINTER_ICON_VALIDATOR); 8101 VALIDATORS.put(PREFERRED_TTY_MODE, PREFERRED_TTY_MODE_VALIDATOR); 8102 VALIDATORS.put(ENHANCED_VOICE_PRIVACY_ENABLED, 8103 ENHANCED_VOICE_PRIVACY_ENABLED_VALIDATOR); 8104 VALIDATORS.put(TTY_MODE_ENABLED, TTY_MODE_ENABLED_VALIDATOR); 8105 VALIDATORS.put(RTT_CALLING_MODE, RTT_CALLING_MODE_VALIDATOR); 8106 VALIDATORS.put(INCALL_POWER_BUTTON_BEHAVIOR, INCALL_POWER_BUTTON_BEHAVIOR_VALIDATOR); 8107 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_START_TIME, 8108 NIGHT_DISPLAY_CUSTOM_START_TIME_VALIDATOR); 8109 VALIDATORS.put(NIGHT_DISPLAY_CUSTOM_END_TIME, NIGHT_DISPLAY_CUSTOM_END_TIME_VALIDATOR); 8110 VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE, 8111 NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR); 8112 VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR); 8113 VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR); 8114 VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, 8115 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR); 8116 VALIDATORS.put(SWIPE_UP_TO_SWITCH_APPS_ENABLED, 8117 SWIPE_UP_TO_SWITCH_APPS_ENABLED_VALIDATOR); 8118 VALIDATORS.put(CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 8119 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED_VALIDATOR); 8120 VALIDATORS.put(SYSTEM_NAVIGATION_KEYS_ENABLED, 8121 SYSTEM_NAVIGATION_KEYS_ENABLED_VALIDATOR); 8122 VALIDATORS.put(QS_TILES, QS_TILES_VALIDATOR); 8123 VALIDATORS.put(DOZE_ENABLED, DOZE_ENABLED_VALIDATOR); 8124 VALIDATORS.put(DOZE_PULSE_ON_PICK_UP, DOZE_PULSE_ON_PICK_UP_VALIDATOR); 8125 VALIDATORS.put(DOZE_PULSE_ON_DOUBLE_TAP, DOZE_PULSE_ON_DOUBLE_TAP_VALIDATOR); 8126 VALIDATORS.put(NFC_PAYMENT_DEFAULT_COMPONENT, NFC_PAYMENT_DEFAULT_COMPONENT_VALIDATOR); 8127 VALIDATORS.put(AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, 8128 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_VALIDATOR); 8129 VALIDATORS.put(ASSIST_GESTURE_ENABLED, ASSIST_GESTURE_ENABLED_VALIDATOR); 8130 VALIDATORS.put(ASSIST_GESTURE_SENSITIVITY, ASSIST_GESTURE_SENSITIVITY_VALIDATOR); 8131 VALIDATORS.put(ASSIST_GESTURE_SETUP_COMPLETE, ASSIST_GESTURE_SETUP_COMPLETE_VALIDATOR); 8132 VALIDATORS.put(ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 8133 ASSIST_GESTURE_SILENCE_ALERTS_ENABLED_VALIDATOR); 8134 VALIDATORS.put(ASSIST_GESTURE_WAKE_ENABLED, ASSIST_GESTURE_WAKE_ENABLED_VALIDATOR); 8135 VALIDATORS.put(VR_DISPLAY_MODE, VR_DISPLAY_MODE_VALIDATOR); 8136 VALIDATORS.put(NOTIFICATION_BADGING, NOTIFICATION_BADGING_VALIDATOR); 8137 VALIDATORS.put(QS_AUTO_ADDED_TILES, QS_AUTO_ADDED_TILES_VALIDATOR); 8138 VALIDATORS.put(SCREENSAVER_ENABLED, SCREENSAVER_ENABLED_VALIDATOR); 8139 VALIDATORS.put(SCREENSAVER_COMPONENTS, SCREENSAVER_COMPONENTS_VALIDATOR); 8140 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_DOCK_VALIDATOR); 8141 VALIDATORS.put(SCREENSAVER_ACTIVATE_ON_SLEEP, SCREENSAVER_ACTIVATE_ON_SLEEP_VALIDATOR); 8142 VALIDATORS.put(LOCKDOWN_IN_POWER_MENU, LOCKDOWN_IN_POWER_MENU_VALIDATOR); 8143 VALIDATORS.put(SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, 8144 SHOW_FIRST_CRASH_DIALOG_DEV_OPTION_VALIDATOR); 8145 VALIDATORS.put(VOLUME_HUSH_GESTURE, VOLUME_HUSH_GESTURE_VALIDATOR); 8146 VALIDATORS.put(ENABLED_NOTIFICATION_LISTENERS, 8147 ENABLED_NOTIFICATION_LISTENERS_VALIDATOR); //legacy restore setting 8148 VALIDATORS.put(ENABLED_NOTIFICATION_ASSISTANT, 8149 ENABLED_NOTIFICATION_ASSISTANT_VALIDATOR); //legacy restore setting 8150 VALIDATORS.put(ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, 8151 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting 8152 VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR); 8153 VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR); 8154 } 8155 8156 /** 8157 * Keys we no longer back up under the current schema, but want to continue to 8158 * process when restoring historical backup datasets. 8159 * 8160 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 8161 * otherwise they won't be restored. 8162 * 8163 * @hide 8164 */ 8165 public static final String[] LEGACY_RESTORE_SETTINGS = { 8166 ENABLED_NOTIFICATION_LISTENERS, 8167 ENABLED_NOTIFICATION_ASSISTANT, 8168 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES 8169 }; 8170 8171 /** 8172 * These entries are considered common between the personal and the managed profile, 8173 * since the managed profile doesn't get to change them. 8174 */ 8175 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 8176 8177 static { 8178 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); 8179 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); 8180 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); 8181 CLONE_TO_MANAGED_PROFILE.add(AUTOFILL_SERVICE); 8182 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); 8183 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); 8184 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); 8185 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); 8186 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); 8187 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); 8188 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); 8189 if (TextServicesManager.DISABLE_PER_PROFILE_SPELL_CHECKER) { 8190 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER); 8191 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE); 8192 } 8193 } 8194 8195 /** @hide */ 8196 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 8197 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 8198 } 8199 8200 /** 8201 * Secure settings which can be accessed by instant apps. 8202 * @hide 8203 */ 8204 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 8205 static { 8206 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); 8207 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); 8208 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); 8209 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); 8210 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); 8211 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); 8212 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); 8213 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); 8214 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); 8215 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); 8216 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); 8217 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); 8218 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); 8219 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); 8220 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); 8221 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); 8222 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); 8223 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); 8224 8225 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); 8226 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); 8227 8228 INSTANT_APP_SETTINGS.add(ANDROID_ID); 8229 8230 INSTANT_APP_SETTINGS.add(PACKAGE_VERIFIER_USER_CONSENT); 8231 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); 8232 } 8233 8234 /** 8235 * Helper method for determining if a location provider is enabled. 8236 * 8237 * @param cr the content resolver to use 8238 * @param provider the location provider to query 8239 * @return true if the provider is enabled 8240 * 8241 * @deprecated use {@link LocationManager#isProviderEnabled(String)} 8242 */ 8243 @Deprecated 8244 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 8245 return isLocationProviderEnabledForUser(cr, provider, cr.getUserId()); 8246 } 8247 8248 /** 8249 * Helper method for determining if a location provider is enabled. 8250 * @param cr the content resolver to use 8251 * @param provider the location provider to query 8252 * @param userId the userId to query 8253 * @return true if the provider is enabled 8254 * 8255 * @deprecated use {@link LocationManager#isProviderEnabled(String)} 8256 * @hide 8257 */ 8258 @Deprecated 8259 public static final boolean isLocationProviderEnabledForUser( 8260 ContentResolver cr, String provider, int userId) { 8261 String allowedProviders = Settings.Secure.getStringForUser(cr, 8262 LOCATION_PROVIDERS_ALLOWED, userId); 8263 return TextUtils.delimitedStringContains(allowedProviders, ',', provider); 8264 } 8265 8266 /** 8267 * Thread-safe method for enabling or disabling a single location provider. 8268 * @param cr the content resolver to use 8269 * @param provider the location provider to enable or disable 8270 * @param enabled true if the provider should be enabled 8271 * @deprecated This API is deprecated. It requires WRITE_SECURE_SETTINGS permission to 8272 * change location settings. 8273 */ 8274 @Deprecated 8275 public static final void setLocationProviderEnabled(ContentResolver cr, 8276 String provider, boolean enabled) { 8277 setLocationProviderEnabledForUser(cr, provider, enabled, cr.getUserId()); 8278 } 8279 8280 /** 8281 * Thread-safe method for enabling or disabling a single location provider. 8282 * 8283 * @param cr the content resolver to use 8284 * @param provider the location provider to enable or disable 8285 * @param enabled true if the provider should be enabled 8286 * @param userId the userId for which to enable/disable providers 8287 * @return true if the value was set, false on database errors 8288 * 8289 * @deprecated use {@link LocationManager#setProviderEnabledForUser(String, boolean, int)} 8290 * @hide 8291 */ 8292 @Deprecated 8293 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, 8294 String provider, boolean enabled, int userId) { 8295 synchronized (mLocationSettingsLock) { 8296 // to ensure thread safety, we write the provider name with a '+' or '-' 8297 // and let the SettingsProvider handle it rather than reading and modifying 8298 // the list of enabled providers. 8299 if (enabled) { 8300 provider = "+" + provider; 8301 } else { 8302 provider = "-" + provider; 8303 } 8304 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, 8305 userId); 8306 } 8307 } 8308 8309 /** 8310 * Thread-safe method for setting the location mode to one of 8311 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 8312 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. 8313 * Necessary because the mode is a composite of the underlying location provider 8314 * settings. 8315 * 8316 * @param cr the content resolver to use 8317 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} 8318 * @param userId the userId for which to change mode 8319 * @return true if the value was set, false on database errors 8320 * 8321 * @throws IllegalArgumentException if mode is not one of the supported values 8322 * 8323 * @deprecated To enable/disable location, use 8324 * {@link LocationManager#setLocationEnabledForUser(boolean, int)}. 8325 * To enable/disable a specific location provider, use 8326 * {@link LocationManager#setProviderEnabledForUser(String, boolean, int)}. 8327 */ 8328 @Deprecated 8329 private static boolean setLocationModeForUser( 8330 ContentResolver cr, int mode, int userId) { 8331 synchronized (mLocationSettingsLock) { 8332 boolean gps = false; 8333 boolean network = false; 8334 switch (mode) { 8335 case LOCATION_MODE_OFF: 8336 break; 8337 case LOCATION_MODE_SENSORS_ONLY: 8338 gps = true; 8339 break; 8340 case LOCATION_MODE_BATTERY_SAVING: 8341 network = true; 8342 break; 8343 case LOCATION_MODE_HIGH_ACCURACY: 8344 gps = true; 8345 network = true; 8346 break; 8347 default: 8348 throw new IllegalArgumentException("Invalid location mode: " + mode); 8349 } 8350 8351 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( 8352 cr, LocationManager.NETWORK_PROVIDER, network, userId); 8353 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( 8354 cr, LocationManager.GPS_PROVIDER, gps, userId); 8355 return gpsSuccess && nlpSuccess; 8356 } 8357 } 8358 8359 /** 8360 * Thread-safe method for reading the location mode, returns one of 8361 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 8362 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary 8363 * because the mode is a composite of the underlying location provider settings. 8364 * 8365 * @param cr the content resolver to use 8366 * @param userId the userId for which to read the mode 8367 * @return the location mode 8368 */ 8369 private static final int getLocationModeForUser(ContentResolver cr, int userId) { 8370 synchronized (mLocationSettingsLock) { 8371 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( 8372 cr, LocationManager.GPS_PROVIDER, userId); 8373 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( 8374 cr, LocationManager.NETWORK_PROVIDER, userId); 8375 if (gpsEnabled && networkEnabled) { 8376 return LOCATION_MODE_HIGH_ACCURACY; 8377 } else if (gpsEnabled) { 8378 return LOCATION_MODE_SENSORS_ONLY; 8379 } else if (networkEnabled) { 8380 return LOCATION_MODE_BATTERY_SAVING; 8381 } else { 8382 return LOCATION_MODE_OFF; 8383 } 8384 } 8385 } 8386 } 8387 8388 /** 8389 * Global system settings, containing preferences that always apply identically 8390 * to all defined users. Applications can read these but are not allowed to write; 8391 * like the "Secure" settings, these are for preferences that the user must 8392 * explicitly modify through the system UI or specialized APIs for those values. 8393 */ 8394 public static final class Global extends NameValueTable { 8395 // NOTE: If you add new settings here, be sure to add them to 8396 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. 8397 8398 /** 8399 * The content:// style URL for global secure settings items. Not public. 8400 */ 8401 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 8402 8403 /** 8404 * Whether users are allowed to add more users or guest from lockscreen. 8405 * <p> 8406 * Type: int 8407 * @hide 8408 */ 8409 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; 8410 8411 /** 8412 * Setting whether the global gesture for enabling accessibility is enabled. 8413 * If this gesture is enabled the user will be able to perfrom it to enable 8414 * the accessibility state without visiting the settings app. 8415 * 8416 * @hide 8417 * No longer used. Should be removed once all dependencies have been updated. 8418 */ 8419 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 8420 "enable_accessibility_global_gesture_enabled"; 8421 8422 /** 8423 * Whether Airplane Mode is on. 8424 */ 8425 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 8426 8427 /** 8428 * Whether Theater Mode is on. 8429 * {@hide} 8430 */ 8431 @SystemApi 8432 public static final String THEATER_MODE_ON = "theater_mode_on"; 8433 8434 /** 8435 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 8436 */ 8437 public static final String RADIO_BLUETOOTH = "bluetooth"; 8438 8439 /** 8440 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 8441 */ 8442 public static final String RADIO_WIFI = "wifi"; 8443 8444 /** 8445 * {@hide} 8446 */ 8447 public static final String RADIO_WIMAX = "wimax"; 8448 /** 8449 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 8450 */ 8451 public static final String RADIO_CELL = "cell"; 8452 8453 /** 8454 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 8455 */ 8456 public static final String RADIO_NFC = "nfc"; 8457 8458 /** 8459 * A comma separated list of radios that need to be disabled when airplane mode 8460 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 8461 * included in the comma separated list. 8462 */ 8463 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 8464 8465 /** 8466 * A comma separated list of radios that should to be disabled when airplane mode 8467 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 8468 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 8469 * will be turned off when entering airplane mode, but the user will be able to reenable 8470 * Wifi in the Settings app. 8471 * 8472 * {@hide} 8473 */ 8474 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 8475 8476 /** 8477 * An integer representing the Bluetooth Class of Device (CoD). 8478 * 8479 * @hide 8480 */ 8481 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; 8482 8483 /** 8484 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. 8485 * See {@link android.bluetooth.BluetoothProfile}. 8486 * {@hide} 8487 */ 8488 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; 8489 8490 /** 8491 * A semi-colon separated list of Bluetooth interoperability workarounds. 8492 * Each entry is a partial Bluetooth device address string and an integer representing 8493 * the feature to be disabled, separated by a comma. The integer must correspond 8494 * to a interoperability feature as defined in "interop.h" in /system/bt. 8495 * <p> 8496 * Example: <br/> 8497 * "00:11:22,0;01:02:03:04,2" 8498 * @hide 8499 */ 8500 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; 8501 8502 /** 8503 * The policy for deciding when Wi-Fi should go to sleep (which will in 8504 * turn switch to using the mobile data as an Internet connection). 8505 * <p> 8506 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 8507 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 8508 * {@link #WIFI_SLEEP_POLICY_NEVER}. 8509 */ 8510 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 8511 8512 /** 8513 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 8514 * policy, which is to sleep shortly after the turning off 8515 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 8516 */ 8517 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 8518 8519 /** 8520 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 8521 * the device is on battery, and never go to sleep when the device is 8522 * plugged in. 8523 */ 8524 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 8525 8526 /** 8527 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 8528 */ 8529 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 8530 8531 /** 8532 * Value to specify if the user prefers the date, time and time zone 8533 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 8534 */ 8535 public static final String AUTO_TIME = "auto_time"; 8536 8537 private static final Validator AUTO_TIME_VALIDATOR = BOOLEAN_VALIDATOR; 8538 8539 /** 8540 * Value to specify if the user prefers the time zone 8541 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 8542 */ 8543 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 8544 8545 private static final Validator AUTO_TIME_ZONE_VALIDATOR = BOOLEAN_VALIDATOR; 8546 8547 /** 8548 * URI for the car dock "in" event sound. 8549 * @hide 8550 */ 8551 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 8552 8553 /** 8554 * URI for the car dock "out" event sound. 8555 * @hide 8556 */ 8557 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 8558 8559 /** 8560 * URI for the desk dock "in" event sound. 8561 * @hide 8562 */ 8563 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 8564 8565 /** 8566 * URI for the desk dock "out" event sound. 8567 * @hide 8568 */ 8569 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 8570 8571 /** 8572 * Whether to play a sound for dock events. 8573 * @hide 8574 */ 8575 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 8576 8577 private static final Validator DOCK_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 8578 8579 /** 8580 * Whether to play a sound for dock events, only when an accessibility service is on. 8581 * @hide 8582 */ 8583 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; 8584 8585 /** 8586 * URI for the "device locked" (keyguard shown) sound. 8587 * @hide 8588 */ 8589 public static final String LOCK_SOUND = "lock_sound"; 8590 8591 /** 8592 * URI for the "device unlocked" sound. 8593 * @hide 8594 */ 8595 public static final String UNLOCK_SOUND = "unlock_sound"; 8596 8597 /** 8598 * URI for the "device is trusted" sound, which is played when the device enters the trusted 8599 * state without unlocking. 8600 * @hide 8601 */ 8602 public static final String TRUSTED_SOUND = "trusted_sound"; 8603 8604 /** 8605 * URI for the low battery sound file. 8606 * @hide 8607 */ 8608 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 8609 8610 /** 8611 * Whether to play a sound for low-battery alerts. 8612 * @hide 8613 */ 8614 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 8615 8616 private static final Validator POWER_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 8617 8618 /** 8619 * URI for the "wireless charging started" and "wired charging started" sound. 8620 * @hide 8621 */ 8622 public static final String CHARGING_STARTED_SOUND = 8623 "wireless_charging_started_sound"; 8624 8625 /** 8626 * Whether to play a sound for charging events. 8627 * @hide 8628 */ 8629 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 8630 8631 private static final Validator CHARGING_SOUNDS_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 8632 8633 /** 8634 * Whether to vibrate for wireless charging events. 8635 * @hide 8636 */ 8637 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 8638 8639 private static final Validator CHARGING_VIBRATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 8640 8641 /** 8642 * Whether we keep the device on while the device is plugged in. 8643 * Supported values are: 8644 * <ul> 8645 * <li>{@code 0} to never stay on while plugged in</li> 8646 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 8647 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 8648 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 8649 * </ul> 8650 * These values can be OR-ed together. 8651 */ 8652 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 8653 8654 private static final Validator STAY_ON_WHILE_PLUGGED_IN_VALIDATOR = new Validator() { 8655 @Override 8656 public boolean validate(String value) { 8657 try { 8658 int val = Integer.parseInt(value); 8659 return (val == 0) 8660 || (val == BatteryManager.BATTERY_PLUGGED_AC) 8661 || (val == BatteryManager.BATTERY_PLUGGED_USB) 8662 || (val == BatteryManager.BATTERY_PLUGGED_WIRELESS) 8663 || (val == (BatteryManager.BATTERY_PLUGGED_AC 8664 | BatteryManager.BATTERY_PLUGGED_USB)) 8665 || (val == (BatteryManager.BATTERY_PLUGGED_AC 8666 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 8667 || (val == (BatteryManager.BATTERY_PLUGGED_USB 8668 | BatteryManager.BATTERY_PLUGGED_WIRELESS)) 8669 || (val == (BatteryManager.BATTERY_PLUGGED_AC 8670 | BatteryManager.BATTERY_PLUGGED_USB 8671 | BatteryManager.BATTERY_PLUGGED_WIRELESS)); 8672 } catch (NumberFormatException e) { 8673 return false; 8674 } 8675 } 8676 }; 8677 8678 /** 8679 * When the user has enable the option to have a "bug report" command 8680 * in the power menu. 8681 * @hide 8682 */ 8683 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 8684 8685 private static final Validator BUGREPORT_IN_POWER_MENU_VALIDATOR = BOOLEAN_VALIDATOR; 8686 8687 /** 8688 * Whether ADB is enabled. 8689 */ 8690 public static final String ADB_ENABLED = "adb_enabled"; 8691 8692 /** 8693 * Whether Views are allowed to save their attribute data. 8694 * @hide 8695 */ 8696 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 8697 8698 /** 8699 * Whether assisted GPS should be enabled or not. 8700 * @hide 8701 */ 8702 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 8703 8704 /** 8705 * Whether bluetooth is enabled/disabled 8706 * 0=disabled. 1=enabled. 8707 */ 8708 public static final String BLUETOOTH_ON = "bluetooth_on"; 8709 8710 private static final Validator BLUETOOTH_ON_VALIDATOR = BOOLEAN_VALIDATOR; 8711 8712 /** 8713 * CDMA Cell Broadcast SMS 8714 * 0 = CDMA Cell Broadcast SMS disabled 8715 * 1 = CDMA Cell Broadcast SMS enabled 8716 * @hide 8717 */ 8718 public static final String CDMA_CELL_BROADCAST_SMS = 8719 "cdma_cell_broadcast_sms"; 8720 8721 /** 8722 * The CDMA roaming mode 0 = Home Networks, CDMA default 8723 * 1 = Roaming on Affiliated networks 8724 * 2 = Roaming on any networks 8725 * @hide 8726 */ 8727 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 8728 8729 /** 8730 * The CDMA subscription mode 0 = RUIM/SIM (default) 8731 * 1 = NV 8732 * @hide 8733 */ 8734 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 8735 8736 /** 8737 * The default value for whether background data is enabled or not. 8738 * 8739 * Used by {@code NetworkPolicyManagerService}. 8740 * 8741 * @hide 8742 */ 8743 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = 8744 "default_restrict_background_data"; 8745 8746 /** Inactivity timeout to track mobile data activity. 8747 * 8748 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 8749 * infer the data activity of mobile network. After a period of no activity on mobile 8750 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 8751 * intent is fired to indicate a transition of network status from "active" to "idle". Any 8752 * subsequent activity on mobile networks triggers the firing of {@code 8753 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 8754 * 8755 * Network activity refers to transmitting or receiving data on the network interfaces. 8756 * 8757 * Tracking is disabled if set to zero or negative value. 8758 * 8759 * @hide 8760 */ 8761 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 8762 8763 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 8764 * but for Wifi network. 8765 * @hide 8766 */ 8767 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 8768 8769 /** 8770 * Whether or not data roaming is enabled. (0 = false, 1 = true) 8771 */ 8772 public static final String DATA_ROAMING = "data_roaming"; 8773 8774 /** 8775 * The value passed to a Mobile DataConnection via bringUp which defines the 8776 * number of retries to preform when setting up the initial connection. The default 8777 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 8778 * @hide 8779 */ 8780 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 8781 8782 /** 8783 * Whether any package can be on external storage. When this is true, any 8784 * package, regardless of manifest values, is a candidate for installing 8785 * or moving onto external storage. (0 = false, 1 = true) 8786 * @hide 8787 */ 8788 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 8789 8790 /** 8791 * The default SM-DP+ configured for this device. 8792 * 8793 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to 8794 * download profiles. If this value is set, the LPA will query this server for any profiles 8795 * available to this device. If any are available, they may be downloaded during device 8796 * provisioning or in settings without needing the user to enter an activation code. 8797 * 8798 * @see android.service.euicc.EuiccService 8799 * @hide 8800 */ 8801 @SystemApi 8802 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; 8803 8804 /** 8805 * Whether any profile has ever been downloaded onto a eUICC on the device. 8806 * 8807 * <p>Used to hide eUICC UI from users who have never made use of it and would only be 8808 * confused by seeing references to it in settings. 8809 * (0 = false, 1 = true) 8810 * @hide 8811 */ 8812 @SystemApi 8813 public static final String EUICC_PROVISIONED = "euicc_provisioned"; 8814 8815 /** 8816 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated 8817 * by comma. 8818 * 8819 * <p>Used to hide eUICC UI from users who are currently in countries no carriers support 8820 * eUICC. 8821 * @hide 8822 */ 8823 //TODO(b/77914569) Changes this to System Api. 8824 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries"; 8825 8826 /** 8827 * Whether any activity can be resized. When this is true, any 8828 * activity, regardless of manifest values, can be resized for multi-window. 8829 * (0 = false, 1 = true) 8830 * @hide 8831 */ 8832 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES 8833 = "force_resizable_activities"; 8834 8835 /** 8836 * Whether to enable experimental freeform support for windows. 8837 * @hide 8838 */ 8839 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT 8840 = "enable_freeform_support"; 8841 8842 /** 8843 * Whether user has enabled development settings. 8844 */ 8845 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 8846 8847 /** 8848 * Whether the device has been provisioned (0 = false, 1 = true). 8849 * <p>On a multiuser device with a separate system user, the screen may be locked 8850 * as soon as this is set to true and further activities cannot be launched on the 8851 * system user unless they are marked to show over keyguard. 8852 */ 8853 public static final String DEVICE_PROVISIONED = "device_provisioned"; 8854 8855 /** 8856 * Whether mobile data should be allowed while the device is being provisioned. 8857 * This allows the provisioning process to turn off mobile data before the user 8858 * has an opportunity to set things up, preventing other processes from burning 8859 * precious bytes before wifi is setup. 8860 * (0 = false, 1 = true) 8861 * @hide 8862 */ 8863 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = 8864 "device_provisioning_mobile_data"; 8865 8866 /** 8867 * The saved value for WindowManagerService.setForcedDisplaySize(). 8868 * Two integers separated by a comma. If unset, then use the real display size. 8869 * @hide 8870 */ 8871 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 8872 8873 /** 8874 * The saved value for WindowManagerService.setForcedDisplayScalingMode(). 8875 * 0 or unset if scaling is automatic, 1 if scaling is disabled. 8876 * @hide 8877 */ 8878 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; 8879 8880 /** 8881 * The maximum size, in bytes, of a download that the download manager will transfer over 8882 * a non-wifi connection. 8883 * @hide 8884 */ 8885 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 8886 "download_manager_max_bytes_over_mobile"; 8887 8888 /** 8889 * The recommended maximum size, in bytes, of a download that the download manager should 8890 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 8891 * have the option to start the download over the mobile connection anyway. 8892 * @hide 8893 */ 8894 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 8895 "download_manager_recommended_max_bytes_over_mobile"; 8896 8897 /** 8898 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 8899 */ 8900 @Deprecated 8901 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 8902 8903 /** 8904 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 8905 * sent or processed. (0 = false, 1 = true) 8906 * @hide 8907 */ 8908 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 8909 8910 /** 8911 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on 8912 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will 8913 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be 8914 * activated. 8915 * @hide 8916 */ 8917 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = 8918 "hdmi_system_audio_control_enabled"; 8919 8920 /** 8921 * Whether TV will automatically turn on upon reception of the CEC command 8922 * <Text View On> or <Image View On>. (0 = false, 1 = true) 8923 * 8924 * @hide 8925 */ 8926 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 8927 "hdmi_control_auto_wakeup_enabled"; 8928 8929 /** 8930 * Whether TV will also turn off other CEC devices when it goes to standby mode. 8931 * (0 = false, 1 = true) 8932 * 8933 * @hide 8934 */ 8935 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 8936 "hdmi_control_auto_device_off_enabled"; 8937 8938 /** 8939 * If <b>true</b>, enables out-of-the-box execution for priv apps. 8940 * Default: false 8941 * Values: 0 = false, 1 = true 8942 * 8943 * @hide 8944 */ 8945 public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled"; 8946 8947 /** 8948 * Comma separated list of privileged package names, which will be running out-of-box APK. 8949 * Default: "ALL" 8950 * 8951 * @hide 8952 */ 8953 public static final String PRIV_APP_OOB_LIST = "priv_app_oob_list"; 8954 8955 /** 8956 * The interval in milliseconds at which location requests will be throttled when they are 8957 * coming from the background. 8958 * 8959 * @hide 8960 */ 8961 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = 8962 "location_background_throttle_interval_ms"; 8963 8964 /** 8965 * Most frequent location update interval in milliseconds that proximity alert is allowed 8966 * to request. 8967 * @hide 8968 */ 8969 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = 8970 "location_background_throttle_proximity_alert_interval_ms"; 8971 8972 /** 8973 * Packages that are whitelisted for background throttling (throttling will not be applied). 8974 * @hide 8975 */ 8976 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = 8977 "location_background_throttle_package_whitelist"; 8978 8979 /** 8980 * Whether TV will switch to MHL port when a mobile device is plugged in. 8981 * (0 = false, 1 = true) 8982 * @hide 8983 */ 8984 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 8985 8986 /** 8987 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 8988 * @hide 8989 */ 8990 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 8991 8992 /** 8993 * Whether mobile data connections are allowed by the user. See 8994 * ConnectivityManager for more info. 8995 * @hide 8996 */ 8997 public static final String MOBILE_DATA = "mobile_data"; 8998 8999 /** 9000 * Whether the mobile data connection should remain active even when higher 9001 * priority networks like WiFi are active, to help make network switching faster. 9002 * 9003 * See ConnectivityService for more info. 9004 * 9005 * (0 = disabled, 1 = enabled) 9006 * @hide 9007 */ 9008 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 9009 9010 /** 9011 * Size of the event buffer for IP connectivity metrics. 9012 * @hide 9013 */ 9014 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = 9015 "connectivity_metrics_buffer_size"; 9016 9017 /** {@hide} */ 9018 public static final String NETSTATS_ENABLED = "netstats_enabled"; 9019 /** {@hide} */ 9020 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 9021 /** {@hide} */ 9022 @Deprecated 9023 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 9024 /** {@hide} */ 9025 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 9026 /** {@hide} */ 9027 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 9028 /** {@hide} */ 9029 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; 9030 9031 /** {@hide} */ 9032 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 9033 /** {@hide} */ 9034 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 9035 /** {@hide} */ 9036 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 9037 /** {@hide} */ 9038 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 9039 9040 /** {@hide} */ 9041 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 9042 /** {@hide} */ 9043 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 9044 /** {@hide} */ 9045 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 9046 /** {@hide} */ 9047 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 9048 9049 /** {@hide} */ 9050 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; 9051 /** {@hide} */ 9052 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; 9053 /** {@hide} */ 9054 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 9055 /** {@hide} */ 9056 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 9057 9058 /** {@hide} */ 9059 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled"; 9060 /** {@hide} */ 9061 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited"; 9062 /** {@hide} */ 9063 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited"; 9064 /** {@hide} */ 9065 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs"; 9066 /** {@hide} */ 9067 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = "netpolicy_quota_frac_multipath"; 9068 9069 /** {@hide} */ 9070 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled"; 9071 9072 /** 9073 * User preference for which network(s) should be used. Only the 9074 * connectivity service should touch this. 9075 */ 9076 public static final String NETWORK_PREFERENCE = "network_preference"; 9077 9078 /** 9079 * Which package name to use for network scoring. If null, or if the package is not a valid 9080 * scorer app, external network scores will neither be requested nor accepted. 9081 * @hide 9082 */ 9083 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 9084 9085 /** 9086 * Whether night display forced auto mode is available. 9087 * 0 = unavailable, 1 = available. 9088 * @hide 9089 */ 9090 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = 9091 "night_display_forced_auto_mode_available"; 9092 9093 /** 9094 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 9095 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 9096 * exceeded. 9097 * @hide 9098 */ 9099 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 9100 9101 /** 9102 * The length of time in milli-seconds that automatic small adjustments to 9103 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 9104 * @hide 9105 */ 9106 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 9107 9108 /** Preferred NTP server. {@hide} */ 9109 public static final String NTP_SERVER = "ntp_server"; 9110 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 9111 public static final String NTP_TIMEOUT = "ntp_timeout"; 9112 9113 /** {@hide} */ 9114 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; 9115 9116 /** 9117 * Sample validity in seconds to configure for the system DNS resolver. 9118 * {@hide} 9119 */ 9120 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = 9121 "dns_resolver_sample_validity_seconds"; 9122 9123 /** 9124 * Success threshold in percent for use with the system DNS resolver. 9125 * {@hide} 9126 */ 9127 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = 9128 "dns_resolver_success_threshold_percent"; 9129 9130 /** 9131 * Minimum number of samples needed for statistics to be considered meaningful in the 9132 * system DNS resolver. 9133 * {@hide} 9134 */ 9135 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; 9136 9137 /** 9138 * Maximum number taken into account for statistics purposes in the system DNS resolver. 9139 * {@hide} 9140 */ 9141 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; 9142 9143 /** 9144 * Whether to disable the automatic scheduling of system updates. 9145 * 1 = system updates won't be automatically scheduled (will always 9146 * present notification instead). 9147 * 0 = system updates will be automatically scheduled. (default) 9148 * @hide 9149 */ 9150 @SystemApi 9151 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; 9152 9153 /** 9154 * Whether the package manager should send package verification broadcasts for verifiers to 9155 * review apps prior to installation. 9156 * 1 = request apps to be verified prior to installation, if a verifier exists. 9157 * 0 = do not verify apps before installation 9158 * @hide 9159 */ 9160 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; 9161 9162 /** Timeout for package verification. 9163 * @hide */ 9164 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 9165 9166 /** Default response code for package verification. 9167 * @hide */ 9168 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 9169 9170 /** 9171 * Show package verification setting in the Settings app. 9172 * 1 = show (default) 9173 * 0 = hide 9174 * @hide 9175 */ 9176 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 9177 9178 /** 9179 * Run package verification on apps installed through ADB/ADT/USB 9180 * 1 = perform package verification on ADB installs (default) 9181 * 0 = bypass package verification on ADB installs 9182 * @hide 9183 */ 9184 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 9185 9186 /** 9187 * Time since last fstrim (milliseconds) after which we force one to happen 9188 * during device startup. If unset, the default is 3 days. 9189 * @hide 9190 */ 9191 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; 9192 9193 /** 9194 * The interval in milliseconds at which to check packet counts on the 9195 * mobile data interface when screen is on, to detect possible data 9196 * connection problems. 9197 * @hide 9198 */ 9199 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 9200 "pdp_watchdog_poll_interval_ms"; 9201 9202 /** 9203 * The interval in milliseconds at which to check packet counts on the 9204 * mobile data interface when screen is off, to detect possible data 9205 * connection problems. 9206 * @hide 9207 */ 9208 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 9209 "pdp_watchdog_long_poll_interval_ms"; 9210 9211 /** 9212 * The interval in milliseconds at which to check packet counts on the 9213 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 9214 * outgoing packets has been reached without incoming packets. 9215 * @hide 9216 */ 9217 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 9218 "pdp_watchdog_error_poll_interval_ms"; 9219 9220 /** 9221 * The number of outgoing packets sent without seeing an incoming packet 9222 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 9223 * device is logged to the event log 9224 * @hide 9225 */ 9226 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 9227 "pdp_watchdog_trigger_packet_count"; 9228 9229 /** 9230 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 9231 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 9232 * attempting data connection recovery. 9233 * @hide 9234 */ 9235 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 9236 "pdp_watchdog_error_poll_count"; 9237 9238 /** 9239 * The number of failed PDP reset attempts before moving to something more 9240 * drastic: re-registering to the network. 9241 * @hide 9242 */ 9243 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 9244 "pdp_watchdog_max_pdp_reset_fail_count"; 9245 9246 /** 9247 * URL to open browser on to allow user to manage a prepay account 9248 * @hide 9249 */ 9250 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 9251 "setup_prepaid_data_service_url"; 9252 9253 /** 9254 * URL to attempt a GET on to see if this is a prepay device 9255 * @hide 9256 */ 9257 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 9258 "setup_prepaid_detection_target_url"; 9259 9260 /** 9261 * Host to check for a redirect to after an attempt to GET 9262 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 9263 * this is a prepaid device with zero balance.) 9264 * @hide 9265 */ 9266 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 9267 "setup_prepaid_detection_redir_host"; 9268 9269 /** 9270 * The interval in milliseconds at which to check the number of SMS sent out without asking 9271 * for use permit, to limit the un-authorized SMS usage. 9272 * 9273 * @hide 9274 */ 9275 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 9276 "sms_outgoing_check_interval_ms"; 9277 9278 /** 9279 * The number of outgoing SMS sent without asking for user permit (of {@link 9280 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 9281 * 9282 * @hide 9283 */ 9284 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 9285 "sms_outgoing_check_max_count"; 9286 9287 /** 9288 * Used to disable SMS short code confirmation - defaults to true. 9289 * True indcates we will do the check, etc. Set to false to disable. 9290 * @see com.android.internal.telephony.SmsUsageMonitor 9291 * @hide 9292 */ 9293 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 9294 9295 /** 9296 * Used to select which country we use to determine premium sms codes. 9297 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 9298 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 9299 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 9300 * @hide 9301 */ 9302 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 9303 9304 /** 9305 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value 9306 * @hide 9307 */ 9308 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 9309 9310 /** 9311 * Used to disable Tethering on a device - defaults to true 9312 * @hide 9313 */ 9314 public static final String TETHER_SUPPORTED = "tether_supported"; 9315 9316 /** 9317 * Used to require DUN APN on the device or not - defaults to a build config value 9318 * which defaults to false 9319 * @hide 9320 */ 9321 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 9322 9323 /** 9324 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 9325 * corresponding build config values are set it will override the APN DB 9326 * values. 9327 * Consists of a comma seperated list of strings: 9328 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 9329 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN" 9330 * @hide 9331 */ 9332 public static final String TETHER_DUN_APN = "tether_dun_apn"; 9333 9334 /** 9335 * Used to disable trying to talk to any available tethering offload HAL. 9336 * 9337 * Integer values are interpreted as boolean, and the absence of an explicit setting 9338 * is interpreted as |false|. 9339 * @hide 9340 */ 9341 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; 9342 9343 /** 9344 * List of certificate (hex string representation of the application's certificate - SHA-1 9345 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for 9346 * install when a sim card with matching UICC carrier privilege rules is inserted. The 9347 * certificate is used as a key, so the certificate encoding here must be the same as the 9348 * certificate encoding used on the SIM. 9349 * 9350 * The value is "cert1:package1;cert2:package2;..." 9351 * @hide 9352 */ 9353 @SystemApi 9354 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; 9355 9356 /** 9357 * Map of package name to application names. The application names cannot and will not be 9358 * localized. App names may not contain colons or semicolons. 9359 * 9360 * The value is "packageName1:appName1;packageName2:appName2;..." 9361 * @hide 9362 */ 9363 @SystemApi 9364 public static final String CARRIER_APP_NAMES = "carrier_app_names"; 9365 9366 /** 9367 * USB Mass Storage Enabled 9368 */ 9369 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 9370 9371 private static final Validator USB_MASS_STORAGE_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 9372 9373 /** 9374 * If this setting is set (to anything), then all references 9375 * to Gmail on the device must change to Google Mail. 9376 */ 9377 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 9378 9379 /** 9380 * Webview Data reduction proxy key. 9381 * @hide 9382 */ 9383 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 9384 "webview_data_reduction_proxy_key"; 9385 9386 /** 9387 * Whether or not the WebView fallback mechanism should be enabled. 9388 * 0=disabled, 1=enabled. 9389 * @hide 9390 */ 9391 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = 9392 "webview_fallback_logic_enabled"; 9393 9394 /** 9395 * Name of the package used as WebView provider (if unset the provider is instead determined 9396 * by the system). 9397 * @hide 9398 */ 9399 public static final String WEBVIEW_PROVIDER = "webview_provider"; 9400 9401 /** 9402 * Developer setting to enable WebView multiprocess rendering. 9403 * @hide 9404 */ 9405 @SystemApi 9406 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; 9407 9408 /** 9409 * The maximum number of notifications shown in 24 hours when switching networks. 9410 * @hide 9411 */ 9412 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = 9413 "network_switch_notification_daily_limit"; 9414 9415 /** 9416 * The minimum time in milliseconds between notifications when switching networks. 9417 * @hide 9418 */ 9419 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = 9420 "network_switch_notification_rate_limit_millis"; 9421 9422 /** 9423 * Whether to automatically switch away from wifi networks that lose Internet access. 9424 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always 9425 * avoids such networks. Valid values are: 9426 * 9427 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. 9428 * null: Ask the user whether to switch away from bad wifi. 9429 * 1: Avoid bad wifi. 9430 * 9431 * @hide 9432 */ 9433 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; 9434 9435 /** 9436 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be 9437 * overridden by the system based on device or application state. If null, the value 9438 * specified by config_networkMeteredMultipathPreference is used. 9439 * 9440 * @hide 9441 */ 9442 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = 9443 "network_metered_multipath_preference"; 9444 9445 /** 9446 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() 9447 * on metered networks. This default quota is only used if quota could not be determined 9448 * from data plan or data limit/warning set by the user. 9449 * @hide 9450 */ 9451 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = 9452 "network_default_daily_multipath_quota_bytes"; 9453 9454 /** 9455 * Network watchlist last report time. 9456 * @hide 9457 */ 9458 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = 9459 "network_watchlist_last_report_time"; 9460 9461 /** 9462 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of 9463 * colon-delimited key-value pairs. The key is the badging enum value defined in 9464 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in 9465 * kbps required for the badge. For example: "10:3000,20:5000,30:25000" 9466 * 9467 * @hide 9468 */ 9469 @SystemApi 9470 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; 9471 9472 /** 9473 * Whether Wifi display is enabled/disabled 9474 * 0=disabled. 1=enabled. 9475 * @hide 9476 */ 9477 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 9478 9479 /** 9480 * Whether Wifi display certification mode is enabled/disabled 9481 * 0=disabled. 1=enabled. 9482 * @hide 9483 */ 9484 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 9485 "wifi_display_certification_on"; 9486 9487 /** 9488 * WPS Configuration method used by Wifi display, this setting only 9489 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 9490 * 9491 * Possible values are: 9492 * 9493 * WpsInfo.INVALID: use default WPS method chosen by framework 9494 * WpsInfo.PBC : use Push button 9495 * WpsInfo.KEYPAD : use Keypad 9496 * WpsInfo.DISPLAY: use Display 9497 * @hide 9498 */ 9499 public static final String WIFI_DISPLAY_WPS_CONFIG = 9500 "wifi_display_wps_config"; 9501 9502 /** 9503 * Whether to notify the user of open networks. 9504 * <p> 9505 * If not connected and the scan results have an open network, we will 9506 * put this notification up. If we attempt to connect to a network or 9507 * the open network(s) disappear, we remove the notification. When we 9508 * show the notification, we will not show it again for 9509 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 9510 * 9511 * @deprecated This feature is no longer controlled by this setting in 9512 * {@link android.os.Build.VERSION_CODES#O}. 9513 */ 9514 @Deprecated 9515 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 9516 "wifi_networks_available_notification_on"; 9517 9518 private static final Validator WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = 9519 BOOLEAN_VALIDATOR; 9520 9521 /** 9522 * Whether to notify the user of carrier networks. 9523 * <p> 9524 * If not connected and the scan results have a carrier network, we will 9525 * put this notification up. If we attempt to connect to a network or 9526 * the carrier network(s) disappear, we remove the notification. When we 9527 * show the notification, we will not show it again for 9528 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 9529 * @hide 9530 */ 9531 public static final String WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON = 9532 "wifi_carrier_networks_available_notification_on"; 9533 9534 private static final Validator WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR = 9535 BOOLEAN_VALIDATOR; 9536 9537 /** 9538 * {@hide} 9539 */ 9540 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 9541 "wimax_networks_available_notification_on"; 9542 9543 /** 9544 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 9545 * Connecting to a network will reset the timer. 9546 */ 9547 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 9548 "wifi_networks_available_repeat_delay"; 9549 9550 private static final Validator WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_VALIDATOR = 9551 NON_NEGATIVE_INTEGER_VALIDATOR; 9552 9553 /** 9554 * 802.11 country code in ISO 3166 format 9555 * @hide 9556 */ 9557 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 9558 9559 /** 9560 * The interval in milliseconds to issue wake up scans when wifi needs 9561 * to connect. This is necessary to connect to an access point when 9562 * device is on the move and the screen is off. 9563 * @hide 9564 */ 9565 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 9566 "wifi_framework_scan_interval_ms"; 9567 9568 /** 9569 * The interval in milliseconds after which Wi-Fi is considered idle. 9570 * When idle, it is possible for the device to be switched from Wi-Fi to 9571 * the mobile data network. 9572 * @hide 9573 */ 9574 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 9575 9576 /** 9577 * When the number of open networks exceeds this number, the 9578 * least-recently-used excess networks will be removed. 9579 */ 9580 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 9581 9582 private static final Validator WIFI_NUM_OPEN_NETWORKS_KEPT_VALIDATOR = 9583 NON_NEGATIVE_INTEGER_VALIDATOR; 9584 9585 /** 9586 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 9587 */ 9588 public static final String WIFI_ON = "wifi_on"; 9589 9590 /** 9591 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 9592 * @hide 9593 */ 9594 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 9595 "wifi_scan_always_enabled"; 9596 9597 /** 9598 * The interval in milliseconds at which wifi rtt ranging requests will be throttled when 9599 * they are coming from the background. 9600 * 9601 * @hide 9602 */ 9603 public static final String WIFI_RTT_BACKGROUND_EXEC_GAP_MS = 9604 "wifi_rtt_background_exec_gap_ms"; 9605 9606 /** 9607 * Whether soft AP will shut down after a timeout period when no devices are connected. 9608 * 9609 * Type: int (0 for false, 1 for true) 9610 * @hide 9611 */ 9612 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; 9613 9614 private static final Validator SOFT_AP_TIMEOUT_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 9615 9616 /** 9617 * Value to specify if Wi-Fi Wakeup feature is enabled. 9618 * 9619 * Type: int (0 for false, 1 for true) 9620 * @hide 9621 */ 9622 @SystemApi 9623 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; 9624 9625 private static final Validator WIFI_WAKEUP_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 9626 9627 /** 9628 * Value to specify whether network quality scores and badging should be shown in the UI. 9629 * 9630 * Type: int (0 for false, 1 for true) 9631 * @hide 9632 */ 9633 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; 9634 9635 /** 9636 * Value to specify how long in milliseconds to retain seen score cache curves to be used 9637 * when generating SSID only bases score curves. 9638 * 9639 * Type: long 9640 * @hide 9641 */ 9642 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = 9643 "speed_label_cache_eviction_age_millis"; 9644 9645 /** 9646 * Value to specify if network recommendations from 9647 * {@link com.android.server.NetworkScoreService} are enabled. 9648 * 9649 * Type: int 9650 * Valid values: 9651 * -1 = Forced off 9652 * 0 = Disabled 9653 * 1 = Enabled 9654 * 9655 * Most readers of this setting should simply check if value == 1 to determined the 9656 * enabled state. 9657 * @hide 9658 */ 9659 public static final String NETWORK_RECOMMENDATIONS_ENABLED = 9660 "network_recommendations_enabled"; 9661 9662 private static final Validator NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR = 9663 new SettingsValidators.DiscreteValueValidator(new String[] {"-1", "0", "1"}); 9664 9665 /** 9666 * Which package name to use for network recommendations. If null, network recommendations 9667 * will neither be requested nor accepted. 9668 * 9669 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and 9670 * {@link NetworkScoreManager#setActiveScorer(String)} to write it. 9671 * 9672 * Type: string - package name 9673 * @hide 9674 */ 9675 public static final String NETWORK_RECOMMENDATIONS_PACKAGE = 9676 "network_recommendations_package"; 9677 9678 /** 9679 * The package name of the application that connect and secures high quality open wifi 9680 * networks automatically. 9681 * 9682 * Type: string package name or null if the feature is either not provided or disabled. 9683 * @hide 9684 */ 9685 @TestApi 9686 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; 9687 9688 private static final Validator USE_OPEN_WIFI_PACKAGE_VALIDATOR = new Validator() { 9689 @Override 9690 public boolean validate(String value) { 9691 return (value == null) || PACKAGE_NAME_VALIDATOR.validate(value); 9692 } 9693 }; 9694 9695 /** 9696 * The number of milliseconds the {@link com.android.server.NetworkScoreService} 9697 * will give a recommendation request to complete before returning a default response. 9698 * 9699 * Type: long 9700 * @hide 9701 * @deprecated to be removed 9702 */ 9703 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = 9704 "network_recommendation_request_timeout_ms"; 9705 9706 /** 9707 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in 9708 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. 9709 * 9710 * Type: long 9711 * @hide 9712 */ 9713 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = 9714 "recommended_network_evaluator_cache_expiry_ms"; 9715 9716 /** 9717 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for 9718 * connectivity. 9719 * @hide 9720 */ 9721 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; 9722 9723 /** 9724 * The length in milliseconds of a BLE scan window in a low-power scan mode. 9725 * @hide 9726 */ 9727 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; 9728 9729 /** 9730 * The length in milliseconds of a BLE scan window in a balanced scan mode. 9731 * @hide 9732 */ 9733 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; 9734 9735 /** 9736 * The length in milliseconds of a BLE scan window in a low-latency scan mode. 9737 * @hide 9738 */ 9739 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = 9740 "ble_scan_low_latency_window_ms"; 9741 9742 /** 9743 * The length in milliseconds of a BLE scan interval in a low-power scan mode. 9744 * @hide 9745 */ 9746 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = 9747 "ble_scan_low_power_interval_ms"; 9748 9749 /** 9750 * The length in milliseconds of a BLE scan interval in a balanced scan mode. 9751 * @hide 9752 */ 9753 public static final String BLE_SCAN_BALANCED_INTERVAL_MS = 9754 "ble_scan_balanced_interval_ms"; 9755 9756 /** 9757 * The length in milliseconds of a BLE scan interval in a low-latency scan mode. 9758 * @hide 9759 */ 9760 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = 9761 "ble_scan_low_latency_interval_ms"; 9762 9763 /** 9764 * The mode that BLE scanning clients will be moved to when in the background. 9765 * @hide 9766 */ 9767 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; 9768 9769 /** 9770 * Used to save the Wifi_ON state prior to tethering. 9771 * This state will be checked to restore Wifi after 9772 * the user turns off tethering. 9773 * 9774 * @hide 9775 */ 9776 public static final String WIFI_SAVED_STATE = "wifi_saved_state"; 9777 9778 /** 9779 * The interval in milliseconds to scan as used by the wifi supplicant 9780 * @hide 9781 */ 9782 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 9783 "wifi_supplicant_scan_interval_ms"; 9784 9785 /** 9786 * whether frameworks handles wifi auto-join 9787 * @hide 9788 */ 9789 public static final String WIFI_ENHANCED_AUTO_JOIN = 9790 "wifi_enhanced_auto_join"; 9791 9792 /** 9793 * whether settings show RSSI 9794 * @hide 9795 */ 9796 public static final String WIFI_NETWORK_SHOW_RSSI = 9797 "wifi_network_show_rssi"; 9798 9799 /** 9800 * The interval in milliseconds to scan at supplicant when p2p is connected 9801 * @hide 9802 */ 9803 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 9804 "wifi_scan_interval_p2p_connected_ms"; 9805 9806 /** 9807 * Whether the Wi-Fi watchdog is enabled. 9808 */ 9809 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 9810 9811 /** 9812 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 9813 * the setting needs to be set to 0 to disable it. 9814 * @hide 9815 */ 9816 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 9817 "wifi_watchdog_poor_network_test_enabled"; 9818 9819 private static final Validator WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR = 9820 ANY_STRING_VALIDATOR; 9821 9822 /** 9823 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and 9824 * needs to be set to 0 to disable it. 9825 * @hide 9826 */ 9827 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = 9828 "wifi_suspend_optimizations_enabled"; 9829 9830 /** 9831 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 9832 * will enable it. In the future, additional values may be supported. 9833 * @hide 9834 */ 9835 public static final String WIFI_VERBOSE_LOGGING_ENABLED = 9836 "wifi_verbose_logging_enabled"; 9837 9838 /** 9839 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and 9840 * setting to 1 will enable it. In the future, additional values may be supported. 9841 * @hide 9842 */ 9843 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = 9844 "wifi_connected_mac_randomization_enabled"; 9845 9846 /** 9847 * Parameters to adjust the performance of framework wifi scoring methods. 9848 * <p> 9849 * Encoded as a comma-separated key=value list, for example: 9850 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" 9851 * This is intended for experimenting with new parameter values, 9852 * and is normally unset or empty. The example does not include all 9853 * parameters that may be honored. 9854 * Default values are provided by code or device configurations. 9855 * Errors in the parameters will cause the entire setting to be ignored. 9856 * @hide 9857 */ 9858 public static final String WIFI_SCORE_PARAMS = 9859 "wifi_score_params"; 9860 9861 /** 9862 * The maximum number of times we will retry a connection to an access 9863 * point for which we have failed in acquiring an IP address from DHCP. 9864 * A value of N means that we will make N+1 connection attempts in all. 9865 */ 9866 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 9867 9868 /** 9869 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 9870 * data connectivity to be established after a disconnect from Wi-Fi. 9871 */ 9872 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 9873 "wifi_mobile_data_transition_wakelock_timeout_ms"; 9874 9875 /** 9876 * This setting controls whether WiFi configurations created by a Device Owner app 9877 * should be locked down (that is, be editable or removable only by the Device Owner App, 9878 * not even by Settings app). 9879 * This setting takes integer values. Non-zero values mean DO created configurations 9880 * are locked down. Value of zero means they are not. Default value in the absence of 9881 * actual value to this setting is 0. 9882 */ 9883 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = 9884 "wifi_device_owner_configs_lockdown"; 9885 9886 /** 9887 * The operational wifi frequency band 9888 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 9889 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 9890 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 9891 * 9892 * @hide 9893 */ 9894 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 9895 9896 /** 9897 * The Wi-Fi peer-to-peer device name 9898 * @hide 9899 */ 9900 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 9901 9902 /** 9903 * The min time between wifi disable and wifi enable 9904 * @hide 9905 */ 9906 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; 9907 9908 /** 9909 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect 9910 * from an ephemeral network if there is no BSSID for that network with a non-null score that 9911 * has been seen in this time period. 9912 * 9913 * If this is less than or equal to zero, we use a more conservative behavior and only check 9914 * for a non-null score from the currently connected or target BSSID. 9915 * @hide 9916 */ 9917 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = 9918 "wifi_ephemeral_out_of_range_timeout_ms"; 9919 9920 /** 9921 * The number of milliseconds to delay when checking for data stalls during 9922 * non-aggressive detection. (screen is turned off.) 9923 * @hide 9924 */ 9925 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 9926 "data_stall_alarm_non_aggressive_delay_in_ms"; 9927 9928 /** 9929 * The number of milliseconds to delay when checking for data stalls during 9930 * aggressive detection. (screen on or suspected data stall) 9931 * @hide 9932 */ 9933 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 9934 "data_stall_alarm_aggressive_delay_in_ms"; 9935 9936 /** 9937 * The number of milliseconds to allow the provisioning apn to remain active 9938 * @hide 9939 */ 9940 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 9941 "provisioning_apn_alarm_delay_in_ms"; 9942 9943 /** 9944 * The interval in milliseconds at which to check gprs registration 9945 * after the first registration mismatch of gprs and voice service, 9946 * to detect possible data network registration problems. 9947 * 9948 * @hide 9949 */ 9950 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 9951 "gprs_register_check_period_ms"; 9952 9953 /** 9954 * Nonzero causes Log.wtf() to crash. 9955 * @hide 9956 */ 9957 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 9958 9959 /** 9960 * Ringer mode. This is used internally, changing this value will not 9961 * change the ringer mode. See AudioManager. 9962 */ 9963 public static final String MODE_RINGER = "mode_ringer"; 9964 9965 /** 9966 * Overlay display devices setting. 9967 * The associated value is a specially formatted string that describes the 9968 * size and density of simulated secondary display devices. 9969 * <p> 9970 * Format: {width}x{height}/{dpi};... 9971 * </p><p> 9972 * Example: 9973 * <ul> 9974 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 9975 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first 9976 * at 1080p and the second at 720p.</li> 9977 * <li>If the value is empty, then no overlay display devices are created.</li> 9978 * </ul></p> 9979 * 9980 * @hide 9981 */ 9982 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 9983 9984 /** 9985 * Threshold values for the duration and level of a discharge cycle, 9986 * under which we log discharge cycle info. 9987 * 9988 * @hide 9989 */ 9990 public static final String 9991 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 9992 9993 /** @hide */ 9994 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 9995 9996 /** 9997 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 9998 * intents on application crashes and ANRs. If this is disabled, the 9999 * crash/ANR dialog will never display the "Report" button. 10000 * <p> 10001 * Type: int (0 = disallow, 1 = allow) 10002 * 10003 * @hide 10004 */ 10005 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 10006 10007 /** 10008 * Maximum age of entries kept by {@link DropBoxManager}. 10009 * 10010 * @hide 10011 */ 10012 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 10013 10014 /** 10015 * Maximum number of entry files which {@link DropBoxManager} will keep 10016 * around. 10017 * 10018 * @hide 10019 */ 10020 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 10021 10022 /** 10023 * Maximum amount of disk space used by {@link DropBoxManager} no matter 10024 * what. 10025 * 10026 * @hide 10027 */ 10028 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 10029 10030 /** 10031 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 10032 * will use. 10033 * 10034 * @hide 10035 */ 10036 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 10037 10038 /** 10039 * Percent of total disk which {@link DropBoxManager} will never dip 10040 * into. 10041 * 10042 * @hide 10043 */ 10044 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 10045 10046 /** 10047 * Prefix for per-tag dropbox disable/enable settings. 10048 * 10049 * @hide 10050 */ 10051 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 10052 10053 /** 10054 * Lines of logcat to include with system crash/ANR/etc. reports, as a 10055 * prefix of the dropbox tag of the report type. For example, 10056 * "logcat_for_system_server_anr" controls the lines of logcat captured 10057 * with system server ANR reports. 0 to disable. 10058 * 10059 * @hide 10060 */ 10061 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 10062 10063 /** 10064 * The interval in minutes after which the amount of free storage left 10065 * on the device is logged to the event log 10066 * 10067 * @hide 10068 */ 10069 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 10070 10071 /** 10072 * Threshold for the amount of change in disk free space required to 10073 * report the amount of free space. Used to prevent spamming the logs 10074 * when the disk free space isn't changing frequently. 10075 * 10076 * @hide 10077 */ 10078 public static final String 10079 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 10080 10081 /** 10082 * Minimum percentage of free storage on the device that is used to 10083 * determine if the device is running low on storage. The default is 10. 10084 * <p> 10085 * Say this value is set to 10, the device is considered running low on 10086 * storage if 90% or more of the device storage is filled up. 10087 * 10088 * @hide 10089 */ 10090 public static final String 10091 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 10092 10093 /** 10094 * Maximum byte size of the low storage threshold. This is to ensure 10095 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 10096 * overly large threshold for large storage devices. Currently this must 10097 * be less than 2GB. This default is 500MB. 10098 * 10099 * @hide 10100 */ 10101 public static final String 10102 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 10103 10104 /** 10105 * Minimum bytes of free storage on the device before the data partition 10106 * is considered full. By default, 1 MB is reserved to avoid system-wide 10107 * SQLite disk full exceptions. 10108 * 10109 * @hide 10110 */ 10111 public static final String 10112 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 10113 10114 /** 10115 * Minimum percentage of storage on the device that is reserved for 10116 * cached data. 10117 * 10118 * @hide 10119 */ 10120 public static final String 10121 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; 10122 10123 /** 10124 * Maximum bytes of storage on the device that is reserved for cached 10125 * data. 10126 * 10127 * @hide 10128 */ 10129 public static final String 10130 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; 10131 10132 /** 10133 * The maximum reconnect delay for short network outages or when the 10134 * network is suspended due to phone use. 10135 * 10136 * @hide 10137 */ 10138 public static final String 10139 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 10140 10141 /** 10142 * The number of milliseconds to delay before sending out 10143 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. 10144 * 10145 * @hide 10146 */ 10147 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 10148 10149 10150 /** 10151 * Network sampling interval, in seconds. We'll generate link information 10152 * about bytes/packets sent and error rates based on data sampled in this interval 10153 * 10154 * @hide 10155 */ 10156 10157 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 10158 "connectivity_sampling_interval_in_seconds"; 10159 10160 /** 10161 * The series of successively longer delays used in retrying to download PAC file. 10162 * Last delay is used between successful PAC downloads. 10163 * 10164 * @hide 10165 */ 10166 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 10167 10168 /** 10169 * Don't attempt to detect captive portals. 10170 * 10171 * @hide 10172 */ 10173 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; 10174 10175 /** 10176 * When detecting a captive portal, display a notification that 10177 * prompts the user to sign in. 10178 * 10179 * @hide 10180 */ 10181 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; 10182 10183 /** 10184 * When detecting a captive portal, immediately disconnect from the 10185 * network and do not reconnect to that network in the future. 10186 * 10187 * @hide 10188 */ 10189 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; 10190 10191 /** 10192 * What to do when connecting a network that presents a captive portal. 10193 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. 10194 * 10195 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. 10196 * @hide 10197 */ 10198 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; 10199 10200 /** 10201 * Setting to turn off captive portal detection. Feature is enabled by 10202 * default and the setting needs to be set to 0 to disable it. 10203 * 10204 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection 10205 * @hide 10206 */ 10207 @Deprecated 10208 public static final String 10209 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 10210 10211 /** 10212 * The server used for captive portal detection upon a new conection. A 10213 * 204 response code from the server is used for validation. 10214 * TODO: remove this deprecated symbol. 10215 * 10216 * @hide 10217 */ 10218 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 10219 10220 /** 10221 * The URL used for HTTPS captive portal detection upon a new connection. 10222 * A 204 response code from the server is used for validation. 10223 * 10224 * @hide 10225 */ 10226 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; 10227 10228 /** 10229 * The URL used for HTTP captive portal detection upon a new connection. 10230 * A 204 response code from the server is used for validation. 10231 * 10232 * @hide 10233 */ 10234 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; 10235 10236 /** 10237 * The URL used for fallback HTTP captive portal detection when previous HTTP 10238 * and HTTPS captive portal detection attemps did not return a conclusive answer. 10239 * 10240 * @hide 10241 */ 10242 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; 10243 10244 /** 10245 * A comma separated list of URLs used for captive portal detection in addition to the 10246 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. 10247 * 10248 * @hide 10249 */ 10250 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = 10251 "captive_portal_other_fallback_urls"; 10252 10253 /** 10254 * A list of captive portal detection specifications used in addition to the fallback URLs. 10255 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated 10256 * by "@@,@@". 10257 * @hide 10258 */ 10259 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = 10260 "captive_portal_fallback_probe_specs"; 10261 10262 /** 10263 * Whether to use HTTPS for network validation. This is enabled by default and the setting 10264 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals 10265 * don't actually use HTTPS, but it's consistent with the other settings. 10266 * 10267 * @hide 10268 */ 10269 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; 10270 10271 /** 10272 * Which User-Agent string to use in the header of the captive portal detection probes. 10273 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). 10274 * 10275 * @hide 10276 */ 10277 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; 10278 10279 /** 10280 * Whether network service discovery is enabled. 10281 * 10282 * @hide 10283 */ 10284 public static final String NSD_ON = "nsd_on"; 10285 10286 /** 10287 * Let user pick default install location. 10288 * 10289 * @hide 10290 */ 10291 public static final String SET_INSTALL_LOCATION = "set_install_location"; 10292 10293 /** 10294 * Default install location value. 10295 * 0 = auto, let system decide 10296 * 1 = internal 10297 * 2 = sdcard 10298 * @hide 10299 */ 10300 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 10301 10302 /** 10303 * ms during which to consume extra events related to Inet connection 10304 * condition after a transtion to fully-connected 10305 * 10306 * @hide 10307 */ 10308 public static final String 10309 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 10310 10311 /** 10312 * ms during which to consume extra events related to Inet connection 10313 * condtion after a transtion to partly-connected 10314 * 10315 * @hide 10316 */ 10317 public static final String 10318 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 10319 10320 /** {@hide} */ 10321 public static final String 10322 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 10323 10324 /** 10325 * Host name and port for global http proxy. Uses ':' seperator for 10326 * between host and port. 10327 */ 10328 public static final String HTTP_PROXY = "http_proxy"; 10329 10330 /** 10331 * Host name for global http proxy. Set via ConnectivityManager. 10332 * 10333 * @hide 10334 */ 10335 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 10336 10337 /** 10338 * Integer host port for global http proxy. Set via ConnectivityManager. 10339 * 10340 * @hide 10341 */ 10342 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 10343 10344 /** 10345 * Exclusion list for global proxy. This string contains a list of 10346 * comma-separated domains where the global proxy does not apply. 10347 * Domains should be listed in a comma- separated list. Example of 10348 * acceptable formats: ".domain1.com,my.domain2.com" Use 10349 * ConnectivityManager to set/get. 10350 * 10351 * @hide 10352 */ 10353 public static final String 10354 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 10355 10356 /** 10357 * The location PAC File for the proxy. 10358 * @hide 10359 */ 10360 public static final String 10361 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 10362 10363 /** 10364 * Enables the UI setting to allow the user to specify the global HTTP 10365 * proxy and associated exclusion list. 10366 * 10367 * @hide 10368 */ 10369 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 10370 10371 /** 10372 * Setting for default DNS in case nobody suggests one 10373 * 10374 * @hide 10375 */ 10376 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 10377 10378 /** 10379 * The requested Private DNS mode (string), and an accompanying specifier (string). 10380 * 10381 * Currently, the specifier holds the chosen provider name when the mode requests 10382 * a specific provider. It may be used to store the provider name even when the 10383 * mode changes so that temporarily disabling and re-enabling the specific 10384 * provider mode does not necessitate retyping the provider hostname. 10385 * 10386 * @hide 10387 */ 10388 public static final String PRIVATE_DNS_MODE = "private_dns_mode"; 10389 10390 private static final Validator PRIVATE_DNS_MODE_VALIDATOR = ANY_STRING_VALIDATOR; 10391 10392 /** 10393 * @hide 10394 */ 10395 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; 10396 10397 private static final Validator PRIVATE_DNS_SPECIFIER_VALIDATOR = ANY_STRING_VALIDATOR; 10398 10399 /** 10400 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic"). 10401 * This allows changing the default mode without effectively disabling other modes, 10402 * all of which require explicit user action to enable/configure. See also b/79719289. 10403 * 10404 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above. 10405 * 10406 * {@hide} 10407 */ 10408 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode"; 10409 10410 /** {@hide} */ 10411 public static final String 10412 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 10413 /** {@hide} */ 10414 public static final String 10415 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 10416 /** {@hide} */ 10417 public static final String 10418 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; 10419 /** {@hide} */ 10420 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = 10421 "bluetooth_a2dp_supports_optional_codecs_"; 10422 /** {@hide} */ 10423 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = 10424 "bluetooth_a2dp_optional_codecs_enabled_"; 10425 /** {@hide} */ 10426 public static final String 10427 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 10428 /** {@hide} */ 10429 public static final String 10430 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 10431 /** {@hide} */ 10432 public static final String 10433 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; 10434 /** {@hide} */ 10435 public static final String 10436 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; 10437 /** {@hide} */ 10438 public static final String 10439 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; 10440 /** {@hide} */ 10441 public static final String 10442 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; 10443 /** {@hide} */ 10444 public static final String 10445 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; 10446 10447 /** 10448 * Activity manager specific settings. 10449 * This is encoded as a key=value list, separated by commas. Ex: 10450 * 10451 * "gc_timeout=5000,max_cached_processes=24" 10452 * 10453 * The following keys are supported: 10454 * 10455 * <pre> 10456 * max_cached_processes (int) 10457 * background_settle_time (long) 10458 * fgservice_min_shown_time (long) 10459 * fgservice_min_report_time (long) 10460 * fgservice_screen_on_before_time (long) 10461 * fgservice_screen_on_after_time (long) 10462 * content_provider_retain_time (long) 10463 * gc_timeout (long) 10464 * gc_min_interval (long) 10465 * full_pss_min_interval (long) 10466 * full_pss_lowered_interval (long) 10467 * power_check_interval (long) 10468 * power_check_max_cpu_1 (int) 10469 * power_check_max_cpu_2 (int) 10470 * power_check_max_cpu_3 (int) 10471 * power_check_max_cpu_4 (int) 10472 * service_usage_interaction_time (long) 10473 * usage_stats_interaction_interval (long) 10474 * service_restart_duration (long) 10475 * service_reset_run_duration (long) 10476 * service_restart_duration_factor (int) 10477 * service_min_restart_time_between (long) 10478 * service_max_inactivity (long) 10479 * service_bg_start_timeout (long) 10480 * process_start_async (boolean) 10481 * </pre> 10482 * 10483 * <p> 10484 * Type: string 10485 * @hide 10486 * @see com.android.server.am.ActivityManagerConstants 10487 */ 10488 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; 10489 10490 /** 10491 * App ops specific settings. 10492 * This is encoded as a key=value list, separated by commas. Ex: 10493 * 10494 * "state_settle_time=10000" 10495 * 10496 * The following keys are supported: 10497 * 10498 * <pre> 10499 * top_state_settle_time (long) 10500 * fg_service_state_settle_time (long) 10501 * bg_state_settle_time (long) 10502 * </pre> 10503 * 10504 * <p> 10505 * Type: string 10506 * @hide 10507 * @see com.android.server.AppOpsService.Constants 10508 */ 10509 public static final String APP_OPS_CONSTANTS = "app_ops_constants"; 10510 10511 /** 10512 * Device Idle (Doze) specific settings. 10513 * This is encoded as a key=value list, separated by commas. Ex: 10514 * 10515 * "inactive_to=60000,sensing_to=400000" 10516 * 10517 * The following keys are supported: 10518 * 10519 * <pre> 10520 * inactive_to (long) 10521 * sensing_to (long) 10522 * motion_inactive_to (long) 10523 * idle_after_inactive_to (long) 10524 * idle_pending_to (long) 10525 * max_idle_pending_to (long) 10526 * idle_pending_factor (float) 10527 * idle_to (long) 10528 * max_idle_to (long) 10529 * idle_factor (float) 10530 * min_time_to_alarm (long) 10531 * max_temp_app_whitelist_duration (long) 10532 * notification_whitelist_duration (long) 10533 * </pre> 10534 * 10535 * <p> 10536 * Type: string 10537 * @hide 10538 * @see com.android.server.DeviceIdleController.Constants 10539 */ 10540 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; 10541 10542 /** 10543 * Battery Saver specific settings 10544 * This is encoded as a key=value list, separated by commas. Ex: 10545 * 10546 * "vibration_disabled=true,adjust_brightness_factor=0.5" 10547 * 10548 * The following keys are supported: 10549 * 10550 * <pre> 10551 * vibration_disabled (boolean) 10552 * animation_disabled (boolean) 10553 * soundtrigger_disabled (boolean) 10554 * fullbackup_deferred (boolean) 10555 * keyvaluebackup_deferred (boolean) 10556 * firewall_disabled (boolean) 10557 * gps_mode (int) 10558 * adjust_brightness_disabled (boolean) 10559 * adjust_brightness_factor (float) 10560 * </pre> 10561 * @hide 10562 * @see com.android.server.power.BatterySaverPolicy 10563 */ 10564 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; 10565 10566 /** 10567 * Battery Saver device specific settings 10568 * This is encoded as a key=value list, separated by commas. 10569 * See {@link com.android.server.power.BatterySaverPolicy} for the details. 10570 * 10571 * @hide 10572 */ 10573 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = 10574 "battery_saver_device_specific_constants"; 10575 10576 /** 10577 * Battery tip specific settings 10578 * This is encoded as a key=value list, separated by commas. Ex: 10579 * 10580 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," 10581 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," 10582 * "high_usage_battery_draining=25,high_usage_period_ms=3000" 10583 * 10584 * The following keys are supported: 10585 * 10586 * <pre> 10587 * battery_tip_enabled (boolean) 10588 * summary_enabled (boolean) 10589 * battery_saver_tip_enabled (boolean) 10590 * high_usage_enabled (boolean) 10591 * high_usage_app_count (int) 10592 * high_usage_period_ms (long) 10593 * high_usage_battery_draining (int) 10594 * app_restriction_enabled (boolean) 10595 * reduced_battery_enabled (boolean) 10596 * reduced_battery_percent (int) 10597 * low_battery_enabled (boolean) 10598 * low_battery_hour (int) 10599 * </pre> 10600 * @hide 10601 */ 10602 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; 10603 10604 /** 10605 * Battery anomaly detection specific settings 10606 * This is encoded as a key=value list, separated by commas. 10607 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via 10608 * {@link Uri#encode(String)}, separated by colons. Ex: 10609 * 10610 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," 10611 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" 10612 * 10613 * The following keys are supported: 10614 * 10615 * <pre> 10616 * anomaly_detection_enabled (boolean) 10617 * wakelock_enabled (boolean) 10618 * wakelock_threshold (long) 10619 * wakeup_alarm_enabled (boolean) 10620 * wakeup_alarm_threshold (long) 10621 * wakeup_blacklisted_tags (string) 10622 * bluetooth_scan_enabled (boolean) 10623 * bluetooth_scan_threshold (long) 10624 * </pre> 10625 * @hide 10626 */ 10627 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; 10628 10629 /** 10630 * An integer to show the version of the anomaly config. Ex: 1, which means 10631 * current version is 1. 10632 * @hide 10633 */ 10634 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; 10635 10636 /** 10637 * A base64-encoded string represents anomaly stats config, used for 10638 * {@link android.app.StatsManager}. 10639 * @hide 10640 */ 10641 public static final String ANOMALY_CONFIG = "anomaly_config"; 10642 10643 /** 10644 * Always on display(AOD) specific settings 10645 * This is encoded as a key=value list, separated by commas. Ex: 10646 * 10647 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" 10648 * 10649 * The following keys are supported: 10650 * 10651 * <pre> 10652 * screen_brightness_array (int[]) 10653 * dimming_scrim_array (int[]) 10654 * prox_screen_off_delay (long) 10655 * prox_cooldown_trigger (long) 10656 * prox_cooldown_period (long) 10657 * </pre> 10658 * @hide 10659 */ 10660 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; 10661 10662 /** 10663 * System VDSO global setting. This links to the "sys.vdso" system property. 10664 * The following values are supported: 10665 * false -> both 32 and 64 bit vdso disabled 10666 * 32 -> 32 bit vdso enabled 10667 * 64 -> 64 bit vdso enabled 10668 * Any other value defaults to both 32 bit and 64 bit true. 10669 * @hide 10670 */ 10671 public static final String SYS_VDSO = "sys_vdso"; 10672 10673 /** 10674 * UidCpuPower global setting. This links the sys.uidcpupower system property. 10675 * The following values are supported: 10676 * 0 -> /proc/uid_cpupower/* are disabled 10677 * 1 -> /proc/uid_cpupower/* are enabled 10678 * Any other value defaults to enabled. 10679 * @hide 10680 */ 10681 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; 10682 10683 /** 10684 * traced global setting. This controls weather the deamons: traced and 10685 * traced_probes run. This links the sys.traced system property. 10686 * The following values are supported: 10687 * 0 -> traced and traced_probes are disabled 10688 * 1 -> traced and traced_probes are enabled 10689 * Any other value defaults to disabled. 10690 * @hide 10691 */ 10692 public static final String SYS_TRACED = "sys_traced"; 10693 10694 /** 10695 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the 10696 * device for this setting to take full effect. 10697 * 10698 * @hide 10699 */ 10700 public static final String FPS_DEVISOR = "fps_divisor"; 10701 10702 /** 10703 * Flag to enable or disable display panel low power mode (lpm) 10704 * false -> Display panel power saving mode is disabled. 10705 * true -> Display panel power saving mode is enabled. 10706 * 10707 * @hide 10708 */ 10709 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; 10710 10711 /** 10712 * App standby (app idle) specific settings. 10713 * This is encoded as a key=value list, separated by commas. Ex: 10714 * <p> 10715 * "idle_duration=5000,parole_interval=4500,screen_thresholds=0/0/60000/120000" 10716 * <p> 10717 * All durations are in millis. 10718 * Array values are separated by forward slashes 10719 * The following keys are supported: 10720 * 10721 * <pre> 10722 * parole_interval (long) 10723 * parole_window (long) 10724 * parole_duration (long) 10725 * screen_thresholds (long[4]) 10726 * elapsed_thresholds (long[4]) 10727 * strong_usage_duration (long) 10728 * notification_seen_duration (long) 10729 * system_update_usage_duration (long) 10730 * prediction_timeout (long) 10731 * sync_adapter_duration (long) 10732 * exempted_sync_duration (long) 10733 * system_interaction_duration (long) 10734 * stable_charging_threshold (long) 10735 * 10736 * idle_duration (long) // This is deprecated and used to circumvent b/26355386. 10737 * idle_duration2 (long) // deprecated 10738 * wallclock_threshold (long) // deprecated 10739 * </pre> 10740 * 10741 * <p> 10742 * Type: string 10743 * @hide 10744 * @see com.android.server.usage.UsageStatsService.SettingsObserver 10745 */ 10746 public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; 10747 10748 /** 10749 * Power manager specific settings. 10750 * This is encoded as a key=value list, separated by commas. Ex: 10751 * 10752 * "no_cached_wake_locks=1" 10753 * 10754 * The following keys are supported: 10755 * 10756 * <pre> 10757 * no_cached_wake_locks (boolean) 10758 * </pre> 10759 * 10760 * <p> 10761 * Type: string 10762 * @hide 10763 * @see com.android.server.power.PowerManagerConstants 10764 */ 10765 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; 10766 10767 /** 10768 * Alarm manager specific settings. 10769 * This is encoded as a key=value list, separated by commas. Ex: 10770 * 10771 * "min_futurity=5000,allow_while_idle_short_time=4500" 10772 * 10773 * The following keys are supported: 10774 * 10775 * <pre> 10776 * min_futurity (long) 10777 * min_interval (long) 10778 * allow_while_idle_short_time (long) 10779 * allow_while_idle_long_time (long) 10780 * allow_while_idle_whitelist_duration (long) 10781 * </pre> 10782 * 10783 * <p> 10784 * Type: string 10785 * @hide 10786 * @see com.android.server.AlarmManagerService.Constants 10787 */ 10788 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; 10789 10790 /** 10791 * Job scheduler specific settings. 10792 * This is encoded as a key=value list, separated by commas. Ex: 10793 * 10794 * "min_ready_jobs_count=2,moderate_use_factor=.5" 10795 * 10796 * The following keys are supported: 10797 * 10798 * <pre> 10799 * min_idle_count (int) 10800 * min_charging_count (int) 10801 * min_connectivity_count (int) 10802 * min_content_count (int) 10803 * min_ready_jobs_count (int) 10804 * heavy_use_factor (float) 10805 * moderate_use_factor (float) 10806 * fg_job_count (int) 10807 * bg_normal_job_count (int) 10808 * bg_moderate_job_count (int) 10809 * bg_low_job_count (int) 10810 * bg_critical_job_count (int) 10811 * </pre> 10812 * 10813 * <p> 10814 * Type: string 10815 * @hide 10816 * @see com.android.server.job.JobSchedulerService.Constants 10817 */ 10818 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; 10819 10820 /** 10821 * ShortcutManager specific settings. 10822 * This is encoded as a key=value list, separated by commas. Ex: 10823 * 10824 * "reset_interval_sec=86400,max_updates_per_interval=1" 10825 * 10826 * The following keys are supported: 10827 * 10828 * <pre> 10829 * reset_interval_sec (long) 10830 * max_updates_per_interval (int) 10831 * max_icon_dimension_dp (int, DP) 10832 * max_icon_dimension_dp_lowram (int, DP) 10833 * max_shortcuts (int) 10834 * icon_quality (int, 0-100) 10835 * icon_format (String) 10836 * </pre> 10837 * 10838 * <p> 10839 * Type: string 10840 * @hide 10841 * @see com.android.server.pm.ShortcutService.ConfigConstants 10842 */ 10843 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; 10844 10845 /** 10846 * DevicePolicyManager specific settings. 10847 * This is encoded as a key=value list, separated by commas. Ex: 10848 * 10849 * <pre> 10850 * das_died_service_reconnect_backoff_sec (long) 10851 * das_died_service_reconnect_backoff_increase (float) 10852 * das_died_service_reconnect_max_backoff_sec (long) 10853 * </pre> 10854 * 10855 * <p> 10856 * Type: string 10857 * @hide 10858 * see also com.android.server.devicepolicy.DevicePolicyConstants 10859 */ 10860 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; 10861 10862 /** 10863 * TextClassifier specific settings. 10864 * This is encoded as a key=value list, separated by commas. String[] types like 10865 * entity_list_default use ":" as delimiter for values. Ex: 10866 * 10867 * <pre> 10868 * smart_linkify_enabled (boolean) 10869 * system_textclassifier_enabled (boolean) 10870 * model_dark_launch_enabled (boolean) 10871 * smart_selection_enabled (boolean) 10872 * smart_text_share_enabled (boolean) 10873 * smart_linkify_enabled (boolean) 10874 * smart_select_animation_enabled (boolean) 10875 * suggest_selection_max_range_length (int) 10876 * classify_text_max_range_length (int) 10877 * generate_links_max_text_length (int) 10878 * generate_links_log_sample_rate (int) 10879 * entity_list_default (String[]) 10880 * entity_list_not_editable (String[]) 10881 * entity_list_editable (String[]) 10882 * </pre> 10883 * 10884 * <p> 10885 * Type: string 10886 * @hide 10887 * see also android.view.textclassifier.TextClassificationConstants 10888 */ 10889 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; 10890 10891 /** 10892 * BatteryStats specific settings. 10893 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 10894 * 10895 * The following keys are supported: 10896 * <pre> 10897 * track_cpu_times_by_proc_state (boolean) 10898 * track_cpu_active_cluster_time (boolean) 10899 * read_binary_cpu_time (boolean) 10900 * proc_state_cpu_times_read_delay_ms (long) 10901 * external_stats_collection_rate_limit_ms (long) 10902 * battery_level_collection_delay_ms (long) 10903 * </pre> 10904 * 10905 * <p> 10906 * Type: string 10907 * @hide 10908 * see also com.android.internal.os.BatteryStatsImpl.Constants 10909 */ 10910 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; 10911 10912 /** 10913 * SyncManager specific settings. 10914 * 10915 * <p> 10916 * Type: string 10917 * @hide 10918 * @see com.android.server.content.SyncManagerConstants 10919 */ 10920 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; 10921 10922 /** 10923 * Whether or not App Standby feature is enabled by system. This controls throttling of apps 10924 * based on usage patterns and predictions. Platform will turn on this feature if both this 10925 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. 10926 * Type: int (0 for false, 1 for true) 10927 * Default: 1 10928 * @hide 10929 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED 10930 */ 10931 public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; 10932 10933 /** 10934 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this 10935 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on. 10936 * Type: int (0 for false, 1 for true) 10937 * Default: 1 10938 * @hide 10939 * @see #APP_STANDBY_ENABLED 10940 */ 10941 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED = 10942 "adaptive_battery_management_enabled"; 10943 10944 /** 10945 * Whether or not app auto restriction is enabled. When it is enabled, settings app will 10946 * auto restrict the app if it has bad behavior(e.g. hold wakelock for long time). 10947 * 10948 * Type: boolean (0 for false, 1 for true) 10949 * Default: 1 10950 * 10951 * @hide 10952 */ 10953 public static final String APP_AUTO_RESTRICTION_ENABLED = 10954 "app_auto_restriction_enabled"; 10955 10956 private static final Validator APP_AUTO_RESTRICTION_ENABLED_VALIDATOR = 10957 BOOLEAN_VALIDATOR; 10958 10959 /** 10960 * Feature flag to enable or disable the Forced App Standby feature. 10961 * Type: int (0 for false, 1 for true) 10962 * Default: 1 10963 * @hide 10964 */ 10965 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; 10966 10967 /** 10968 * Whether or not to enable Forced App Standby on small battery devices. 10969 * Type: int (0 for false, 1 for true) 10970 * Default: 0 10971 * @hide 10972 */ 10973 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED 10974 = "forced_app_standby_for_small_battery_enabled"; 10975 10976 /** 10977 * Whether or not to enable the User Absent, Radios Off feature on small battery devices. 10978 * Type: int (0 for false, 1 for true) 10979 * Default: 0 10980 * @hide 10981 */ 10982 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED 10983 = "user_absent_radios_off_for_small_battery_enabled"; 10984 10985 /** 10986 * Whether or not to turn on Wifi when proxy is disconnected. 10987 * Type: int (0 for false, 1 for true) 10988 * Default: 1 10989 * @hide 10990 */ 10991 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED 10992 = "wifi_on_when_proxy_disconnected"; 10993 10994 /** 10995 * Time Only Mode specific settings. 10996 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 10997 * 10998 * The following keys are supported: 10999 * 11000 * <pre> 11001 * enabled (boolean) 11002 * disable_tilt_to_wake (boolean) 11003 * disable_touch_to_wake (boolean) 11004 * </pre> 11005 * Type: string 11006 * @hide 11007 */ 11008 public static final String TIME_ONLY_MODE_CONSTANTS 11009 = "time_only_mode_constants"; 11010 11011 /** 11012 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on 11013 * watch type devices. 11014 * Type: int (0 for false, 1 for true) 11015 * Default: 0 11016 * @hide 11017 */ 11018 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled"; 11019 11020 /** 11021 * Whether or not Network Watchlist feature is enabled. 11022 * Type: int (0 for false, 1 for true) 11023 * Default: 0 11024 * @hide 11025 */ 11026 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; 11027 11028 /** 11029 * Flag to keep background restricted profiles running after exiting. If disabled, 11030 * the restricted profile can be put into stopped state as soon as the user leaves it. 11031 * Type: int (0 for false, 1 for true) 11032 * 11033 * Overridden by the system based on device information. If null, the value specified 11034 * by {@code config_keepRestrictedProfilesInBackground} is used. 11035 * 11036 * @hide 11037 */ 11038 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; 11039 11040 /** 11041 * Get the key that retrieves a bluetooth headset's priority. 11042 * @hide 11043 */ 11044 public static final String getBluetoothHeadsetPriorityKey(String address) { 11045 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11046 } 11047 11048 /** 11049 * Get the key that retrieves a bluetooth a2dp sink's priority. 11050 * @hide 11051 */ 11052 public static final String getBluetoothA2dpSinkPriorityKey(String address) { 11053 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11054 } 11055 11056 /** 11057 * Get the key that retrieves a bluetooth a2dp src's priority. 11058 * @hide 11059 */ 11060 public static final String getBluetoothA2dpSrcPriorityKey(String address) { 11061 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11062 } 11063 11064 /** 11065 * Get the key that retrieves a bluetooth a2dp device's ability to support optional codecs. 11066 * @hide 11067 */ 11068 public static final String getBluetoothA2dpSupportsOptionalCodecsKey(String address) { 11069 return BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX + 11070 address.toUpperCase(Locale.ROOT); 11071 } 11072 11073 /** 11074 * Get the key that retrieves whether a bluetooth a2dp device should have optional codecs 11075 * enabled. 11076 * @hide 11077 */ 11078 public static final String getBluetoothA2dpOptionalCodecsEnabledKey(String address) { 11079 return BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX + 11080 address.toUpperCase(Locale.ROOT); 11081 } 11082 11083 /** 11084 * Get the key that retrieves a bluetooth Input Device's priority. 11085 * @hide 11086 */ 11087 public static final String getBluetoothHidHostPriorityKey(String address) { 11088 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11089 } 11090 11091 /** 11092 * Get the key that retrieves a bluetooth pan client priority. 11093 * @hide 11094 */ 11095 public static final String getBluetoothPanPriorityKey(String address) { 11096 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11097 } 11098 11099 /** 11100 * Get the key that retrieves a bluetooth hearing aid priority. 11101 * @hide 11102 */ 11103 public static final String getBluetoothHearingAidPriorityKey(String address) { 11104 return BLUETOOTH_HEARING_AID_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11105 } 11106 11107 /** 11108 * Get the key that retrieves a bluetooth map priority. 11109 * @hide 11110 */ 11111 public static final String getBluetoothMapPriorityKey(String address) { 11112 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11113 } 11114 11115 /** 11116 * Get the key that retrieves a bluetooth map client priority. 11117 * @hide 11118 */ 11119 public static final String getBluetoothMapClientPriorityKey(String address) { 11120 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11121 } 11122 11123 /** 11124 * Get the key that retrieves a bluetooth pbap client priority. 11125 * @hide 11126 */ 11127 public static final String getBluetoothPbapClientPriorityKey(String address) { 11128 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11129 } 11130 11131 /** 11132 * Get the key that retrieves a bluetooth sap priority. 11133 * @hide 11134 */ 11135 public static final String getBluetoothSapPriorityKey(String address) { 11136 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 11137 } 11138 11139 /** 11140 * Scaling factor for normal window animations. Setting to 0 will 11141 * disable window animations. 11142 */ 11143 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 11144 11145 /** 11146 * Scaling factor for activity transition animations. Setting to 0 will 11147 * disable window animations. 11148 */ 11149 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 11150 11151 /** 11152 * Scaling factor for Animator-based animations. This affects both the 11153 * start delay and duration of all such animations. Setting to 0 will 11154 * cause animations to end immediately. The default value is 1. 11155 */ 11156 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 11157 11158 /** 11159 * Scaling factor for normal window animations. Setting to 0 will 11160 * disable window animations. 11161 * 11162 * @hide 11163 */ 11164 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 11165 11166 /** 11167 * If 0, the compatibility mode is off for all applications. 11168 * If 1, older applications run under compatibility mode. 11169 * TODO: remove this settings before code freeze (bug/1907571) 11170 * @hide 11171 */ 11172 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 11173 11174 /** 11175 * CDMA only settings 11176 * Emergency Tone 0 = Off 11177 * 1 = Alert 11178 * 2 = Vibrate 11179 * @hide 11180 */ 11181 public static final String EMERGENCY_TONE = "emergency_tone"; 11182 11183 private static final Validator EMERGENCY_TONE_VALIDATOR = 11184 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"}); 11185 11186 /** 11187 * CDMA only settings 11188 * Whether the auto retry is enabled. The value is 11189 * boolean (1 or 0). 11190 * @hide 11191 */ 11192 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 11193 11194 private static final Validator CALL_AUTO_RETRY_VALIDATOR = BOOLEAN_VALIDATOR; 11195 11196 /** 11197 * A setting that can be read whether the emergency affordance is currently needed. 11198 * The value is a boolean (1 or 0). 11199 * @hide 11200 */ 11201 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; 11202 11203 /** 11204 * See RIL_PreferredNetworkType in ril.h 11205 * @hide 11206 */ 11207 public static final String PREFERRED_NETWORK_MODE = 11208 "preferred_network_mode"; 11209 11210 /** 11211 * Name of an application package to be debugged. 11212 */ 11213 public static final String DEBUG_APP = "debug_app"; 11214 11215 /** 11216 * If 1, when launching DEBUG_APP it will wait for the debugger before 11217 * starting user code. If 0, it will run normally. 11218 */ 11219 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 11220 11221 /** 11222 * Allow GPU debug layers? 11223 * 0 = no 11224 * 1 = yes 11225 * @hide 11226 */ 11227 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; 11228 11229 /** 11230 * App allowed to load GPU debug layers 11231 * @hide 11232 */ 11233 public static final String GPU_DEBUG_APP = "gpu_debug_app"; 11234 11235 /** 11236 * Ordered GPU debug layer list 11237 * i.e. <layer1>:<layer2>:...:<layerN> 11238 * @hide 11239 */ 11240 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; 11241 11242 /** 11243 * Control whether the process CPU usage meter should be shown. 11244 * 11245 * @deprecated This functionality is no longer available as of 11246 * {@link android.os.Build.VERSION_CODES#N_MR1}. 11247 */ 11248 @Deprecated 11249 public static final String SHOW_PROCESSES = "show_processes"; 11250 11251 /** 11252 * If 1 low power mode (aka battery saver) is enabled. 11253 * @hide 11254 */ 11255 @TestApi 11256 public static final String LOW_POWER_MODE = "low_power"; 11257 11258 /** 11259 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device 11260 * is unplugged from a charger or rebooted. 11261 * @hide 11262 */ 11263 @TestApi 11264 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; 11265 11266 /** 11267 * Battery level [1-100] at which low power mode automatically turns on. 11268 * If 0, it will not automatically turn on. 11269 * @hide 11270 */ 11271 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 11272 11273 private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = 11274 new SettingsValidators.InclusiveIntegerRangeValidator(0, 100); 11275 11276 11277 /** 11278 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set 11279 * or the value is 0, the default max will be used. 11280 * 11281 * @hide 11282 */ 11283 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; 11284 11285 /** 11286 * See com.android.settingslib.fuelgauge.BatterySaverUtils. 11287 * @hide 11288 */ 11289 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = 11290 "low_power_mode_suggestion_params"; 11291 11292 /** 11293 * If not 0, the activity manager will aggressively finish activities and 11294 * processes as soon as they are no longer needed. If 0, the normal 11295 * extended lifetime is used. 11296 */ 11297 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; 11298 11299 /** 11300 * If nonzero, all system error dialogs will be hidden. For example, the 11301 * crash and ANR dialogs will not be shown, and the system will just proceed 11302 * as if they had been accepted by the user. 11303 * @hide 11304 */ 11305 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs"; 11306 11307 /** 11308 * Use Dock audio output for media: 11309 * 0 = disabled 11310 * 1 = enabled 11311 * @hide 11312 */ 11313 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 11314 11315 private static final Validator DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR; 11316 11317 /** 11318 * The surround sound formats AC3, DTS or IEC61937 are 11319 * available for use if they are detected. 11320 * This is the default mode. 11321 * 11322 * Note that AUTO is equivalent to ALWAYS for Android TVs and other 11323 * devices that have an S/PDIF output. This is because S/PDIF 11324 * is unidirectional and the TV cannot know if a decoder is 11325 * connected. So it assumes they are always available. 11326 * @hide 11327 */ 11328 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; 11329 11330 /** 11331 * AC3, DTS or IEC61937 are NEVER available, even if they 11332 * are detected by the hardware. Those formats will not be 11333 * reported. 11334 * 11335 * An example use case would be an AVR reports that it is capable of 11336 * surround sound decoding but is broken. If NEVER is chosen 11337 * then apps must use PCM output instead of encoded output. 11338 * @hide 11339 */ 11340 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; 11341 11342 /** 11343 * AC3, DTS or IEC61937 are ALWAYS available, even if they 11344 * are not detected by the hardware. Those formats will be 11345 * reported as part of the HDMI output capability. Applications 11346 * are then free to use either PCM or encoded output. 11347 * 11348 * An example use case would be a when TV was connected over 11349 * TOS-link to an AVR. But the TV could not see it because TOS-link 11350 * is unidirectional. 11351 * @hide 11352 */ 11353 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; 11354 11355 /** 11356 * Surround sound formats are available according to the choice 11357 * of user, even if they are not detected by the hardware. Those 11358 * formats will be reported as part of the HDMI output capability. 11359 * Applications are then free to use either PCM or encoded output. 11360 * 11361 * An example use case would be an AVR that doesn't report a surround 11362 * format while the user knows the AVR does support it. 11363 * @hide 11364 */ 11365 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3; 11366 11367 /** 11368 * Set to ENCODED_SURROUND_OUTPUT_AUTO, 11369 * ENCODED_SURROUND_OUTPUT_NEVER, 11370 * ENCODED_SURROUND_OUTPUT_ALWAYS or 11371 * ENCODED_SURROUND_OUTPUT_MANUAL 11372 * @hide 11373 */ 11374 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; 11375 11376 private static final Validator ENCODED_SURROUND_OUTPUT_VALIDATOR = 11377 new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2", "3"}); 11378 11379 /** 11380 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to 11381 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values 11382 * are the format constants defined in AudioFormat.java. Ex: 11383 * 11384 * "5,6" 11385 * 11386 * @hide 11387 */ 11388 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS = 11389 "encoded_surround_output_enabled_formats"; 11390 11391 private static final Validator ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR = 11392 new Validator() { 11393 @Override 11394 public boolean validate(String value) { 11395 try { 11396 String[] surroundFormats = TextUtils.split(value, ","); 11397 for (String format : surroundFormats) { 11398 int audioFormat = Integer.valueOf(format); 11399 boolean isSurroundFormat = false; 11400 for (int sf : AudioFormat.SURROUND_SOUND_ENCODING) { 11401 if (sf == audioFormat) { 11402 isSurroundFormat = true; 11403 break; 11404 } 11405 } 11406 if (!isSurroundFormat) { 11407 return false; 11408 } 11409 } 11410 return true; 11411 } catch (NumberFormatException e) { 11412 return false; 11413 } 11414 } 11415 }; 11416 11417 /** 11418 * Persisted safe headphone volume management state by AudioService 11419 * @hide 11420 */ 11421 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 11422 11423 /** 11424 * URL for tzinfo (time zone) updates 11425 * @hide 11426 */ 11427 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 11428 11429 /** 11430 * URL for tzinfo (time zone) update metadata 11431 * @hide 11432 */ 11433 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 11434 11435 /** 11436 * URL for selinux (mandatory access control) updates 11437 * @hide 11438 */ 11439 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 11440 11441 /** 11442 * URL for selinux (mandatory access control) update metadata 11443 * @hide 11444 */ 11445 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 11446 11447 /** 11448 * URL for sms short code updates 11449 * @hide 11450 */ 11451 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 11452 "sms_short_codes_content_url"; 11453 11454 /** 11455 * URL for sms short code update metadata 11456 * @hide 11457 */ 11458 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 11459 "sms_short_codes_metadata_url"; 11460 11461 /** 11462 * URL for apn_db updates 11463 * @hide 11464 */ 11465 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; 11466 11467 /** 11468 * URL for apn_db update metadata 11469 * @hide 11470 */ 11471 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; 11472 11473 /** 11474 * URL for cert pinlist updates 11475 * @hide 11476 */ 11477 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 11478 11479 /** 11480 * URL for cert pinlist updates 11481 * @hide 11482 */ 11483 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 11484 11485 /** 11486 * URL for intent firewall updates 11487 * @hide 11488 */ 11489 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 11490 "intent_firewall_content_url"; 11491 11492 /** 11493 * URL for intent firewall update metadata 11494 * @hide 11495 */ 11496 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 11497 "intent_firewall_metadata_url"; 11498 11499 /** 11500 * URL for lang id model updates 11501 * @hide 11502 */ 11503 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; 11504 11505 /** 11506 * URL for lang id model update metadata 11507 * @hide 11508 */ 11509 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; 11510 11511 /** 11512 * URL for smart selection model updates 11513 * @hide 11514 */ 11515 public static final String SMART_SELECTION_UPDATE_CONTENT_URL = 11516 "smart_selection_content_url"; 11517 11518 /** 11519 * URL for smart selection model update metadata 11520 * @hide 11521 */ 11522 public static final String SMART_SELECTION_UPDATE_METADATA_URL = 11523 "smart_selection_metadata_url"; 11524 11525 /** 11526 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 11527 * @hide 11528 */ 11529 public static final String SELINUX_STATUS = "selinux_status"; 11530 11531 /** 11532 * Developer setting to force RTL layout. 11533 * @hide 11534 */ 11535 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 11536 11537 /** 11538 * Milliseconds after screen-off after which low battery sounds will be silenced. 11539 * 11540 * If zero, battery sounds will always play. 11541 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 11542 * 11543 * @hide 11544 */ 11545 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 11546 11547 /** 11548 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 11549 * the caller is done with this, they should call {@link ContentResolver#delete} to 11550 * clean up any value that they may have written. 11551 * 11552 * @hide 11553 */ 11554 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 11555 11556 /** 11557 * Defines global runtime overrides to window policy. 11558 * 11559 * See {@link com.android.server.policy.PolicyControl} for value format. 11560 * 11561 * @hide 11562 */ 11563 public static final String POLICY_CONTROL = "policy_control"; 11564 11565 /** 11566 * {@link android.view.DisplayCutout DisplayCutout} emulation mode. 11567 * 11568 * @hide 11569 */ 11570 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; 11571 11572 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; 11573 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; 11574 11575 /** 11576 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 11577 * or ZEN_MODE_NO_INTERRUPTIONS. 11578 * 11579 * @hide 11580 */ 11581 public static final String ZEN_MODE = "zen_mode"; 11582 11583 /** @hide */ public static final int ZEN_MODE_OFF = 0; 11584 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 11585 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 11586 /** @hide */ public static final int ZEN_MODE_ALARMS = 3; 11587 11588 /** @hide */ public static String zenModeToString(int mode) { 11589 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 11590 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; 11591 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 11592 return "ZEN_MODE_OFF"; 11593 } 11594 11595 /** @hide */ public static boolean isValidZenMode(int value) { 11596 switch (value) { 11597 case Global.ZEN_MODE_OFF: 11598 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: 11599 case Global.ZEN_MODE_ALARMS: 11600 case Global.ZEN_MODE_NO_INTERRUPTIONS: 11601 return true; 11602 default: 11603 return false; 11604 } 11605 } 11606 11607 /** 11608 * Value of the ringer before entering zen mode. 11609 * 11610 * @hide 11611 */ 11612 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; 11613 11614 /** 11615 * Opaque value, changes when persisted zen mode configuration changes. 11616 * 11617 * @hide 11618 */ 11619 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 11620 11621 /** 11622 * If 0, turning on dnd manually will last indefinitely. 11623 * Else if non-negative, turning on dnd manually will last for this many minutes. 11624 * Else (if negative), turning on dnd manually will surface a dialog that prompts 11625 * user to specify a duration. 11626 * @hide 11627 */ 11628 public static final String ZEN_DURATION = "zen_duration"; 11629 11630 private static final Validator ZEN_DURATION_VALIDATOR = ANY_INTEGER_VALIDATOR; 11631 11632 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; 11633 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; 11634 11635 /** 11636 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 11637 * 11638 * @hide 11639 */ 11640 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 11641 "heads_up_notifications_enabled"; 11642 11643 /** @hide */ public static final int HEADS_UP_OFF = 0; 11644 /** @hide */ public static final int HEADS_UP_ON = 1; 11645 11646 /** 11647 * The name of the device 11648 */ 11649 public static final String DEVICE_NAME = "device_name"; 11650 11651 /** 11652 * Whether the NetworkScoringService has been first initialized. 11653 * <p> 11654 * Type: int (0 for false, 1 for true) 11655 * @hide 11656 */ 11657 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; 11658 11659 /** 11660 * Whether the user wants to be prompted for password to decrypt the device on boot. 11661 * This only matters if the storage is encrypted. 11662 * <p> 11663 * Type: int (0 for false, 1 for true) 11664 * @hide 11665 */ 11666 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; 11667 11668 /** 11669 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config 11670 * value {@link CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}. 11671 * <p> 11672 * Type: int (0 for false, 1 for true) 11673 * @hide 11674 * @deprecated Use {@link android.telephony.SubscriptionManager#ENHANCED_4G_MODE_ENABLED} 11675 * instead. 11676 */ 11677 @Deprecated 11678 public static final String ENHANCED_4G_MODE_ENABLED = 11679 SubscriptionManager.ENHANCED_4G_MODE_ENABLED; 11680 11681 /** 11682 * Whether VT (Video Telephony over IMS) is enabled 11683 * <p> 11684 * Type: int (0 for false, 1 for true) 11685 * 11686 * @hide 11687 * @deprecated Use {@link android.telephony.SubscriptionManager#VT_IMS_ENABLED} instead. 11688 */ 11689 @Deprecated 11690 public static final String VT_IMS_ENABLED = SubscriptionManager.VT_IMS_ENABLED; 11691 11692 /** 11693 * Whether WFC is enabled 11694 * <p> 11695 * Type: int (0 for false, 1 for true) 11696 * 11697 * @hide 11698 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ENABLED} instead. 11699 */ 11700 @Deprecated 11701 public static final String WFC_IMS_ENABLED = SubscriptionManager.WFC_IMS_ENABLED; 11702 11703 /** 11704 * WFC mode on home/non-roaming network. 11705 * <p> 11706 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only 11707 * 11708 * @hide 11709 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_MODE} instead. 11710 */ 11711 @Deprecated 11712 public static final String WFC_IMS_MODE = SubscriptionManager.WFC_IMS_MODE; 11713 11714 /** 11715 * WFC mode on roaming network. 11716 * <p> 11717 * Type: int - see {@link #WFC_IMS_MODE} for values 11718 * 11719 * @hide 11720 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_MODE} 11721 * instead. 11722 */ 11723 @Deprecated 11724 public static final String WFC_IMS_ROAMING_MODE = SubscriptionManager.WFC_IMS_ROAMING_MODE; 11725 11726 /** 11727 * Whether WFC roaming is enabled 11728 * <p> 11729 * Type: int (0 for false, 1 for true) 11730 * 11731 * @hide 11732 * @deprecated Use {@link android.telephony.SubscriptionManager#WFC_IMS_ROAMING_ENABLED} 11733 * instead 11734 */ 11735 @Deprecated 11736 public static final String WFC_IMS_ROAMING_ENABLED = 11737 SubscriptionManager.WFC_IMS_ROAMING_ENABLED; 11738 11739 /** 11740 * Whether user can enable/disable LTE as a preferred network. A carrier might control 11741 * this via gservices, OMA-DM, carrier app, etc. 11742 * <p> 11743 * Type: int (0 for false, 1 for true) 11744 * @hide 11745 */ 11746 public static final String LTE_SERVICE_FORCED = "lte_service_forced"; 11747 11748 /** 11749 * Ephemeral app cookie max size in bytes. 11750 * <p> 11751 * Type: int 11752 * @hide 11753 */ 11754 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 11755 "ephemeral_cookie_max_size_bytes"; 11756 11757 /** 11758 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is 11759 * enabled. Set to zero to disable. 11760 * <p> 11761 * Type: int (0 for false, 1 for true) 11762 * 11763 * @hide 11764 */ 11765 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; 11766 11767 /** 11768 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt 11769 * to be disabled. 11770 * <p> 11771 * Type: int (0 to disable, 1 to enable) 11772 * 11773 * @hide 11774 */ 11775 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; 11776 11777 /** 11778 * The min period for caching installed instant apps in milliseconds. 11779 * <p> 11780 * Type: long 11781 * @hide 11782 */ 11783 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 11784 "installed_instant_app_min_cache_period"; 11785 11786 /** 11787 * The max period for caching installed instant apps in milliseconds. 11788 * <p> 11789 * Type: long 11790 * @hide 11791 */ 11792 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 11793 "installed_instant_app_max_cache_period"; 11794 11795 /** 11796 * The min period for caching uninstalled instant apps in milliseconds. 11797 * <p> 11798 * Type: long 11799 * @hide 11800 */ 11801 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 11802 "uninstalled_instant_app_min_cache_period"; 11803 11804 /** 11805 * The max period for caching uninstalled instant apps in milliseconds. 11806 * <p> 11807 * Type: long 11808 * @hide 11809 */ 11810 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 11811 "uninstalled_instant_app_max_cache_period"; 11812 11813 /** 11814 * The min period for caching unused static shared libs in milliseconds. 11815 * <p> 11816 * Type: long 11817 * @hide 11818 */ 11819 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = 11820 "unused_static_shared_lib_min_cache_period"; 11821 11822 /** 11823 * Allows switching users when system user is locked. 11824 * <p> 11825 * Type: int 11826 * @hide 11827 */ 11828 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = 11829 "allow_user_switching_when_system_user_locked"; 11830 11831 /** 11832 * Boot count since the device starts running API level 24. 11833 * <p> 11834 * Type: int 11835 */ 11836 public static final String BOOT_COUNT = "boot_count"; 11837 11838 /** 11839 * Whether the safe boot is disallowed. 11840 * 11841 * <p>This setting should have the identical value as the corresponding user restriction. 11842 * The purpose of the setting is to make the restriction available in early boot stages 11843 * before the user restrictions are loaded. 11844 * @hide 11845 */ 11846 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; 11847 11848 /** 11849 * Whether this device is currently in retail demo mode. If true, device 11850 * usage is severely limited. 11851 * <p> 11852 * Type: int (0 for false, 1 for true) 11853 * @hide 11854 */ 11855 public static final String DEVICE_DEMO_MODE = "device_demo_mode"; 11856 11857 /** 11858 * Indicates the maximum time that an app is blocked for the network rules to get updated. 11859 * 11860 * Type: long 11861 * 11862 * @hide 11863 */ 11864 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; 11865 11866 /** 11867 * The reason for the settings database being downgraded. This is only for 11868 * troubleshooting purposes and its value should not be interpreted in any way. 11869 * 11870 * Type: string 11871 * 11872 * @hide 11873 */ 11874 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; 11875 11876 /** 11877 * The build id of when the settings database was first created (or re-created due it 11878 * being missing). 11879 * 11880 * Type: string 11881 * 11882 * @hide 11883 */ 11884 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; 11885 11886 /** 11887 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by 11888 * default. Set to 0 to disable. 11889 * 11890 * @hide 11891 */ 11892 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; 11893 11894 /** 11895 * Flag to enable the link to location permissions in location setting. Set to 0 to disable. 11896 * 11897 * @hide 11898 */ 11899 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = 11900 "location_settings_link_to_permissions_enabled"; 11901 11902 /** 11903 * Flag to set the waiting time for euicc factory reset inside System > Settings 11904 * Type: long 11905 * 11906 * @hide 11907 */ 11908 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = 11909 "euicc_factory_reset_timeout_millis"; 11910 11911 /** 11912 * Flag to set the timeout for when to refresh the storage settings cached data. 11913 * Type: long 11914 * 11915 * @hide 11916 */ 11917 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = 11918 "storage_settings_clobber_threshold"; 11919 11920 /** 11921 * If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link Secure#LOCATION_MODE_OFF} 11922 * temporarily for all users. 11923 * 11924 * @hide 11925 */ 11926 @TestApi 11927 public static final String LOCATION_GLOBAL_KILL_SWITCH = 11928 "location_global_kill_switch"; 11929 11930 /** 11931 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored 11932 * and restoring to lower version of platform API will be skipped. 11933 * 11934 * @hide 11935 */ 11936 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = 11937 "override_settings_provider_restore_any_version"; 11938 /** 11939 * Flag to toggle whether system services report attribution chains when they attribute 11940 * battery use via a {@code WorkSource}. 11941 * 11942 * Type: int (0 to disable, 1 to enable) 11943 * 11944 * @hide 11945 */ 11946 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = 11947 "chained_battery_attribution_enabled"; 11948 11949 /** 11950 * The packages whitelisted to be run in autofill compatibility mode. The list 11951 * of packages is {@code ":"} colon delimited, and each entry has the name of the 11952 * package and an optional list of url bar resource ids (the list is delimited by 11953 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). 11954 * 11955 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where 11956 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } 11957 * have 2 ids {@code url_foo} and {@code url_bas}) would be 11958 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} 11959 * 11960 * @hide 11961 */ 11962 @SystemApi 11963 @TestApi 11964 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = 11965 "autofill_compat_mode_allowed_packages"; 11966 11967 /** 11968 * Exemptions to the hidden API blacklist. 11969 * 11970 * @hide 11971 */ 11972 @TestApi 11973 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = 11974 "hidden_api_blacklist_exemptions"; 11975 11976 /** 11977 * Sampling rate for hidden API access event logs, as an integer in the range 0 to 0x10000 11978 * inclusive. 11979 * 11980 * @hide 11981 */ 11982 public static final String HIDDEN_API_ACCESS_LOG_SAMPLING_RATE = 11983 "hidden_api_access_log_sampling_rate"; 11984 11985 /** 11986 * Hidden API enforcement policy for apps targeting SDK versions prior to the latest 11987 * version. 11988 * 11989 * Values correspond to @{@link 11990 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} 11991 * 11992 * @hide 11993 */ 11994 public static final String HIDDEN_API_POLICY_PRE_P_APPS = 11995 "hidden_api_policy_pre_p_apps"; 11996 11997 /** 11998 * Hidden API enforcement policy for apps targeting the current SDK version. 11999 * 12000 * Values correspond to @{@link 12001 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} 12002 * 12003 * @hide 12004 */ 12005 public static final String HIDDEN_API_POLICY_P_APPS = 12006 "hidden_api_policy_p_apps"; 12007 12008 /** 12009 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} 12010 * operation (in ms). 12011 * 12012 * @hide 12013 */ 12014 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = 12015 "sound_trigger_detection_service_op_timeout"; 12016 12017 /** 12018 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} 12019 * operations per day. 12020 * 12021 * @hide 12022 */ 12023 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = 12024 "max_sound_trigger_detection_service_ops_per_day"; 12025 12026 /** 12027 * Settings to backup. This is here so that it's in the same place as the settings 12028 * keys and easy to update. 12029 * 12030 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System 12031 * and Secure as well. This is because those tables drive both backup and 12032 * restore, and restore needs to properly whitelist keys that used to live 12033 * in those namespaces. The keys will only actually be backed up / restored 12034 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). 12035 * 12036 * NOTE: Settings are backed up and restored in the order they appear 12037 * in this array. If you have one setting depending on another, 12038 * make sure that they are ordered appropriately. 12039 * 12040 * @hide 12041 */ 12042 public static final String[] SETTINGS_TO_BACKUP = { 12043 BUGREPORT_IN_POWER_MENU, 12044 STAY_ON_WHILE_PLUGGED_IN, 12045 APP_AUTO_RESTRICTION_ENABLED, 12046 AUTO_TIME, 12047 AUTO_TIME_ZONE, 12048 POWER_SOUNDS_ENABLED, 12049 DOCK_SOUNDS_ENABLED, 12050 CHARGING_SOUNDS_ENABLED, 12051 USB_MASS_STORAGE_ENABLED, 12052 NETWORK_RECOMMENDATIONS_ENABLED, 12053 WIFI_WAKEUP_ENABLED, 12054 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 12055 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, 12056 USE_OPEN_WIFI_PACKAGE, 12057 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 12058 EMERGENCY_TONE, 12059 CALL_AUTO_RETRY, 12060 DOCK_AUDIO_MEDIA_ENABLED, 12061 ENCODED_SURROUND_OUTPUT, 12062 ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, 12063 LOW_POWER_MODE_TRIGGER_LEVEL, 12064 BLUETOOTH_ON, 12065 PRIVATE_DNS_MODE, 12066 PRIVATE_DNS_SPECIFIER, 12067 SOFT_AP_TIMEOUT_ENABLED, 12068 ZEN_DURATION, 12069 CHARGING_VIBRATION_ENABLED, 12070 }; 12071 12072 /** 12073 * All settings in {@link SETTINGS_TO_BACKUP} array *must* have a non-null validator, 12074 * otherwise they won't be restored. 12075 * 12076 * @hide 12077 */ 12078 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); 12079 static { 12080 VALIDATORS.put(BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU_VALIDATOR); 12081 VALIDATORS.put(STAY_ON_WHILE_PLUGGED_IN, STAY_ON_WHILE_PLUGGED_IN_VALIDATOR); 12082 VALIDATORS.put(AUTO_TIME, AUTO_TIME_VALIDATOR); 12083 VALIDATORS.put(AUTO_TIME_ZONE, AUTO_TIME_ZONE_VALIDATOR); 12084 VALIDATORS.put(POWER_SOUNDS_ENABLED, POWER_SOUNDS_ENABLED_VALIDATOR); 12085 VALIDATORS.put(DOCK_SOUNDS_ENABLED, DOCK_SOUNDS_ENABLED_VALIDATOR); 12086 VALIDATORS.put(CHARGING_SOUNDS_ENABLED, CHARGING_SOUNDS_ENABLED_VALIDATOR); 12087 VALIDATORS.put(USB_MASS_STORAGE_ENABLED, USB_MASS_STORAGE_ENABLED_VALIDATOR); 12088 VALIDATORS.put(NETWORK_RECOMMENDATIONS_ENABLED, 12089 NETWORK_RECOMMENDATIONS_ENABLED_VALIDATOR); 12090 VALIDATORS.put(WIFI_WAKEUP_ENABLED, WIFI_WAKEUP_ENABLED_VALIDATOR); 12091 VALIDATORS.put(WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 12092 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); 12093 VALIDATORS.put(USE_OPEN_WIFI_PACKAGE, USE_OPEN_WIFI_PACKAGE_VALIDATOR); 12094 VALIDATORS.put(WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 12095 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED_VALIDATOR); 12096 VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); 12097 VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); 12098 VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); 12099 VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); 12100 VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, 12101 ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR); 12102 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL, LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); 12103 VALIDATORS.put(LOW_POWER_MODE_TRIGGER_LEVEL_MAX, 12104 LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR); 12105 VALIDATORS.put(BLUETOOTH_ON, BLUETOOTH_ON_VALIDATOR); 12106 VALIDATORS.put(PRIVATE_DNS_MODE, PRIVATE_DNS_MODE_VALIDATOR); 12107 VALIDATORS.put(PRIVATE_DNS_SPECIFIER, PRIVATE_DNS_SPECIFIER_VALIDATOR); 12108 VALIDATORS.put(SOFT_AP_TIMEOUT_ENABLED, SOFT_AP_TIMEOUT_ENABLED_VALIDATOR); 12109 VALIDATORS.put(WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON, 12110 WIFI_CARRIER_NETWORKS_AVAILABLE_NOTIFICATION_ON_VALIDATOR); 12111 VALIDATORS.put(APP_AUTO_RESTRICTION_ENABLED, APP_AUTO_RESTRICTION_ENABLED_VALIDATOR); 12112 VALIDATORS.put(ZEN_DURATION, ZEN_DURATION_VALIDATOR); 12113 VALIDATORS.put(CHARGING_VIBRATION_ENABLED, CHARGING_VIBRATION_ENABLED_VALIDATOR); 12114 } 12115 12116 /** 12117 * Global settings that shouldn't be persisted. 12118 * 12119 * @hide 12120 */ 12121 public static final String[] TRANSIENT_SETTINGS = { 12122 LOCATION_GLOBAL_KILL_SWITCH, 12123 }; 12124 12125 /** 12126 * Keys we no longer back up under the current schema, but want to continue to 12127 * process when restoring historical backup datasets. 12128 * 12129 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 12130 * otherwise they won't be restored. 12131 * 12132 * @hide 12133 */ 12134 public static final String[] LEGACY_RESTORE_SETTINGS = { 12135 }; 12136 12137 private static final ContentProviderHolder sProviderHolder = 12138 new ContentProviderHolder(CONTENT_URI); 12139 12140 // Populated lazily, guarded by class object: 12141 private static final NameValueCache sNameValueCache = new NameValueCache( 12142 CONTENT_URI, 12143 CALL_METHOD_GET_GLOBAL, 12144 CALL_METHOD_PUT_GLOBAL, 12145 sProviderHolder); 12146 12147 // Certain settings have been moved from global to the per-user secure namespace 12148 private static final HashSet<String> MOVED_TO_SECURE; 12149 static { 12150 MOVED_TO_SECURE = new HashSet<>(1); 12151 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); 12152 } 12153 12154 /** @hide */ 12155 public static void getMovedToSecureSettings(Set<String> outKeySet) { 12156 outKeySet.addAll(MOVED_TO_SECURE); 12157 } 12158 12159 /** @hide */ 12160 public static void clearProviderForTest() { 12161 sProviderHolder.clearProviderForTest(); 12162 sNameValueCache.clearGenerationTrackerForTest(); 12163 } 12164 12165 /** 12166 * Look up a name in the database. 12167 * @param resolver to access the database with 12168 * @param name to look up in the table 12169 * @return the corresponding value, or null if not present 12170 */ 12171 public static String getString(ContentResolver resolver, String name) { 12172 return getStringForUser(resolver, name, resolver.getUserId()); 12173 } 12174 12175 /** @hide */ 12176 public static String getStringForUser(ContentResolver resolver, String name, 12177 int userHandle) { 12178 if (MOVED_TO_SECURE.contains(name)) { 12179 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 12180 + " to android.provider.Settings.Secure, returning read-only value."); 12181 return Secure.getStringForUser(resolver, name, userHandle); 12182 } 12183 return sNameValueCache.getStringForUser(resolver, name, userHandle); 12184 } 12185 12186 /** 12187 * Store a name/value pair into the database. 12188 * @param resolver to access the database with 12189 * @param name to store 12190 * @param value to associate with the name 12191 * @return true if the value was set, false on database errors 12192 */ 12193 public static boolean putString(ContentResolver resolver, 12194 String name, String value) { 12195 return putStringForUser(resolver, name, value, null, false, resolver.getUserId()); 12196 } 12197 12198 /** 12199 * Store a name/value pair into the database. 12200 * <p> 12201 * The method takes an optional tag to associate with the setting 12202 * which can be used to clear only settings made by your package and 12203 * associated with this tag by passing the tag to {@link 12204 * #resetToDefaults(ContentResolver, String)}. Anyone can override 12205 * the current tag. Also if another package changes the setting 12206 * then the tag will be set to the one specified in the set call 12207 * which can be null. Also any of the settings setters that do not 12208 * take a tag as an argument effectively clears the tag. 12209 * </p><p> 12210 * For example, if you set settings A and B with tags T1 and T2 and 12211 * another app changes setting A (potentially to the same value), it 12212 * can assign to it a tag T3 (note that now the package that changed 12213 * the setting is not yours). Now if you reset your changes for T1 and 12214 * T2 only setting B will be reset and A not (as it was changed by 12215 * another package) but since A did not change you are in the desired 12216 * initial state. Now if the other app changes the value of A (assuming 12217 * you registered an observer in the beginning) you would detect that 12218 * the setting was changed by another app and handle this appropriately 12219 * (ignore, set back to some value, etc). 12220 * </p><p> 12221 * Also the method takes an argument whether to make the value the 12222 * default for this setting. If the system already specified a default 12223 * value, then the one passed in here will <strong>not</strong> 12224 * be set as the default. 12225 * </p> 12226 * 12227 * @param resolver to access the database with. 12228 * @param name to store. 12229 * @param value to associate with the name. 12230 * @param tag to associated with the setting. 12231 * @param makeDefault whether to make the value the default one. 12232 * @return true if the value was set, false on database errors. 12233 * 12234 * @see #resetToDefaults(ContentResolver, String) 12235 * 12236 * @hide 12237 */ 12238 @SystemApi 12239 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 12240 public static boolean putString(@NonNull ContentResolver resolver, 12241 @NonNull String name, @Nullable String value, @Nullable String tag, 12242 boolean makeDefault) { 12243 return putStringForUser(resolver, name, value, tag, makeDefault, 12244 resolver.getUserId()); 12245 } 12246 12247 /** 12248 * Reset the settings to their defaults. This would reset <strong>only</strong> 12249 * settings set by the caller's package. Think of it of a way to undo your own 12250 * changes to the secure settings. Passing in the optional tag will reset only 12251 * settings changed by your package and associated with this tag. 12252 * 12253 * @param resolver Handle to the content resolver. 12254 * @param tag Optional tag which should be associated with the settings to reset. 12255 * 12256 * @see #putString(ContentResolver, String, String, String, boolean) 12257 * 12258 * @hide 12259 */ 12260 @SystemApi 12261 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 12262 public static void resetToDefaults(@NonNull ContentResolver resolver, 12263 @Nullable String tag) { 12264 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 12265 resolver.getUserId()); 12266 } 12267 12268 /** 12269 * Reset the settings to their defaults for a given user with a specific mode. The 12270 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 12271 * allowing resetting the settings made by a package and associated with the tag. 12272 * 12273 * @param resolver Handle to the content resolver. 12274 * @param tag Optional tag which should be associated with the settings to reset. 12275 * @param mode The reset mode. 12276 * @param userHandle The user for which to reset to defaults. 12277 * 12278 * @see #RESET_MODE_PACKAGE_DEFAULTS 12279 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 12280 * @see #RESET_MODE_UNTRUSTED_CHANGES 12281 * @see #RESET_MODE_TRUSTED_DEFAULTS 12282 * 12283 * @hide 12284 */ 12285 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 12286 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 12287 try { 12288 Bundle arg = new Bundle(); 12289 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 12290 if (tag != null) { 12291 arg.putString(CALL_METHOD_TAG_KEY, tag); 12292 } 12293 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 12294 IContentProvider cp = sProviderHolder.getProvider(resolver); 12295 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); 12296 } catch (RemoteException e) { 12297 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 12298 } 12299 } 12300 12301 /** @hide */ 12302 public static boolean putStringForUser(ContentResolver resolver, 12303 String name, String value, int userHandle) { 12304 return putStringForUser(resolver, name, value, null, false, userHandle); 12305 } 12306 12307 /** @hide */ 12308 public static boolean putStringForUser(@NonNull ContentResolver resolver, 12309 @NonNull String name, @Nullable String value, @Nullable String tag, 12310 boolean makeDefault, @UserIdInt int userHandle) { 12311 if (LOCAL_LOGV) { 12312 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 12313 + " for " + userHandle); 12314 } 12315 // Global and Secure have the same access policy so we can forward writes 12316 if (MOVED_TO_SECURE.contains(name)) { 12317 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 12318 + " to android.provider.Settings.Secure, value is unchanged."); 12319 return Secure.putStringForUser(resolver, name, value, tag, 12320 makeDefault, userHandle); 12321 } 12322 return sNameValueCache.putStringForUser(resolver, name, value, tag, 12323 makeDefault, userHandle); 12324 } 12325 12326 /** 12327 * Construct the content URI for a particular name/value pair, 12328 * useful for monitoring changes with a ContentObserver. 12329 * @param name to look up in the table 12330 * @return the corresponding content URI, or null if not present 12331 */ 12332 public static Uri getUriFor(String name) { 12333 return getUriFor(CONTENT_URI, name); 12334 } 12335 12336 /** 12337 * Convenience function for retrieving a single secure settings value 12338 * as an integer. Note that internally setting values are always 12339 * stored as strings; this function converts the string to an integer 12340 * for you. The default value will be returned if the setting is 12341 * not defined or not an integer. 12342 * 12343 * @param cr The ContentResolver to access. 12344 * @param name The name of the setting to retrieve. 12345 * @param def Value to return if the setting is not defined. 12346 * 12347 * @return The setting's current value, or 'def' if it is not defined 12348 * or not a valid integer. 12349 */ 12350 public static int getInt(ContentResolver cr, String name, int def) { 12351 String v = getString(cr, name); 12352 try { 12353 return v != null ? Integer.parseInt(v) : def; 12354 } catch (NumberFormatException e) { 12355 return def; 12356 } 12357 } 12358 12359 /** 12360 * Convenience function for retrieving a single secure settings value 12361 * as an integer. Note that internally setting values are always 12362 * stored as strings; this function converts the string to an integer 12363 * for you. 12364 * <p> 12365 * This version does not take a default value. If the setting has not 12366 * been set, or the string value is not a number, 12367 * it throws {@link SettingNotFoundException}. 12368 * 12369 * @param cr The ContentResolver to access. 12370 * @param name The name of the setting to retrieve. 12371 * 12372 * @throws SettingNotFoundException Thrown if a setting by the given 12373 * name can't be found or the setting value is not an integer. 12374 * 12375 * @return The setting's current value. 12376 */ 12377 public static int getInt(ContentResolver cr, String name) 12378 throws SettingNotFoundException { 12379 String v = getString(cr, name); 12380 try { 12381 return Integer.parseInt(v); 12382 } catch (NumberFormatException e) { 12383 throw new SettingNotFoundException(name); 12384 } 12385 } 12386 12387 /** 12388 * Convenience function for updating a single settings value as an 12389 * integer. This will either create a new entry in the table if the 12390 * given name does not exist, or modify the value of the existing row 12391 * with that name. Note that internally setting values are always 12392 * stored as strings, so this function converts the given value to a 12393 * string before storing it. 12394 * 12395 * @param cr The ContentResolver to access. 12396 * @param name The name of the setting to modify. 12397 * @param value The new value for the setting. 12398 * @return true if the value was set, false on database errors 12399 */ 12400 public static boolean putInt(ContentResolver cr, String name, int value) { 12401 return putString(cr, name, Integer.toString(value)); 12402 } 12403 12404 /** 12405 * Convenience function for retrieving a single secure settings value 12406 * as a {@code long}. Note that internally setting values are always 12407 * stored as strings; this function converts the string to a {@code long} 12408 * for you. The default value will be returned if the setting is 12409 * not defined or not a {@code long}. 12410 * 12411 * @param cr The ContentResolver to access. 12412 * @param name The name of the setting to retrieve. 12413 * @param def Value to return if the setting is not defined. 12414 * 12415 * @return The setting's current value, or 'def' if it is not defined 12416 * or not a valid {@code long}. 12417 */ 12418 public static long getLong(ContentResolver cr, String name, long def) { 12419 String valString = getString(cr, name); 12420 long value; 12421 try { 12422 value = valString != null ? Long.parseLong(valString) : def; 12423 } catch (NumberFormatException e) { 12424 value = def; 12425 } 12426 return value; 12427 } 12428 12429 /** 12430 * Convenience function for retrieving a single secure settings value 12431 * as a {@code long}. Note that internally setting values are always 12432 * stored as strings; this function converts the string to a {@code long} 12433 * for you. 12434 * <p> 12435 * This version does not take a default value. If the setting has not 12436 * been set, or the string value is not a number, 12437 * it throws {@link SettingNotFoundException}. 12438 * 12439 * @param cr The ContentResolver to access. 12440 * @param name The name of the setting to retrieve. 12441 * 12442 * @return The setting's current value. 12443 * @throws SettingNotFoundException Thrown if a setting by the given 12444 * name can't be found or the setting value is not an integer. 12445 */ 12446 public static long getLong(ContentResolver cr, String name) 12447 throws SettingNotFoundException { 12448 String valString = getString(cr, name); 12449 try { 12450 return Long.parseLong(valString); 12451 } catch (NumberFormatException e) { 12452 throw new SettingNotFoundException(name); 12453 } 12454 } 12455 12456 /** 12457 * Convenience function for updating a secure settings value as a long 12458 * integer. This will either create a new entry in the table if the 12459 * given name does not exist, or modify the value of the existing row 12460 * with that name. Note that internally setting values are always 12461 * stored as strings, so this function converts the given value to a 12462 * string before storing it. 12463 * 12464 * @param cr The ContentResolver to access. 12465 * @param name The name of the setting to modify. 12466 * @param value The new value for the setting. 12467 * @return true if the value was set, false on database errors 12468 */ 12469 public static boolean putLong(ContentResolver cr, String name, long value) { 12470 return putString(cr, name, Long.toString(value)); 12471 } 12472 12473 /** 12474 * Convenience function for retrieving a single secure settings value 12475 * as a floating point number. Note that internally setting values are 12476 * always stored as strings; this function converts the string to an 12477 * float for you. The default value will be returned if the setting 12478 * is not defined or not a valid float. 12479 * 12480 * @param cr The ContentResolver to access. 12481 * @param name The name of the setting to retrieve. 12482 * @param def Value to return if the setting is not defined. 12483 * 12484 * @return The setting's current value, or 'def' if it is not defined 12485 * or not a valid float. 12486 */ 12487 public static float getFloat(ContentResolver cr, String name, float def) { 12488 String v = getString(cr, name); 12489 try { 12490 return v != null ? Float.parseFloat(v) : def; 12491 } catch (NumberFormatException e) { 12492 return def; 12493 } 12494 } 12495 12496 /** 12497 * Convenience function for retrieving a single secure settings value 12498 * as a float. Note that internally setting values are always 12499 * stored as strings; this function converts the string to a float 12500 * for you. 12501 * <p> 12502 * This version does not take a default value. If the setting has not 12503 * been set, or the string value is not a number, 12504 * it throws {@link SettingNotFoundException}. 12505 * 12506 * @param cr The ContentResolver to access. 12507 * @param name The name of the setting to retrieve. 12508 * 12509 * @throws SettingNotFoundException Thrown if a setting by the given 12510 * name can't be found or the setting value is not a float. 12511 * 12512 * @return The setting's current value. 12513 */ 12514 public static float getFloat(ContentResolver cr, String name) 12515 throws SettingNotFoundException { 12516 String v = getString(cr, name); 12517 if (v == null) { 12518 throw new SettingNotFoundException(name); 12519 } 12520 try { 12521 return Float.parseFloat(v); 12522 } catch (NumberFormatException e) { 12523 throw new SettingNotFoundException(name); 12524 } 12525 } 12526 12527 /** 12528 * Convenience function for updating a single settings value as a 12529 * floating point number. This will either create a new entry in the 12530 * table if the given name does not exist, or modify the value of the 12531 * existing row with that name. Note that internally setting values 12532 * are always stored as strings, so this function converts the given 12533 * value to a string before storing it. 12534 * 12535 * @param cr The ContentResolver to access. 12536 * @param name The name of the setting to modify. 12537 * @param value The new value for the setting. 12538 * @return true if the value was set, false on database errors 12539 */ 12540 public static boolean putFloat(ContentResolver cr, String name, float value) { 12541 return putString(cr, name, Float.toString(value)); 12542 } 12543 12544 /** 12545 * Subscription to be used for voice call on a multi sim device. The supported values 12546 * are 0 = SUB1, 1 = SUB2 and etc. 12547 * @hide 12548 */ 12549 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 12550 12551 /** 12552 * Used to provide option to user to select subscription during dial. 12553 * The supported values are 0 = disable or 1 = enable prompt. 12554 * @hide 12555 */ 12556 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 12557 12558 /** 12559 * Subscription to be used for data call on a multi sim device. The supported values 12560 * are 0 = SUB1, 1 = SUB2 and etc. 12561 * @hide 12562 */ 12563 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 12564 12565 /** 12566 * Subscription to be used for SMS on a multi sim device. The supported values 12567 * are 0 = SUB1, 1 = SUB2 and etc. 12568 * @hide 12569 */ 12570 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 12571 12572 /** 12573 * Used to provide option to user to select subscription during send SMS. 12574 * The value 1 - enable, 0 - disable 12575 * @hide 12576 */ 12577 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 12578 12579 /** User preferred subscriptions setting. 12580 * This holds the details of the user selected subscription from the card and 12581 * the activation status. Each settings string have the comma separated values 12582 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 12583 * @hide 12584 */ 12585 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 12586 "user_preferred_sub2","user_preferred_sub3"}; 12587 12588 /** 12589 * Whether to enable new contacts aggregator or not. 12590 * The value 1 - enable, 0 - disable 12591 * @hide 12592 */ 12593 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; 12594 12595 /** 12596 * Whether to enable contacts metadata syncing or not 12597 * The value 1 - enable, 0 - disable 12598 * 12599 * @removed 12600 */ 12601 @Deprecated 12602 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; 12603 12604 /** 12605 * Whether to enable contacts metadata syncing or not 12606 * The value 1 - enable, 0 - disable 12607 */ 12608 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; 12609 12610 /** 12611 * Whether to enable cellular on boot. 12612 * The value 1 - enable, 0 - disable 12613 * @hide 12614 */ 12615 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; 12616 12617 /** 12618 * The maximum allowed notification enqueue rate in Hertz. 12619 * 12620 * Should be a float, and includes updates only. 12621 * @hide 12622 */ 12623 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; 12624 12625 /** 12626 * Displays toasts when an app posts a notification that does not specify a valid channel. 12627 * 12628 * The value 1 - enable, 0 - disable 12629 * @hide 12630 */ 12631 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = 12632 "show_notification_channel_warnings"; 12633 12634 /** 12635 * Whether cell is enabled/disabled 12636 * @hide 12637 */ 12638 public static final String CELL_ON = "cell_on"; 12639 12640 /** 12641 * Global settings which can be accessed by instant apps. 12642 * @hide 12643 */ 12644 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 12645 static { 12646 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); 12647 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); 12648 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); 12649 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); 12650 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); 12651 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); 12652 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); 12653 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); 12654 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); 12655 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); 12656 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); 12657 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); 12658 INSTANT_APP_SETTINGS.add(ZEN_MODE); 12659 } 12660 12661 /** 12662 * Whether to show the high temperature warning notification. 12663 * @hide 12664 */ 12665 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; 12666 12667 /** 12668 * Temperature at which the high temperature warning notification should be shown. 12669 * @hide 12670 */ 12671 public static final String WARNING_TEMPERATURE = "warning_temperature"; 12672 12673 /** 12674 * Whether the diskstats logging task is enabled/disabled. 12675 * @hide 12676 */ 12677 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; 12678 12679 /** 12680 * Whether the cache quota calculation task is enabled/disabled. 12681 * @hide 12682 */ 12683 public static final String ENABLE_CACHE_QUOTA_CALCULATION = 12684 "enable_cache_quota_calculation"; 12685 12686 /** 12687 * Whether the Deletion Helper no threshold toggle is available. 12688 * @hide 12689 */ 12690 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = 12691 "enable_deletion_helper_no_threshold_toggle"; 12692 12693 /** 12694 * The list of snooze options for notifications 12695 * This is encoded as a key=value list, separated by commas. Ex: 12696 * 12697 * "default=60,options_array=15:30:60:120" 12698 * 12699 * The following keys are supported: 12700 * 12701 * <pre> 12702 * default (int) 12703 * options_array (int[]) 12704 * </pre> 12705 * 12706 * All delays in integer minutes. Array order is respected. 12707 * Options will be used in order up to the maximum allowed by the UI. 12708 * @hide 12709 */ 12710 public static final String NOTIFICATION_SNOOZE_OPTIONS = 12711 "notification_snooze_options"; 12712 12713 /** 12714 * Settings key for the ratio of notification dismissals to notification views - one of the 12715 * criteria for showing the notification blocking helper. 12716 * 12717 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive 12718 * the blocking helper will be). 12719 * 12720 * @hide 12721 */ 12722 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT = 12723 "blocking_helper_dismiss_to_view_ratio"; 12724 12725 /** 12726 * Settings key for the longest streak of dismissals - one of the criteria for showing the 12727 * notification blocking helper. 12728 * 12729 * <p>The value is an integer greater than 0. 12730 * 12731 * @hide 12732 */ 12733 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit"; 12734 12735 /** 12736 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated 12737 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF 12738 * 12739 * Supported keys: 12740 * compatibility_wal_supported (boolean) 12741 * wal_syncmode (String) 12742 * 12743 * @hide 12744 */ 12745 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = 12746 "sqlite_compatibility_wal_flags"; 12747 12748 /** 12749 * Enable GNSS Raw Measurements Full Tracking? 12750 * 0 = no 12751 * 1 = yes 12752 * @hide 12753 */ 12754 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = 12755 "enable_gnss_raw_meas_full_tracking"; 12756 12757 /** 12758 * Whether the notification should be ongoing (persistent) when a carrier app install is 12759 * required. 12760 * 12761 * The value is a boolean (1 or 0). 12762 * @hide 12763 */ 12764 @SystemApi 12765 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = 12766 "install_carrier_app_notification_persistent"; 12767 12768 /** 12769 * The amount of time (ms) to hide the install carrier app notification after the user has 12770 * ignored it. After this time passes, the notification will be shown again 12771 * 12772 * The value is a long 12773 * @hide 12774 */ 12775 @SystemApi 12776 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = 12777 "install_carrier_app_notification_sleep_millis"; 12778 12779 /** 12780 * Whether we've enabled zram on this device. Takes effect on 12781 * reboot. The value "1" enables zram; "0" disables it, and 12782 * everything else is unspecified. 12783 * @hide 12784 */ 12785 public static final String ZRAM_ENABLED = 12786 "zram_enabled"; 12787 12788 /** 12789 * Whether we have enable CPU frequency scaling for this device. 12790 * For Wear, default is disable. 12791 * 12792 * The value is "1" for enable, "0" for disable. 12793 * @hide 12794 */ 12795 public static final String CPU_SCALING_ENABLED = 12796 "cpu_frequency_scaling_enabled"; 12797 12798 /** 12799 * Configuration flags for smart replies in notifications. 12800 * This is encoded as a key=value list, separated by commas. Ex: 12801 * 12802 * "enabled=1,max_squeeze_remeasure_count=3" 12803 * 12804 * The following keys are supported: 12805 * 12806 * <pre> 12807 * enabled (boolean) 12808 * requires_targeting_p (boolean) 12809 * max_squeeze_remeasure_attempts (int) 12810 * </pre> 12811 * @see com.android.systemui.statusbar.policy.SmartReplyConstants 12812 * @hide 12813 */ 12814 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = 12815 "smart_replies_in_notifications_flags"; 12816 12817 /** 12818 * If nonzero, crashes in foreground processes will bring up a dialog. 12819 * Otherwise, the process will be silently killed. 12820 * @hide 12821 */ 12822 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; 12823 12824 /** 12825 * If nonzero, crash dialogs will show an option to restart the app. 12826 * @hide 12827 */ 12828 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; 12829 12830 /** 12831 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for 12832 * this app. 12833 * @hide 12834 */ 12835 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; 12836 12837 /** 12838 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 12839 * @hide 12840 */ 12841 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 12842 12843 /** 12844 * If nonzero, will show the zen update settings suggestion. 12845 * @hide 12846 */ 12847 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 12848 12849 /** 12850 * If nonzero, zen has not been updated to reflect new changes. 12851 * @hide 12852 */ 12853 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 12854 12855 /** 12856 * If nonzero, zen setting suggestion has beem viewed by user 12857 * @hide 12858 */ 12859 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 12860 "zen_settings_suggestion_viewed"; 12861 12862 /** 12863 * Backup and restore agent timeout parameters. 12864 * These parameters are represented by a comma-delimited key-value list. 12865 * 12866 * The following strings are supported as keys: 12867 * <pre> 12868 * kv_backup_agent_timeout_millis (long) 12869 * full_backup_agent_timeout_millis (long) 12870 * shared_backup_agent_timeout_millis (long) 12871 * restore_agent_timeout_millis (long) 12872 * restore_agent_finished_timeout_millis (long) 12873 * </pre> 12874 * 12875 * They map to milliseconds represented as longs. 12876 * 12877 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" 12878 * 12879 * @hide 12880 */ 12881 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = 12882 "backup_agent_timeout_parameters"; 12883 12884 /** 12885 * Whether we have enabled swapping on this device. For Wear, default is 12886 * enabled. 12887 * 12888 * The value is "1" for enable, "0" for disable. 12889 * @hide 12890 */ 12891 public static final String SWAP_ENABLED = "swap_enabled"; 12892 12893 /** 12894 * Blacklist of GNSS satellites. 12895 * 12896 * This is a list of integers separated by commas to represent pairs of (constellation, 12897 * svid). Thus, the number of integers should be even. 12898 * 12899 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are 12900 * blacklisted. Note that svid=0 denotes all svids in the 12901 * constellation are blacklisted. 12902 * 12903 * @hide 12904 */ 12905 public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist"; 12906 12907 /** 12908 * Duration of updates in millisecond for GNSS location request from HAL to framework. 12909 * 12910 * If zero, the GNSS location request feature is disabled. 12911 * 12912 * The value is a non-negative long. 12913 * 12914 * @hide 12915 */ 12916 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS = 12917 "gnss_hal_location_request_duration_millis"; 12918 } 12919 12920 /** 12921 * User-defined bookmarks and shortcuts. The target of each bookmark is an 12922 * Intent URL, allowing it to be either a web page or a particular 12923 * application activity. 12924 * 12925 * @hide 12926 */ 12927 public static final class Bookmarks implements BaseColumns 12928 { 12929 private static final String TAG = "Bookmarks"; 12930 12931 /** 12932 * The content:// style URL for this table 12933 */ 12934 public static final Uri CONTENT_URI = 12935 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 12936 12937 /** 12938 * The row ID. 12939 * <p>Type: INTEGER</p> 12940 */ 12941 public static final String ID = "_id"; 12942 12943 /** 12944 * Descriptive name of the bookmark that can be displayed to the user. 12945 * If this is empty, the title should be resolved at display time (use 12946 * {@link #getTitle(Context, Cursor)} any time you want to display the 12947 * title of a bookmark.) 12948 * <P> 12949 * Type: TEXT 12950 * </P> 12951 */ 12952 public static final String TITLE = "title"; 12953 12954 /** 12955 * Arbitrary string (displayed to the user) that allows bookmarks to be 12956 * organized into categories. There are some special names for 12957 * standard folders, which all start with '@'. The label displayed for 12958 * the folder changes with the locale (via {@link #getLabelForFolder}) but 12959 * the folder name does not change so you can consistently query for 12960 * the folder regardless of the current locale. 12961 * 12962 * <P>Type: TEXT</P> 12963 * 12964 */ 12965 public static final String FOLDER = "folder"; 12966 12967 /** 12968 * The Intent URL of the bookmark, describing what it points to. This 12969 * value is given to {@link android.content.Intent#getIntent} to create 12970 * an Intent that can be launched. 12971 * <P>Type: TEXT</P> 12972 */ 12973 public static final String INTENT = "intent"; 12974 12975 /** 12976 * Optional shortcut character associated with this bookmark. 12977 * <P>Type: INTEGER</P> 12978 */ 12979 public static final String SHORTCUT = "shortcut"; 12980 12981 /** 12982 * The order in which the bookmark should be displayed 12983 * <P>Type: INTEGER</P> 12984 */ 12985 public static final String ORDERING = "ordering"; 12986 12987 private static final String[] sIntentProjection = { INTENT }; 12988 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 12989 private static final String sShortcutSelection = SHORTCUT + "=?"; 12990 12991 /** 12992 * Convenience function to retrieve the bookmarked Intent for a 12993 * particular shortcut key. 12994 * 12995 * @param cr The ContentResolver to query. 12996 * @param shortcut The shortcut key. 12997 * 12998 * @return Intent The bookmarked URL, or null if there is no bookmark 12999 * matching the given shortcut. 13000 */ 13001 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 13002 { 13003 Intent intent = null; 13004 13005 Cursor c = cr.query(CONTENT_URI, 13006 sIntentProjection, sShortcutSelection, 13007 new String[] { String.valueOf((int) shortcut) }, ORDERING); 13008 // Keep trying until we find a valid shortcut 13009 try { 13010 while (intent == null && c.moveToNext()) { 13011 try { 13012 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 13013 intent = Intent.parseUri(intentURI, 0); 13014 } catch (java.net.URISyntaxException e) { 13015 // The stored URL is bad... ignore it. 13016 } catch (IllegalArgumentException e) { 13017 // Column not found 13018 Log.w(TAG, "Intent column not found", e); 13019 } 13020 } 13021 } finally { 13022 if (c != null) c.close(); 13023 } 13024 13025 return intent; 13026 } 13027 13028 /** 13029 * Add a new bookmark to the system. 13030 * 13031 * @param cr The ContentResolver to query. 13032 * @param intent The desired target of the bookmark. 13033 * @param title Bookmark title that is shown to the user; null if none 13034 * or it should be resolved to the intent's title. 13035 * @param folder Folder in which to place the bookmark; null if none. 13036 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 13037 * this is non-zero and there is an existing bookmark entry 13038 * with this same shortcut, then that existing shortcut is 13039 * cleared (the bookmark is not removed). 13040 * @return The unique content URL for the new bookmark entry. 13041 */ 13042 public static Uri add(ContentResolver cr, 13043 Intent intent, 13044 String title, 13045 String folder, 13046 char shortcut, 13047 int ordering) 13048 { 13049 // If a shortcut is supplied, and it is already defined for 13050 // another bookmark, then remove the old definition. 13051 if (shortcut != 0) { 13052 cr.delete(CONTENT_URI, sShortcutSelection, 13053 new String[] { String.valueOf((int) shortcut) }); 13054 } 13055 13056 ContentValues values = new ContentValues(); 13057 if (title != null) values.put(TITLE, title); 13058 if (folder != null) values.put(FOLDER, folder); 13059 values.put(INTENT, intent.toUri(0)); 13060 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 13061 values.put(ORDERING, ordering); 13062 return cr.insert(CONTENT_URI, values); 13063 } 13064 13065 /** 13066 * Return the folder name as it should be displayed to the user. This 13067 * takes care of localizing special folders. 13068 * 13069 * @param r Resources object for current locale; only need access to 13070 * system resources. 13071 * @param folder The value found in the {@link #FOLDER} column. 13072 * 13073 * @return CharSequence The label for this folder that should be shown 13074 * to the user. 13075 */ 13076 public static CharSequence getLabelForFolder(Resources r, String folder) { 13077 return folder; 13078 } 13079 13080 /** 13081 * Return the title as it should be displayed to the user. This takes 13082 * care of localizing bookmarks that point to activities. 13083 * 13084 * @param context A context. 13085 * @param cursor A cursor pointing to the row whose title should be 13086 * returned. The cursor must contain at least the {@link #TITLE} 13087 * and {@link #INTENT} columns. 13088 * @return A title that is localized and can be displayed to the user, 13089 * or the empty string if one could not be found. 13090 */ 13091 public static CharSequence getTitle(Context context, Cursor cursor) { 13092 int titleColumn = cursor.getColumnIndex(TITLE); 13093 int intentColumn = cursor.getColumnIndex(INTENT); 13094 if (titleColumn == -1 || intentColumn == -1) { 13095 throw new IllegalArgumentException( 13096 "The cursor must contain the TITLE and INTENT columns."); 13097 } 13098 13099 String title = cursor.getString(titleColumn); 13100 if (!TextUtils.isEmpty(title)) { 13101 return title; 13102 } 13103 13104 String intentUri = cursor.getString(intentColumn); 13105 if (TextUtils.isEmpty(intentUri)) { 13106 return ""; 13107 } 13108 13109 Intent intent; 13110 try { 13111 intent = Intent.parseUri(intentUri, 0); 13112 } catch (URISyntaxException e) { 13113 return ""; 13114 } 13115 13116 PackageManager packageManager = context.getPackageManager(); 13117 ResolveInfo info = packageManager.resolveActivity(intent, 0); 13118 return info != null ? info.loadLabel(packageManager) : ""; 13119 } 13120 } 13121 13122 /** 13123 * Returns the device ID that we should use when connecting to the mobile gtalk server. 13124 * This is a string like "android-0x1242", where the hex string is the Android ID obtained 13125 * from the GoogleLoginService. 13126 * 13127 * @param androidId The Android ID for this device. 13128 * @return The device ID that should be used when connecting to the mobile gtalk server. 13129 * @hide 13130 */ 13131 public static String getGTalkDeviceId(long androidId) { 13132 return "android-" + Long.toHexString(androidId); 13133 } 13134 13135 private static final String[] PM_WRITE_SETTINGS = { 13136 android.Manifest.permission.WRITE_SETTINGS 13137 }; 13138 private static final String[] PM_CHANGE_NETWORK_STATE = { 13139 android.Manifest.permission.CHANGE_NETWORK_STATE, 13140 android.Manifest.permission.WRITE_SETTINGS 13141 }; 13142 private static final String[] PM_SYSTEM_ALERT_WINDOW = { 13143 android.Manifest.permission.SYSTEM_ALERT_WINDOW 13144 }; 13145 13146 /** 13147 * Performs a strict and comprehensive check of whether a calling package is allowed to 13148 * write/modify system settings, as the condition differs for pre-M, M+, and 13149 * privileged/preinstalled apps. If the provided uid does not match the 13150 * callingPackage, a negative result will be returned. 13151 * @hide 13152 */ 13153 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, 13154 String callingPackage, boolean throwException) { 13155 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 13156 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 13157 PM_WRITE_SETTINGS, false); 13158 } 13159 13160 /** 13161 * Performs a strict and comprehensive check of whether a calling package is allowed to 13162 * write/modify system settings, as the condition differs for pre-M, M+, and 13163 * privileged/preinstalled apps. If the provided uid does not match the 13164 * callingPackage, a negative result will be returned. The caller is expected to have 13165 * the WRITE_SETTINGS permission declared. 13166 * 13167 * Note: if the check is successful, the operation of this app will be updated to the 13168 * current time. 13169 * @hide 13170 */ 13171 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, 13172 String callingPackage, boolean throwException) { 13173 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 13174 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 13175 PM_WRITE_SETTINGS, true); 13176 } 13177 13178 /** 13179 * Performs a strict and comprehensive check of whether a calling package is allowed to 13180 * change the state of network, as the condition differs for pre-M, M+, and 13181 * privileged/preinstalled apps. The caller is expected to have either the 13182 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these 13183 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and 13184 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal 13185 * permission and cannot be revoked. See http://b/23597341 13186 * 13187 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation 13188 * of this app will be updated to the current time. 13189 * @hide 13190 */ 13191 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, 13192 String callingPackage, boolean throwException) { 13193 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) 13194 == PackageManager.PERMISSION_GRANTED) { 13195 return true; 13196 } 13197 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 13198 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 13199 PM_CHANGE_NETWORK_STATE, true); 13200 } 13201 13202 /** 13203 * Performs a strict and comprehensive check of whether a calling package is allowed to 13204 * draw on top of other apps, as the conditions differs for pre-M, M+, and 13205 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 13206 * a negative result will be returned. 13207 * @hide 13208 */ 13209 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, 13210 String callingPackage, boolean throwException) { 13211 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 13212 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 13213 PM_SYSTEM_ALERT_WINDOW, false); 13214 } 13215 13216 /** 13217 * Performs a strict and comprehensive check of whether a calling package is allowed to 13218 * draw on top of other apps, as the conditions differs for pre-M, M+, and 13219 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 13220 * a negative result will be returned. 13221 * 13222 * Note: if the check is successful, the operation of this app will be updated to the 13223 * current time. 13224 * @hide 13225 */ 13226 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String 13227 callingPackage, boolean throwException) { 13228 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 13229 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 13230 PM_SYSTEM_ALERT_WINDOW, true); 13231 } 13232 13233 /** 13234 * Helper method to perform a general and comprehensive check of whether an operation that is 13235 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and 13236 * OP_WRITE_SETTINGS 13237 * @hide 13238 */ 13239 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 13240 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] 13241 permissions, boolean makeNote) { 13242 if (callingPackage == null) { 13243 return false; 13244 } 13245 13246 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); 13247 int mode = AppOpsManager.MODE_DEFAULT; 13248 if (makeNote) { 13249 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); 13250 } else { 13251 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); 13252 } 13253 13254 switch (mode) { 13255 case AppOpsManager.MODE_ALLOWED: 13256 return true; 13257 13258 case AppOpsManager.MODE_DEFAULT: 13259 // this is the default operating mode after an app's installation 13260 // In this case we will check all associated static permission to see 13261 // if it is granted during install time. 13262 for (String permission : permissions) { 13263 if (context.checkCallingOrSelfPermission(permission) == PackageManager 13264 .PERMISSION_GRANTED) { 13265 // if either of the permissions are granted, we will allow it 13266 return true; 13267 } 13268 } 13269 13270 default: 13271 // this is for all other cases trickled down here... 13272 if (!throwException) { 13273 return false; 13274 } 13275 } 13276 13277 // prepare string to throw SecurityException 13278 StringBuilder exceptionMessage = new StringBuilder(); 13279 exceptionMessage.append(callingPackage); 13280 exceptionMessage.append(" was not granted "); 13281 if (permissions.length > 1) { 13282 exceptionMessage.append(" either of these permissions: "); 13283 } else { 13284 exceptionMessage.append(" this permission: "); 13285 } 13286 for (int i = 0; i < permissions.length; i++) { 13287 exceptionMessage.append(permissions[i]); 13288 exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); 13289 } 13290 13291 throw new SecurityException(exceptionMessage.toString()); 13292 } 13293 13294 /** 13295 * Retrieves a correponding package name for a given uid. It will query all 13296 * packages that are associated with the given uid, but it will return only 13297 * the zeroth result. 13298 * Note: If package could not be found, a null is returned. 13299 * @hide 13300 */ 13301 public static String getPackageNameForUid(Context context, int uid) { 13302 String[] packages = context.getPackageManager().getPackagesForUid(uid); 13303 if (packages == null) { 13304 return null; 13305 } 13306 return packages[0]; 13307 } 13308} 13309