Settings.java revision 55021797c637c5bd4d828b515b403a29d79ca274
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 android.annotation.SdkConstant; 20import android.annotation.SdkConstant.SdkConstantType; 21import android.app.SearchManager; 22import android.app.WallpaperManager; 23import android.content.ComponentName; 24import android.content.ContentResolver; 25import android.content.ContentValues; 26import android.content.Context; 27import android.content.IContentProvider; 28import android.content.Intent; 29import android.content.pm.ActivityInfo; 30import android.content.pm.PackageManager; 31import android.content.pm.ResolveInfo; 32import android.content.res.Configuration; 33import android.content.res.Resources; 34import android.database.Cursor; 35import android.database.SQLException; 36import android.location.LocationManager; 37import android.net.ConnectivityManager; 38import android.net.Uri; 39import android.net.wifi.WifiManager; 40import android.os.BatteryManager; 41import android.os.Bundle; 42import android.os.DropBoxManager; 43import android.os.IBinder; 44import android.os.Process; 45import android.os.RemoteException; 46import android.os.ServiceManager; 47import android.os.SystemProperties; 48import android.os.UserHandle; 49import android.os.Build.VERSION_CODES; 50import android.speech.tts.TextToSpeech; 51import android.text.TextUtils; 52import android.util.AndroidException; 53import android.util.Log; 54 55import com.android.internal.widget.ILockSettings; 56 57import java.net.URISyntaxException; 58import java.util.HashMap; 59import java.util.HashSet; 60import java.util.Locale; 61 62/** 63 * The Settings provider contains global system-level device preferences. 64 */ 65public final class Settings { 66 67 // Intent actions for Settings 68 69 /** 70 * Activity Action: Show system settings. 71 * <p> 72 * Input: Nothing. 73 * <p> 74 * Output: Nothing. 75 */ 76 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 77 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 78 79 /** 80 * Activity Action: Show settings to allow configuration of APNs. 81 * <p> 82 * Input: Nothing. 83 * <p> 84 * Output: Nothing. 85 */ 86 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 87 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 88 89 /** 90 * Activity Action: Show settings to allow configuration of current location 91 * sources. 92 * <p> 93 * In some cases, a matching Activity may not exist, so ensure you 94 * safeguard against this. 95 * <p> 96 * Input: Nothing. 97 * <p> 98 * Output: Nothing. 99 */ 100 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 101 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 102 "android.settings.LOCATION_SOURCE_SETTINGS"; 103 104 /** 105 * Activity Action: Show settings to allow configuration of wireless controls 106 * such as Wi-Fi, Bluetooth and Mobile networks. 107 * <p> 108 * In some cases, a matching Activity may not exist, so ensure you 109 * safeguard against this. 110 * <p> 111 * Input: Nothing. 112 * <p> 113 * Output: Nothing. 114 */ 115 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 116 public static final String ACTION_WIRELESS_SETTINGS = 117 "android.settings.WIRELESS_SETTINGS"; 118 119 /** 120 * Activity Action: Show settings to allow entering/exiting airplane mode. 121 * <p> 122 * In some cases, a matching Activity may not exist, so ensure you 123 * safeguard against this. 124 * <p> 125 * Input: Nothing. 126 * <p> 127 * Output: Nothing. 128 */ 129 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 130 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 131 "android.settings.AIRPLANE_MODE_SETTINGS"; 132 133 /** 134 * Activity Action: Show settings for accessibility modules. 135 * <p> 136 * In some cases, a matching Activity may not exist, so ensure you 137 * safeguard against this. 138 * <p> 139 * Input: Nothing. 140 * <p> 141 * Output: Nothing. 142 */ 143 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 144 public static final String ACTION_ACCESSIBILITY_SETTINGS = 145 "android.settings.ACCESSIBILITY_SETTINGS"; 146 147 /** 148 * Activity Action: Show settings to allow configuration of security and 149 * location privacy. 150 * <p> 151 * In some cases, a matching Activity may not exist, so ensure you 152 * safeguard against this. 153 * <p> 154 * Input: Nothing. 155 * <p> 156 * Output: Nothing. 157 */ 158 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 159 public static final String ACTION_SECURITY_SETTINGS = 160 "android.settings.SECURITY_SETTINGS"; 161 162 /** 163 * Activity Action: Show trusted credentials settings, opening to the user tab, 164 * to allow management of installed credentials. 165 * <p> 166 * In some cases, a matching Activity may not exist, so ensure you 167 * safeguard against this. 168 * <p> 169 * Input: Nothing. 170 * <p> 171 * Output: Nothing. 172 * @hide 173 */ 174 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 175 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 176 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 177 178 /** 179 * Activity Action: Show dialog explaining that an installed CA cert may enable 180 * monitoring of encrypted network traffic. 181 * <p> 182 * In some cases, a matching Activity may not exist, so ensure you 183 * safeguard against this. 184 * <p> 185 * Input: Nothing. 186 * <p> 187 * Output: Nothing. 188 * @hide 189 */ 190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 191 public static final String ACTION_MONITORING_CERT_INFO = 192 "com.android.settings.MONITORING_CERT_INFO"; 193 194 /** 195 * Activity Action: Show settings to allow configuration of privacy options. 196 * <p> 197 * In some cases, a matching Activity may not exist, so ensure you 198 * safeguard against this. 199 * <p> 200 * Input: Nothing. 201 * <p> 202 * Output: Nothing. 203 */ 204 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 205 public static final String ACTION_PRIVACY_SETTINGS = 206 "android.settings.PRIVACY_SETTINGS"; 207 208 /** 209 * Activity Action: Show settings to allow configuration of Wi-Fi. 210 211 * <p> 212 * In some cases, a matching Activity may not exist, so ensure you 213 * safeguard against this. 214 * <p> 215 * Input: Nothing. 216 * <p> 217 * Output: Nothing. 218 219 */ 220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 221 public static final String ACTION_WIFI_SETTINGS = 222 "android.settings.WIFI_SETTINGS"; 223 224 /** 225 * Activity Action: Show settings to allow configuration of a static IP 226 * address for Wi-Fi. 227 * <p> 228 * In some cases, a matching Activity may not exist, so ensure you safeguard 229 * against this. 230 * <p> 231 * Input: Nothing. 232 * <p> 233 * Output: Nothing. 234 */ 235 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 236 public static final String ACTION_WIFI_IP_SETTINGS = 237 "android.settings.WIFI_IP_SETTINGS"; 238 239 /** 240 * Activity Action: Show settings to allow configuration of Bluetooth. 241 * <p> 242 * In some cases, a matching Activity may not exist, so ensure you 243 * safeguard against this. 244 * <p> 245 * Input: Nothing. 246 * <p> 247 * Output: Nothing. 248 */ 249 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 250 public static final String ACTION_BLUETOOTH_SETTINGS = 251 "android.settings.BLUETOOTH_SETTINGS"; 252 253 /** 254 * Activity Action: Show settings to allow configuration of Wifi Displays. 255 * <p> 256 * In some cases, a matching Activity may not exist, so ensure you 257 * safeguard against this. 258 * <p> 259 * Input: Nothing. 260 * <p> 261 * Output: Nothing. 262 * @hide 263 */ 264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 265 public static final String ACTION_WIFI_DISPLAY_SETTINGS = 266 "android.settings.WIFI_DISPLAY_SETTINGS"; 267 268 /** 269 * Activity Action: Show settings to allow configuration of 270 * {@link android.media.routing.MediaRouteService media route providers}. 271 * <p> 272 * In some cases, a matching Activity may not exist, so ensure you 273 * safeguard against this. 274 * <p> 275 * Input: Nothing. 276 * <p> 277 * Output: Nothing. 278 */ 279 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 280 public static final String ACTION_CAST_SETTINGS = 281 "android.settings.CAST_SETTINGS"; 282 283 /** 284 * Activity Action: Show settings to allow configuration of date and time. 285 * <p> 286 * In some cases, a matching Activity may not exist, so ensure you 287 * safeguard against this. 288 * <p> 289 * Input: Nothing. 290 * <p> 291 * Output: Nothing. 292 */ 293 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 294 public static final String ACTION_DATE_SETTINGS = 295 "android.settings.DATE_SETTINGS"; 296 297 /** 298 * Activity Action: Show settings to allow configuration of sound and volume. 299 * <p> 300 * In some cases, a matching Activity may not exist, so ensure you 301 * safeguard against this. 302 * <p> 303 * Input: Nothing. 304 * <p> 305 * Output: Nothing. 306 */ 307 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 308 public static final String ACTION_SOUND_SETTINGS = 309 "android.settings.SOUND_SETTINGS"; 310 311 /** 312 * Activity Action: Show settings to allow configuration of display. 313 * <p> 314 * In some cases, a matching Activity may not exist, so ensure you 315 * safeguard against this. 316 * <p> 317 * Input: Nothing. 318 * <p> 319 * Output: Nothing. 320 */ 321 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 322 public static final String ACTION_DISPLAY_SETTINGS = 323 "android.settings.DISPLAY_SETTINGS"; 324 325 /** 326 * Activity Action: Show settings to allow configuration of locale. 327 * <p> 328 * In some cases, a matching Activity may not exist, so ensure you 329 * safeguard against this. 330 * <p> 331 * Input: Nothing. 332 * <p> 333 * Output: Nothing. 334 */ 335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 336 public static final String ACTION_LOCALE_SETTINGS = 337 "android.settings.LOCALE_SETTINGS"; 338 339 /** 340 * Activity Action: Show settings to configure input methods, in particular 341 * allowing the user to enable input methods. 342 * <p> 343 * In some cases, a matching Activity may not exist, so ensure you 344 * safeguard against this. 345 * <p> 346 * Input: Nothing. 347 * <p> 348 * Output: Nothing. 349 */ 350 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 351 public static final String ACTION_INPUT_METHOD_SETTINGS = 352 "android.settings.INPUT_METHOD_SETTINGS"; 353 354 /** 355 * Activity Action: Show settings to enable/disable input method subtypes. 356 * <p> 357 * In some cases, a matching Activity may not exist, so ensure you 358 * safeguard against this. 359 * <p> 360 * To tell which input method's subtypes are displayed in the settings, add 361 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 362 * If there is no extra in this Intent, subtypes from all installed input methods 363 * will be displayed in the settings. 364 * 365 * @see android.view.inputmethod.InputMethodInfo#getId 366 * <p> 367 * Input: Nothing. 368 * <p> 369 * Output: Nothing. 370 */ 371 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 372 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 373 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 374 375 /** 376 * Activity Action: Show a dialog to select input method. 377 * <p> 378 * In some cases, a matching Activity may not exist, so ensure you 379 * safeguard against this. 380 * <p> 381 * Input: Nothing. 382 * <p> 383 * Output: Nothing. 384 * @hide 385 */ 386 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 387 public static final String ACTION_SHOW_INPUT_METHOD_PICKER = 388 "android.settings.SHOW_INPUT_METHOD_PICKER"; 389 390 /** 391 * Activity Action: Show settings to manage the user input dictionary. 392 * <p> 393 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 394 * it is guaranteed there will always be an appropriate implementation for this Intent action. 395 * In prior releases of the platform this was optional, so ensure you safeguard against it. 396 * <p> 397 * Input: Nothing. 398 * <p> 399 * Output: Nothing. 400 */ 401 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 402 public static final String ACTION_USER_DICTIONARY_SETTINGS = 403 "android.settings.USER_DICTIONARY_SETTINGS"; 404 405 /** 406 * Activity Action: Adds a word to the user dictionary. 407 * <p> 408 * In some cases, a matching Activity may not exist, so ensure you 409 * safeguard against this. 410 * <p> 411 * Input: An extra with key <code>word</code> that contains the word 412 * that should be added to the dictionary. 413 * <p> 414 * Output: Nothing. 415 * 416 * @hide 417 */ 418 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 419 public static final String ACTION_USER_DICTIONARY_INSERT = 420 "com.android.settings.USER_DICTIONARY_INSERT"; 421 422 /** 423 * Activity Action: Show settings to allow configuration of application-related settings. 424 * <p> 425 * In some cases, a matching Activity may not exist, so ensure you 426 * safeguard against this. 427 * <p> 428 * Input: Nothing. 429 * <p> 430 * Output: Nothing. 431 */ 432 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 433 public static final String ACTION_APPLICATION_SETTINGS = 434 "android.settings.APPLICATION_SETTINGS"; 435 436 /** 437 * Activity Action: Show settings to allow configuration of application 438 * development-related settings. As of 439 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 440 * a required part of the platform. 441 * <p> 442 * Input: Nothing. 443 * <p> 444 * Output: Nothing. 445 */ 446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 447 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 448 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 449 450 /** 451 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 452 * <p> 453 * In some cases, a matching Activity may not exist, so ensure you 454 * safeguard against this. 455 * <p> 456 * Input: Nothing. 457 * <p> 458 * Output: Nothing. 459 */ 460 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 461 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 462 "android.settings.QUICK_LAUNCH_SETTINGS"; 463 464 /** 465 * Activity Action: Show settings to manage installed applications. 466 * <p> 467 * In some cases, a matching Activity may not exist, so ensure you 468 * safeguard against this. 469 * <p> 470 * Input: Nothing. 471 * <p> 472 * Output: Nothing. 473 */ 474 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 475 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 476 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 477 478 /** 479 * Activity Action: Show settings to manage all applications. 480 * <p> 481 * In some cases, a matching Activity may not exist, so ensure you 482 * safeguard against this. 483 * <p> 484 * Input: Nothing. 485 * <p> 486 * Output: Nothing. 487 */ 488 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 489 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 490 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 491 492 /** 493 * Activity Action: Show screen of details about a particular application. 494 * <p> 495 * In some cases, a matching Activity may not exist, so ensure you 496 * safeguard against this. 497 * <p> 498 * Input: The Intent's data URI specifies the application package name 499 * to be shown, with the "package" scheme. That is "package:com.my.app". 500 * <p> 501 * Output: Nothing. 502 */ 503 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 504 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 505 "android.settings.APPLICATION_DETAILS_SETTINGS"; 506 507 /** 508 * @hide 509 * Activity Action: Show the "app ops" settings screen. 510 * <p> 511 * Input: Nothing. 512 * <p> 513 * Output: Nothing. 514 */ 515 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 516 public static final String ACTION_APP_OPS_SETTINGS = 517 "android.settings.APP_OPS_SETTINGS"; 518 519 /** 520 * Activity Action: Show settings for system update functionality. 521 * <p> 522 * In some cases, a matching Activity may not exist, so ensure you 523 * safeguard against this. 524 * <p> 525 * Input: Nothing. 526 * <p> 527 * Output: Nothing. 528 * 529 * @hide 530 */ 531 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 532 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 533 "android.settings.SYSTEM_UPDATE_SETTINGS"; 534 535 /** 536 * Activity Action: Show settings to allow configuration of sync settings. 537 * <p> 538 * In some cases, a matching Activity may not exist, so ensure you 539 * safeguard against this. 540 * <p> 541 * The account types available to add via the add account button may be restricted by adding an 542 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 543 * authorities. Only account types which can sync with that content provider will be offered to 544 * the user. 545 * <p> 546 * Input: Nothing. 547 * <p> 548 * Output: Nothing. 549 */ 550 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 551 public static final String ACTION_SYNC_SETTINGS = 552 "android.settings.SYNC_SETTINGS"; 553 554 /** 555 * Activity Action: Show add account screen for creating a new account. 556 * <p> 557 * In some cases, a matching Activity may not exist, so ensure you 558 * safeguard against this. 559 * <p> 560 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 561 * extra to the Intent with one or more syncable content provider's authorities. Only account 562 * types which can sync with that content provider will be offered to the user. 563 * <p> 564 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 565 * Intent with one or more account types. 566 * <p> 567 * Input: Nothing. 568 * <p> 569 * Output: Nothing. 570 */ 571 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 572 public static final String ACTION_ADD_ACCOUNT = 573 "android.settings.ADD_ACCOUNT_SETTINGS"; 574 575 /** 576 * Activity Action: Show settings for selecting the network operator. 577 * <p> 578 * In some cases, a matching Activity may not exist, so ensure you 579 * safeguard against this. 580 * <p> 581 * Input: Nothing. 582 * <p> 583 * Output: Nothing. 584 */ 585 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 586 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 587 "android.settings.NETWORK_OPERATOR_SETTINGS"; 588 589 /** 590 * Activity Action: Show settings for selection of 2G/3G. 591 * <p> 592 * In some cases, a matching Activity may not exist, so ensure you 593 * safeguard against this. 594 * <p> 595 * Input: Nothing. 596 * <p> 597 * Output: Nothing. 598 */ 599 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 600 public static final String ACTION_DATA_ROAMING_SETTINGS = 601 "android.settings.DATA_ROAMING_SETTINGS"; 602 603 /** 604 * Activity Action: Show settings for internal storage. 605 * <p> 606 * In some cases, a matching Activity may not exist, so ensure you 607 * safeguard against this. 608 * <p> 609 * Input: Nothing. 610 * <p> 611 * Output: Nothing. 612 */ 613 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 614 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 615 "android.settings.INTERNAL_STORAGE_SETTINGS"; 616 /** 617 * Activity Action: Show settings for memory card storage. 618 * <p> 619 * In some cases, a matching Activity may not exist, so ensure you 620 * safeguard against this. 621 * <p> 622 * Input: Nothing. 623 * <p> 624 * Output: Nothing. 625 */ 626 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 627 public static final String ACTION_MEMORY_CARD_SETTINGS = 628 "android.settings.MEMORY_CARD_SETTINGS"; 629 630 /** 631 * Activity Action: Show settings for global search. 632 * <p> 633 * In some cases, a matching Activity may not exist, so ensure you 634 * safeguard against this. 635 * <p> 636 * Input: Nothing. 637 * <p> 638 * Output: Nothing 639 */ 640 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 641 public static final String ACTION_SEARCH_SETTINGS = 642 "android.search.action.SEARCH_SETTINGS"; 643 644 /** 645 * Activity Action: Show general device information settings (serial 646 * number, software version, phone number, etc.). 647 * <p> 648 * In some cases, a matching Activity may not exist, so ensure you 649 * safeguard against this. 650 * <p> 651 * Input: Nothing. 652 * <p> 653 * Output: Nothing 654 */ 655 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 656 public static final String ACTION_DEVICE_INFO_SETTINGS = 657 "android.settings.DEVICE_INFO_SETTINGS"; 658 659 /** 660 * Activity Action: Show NFC settings. 661 * <p> 662 * This shows UI that allows NFC to be turned on or off. 663 * <p> 664 * In some cases, a matching Activity may not exist, so ensure you 665 * safeguard against this. 666 * <p> 667 * Input: Nothing. 668 * <p> 669 * Output: Nothing 670 * @see android.nfc.NfcAdapter#isEnabled() 671 */ 672 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 673 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 674 675 /** 676 * Activity Action: Show NFC Sharing settings. 677 * <p> 678 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 679 * off. 680 * <p> 681 * In some cases, a matching Activity may not exist, so ensure you 682 * safeguard against this. 683 * <p> 684 * Input: Nothing. 685 * <p> 686 * Output: Nothing 687 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 688 */ 689 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 690 public static final String ACTION_NFCSHARING_SETTINGS = 691 "android.settings.NFCSHARING_SETTINGS"; 692 693 /** 694 * Activity Action: Show NFC Tap & Pay settings 695 * <p> 696 * This shows UI that allows the user to configure Tap&Pay 697 * settings. 698 * <p> 699 * In some cases, a matching Activity may not exist, so ensure you 700 * safeguard against this. 701 * <p> 702 * Input: Nothing. 703 * <p> 704 * Output: Nothing 705 */ 706 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 707 public static final String ACTION_NFC_PAYMENT_SETTINGS = 708 "android.settings.NFC_PAYMENT_SETTINGS"; 709 710 /** 711 * Activity Action: Show Daydream settings. 712 * <p> 713 * In some cases, a matching Activity may not exist, so ensure you 714 * safeguard against this. 715 * <p> 716 * Input: Nothing. 717 * <p> 718 * Output: Nothing. 719 * @see android.service.dreams.DreamService 720 */ 721 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 722 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 723 724 /** 725 * Activity Action: Show Notification listener settings. 726 * <p> 727 * In some cases, a matching Activity may not exist, so ensure you 728 * safeguard against this. 729 * <p> 730 * Input: Nothing. 731 * <p> 732 * Output: Nothing. 733 * @see android.service.notification.NotificationListenerService 734 * @hide 735 */ 736 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 737 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 738 = "android.settings.NOTIFICATION_LISTENER_SETTINGS"; 739 740 /** 741 * @hide 742 */ 743 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 744 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 745 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 746 747 /** 748 * Activity Action: Show settings for video captioning. 749 * <p> 750 * In some cases, a matching Activity may not exist, so ensure you safeguard 751 * against this. 752 * <p> 753 * Input: Nothing. 754 * <p> 755 * Output: Nothing. 756 */ 757 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 758 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 759 760 /** 761 * Activity Action: Show the top level print settings. 762 * <p> 763 * In some cases, a matching Activity may not exist, so ensure you 764 * safeguard against this. 765 * <p> 766 * Input: Nothing. 767 * <p> 768 * Output: Nothing. 769 */ 770 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 771 public static final String ACTION_PRINT_SETTINGS = 772 "android.settings.ACTION_PRINT_SETTINGS"; 773 774 /** 775 * Activity Action: Show Zen Mode configuration settings. 776 * 777 * @hide 778 */ 779 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 780 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 781 782 /** 783 * Activity Action: Show the regulatory information screen for the device. 784 * <p> 785 * In some cases, a matching Activity may not exist, so ensure you safeguard 786 * against this. 787 * <p> 788 * Input: Nothing. 789 * <p> 790 * Output: Nothing. 791 */ 792 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 793 public static final String 794 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 795 796 /** 797 * Activity Action: Show Device Name Settings. 798 * <p> 799 * In some cases, a matching Activity may not exist, so ensure you safeguard 800 * against this. 801 * 802 * @hide 803 */ 804 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 805 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 806 807 /** 808 * Activity Action: Show pairing settings. 809 * <p> 810 * In some cases, a matching Activity may not exist, so ensure you safeguard 811 * against this. 812 * 813 * @hide 814 */ 815 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 816 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 817 818 /** 819 * Activity Action: Show battery saver settings. 820 * 821 * @hide 822 */ 823 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 824 public static final String ACTION_BATTERY_SAVER_SETTINGS 825 = "android.settings.BATTERY_SAVER_SETTINGS"; 826 827 /** 828 * Activity Action: Show Home selection settings. If there are multiple activities 829 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 830 * to pick your preferred activity. 831 */ 832 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 833 public static final String ACTION_HOME_SETTINGS 834 = "android.settings.HOME_SETTINGS"; 835 836 // End of Intent actions for Settings 837 838 /** 839 * @hide - Private call() method on SettingsProvider to read from 'system' table. 840 */ 841 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 842 843 /** 844 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 845 */ 846 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 847 848 /** 849 * @hide - Private call() method on SettingsProvider to read from 'global' table. 850 */ 851 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 852 853 /** 854 * @hide - User handle argument extra to the fast-path call()-based requests 855 */ 856 public static final String CALL_METHOD_USER_KEY = "_user"; 857 858 /** @hide - Private call() method to write to 'system' table */ 859 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 860 861 /** @hide - Private call() method to write to 'secure' table */ 862 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 863 864 /** @hide - Private call() method to write to 'global' table */ 865 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 866 867 /** 868 * Activity Extra: Limit available options in launched activity based on the given authority. 869 * <p> 870 * This can be passed as an extra field in an Activity Intent with one or more syncable content 871 * provider's authorities as a String[]. This field is used by some intents to alter the 872 * behavior of the called activity. 873 * <p> 874 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 875 * on the authority given. 876 */ 877 public static final String EXTRA_AUTHORITIES = "authorities"; 878 879 /** 880 * Activity Extra: Limit available options in launched activity based on the given account 881 * types. 882 * <p> 883 * This can be passed as an extra field in an Activity Intent with one or more account types 884 * as a String[]. This field is used by some intents to alter the behavior of the called 885 * activity. 886 * <p> 887 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 888 * list. 889 */ 890 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 891 892 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 893 894 private static final String JID_RESOURCE_PREFIX = "android"; 895 896 public static final String AUTHORITY = "settings"; 897 898 private static final String TAG = "Settings"; 899 private static final boolean LOCAL_LOGV = false; 900 901 // Lock ensures that when enabling/disabling the master location switch, we don't end up 902 // with a partial enable/disable state in multi-threaded situations. 903 private static final Object mLocationSettingsLock = new Object(); 904 905 public static class SettingNotFoundException extends AndroidException { 906 public SettingNotFoundException(String msg) { 907 super(msg); 908 } 909 } 910 911 /** 912 * Common base for tables of name/value settings. 913 */ 914 public static class NameValueTable implements BaseColumns { 915 public static final String NAME = "name"; 916 public static final String VALUE = "value"; 917 918 protected static boolean putString(ContentResolver resolver, Uri uri, 919 String name, String value) { 920 // The database will take care of replacing duplicates. 921 try { 922 ContentValues values = new ContentValues(); 923 values.put(NAME, name); 924 values.put(VALUE, value); 925 resolver.insert(uri, values); 926 return true; 927 } catch (SQLException e) { 928 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 929 return false; 930 } 931 } 932 933 public static Uri getUriFor(Uri uri, String name) { 934 return Uri.withAppendedPath(uri, name); 935 } 936 } 937 938 // Thread-safe. 939 private static class NameValueCache { 940 private final String mVersionSystemProperty; 941 private final Uri mUri; 942 943 private static final String[] SELECT_VALUE = 944 new String[] { Settings.NameValueTable.VALUE }; 945 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 946 947 // Must synchronize on 'this' to access mValues and mValuesVersion. 948 private final HashMap<String, String> mValues = new HashMap<String, String>(); 949 private long mValuesVersion = 0; 950 951 // Initially null; set lazily and held forever. Synchronized on 'this'. 952 private IContentProvider mContentProvider = null; 953 954 // The method we'll call (or null, to not use) on the provider 955 // for the fast path of retrieving settings. 956 private final String mCallGetCommand; 957 private final String mCallSetCommand; 958 959 public NameValueCache(String versionSystemProperty, Uri uri, 960 String getCommand, String setCommand) { 961 mVersionSystemProperty = versionSystemProperty; 962 mUri = uri; 963 mCallGetCommand = getCommand; 964 mCallSetCommand = setCommand; 965 } 966 967 private IContentProvider lazyGetProvider(ContentResolver cr) { 968 IContentProvider cp = null; 969 synchronized (this) { 970 cp = mContentProvider; 971 if (cp == null) { 972 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority()); 973 } 974 } 975 return cp; 976 } 977 978 public boolean putStringForUser(ContentResolver cr, String name, String value, 979 final int userHandle) { 980 try { 981 Bundle arg = new Bundle(); 982 arg.putString(Settings.NameValueTable.VALUE, value); 983 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 984 IContentProvider cp = lazyGetProvider(cr); 985 cp.call(cr.getPackageName(), mCallSetCommand, name, arg); 986 } catch (RemoteException e) { 987 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 988 return false; 989 } 990 return true; 991 } 992 993 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 994 final boolean isSelf = (userHandle == UserHandle.myUserId()); 995 if (isSelf) { 996 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0); 997 998 // Our own user's settings data uses a client-side cache 999 synchronized (this) { 1000 if (mValuesVersion != newValuesVersion) { 1001 if (LOCAL_LOGV || false) { 1002 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " 1003 + newValuesVersion + " != cached " + mValuesVersion); 1004 } 1005 1006 mValues.clear(); 1007 mValuesVersion = newValuesVersion; 1008 } 1009 1010 if (mValues.containsKey(name)) { 1011 return mValues.get(name); // Could be null, that's OK -- negative caching 1012 } 1013 } 1014 } else { 1015 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 1016 + " by user " + UserHandle.myUserId() + " so skipping cache"); 1017 } 1018 1019 IContentProvider cp = lazyGetProvider(cr); 1020 1021 // Try the fast path first, not using query(). If this 1022 // fails (alternate Settings provider that doesn't support 1023 // this interface?) then we fall back to the query/table 1024 // interface. 1025 if (mCallGetCommand != null) { 1026 try { 1027 Bundle args = null; 1028 if (!isSelf) { 1029 args = new Bundle(); 1030 args.putInt(CALL_METHOD_USER_KEY, userHandle); 1031 } 1032 Bundle b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); 1033 if (b != null) { 1034 String value = b.getPairValue(); 1035 // Don't update our cache for reads of other users' data 1036 if (isSelf) { 1037 synchronized (this) { 1038 mValues.put(name, value); 1039 } 1040 } else { 1041 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 1042 + " by " + UserHandle.myUserId() 1043 + " so not updating cache"); 1044 } 1045 return value; 1046 } 1047 // If the response Bundle is null, we fall through 1048 // to the query interface below. 1049 } catch (RemoteException e) { 1050 // Not supported by the remote side? Fall through 1051 // to query(). 1052 } 1053 } 1054 1055 Cursor c = null; 1056 try { 1057 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER, 1058 new String[]{name}, null, null); 1059 if (c == null) { 1060 Log.w(TAG, "Can't get key " + name + " from " + mUri); 1061 return null; 1062 } 1063 1064 String value = c.moveToNext() ? c.getString(0) : null; 1065 synchronized (this) { 1066 mValues.put(name, value); 1067 } 1068 if (LOCAL_LOGV) { 1069 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 1070 name + " = " + (value == null ? "(null)" : value)); 1071 } 1072 return value; 1073 } catch (RemoteException e) { 1074 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 1075 return null; // Return null, but don't cache it. 1076 } finally { 1077 if (c != null) c.close(); 1078 } 1079 } 1080 } 1081 1082 /** 1083 * System settings, containing miscellaneous system preferences. This 1084 * table holds simple name/value pairs. There are convenience 1085 * functions for accessing individual settings entries. 1086 */ 1087 public static final class System extends NameValueTable { 1088 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; 1089 1090 /** 1091 * The content:// style URL for this table 1092 */ 1093 public static final Uri CONTENT_URI = 1094 Uri.parse("content://" + AUTHORITY + "/system"); 1095 1096 private static final NameValueCache sNameValueCache = new NameValueCache( 1097 SYS_PROP_SETTING_VERSION, 1098 CONTENT_URI, 1099 CALL_METHOD_GET_SYSTEM, 1100 CALL_METHOD_PUT_SYSTEM); 1101 1102 private static final HashSet<String> MOVED_TO_SECURE; 1103 static { 1104 MOVED_TO_SECURE = new HashSet<String>(30); 1105 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 1106 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 1107 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 1108 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 1109 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 1110 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 1111 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 1112 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 1113 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 1114 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 1115 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 1116 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 1117 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 1118 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 1119 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 1120 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 1121 MOVED_TO_SECURE.add(Secure.WIFI_ON); 1122 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 1123 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 1124 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 1125 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 1126 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 1127 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 1128 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 1129 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 1130 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 1131 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 1132 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 1133 1134 // At one time in System, then Global, but now back in Secure 1135 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 1136 } 1137 1138 private static final HashSet<String> MOVED_TO_GLOBAL; 1139 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 1140 static { 1141 MOVED_TO_GLOBAL = new HashSet<String>(); 1142 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>(); 1143 1144 // these were originally in system but migrated to secure in the past, 1145 // so are duplicated in the Secure.* namespace 1146 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 1147 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 1148 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 1149 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 1150 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 1151 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 1152 1153 // these are moving directly from system to global 1154 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 1155 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 1156 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 1157 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 1158 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 1159 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 1160 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 1161 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 1162 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 1163 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 1164 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 1165 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 1166 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 1167 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 1168 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 1169 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 1170 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 1171 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 1172 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 1173 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 1174 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 1175 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 1176 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 1177 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 1178 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 1179 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 1180 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES); 1181 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 1182 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 1183 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 1184 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 1185 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 1186 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 1187 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 1188 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 1189 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 1190 } 1191 1192 /** @hide */ 1193 public static void getMovedKeys(HashSet<String> outKeySet) { 1194 outKeySet.addAll(MOVED_TO_GLOBAL); 1195 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 1196 } 1197 1198 /** @hide */ 1199 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 1200 outKeySet.addAll(MOVED_TO_GLOBAL); 1201 } 1202 1203 /** 1204 * Look up a name in the database. 1205 * @param resolver to access the database with 1206 * @param name to look up in the table 1207 * @return the corresponding value, or null if not present 1208 */ 1209 public static String getString(ContentResolver resolver, String name) { 1210 return getStringForUser(resolver, name, UserHandle.myUserId()); 1211 } 1212 1213 /** @hide */ 1214 public static String getStringForUser(ContentResolver resolver, String name, 1215 int userHandle) { 1216 if (MOVED_TO_SECURE.contains(name)) { 1217 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1218 + " to android.provider.Settings.Secure, returning read-only value."); 1219 return Secure.getStringForUser(resolver, name, userHandle); 1220 } 1221 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 1222 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1223 + " to android.provider.Settings.Global, returning read-only value."); 1224 return Global.getStringForUser(resolver, name, userHandle); 1225 } 1226 return sNameValueCache.getStringForUser(resolver, name, userHandle); 1227 } 1228 1229 /** 1230 * Store a name/value pair into the database. 1231 * @param resolver to access the database with 1232 * @param name to store 1233 * @param value to associate with the name 1234 * @return true if the value was set, false on database errors 1235 */ 1236 public static boolean putString(ContentResolver resolver, String name, String value) { 1237 return putStringForUser(resolver, name, value, UserHandle.myUserId()); 1238 } 1239 1240 /** @hide */ 1241 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 1242 int userHandle) { 1243 if (MOVED_TO_SECURE.contains(name)) { 1244 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1245 + " to android.provider.Settings.Secure, value is unchanged."); 1246 return false; 1247 } 1248 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 1249 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1250 + " to android.provider.Settings.Global, value is unchanged."); 1251 return false; 1252 } 1253 return sNameValueCache.putStringForUser(resolver, name, value, userHandle); 1254 } 1255 1256 /** 1257 * Construct the content URI for a particular name/value pair, 1258 * useful for monitoring changes with a ContentObserver. 1259 * @param name to look up in the table 1260 * @return the corresponding content URI, or null if not present 1261 */ 1262 public static Uri getUriFor(String name) { 1263 if (MOVED_TO_SECURE.contains(name)) { 1264 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1265 + " to android.provider.Settings.Secure, returning Secure URI."); 1266 return Secure.getUriFor(Secure.CONTENT_URI, name); 1267 } 1268 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 1269 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 1270 + " to android.provider.Settings.Global, returning read-only global URI."); 1271 return Global.getUriFor(Global.CONTENT_URI, name); 1272 } 1273 return getUriFor(CONTENT_URI, name); 1274 } 1275 1276 /** 1277 * Convenience function for retrieving a single system settings value 1278 * as an integer. Note that internally setting values are always 1279 * stored as strings; this function converts the string to an integer 1280 * for you. The default value will be returned if the setting is 1281 * not defined or not an integer. 1282 * 1283 * @param cr The ContentResolver to access. 1284 * @param name The name of the setting to retrieve. 1285 * @param def Value to return if the setting is not defined. 1286 * 1287 * @return The setting's current value, or 'def' if it is not defined 1288 * or not a valid integer. 1289 */ 1290 public static int getInt(ContentResolver cr, String name, int def) { 1291 return getIntForUser(cr, name, def, UserHandle.myUserId()); 1292 } 1293 1294 /** @hide */ 1295 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 1296 String v = getStringForUser(cr, name, userHandle); 1297 try { 1298 return v != null ? Integer.parseInt(v) : def; 1299 } catch (NumberFormatException e) { 1300 return def; 1301 } 1302 } 1303 1304 /** 1305 * Convenience function for retrieving a single system settings value 1306 * as an integer. Note that internally setting values are always 1307 * stored as strings; this function converts the string to an integer 1308 * for you. 1309 * <p> 1310 * This version does not take a default value. If the setting has not 1311 * been set, or the string value is not a number, 1312 * it throws {@link SettingNotFoundException}. 1313 * 1314 * @param cr The ContentResolver to access. 1315 * @param name The name of the setting to retrieve. 1316 * 1317 * @throws SettingNotFoundException Thrown if a setting by the given 1318 * name can't be found or the setting value is not an integer. 1319 * 1320 * @return The setting's current value. 1321 */ 1322 public static int getInt(ContentResolver cr, String name) 1323 throws SettingNotFoundException { 1324 return getIntForUser(cr, name, UserHandle.myUserId()); 1325 } 1326 1327 /** @hide */ 1328 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 1329 throws SettingNotFoundException { 1330 String v = getStringForUser(cr, name, userHandle); 1331 try { 1332 return Integer.parseInt(v); 1333 } catch (NumberFormatException e) { 1334 throw new SettingNotFoundException(name); 1335 } 1336 } 1337 1338 /** 1339 * Convenience function for updating a single settings value as an 1340 * integer. This will either create a new entry in the table if the 1341 * given name does not exist, or modify the value of the existing row 1342 * with that name. Note that internally setting values are always 1343 * stored as strings, so this function converts the given value to a 1344 * string before storing it. 1345 * 1346 * @param cr The ContentResolver to access. 1347 * @param name The name of the setting to modify. 1348 * @param value The new value for the setting. 1349 * @return true if the value was set, false on database errors 1350 */ 1351 public static boolean putInt(ContentResolver cr, String name, int value) { 1352 return putIntForUser(cr, name, value, UserHandle.myUserId()); 1353 } 1354 1355 /** @hide */ 1356 public static boolean putIntForUser(ContentResolver cr, String name, int value, 1357 int userHandle) { 1358 return putStringForUser(cr, name, Integer.toString(value), userHandle); 1359 } 1360 1361 /** 1362 * Convenience function for retrieving a single system settings value 1363 * as a {@code long}. Note that internally setting values are always 1364 * stored as strings; this function converts the string to a {@code long} 1365 * for you. The default value will be returned if the setting is 1366 * not defined or not a {@code long}. 1367 * 1368 * @param cr The ContentResolver to access. 1369 * @param name The name of the setting to retrieve. 1370 * @param def Value to return if the setting is not defined. 1371 * 1372 * @return The setting's current value, or 'def' if it is not defined 1373 * or not a valid {@code long}. 1374 */ 1375 public static long getLong(ContentResolver cr, String name, long def) { 1376 return getLongForUser(cr, name, def, UserHandle.myUserId()); 1377 } 1378 1379 /** @hide */ 1380 public static long getLongForUser(ContentResolver cr, String name, long def, 1381 int userHandle) { 1382 String valString = getStringForUser(cr, name, userHandle); 1383 long value; 1384 try { 1385 value = valString != null ? Long.parseLong(valString) : def; 1386 } catch (NumberFormatException e) { 1387 value = def; 1388 } 1389 return value; 1390 } 1391 1392 /** 1393 * Convenience function for retrieving a single system settings value 1394 * as a {@code long}. Note that internally setting values are always 1395 * stored as strings; this function converts the string to a {@code long} 1396 * for you. 1397 * <p> 1398 * This version does not take a default value. If the setting has not 1399 * been set, or the string value is not a number, 1400 * it throws {@link SettingNotFoundException}. 1401 * 1402 * @param cr The ContentResolver to access. 1403 * @param name The name of the setting to retrieve. 1404 * 1405 * @return The setting's current value. 1406 * @throws SettingNotFoundException Thrown if a setting by the given 1407 * name can't be found or the setting value is not an integer. 1408 */ 1409 public static long getLong(ContentResolver cr, String name) 1410 throws SettingNotFoundException { 1411 return getLongForUser(cr, name, UserHandle.myUserId()); 1412 } 1413 1414 /** @hide */ 1415 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 1416 throws SettingNotFoundException { 1417 String valString = getStringForUser(cr, name, userHandle); 1418 try { 1419 return Long.parseLong(valString); 1420 } catch (NumberFormatException e) { 1421 throw new SettingNotFoundException(name); 1422 } 1423 } 1424 1425 /** 1426 * Convenience function for updating a single settings value as a long 1427 * integer. This will either create a new entry in the table if the 1428 * given name does not exist, or modify the value of the existing row 1429 * with that name. Note that internally setting values are always 1430 * stored as strings, so this function converts the given value to a 1431 * string before storing it. 1432 * 1433 * @param cr The ContentResolver to access. 1434 * @param name The name of the setting to modify. 1435 * @param value The new value for the setting. 1436 * @return true if the value was set, false on database errors 1437 */ 1438 public static boolean putLong(ContentResolver cr, String name, long value) { 1439 return putLongForUser(cr, name, value, UserHandle.myUserId()); 1440 } 1441 1442 /** @hide */ 1443 public static boolean putLongForUser(ContentResolver cr, String name, long value, 1444 int userHandle) { 1445 return putStringForUser(cr, name, Long.toString(value), userHandle); 1446 } 1447 1448 /** 1449 * Convenience function for retrieving a single system settings value 1450 * as a floating point number. Note that internally setting values are 1451 * always stored as strings; this function converts the string to an 1452 * float for you. The default value will be returned if the setting 1453 * is not defined or not a valid float. 1454 * 1455 * @param cr The ContentResolver to access. 1456 * @param name The name of the setting to retrieve. 1457 * @param def Value to return if the setting is not defined. 1458 * 1459 * @return The setting's current value, or 'def' if it is not defined 1460 * or not a valid float. 1461 */ 1462 public static float getFloat(ContentResolver cr, String name, float def) { 1463 return getFloatForUser(cr, name, def, UserHandle.myUserId()); 1464 } 1465 1466 /** @hide */ 1467 public static float getFloatForUser(ContentResolver cr, String name, float def, 1468 int userHandle) { 1469 String v = getStringForUser(cr, name, userHandle); 1470 try { 1471 return v != null ? Float.parseFloat(v) : def; 1472 } catch (NumberFormatException e) { 1473 return def; 1474 } 1475 } 1476 1477 /** 1478 * Convenience function for retrieving a single system settings value 1479 * as a float. Note that internally setting values are always 1480 * stored as strings; this function converts the string to a float 1481 * for you. 1482 * <p> 1483 * This version does not take a default value. If the setting has not 1484 * been set, or the string value is not a number, 1485 * it throws {@link SettingNotFoundException}. 1486 * 1487 * @param cr The ContentResolver to access. 1488 * @param name The name of the setting to retrieve. 1489 * 1490 * @throws SettingNotFoundException Thrown if a setting by the given 1491 * name can't be found or the setting value is not a float. 1492 * 1493 * @return The setting's current value. 1494 */ 1495 public static float getFloat(ContentResolver cr, String name) 1496 throws SettingNotFoundException { 1497 return getFloatForUser(cr, name, UserHandle.myUserId()); 1498 } 1499 1500 /** @hide */ 1501 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 1502 throws SettingNotFoundException { 1503 String v = getStringForUser(cr, name, userHandle); 1504 if (v == null) { 1505 throw new SettingNotFoundException(name); 1506 } 1507 try { 1508 return Float.parseFloat(v); 1509 } catch (NumberFormatException e) { 1510 throw new SettingNotFoundException(name); 1511 } 1512 } 1513 1514 /** 1515 * Convenience function for updating a single settings value as a 1516 * floating point number. This will either create a new entry in the 1517 * table if the given name does not exist, or modify the value of the 1518 * existing row with that name. Note that internally setting values 1519 * are always stored as strings, so this function converts the given 1520 * value to a string before storing it. 1521 * 1522 * @param cr The ContentResolver to access. 1523 * @param name The name of the setting to modify. 1524 * @param value The new value for the setting. 1525 * @return true if the value was set, false on database errors 1526 */ 1527 public static boolean putFloat(ContentResolver cr, String name, float value) { 1528 return putFloatForUser(cr, name, value, UserHandle.myUserId()); 1529 } 1530 1531 /** @hide */ 1532 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 1533 int userHandle) { 1534 return putStringForUser(cr, name, Float.toString(value), userHandle); 1535 } 1536 1537 /** 1538 * Convenience function to read all of the current 1539 * configuration-related settings into a 1540 * {@link Configuration} object. 1541 * 1542 * @param cr The ContentResolver to access. 1543 * @param outConfig Where to place the configuration settings. 1544 */ 1545 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 1546 getConfigurationForUser(cr, outConfig, UserHandle.myUserId()); 1547 } 1548 1549 /** @hide */ 1550 public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig, 1551 int userHandle) { 1552 outConfig.fontScale = Settings.System.getFloatForUser( 1553 cr, FONT_SCALE, outConfig.fontScale, userHandle); 1554 if (outConfig.fontScale < 0) { 1555 outConfig.fontScale = 1; 1556 } 1557 } 1558 1559 /** 1560 * @hide Erase the fields in the Configuration that should be applied 1561 * by the settings. 1562 */ 1563 public static void clearConfiguration(Configuration inoutConfig) { 1564 inoutConfig.fontScale = 0; 1565 } 1566 1567 /** 1568 * Convenience function to write a batch of configuration-related 1569 * settings from a {@link Configuration} object. 1570 * 1571 * @param cr The ContentResolver to access. 1572 * @param config The settings to write. 1573 * @return true if the values were set, false on database errors 1574 */ 1575 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 1576 return putConfigurationForUser(cr, config, UserHandle.myUserId()); 1577 } 1578 1579 /** @hide */ 1580 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 1581 int userHandle) { 1582 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle); 1583 } 1584 1585 /** @hide */ 1586 public static boolean hasInterestingConfigurationChanges(int changes) { 1587 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0; 1588 } 1589 1590 /** @deprecated - Do not use */ 1591 @Deprecated 1592 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 1593 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId()); 1594 } 1595 1596 /** 1597 * @hide 1598 * @deprecated - Do not use 1599 */ 1600 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 1601 int userHandle) { 1602 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 1603 } 1604 1605 /** @deprecated - Do not use */ 1606 @Deprecated 1607 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 1608 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId()); 1609 } 1610 1611 /** 1612 * @hide 1613 * @deprecated - Do not use 1614 */ 1615 @Deprecated 1616 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 1617 int userHandle) { 1618 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 1619 } 1620 1621 /** 1622 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 1623 */ 1624 @Deprecated 1625 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 1626 1627 /** 1628 * What happens when the user presses the end call button if they're not 1629 * on a call.<br/> 1630 * <b>Values:</b><br/> 1631 * 0 - The end button does nothing.<br/> 1632 * 1 - The end button goes to the home screen.<br/> 1633 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 1634 * 3 - The end button goes to the home screen. If the user is already on the 1635 * home screen, it puts the device to sleep. 1636 */ 1637 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 1638 1639 /** 1640 * END_BUTTON_BEHAVIOR value for "go home". 1641 * @hide 1642 */ 1643 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 1644 1645 /** 1646 * END_BUTTON_BEHAVIOR value for "go to sleep". 1647 * @hide 1648 */ 1649 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 1650 1651 /** 1652 * END_BUTTON_BEHAVIOR default value. 1653 * @hide 1654 */ 1655 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 1656 1657 /** 1658 * Is advanced settings mode turned on. 0 == no, 1 == yes 1659 * @hide 1660 */ 1661 public static final String ADVANCED_SETTINGS = "advanced_settings"; 1662 1663 /** 1664 * ADVANCED_SETTINGS default value. 1665 * @hide 1666 */ 1667 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 1668 1669 /** 1670 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 1671 */ 1672 @Deprecated 1673 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 1674 1675 /** 1676 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 1677 */ 1678 @Deprecated 1679 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 1680 1681 /** 1682 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 1683 */ 1684 @Deprecated 1685 public static final String RADIO_WIFI = Global.RADIO_WIFI; 1686 1687 /** 1688 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 1689 * {@hide} 1690 */ 1691 @Deprecated 1692 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 1693 1694 /** 1695 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 1696 */ 1697 @Deprecated 1698 public static final String RADIO_CELL = Global.RADIO_CELL; 1699 1700 /** 1701 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 1702 */ 1703 @Deprecated 1704 public static final String RADIO_NFC = Global.RADIO_NFC; 1705 1706 /** 1707 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 1708 */ 1709 @Deprecated 1710 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 1711 1712 /** 1713 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 1714 * 1715 * {@hide} 1716 */ 1717 @Deprecated 1718 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 1719 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 1720 1721 /** 1722 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 1723 */ 1724 @Deprecated 1725 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 1726 1727 /** 1728 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 1729 */ 1730 @Deprecated 1731 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 1732 1733 /** 1734 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 1735 */ 1736 @Deprecated 1737 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1738 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 1739 1740 /** 1741 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 1742 */ 1743 @Deprecated 1744 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 1745 1746 /** 1747 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 1748 */ 1749 @Deprecated 1750 public static final String MODE_RINGER = Global.MODE_RINGER; 1751 1752 /** 1753 * Whether to use static IP and other static network attributes. 1754 * <p> 1755 * Set to 1 for true and 0 for false. 1756 * 1757 * @deprecated Use {@link WifiManager} instead 1758 */ 1759 @Deprecated 1760 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 1761 1762 /** 1763 * The static IP address. 1764 * <p> 1765 * Example: "192.168.1.51" 1766 * 1767 * @deprecated Use {@link WifiManager} instead 1768 */ 1769 @Deprecated 1770 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 1771 1772 /** 1773 * If using static IP, the gateway's IP address. 1774 * <p> 1775 * Example: "192.168.1.1" 1776 * 1777 * @deprecated Use {@link WifiManager} instead 1778 */ 1779 @Deprecated 1780 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 1781 1782 /** 1783 * If using static IP, the net mask. 1784 * <p> 1785 * Example: "255.255.255.0" 1786 * 1787 * @deprecated Use {@link WifiManager} instead 1788 */ 1789 @Deprecated 1790 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 1791 1792 /** 1793 * If using static IP, the primary DNS's IP address. 1794 * <p> 1795 * Example: "192.168.1.1" 1796 * 1797 * @deprecated Use {@link WifiManager} instead 1798 */ 1799 @Deprecated 1800 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 1801 1802 /** 1803 * If using static IP, the secondary DNS's IP address. 1804 * <p> 1805 * Example: "192.168.1.2" 1806 * 1807 * @deprecated Use {@link WifiManager} instead 1808 */ 1809 @Deprecated 1810 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 1811 1812 1813 /** 1814 * Determines whether remote devices may discover and/or connect to 1815 * this device. 1816 * <P>Type: INT</P> 1817 * 2 -- discoverable and connectable 1818 * 1 -- connectable but not discoverable 1819 * 0 -- neither connectable nor discoverable 1820 */ 1821 public static final String BLUETOOTH_DISCOVERABILITY = 1822 "bluetooth_discoverability"; 1823 1824 /** 1825 * Bluetooth discoverability timeout. If this value is nonzero, then 1826 * Bluetooth becomes discoverable for a certain number of seconds, 1827 * after which is becomes simply connectable. The value is in seconds. 1828 */ 1829 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 1830 "bluetooth_discoverability_timeout"; 1831 1832 /** 1833 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 1834 * instead 1835 */ 1836 @Deprecated 1837 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 1838 1839 /** 1840 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 1841 * instead 1842 */ 1843 @Deprecated 1844 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 1845 1846 /** 1847 * @deprecated Use 1848 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 1849 * instead 1850 */ 1851 @Deprecated 1852 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 1853 "lock_pattern_tactile_feedback_enabled"; 1854 1855 1856 /** 1857 * A formatted string of the next alarm that is set, or the empty string 1858 * if there is no alarm set. 1859 * 1860 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 1861 */ 1862 @Deprecated 1863 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 1864 1865 /** 1866 * Scaling factor for fonts, float. 1867 */ 1868 public static final String FONT_SCALE = "font_scale"; 1869 1870 /** 1871 * Name of an application package to be debugged. 1872 * 1873 * @deprecated Use {@link Global#DEBUG_APP} instead 1874 */ 1875 @Deprecated 1876 public static final String DEBUG_APP = Global.DEBUG_APP; 1877 1878 /** 1879 * If 1, when launching DEBUG_APP it will wait for the debugger before 1880 * starting user code. If 0, it will run normally. 1881 * 1882 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 1883 */ 1884 @Deprecated 1885 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 1886 1887 /** 1888 * Whether or not to dim the screen. 0=no 1=yes 1889 * @deprecated This setting is no longer used. 1890 */ 1891 @Deprecated 1892 public static final String DIM_SCREEN = "dim_screen"; 1893 1894 /** 1895 * The timeout before the screen turns off. 1896 */ 1897 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 1898 1899 /** 1900 * The screen backlight brightness between 0 and 255. 1901 */ 1902 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 1903 1904 /** 1905 * Control whether to enable automatic brightness mode. 1906 */ 1907 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 1908 1909 /** 1910 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 1911 * or less (<0.0 >-1.0) bright. 1912 * @hide 1913 */ 1914 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 1915 1916 /** 1917 * SCREEN_BRIGHTNESS_MODE value for manual mode. 1918 */ 1919 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 1920 1921 /** 1922 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 1923 */ 1924 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 1925 1926 /** 1927 * Control whether the process CPU usage meter should be shown. 1928 * 1929 * @deprecated Use {@link Global#SHOW_PROCESSES} instead 1930 */ 1931 @Deprecated 1932 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 1933 1934 /** 1935 * If 1, the activity manager will aggressively finish activities and 1936 * processes as soon as they are no longer needed. If 0, the normal 1937 * extended lifetime is used. 1938 * 1939 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 1940 */ 1941 @Deprecated 1942 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 1943 1944 /** 1945 * Determines which streams are affected by ringer mode changes. The 1946 * stream type's bit should be set to 1 if it should be muted when going 1947 * into an inaudible ringer mode. 1948 */ 1949 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 1950 1951 /** 1952 * Determines which streams are affected by mute. The 1953 * stream type's bit should be set to 1 if it should be muted when a mute request 1954 * is received. 1955 */ 1956 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 1957 1958 /** 1959 * Whether vibrate is on for different events. This is used internally, 1960 * changing this value will not change the vibrate. See AudioManager. 1961 */ 1962 public static final String VIBRATE_ON = "vibrate_on"; 1963 1964 /** 1965 * If 1, redirects the system vibrator to all currently attached input devices 1966 * that support vibration. If there are no such input devices, then the system 1967 * vibrator is used instead. 1968 * If 0, does not register the system vibrator. 1969 * 1970 * This setting is mainly intended to provide a compatibility mechanism for 1971 * applications that only know about the system vibrator and do not use the 1972 * input device vibrator API. 1973 * 1974 * @hide 1975 */ 1976 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 1977 1978 /** 1979 * Ringer volume. This is used internally, changing this value will not 1980 * change the volume. See AudioManager. 1981 */ 1982 public static final String VOLUME_RING = "volume_ring"; 1983 1984 /** 1985 * System/notifications volume. This is used internally, changing this 1986 * value will not change the volume. See AudioManager. 1987 */ 1988 public static final String VOLUME_SYSTEM = "volume_system"; 1989 1990 /** 1991 * Voice call volume. This is used internally, changing this value will 1992 * not change the volume. See AudioManager. 1993 */ 1994 public static final String VOLUME_VOICE = "volume_voice"; 1995 1996 /** 1997 * Music/media/gaming volume. This is used internally, changing this 1998 * value will not change the volume. See AudioManager. 1999 */ 2000 public static final String VOLUME_MUSIC = "volume_music"; 2001 2002 /** 2003 * Alarm volume. This is used internally, changing this 2004 * value will not change the volume. See AudioManager. 2005 */ 2006 public static final String VOLUME_ALARM = "volume_alarm"; 2007 2008 /** 2009 * Notification volume. This is used internally, changing this 2010 * value will not change the volume. See AudioManager. 2011 */ 2012 public static final String VOLUME_NOTIFICATION = "volume_notification"; 2013 2014 /** 2015 * Bluetooth Headset volume. This is used internally, changing this value will 2016 * not change the volume. See AudioManager. 2017 */ 2018 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 2019 2020 /** 2021 * Master volume (float in the range 0.0f to 1.0f). 2022 * @hide 2023 */ 2024 public static final String VOLUME_MASTER = "volume_master"; 2025 2026 /** 2027 * Master volume mute (int 1 = mute, 0 = not muted). 2028 * 2029 * @hide 2030 */ 2031 public static final String VOLUME_MASTER_MUTE = "volume_master_mute"; 2032 2033 /** 2034 * Whether the notifications should use the ring volume (value of 1) or 2035 * a separate notification volume (value of 0). In most cases, users 2036 * will have this enabled so the notification and ringer volumes will be 2037 * the same. However, power users can disable this and use the separate 2038 * notification volume control. 2039 * <p> 2040 * Note: This is a one-off setting that will be removed in the future 2041 * when there is profile support. For this reason, it is kept hidden 2042 * from the public APIs. 2043 * 2044 * @hide 2045 * @deprecated 2046 */ 2047 @Deprecated 2048 public static final String NOTIFICATIONS_USE_RING_VOLUME = 2049 "notifications_use_ring_volume"; 2050 2051 /** 2052 * Whether silent mode should allow vibration feedback. This is used 2053 * internally in AudioService and the Sound settings activity to 2054 * coordinate decoupling of vibrate and silent modes. This setting 2055 * will likely be removed in a future release with support for 2056 * audio/vibe feedback profiles. 2057 * 2058 * Not used anymore. On devices with vibrator, the user explicitly selects 2059 * silent or vibrate mode. 2060 * Kept for use by legacy database upgrade code in DatabaseHelper. 2061 * @hide 2062 */ 2063 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 2064 2065 /** 2066 * The mapping of stream type (integer) to its setting. 2067 */ 2068 public static final String[] VOLUME_SETTINGS = { 2069 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 2070 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 2071 }; 2072 2073 /** 2074 * Appended to various volume related settings to record the previous 2075 * values before they the settings were affected by a silent/vibrate 2076 * ringer mode change. 2077 */ 2078 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 2079 2080 /** 2081 * Persistent store for the system-wide default ringtone URI. 2082 * <p> 2083 * If you need to play the default ringtone at any given time, it is recommended 2084 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 2085 * to the set default ringtone at the time of playing. 2086 * 2087 * @see #DEFAULT_RINGTONE_URI 2088 */ 2089 public static final String RINGTONE = "ringtone"; 2090 2091 /** 2092 * A {@link Uri} that will point to the current default ringtone at any 2093 * given time. 2094 * <p> 2095 * If the current default ringtone is in the DRM provider and the caller 2096 * does not have permission, the exception will be a 2097 * FileNotFoundException. 2098 */ 2099 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 2100 2101 /** 2102 * Persistent store for the system-wide default notification sound. 2103 * 2104 * @see #RINGTONE 2105 * @see #DEFAULT_NOTIFICATION_URI 2106 */ 2107 public static final String NOTIFICATION_SOUND = "notification_sound"; 2108 2109 /** 2110 * A {@link Uri} that will point to the current default notification 2111 * sound at any given time. 2112 * 2113 * @see #DEFAULT_RINGTONE_URI 2114 */ 2115 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 2116 2117 /** 2118 * Persistent store for the system-wide default alarm alert. 2119 * 2120 * @see #RINGTONE 2121 * @see #DEFAULT_ALARM_ALERT_URI 2122 */ 2123 public static final String ALARM_ALERT = "alarm_alert"; 2124 2125 /** 2126 * A {@link Uri} that will point to the current default alarm alert at 2127 * any given time. 2128 * 2129 * @see #DEFAULT_ALARM_ALERT_URI 2130 */ 2131 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 2132 2133 /** 2134 * Persistent store for the system default media button event receiver. 2135 * 2136 * @hide 2137 */ 2138 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 2139 2140 /** 2141 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 2142 */ 2143 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 2144 2145 /** 2146 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 2147 */ 2148 public static final String TEXT_AUTO_CAPS = "auto_caps"; 2149 2150 /** 2151 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 2152 * feature converts two spaces to a "." and space. 2153 */ 2154 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 2155 2156 /** 2157 * Setting to showing password characters in text editors. 1 = On, 0 = Off 2158 */ 2159 public static final String TEXT_SHOW_PASSWORD = "show_password"; 2160 2161 public static final String SHOW_GTALK_SERVICE_STATUS = 2162 "SHOW_GTALK_SERVICE_STATUS"; 2163 2164 /** 2165 * Name of activity to use for wallpaper on the home screen. 2166 * 2167 * @deprecated Use {@link WallpaperManager} instead. 2168 */ 2169 @Deprecated 2170 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 2171 2172 /** 2173 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 2174 * instead 2175 */ 2176 @Deprecated 2177 public static final String AUTO_TIME = Global.AUTO_TIME; 2178 2179 /** 2180 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 2181 * instead 2182 */ 2183 @Deprecated 2184 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 2185 2186 /** 2187 * Display times as 12 or 24 hours 2188 * 12 2189 * 24 2190 */ 2191 public static final String TIME_12_24 = "time_12_24"; 2192 2193 /** 2194 * Date format string 2195 * mm/dd/yyyy 2196 * dd/mm/yyyy 2197 * yyyy/mm/dd 2198 */ 2199 public static final String DATE_FORMAT = "date_format"; 2200 2201 /** 2202 * Whether the setup wizard has been run before (on first boot), or if 2203 * it still needs to be run. 2204 * 2205 * nonzero = it has been run in the past 2206 * 0 = it has not been run in the past 2207 */ 2208 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 2209 2210 /** 2211 * Scaling factor for normal window animations. Setting to 0 will disable window 2212 * animations. 2213 * 2214 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 2215 */ 2216 @Deprecated 2217 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 2218 2219 /** 2220 * Scaling factor for activity transition animations. Setting to 0 will disable window 2221 * animations. 2222 * 2223 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 2224 */ 2225 @Deprecated 2226 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 2227 2228 /** 2229 * Scaling factor for Animator-based animations. This affects both the start delay and 2230 * duration of all such animations. Setting to 0 will cause animations to end immediately. 2231 * The default value is 1. 2232 * 2233 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 2234 */ 2235 @Deprecated 2236 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 2237 2238 /** 2239 * Control whether the accelerometer will be used to change screen 2240 * orientation. If 0, it will not be used unless explicitly requested 2241 * by the application; if 1, it will be used by default unless explicitly 2242 * disabled by the application. 2243 */ 2244 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 2245 2246 /** 2247 * Default screen rotation when no other policy applies. 2248 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 2249 * preference, this rotation value will be used. Must be one of the 2250 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 2251 * 2252 * @see Display#getRotation 2253 */ 2254 public static final String USER_ROTATION = "user_rotation"; 2255 2256 /** 2257 * Control whether the rotation lock toggle in the System UI should be hidden. 2258 * Typically this is done for accessibility purposes to make it harder for 2259 * the user to accidentally toggle the rotation lock while the display rotation 2260 * has been locked for accessibility. 2261 * 2262 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 2263 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 2264 * 2265 * @hide 2266 */ 2267 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 2268 "hide_rotation_lock_toggle_for_accessibility"; 2269 2270 /** 2271 * Whether the phone vibrates when it is ringing due to an incoming call. This will 2272 * be used by Phone and Setting apps; it shouldn't affect other apps. 2273 * The value is boolean (1 or 0). 2274 * 2275 * Note: this is not same as "vibrate on ring", which had been available until ICS. 2276 * It was about AudioManager's setting and thus affected all the applications which 2277 * relied on the setting, while this is purely about the vibration setting for incoming 2278 * calls. 2279 * 2280 * @hide 2281 */ 2282 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 2283 2284 /** 2285 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 2286 * boolean (1 or 0). 2287 */ 2288 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 2289 2290 /** 2291 * CDMA only settings 2292 * DTMF tone type played by the dialer when dialing. 2293 * 0 = Normal 2294 * 1 = Long 2295 * @hide 2296 */ 2297 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 2298 2299 /** 2300 * Whether the hearing aid is enabled. The value is 2301 * boolean (1 or 0). 2302 * @hide 2303 */ 2304 public static final String HEARING_AID = "hearing_aid"; 2305 2306 /** 2307 * CDMA only settings 2308 * TTY Mode 2309 * 0 = OFF 2310 * 1 = FULL 2311 * 2 = VCO 2312 * 3 = HCO 2313 * @hide 2314 */ 2315 public static final String TTY_MODE = "tty_mode"; 2316 2317 /** 2318 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 2319 * boolean (1 or 0). 2320 */ 2321 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 2322 2323 /** 2324 * Whether the haptic feedback (long presses, ...) are enabled. The value is 2325 * boolean (1 or 0). 2326 */ 2327 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 2328 2329 /** 2330 * @deprecated Each application that shows web suggestions should have its own 2331 * setting for this. 2332 */ 2333 @Deprecated 2334 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 2335 2336 /** 2337 * Whether the notification LED should repeatedly flash when a notification is 2338 * pending. The value is boolean (1 or 0). 2339 * @hide 2340 */ 2341 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 2342 2343 /** 2344 * Show pointer location on screen? 2345 * 0 = no 2346 * 1 = yes 2347 * @hide 2348 */ 2349 public static final String POINTER_LOCATION = "pointer_location"; 2350 2351 /** 2352 * Show touch positions on screen? 2353 * 0 = no 2354 * 1 = yes 2355 * @hide 2356 */ 2357 public static final String SHOW_TOUCHES = "show_touches"; 2358 2359 /** 2360 * Log raw orientation data from {@link WindowOrientationListener} for use with the 2361 * orientationplot.py tool. 2362 * 0 = no 2363 * 1 = yes 2364 * @hide 2365 */ 2366 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 2367 "window_orientation_listener_log"; 2368 2369 /** 2370 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 2371 * instead 2372 * @hide 2373 */ 2374 @Deprecated 2375 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 2376 2377 /** 2378 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 2379 * instead 2380 * @hide 2381 */ 2382 @Deprecated 2383 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 2384 2385 /** 2386 * Whether to play sounds when the keyguard is shown and dismissed. 2387 * @hide 2388 */ 2389 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 2390 2391 /** 2392 * Whether the lockscreen should be completely disabled. 2393 * @hide 2394 */ 2395 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 2396 2397 /** 2398 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 2399 * instead 2400 * @hide 2401 */ 2402 @Deprecated 2403 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 2404 2405 /** 2406 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 2407 * instead 2408 * @hide 2409 */ 2410 @Deprecated 2411 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 2412 2413 /** 2414 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 2415 * instead 2416 * @hide 2417 */ 2418 @Deprecated 2419 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 2420 2421 /** 2422 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 2423 * instead 2424 * @hide 2425 */ 2426 @Deprecated 2427 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 2428 2429 /** 2430 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 2431 * instead 2432 * @hide 2433 */ 2434 @Deprecated 2435 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 2436 2437 /** 2438 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 2439 * instead 2440 * @hide 2441 */ 2442 @Deprecated 2443 public static final String LOCK_SOUND = Global.LOCK_SOUND; 2444 2445 /** 2446 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 2447 * instead 2448 * @hide 2449 */ 2450 @Deprecated 2451 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 2452 2453 /** 2454 * Receive incoming SIP calls? 2455 * 0 = no 2456 * 1 = yes 2457 * @hide 2458 */ 2459 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 2460 2461 /** 2462 * Call Preference String. 2463 * "SIP_ALWAYS" : Always use SIP with network access 2464 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 2465 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time 2466 * @hide 2467 */ 2468 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 2469 2470 /** 2471 * One of the sip call options: Always use SIP with network access. 2472 * @hide 2473 */ 2474 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 2475 2476 /** 2477 * One of the sip call options: Only if destination is a SIP address. 2478 * @hide 2479 */ 2480 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 2481 2482 /** 2483 * One of the sip call options: Always ask me each time. 2484 * @hide 2485 */ 2486 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 2487 2488 /** 2489 * Pointer speed setting. 2490 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 2491 * -7 = slowest 2492 * 0 = default speed 2493 * +7 = fastest 2494 * @hide 2495 */ 2496 public static final String POINTER_SPEED = "pointer_speed"; 2497 2498 /** 2499 * Whether lock-to-app will lock the keyguard when exiting. 2500 * @hide 2501 */ 2502 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 2503 2504 /** 2505 * I am the lolrus. 2506 * <p> 2507 * Nonzero values indicate that the user has a bukkit. 2508 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 2509 * @hide 2510 */ 2511 public static final String EGG_MODE = "egg_mode"; 2512 2513 /** 2514 * Settings to backup. This is here so that it's in the same place as the settings 2515 * keys and easy to update. 2516 * 2517 * NOTE: Settings are backed up and restored in the order they appear 2518 * in this array. If you have one setting depending on another, 2519 * make sure that they are ordered appropriately. 2520 * 2521 * @hide 2522 */ 2523 public static final String[] SETTINGS_TO_BACKUP = { 2524 STAY_ON_WHILE_PLUGGED_IN, // moved to global 2525 WIFI_USE_STATIC_IP, 2526 WIFI_STATIC_IP, 2527 WIFI_STATIC_GATEWAY, 2528 WIFI_STATIC_NETMASK, 2529 WIFI_STATIC_DNS1, 2530 WIFI_STATIC_DNS2, 2531 BLUETOOTH_DISCOVERABILITY, 2532 BLUETOOTH_DISCOVERABILITY_TIMEOUT, 2533 DIM_SCREEN, 2534 SCREEN_OFF_TIMEOUT, 2535 SCREEN_BRIGHTNESS, 2536 SCREEN_BRIGHTNESS_MODE, 2537 SCREEN_AUTO_BRIGHTNESS_ADJ, 2538 VIBRATE_INPUT_DEVICES, 2539 MODE_RINGER_STREAMS_AFFECTED, 2540 VOLUME_VOICE, 2541 VOLUME_SYSTEM, 2542 VOLUME_RING, 2543 VOLUME_MUSIC, 2544 VOLUME_ALARM, 2545 VOLUME_NOTIFICATION, 2546 VOLUME_BLUETOOTH_SCO, 2547 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE, 2548 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE, 2549 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE, 2550 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE, 2551 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE, 2552 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE, 2553 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE, 2554 TEXT_AUTO_REPLACE, 2555 TEXT_AUTO_CAPS, 2556 TEXT_AUTO_PUNCTUATE, 2557 TEXT_SHOW_PASSWORD, 2558 AUTO_TIME, // moved to global 2559 AUTO_TIME_ZONE, // moved to global 2560 TIME_12_24, 2561 DATE_FORMAT, 2562 DTMF_TONE_WHEN_DIALING, 2563 DTMF_TONE_TYPE_WHEN_DIALING, 2564 HEARING_AID, 2565 TTY_MODE, 2566 SOUND_EFFECTS_ENABLED, 2567 HAPTIC_FEEDBACK_ENABLED, 2568 POWER_SOUNDS_ENABLED, // moved to global 2569 DOCK_SOUNDS_ENABLED, // moved to global 2570 LOCKSCREEN_SOUNDS_ENABLED, 2571 SHOW_WEB_SUGGESTIONS, 2572 NOTIFICATION_LIGHT_PULSE, 2573 SIP_CALL_OPTIONS, 2574 SIP_RECEIVE_CALLS, 2575 POINTER_SPEED, 2576 VIBRATE_WHEN_RINGING, 2577 RINGTONE, 2578 NOTIFICATION_SOUND 2579 }; 2580 2581 /** 2582 * When to use Wi-Fi calling 2583 * 2584 * @see android.telephony.TelephonyManager.WifiCallingChoices 2585 * @hide 2586 */ 2587 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 2588 2589 // Settings moved to Settings.Secure 2590 2591 /** 2592 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 2593 * instead 2594 */ 2595 @Deprecated 2596 public static final String ADB_ENABLED = Global.ADB_ENABLED; 2597 2598 /** 2599 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 2600 */ 2601 @Deprecated 2602 public static final String ANDROID_ID = Secure.ANDROID_ID; 2603 2604 /** 2605 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 2606 */ 2607 @Deprecated 2608 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 2609 2610 /** 2611 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 2612 */ 2613 @Deprecated 2614 public static final String DATA_ROAMING = Global.DATA_ROAMING; 2615 2616 /** 2617 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 2618 */ 2619 @Deprecated 2620 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 2621 2622 /** 2623 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 2624 */ 2625 @Deprecated 2626 public static final String HTTP_PROXY = Global.HTTP_PROXY; 2627 2628 /** 2629 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 2630 */ 2631 @Deprecated 2632 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 2633 2634 /** 2635 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 2636 * instead 2637 */ 2638 @Deprecated 2639 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 2640 2641 /** 2642 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 2643 */ 2644 @Deprecated 2645 public static final String LOGGING_ID = Secure.LOGGING_ID; 2646 2647 /** 2648 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 2649 */ 2650 @Deprecated 2651 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 2652 2653 /** 2654 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 2655 * instead 2656 */ 2657 @Deprecated 2658 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 2659 2660 /** 2661 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 2662 * instead 2663 */ 2664 @Deprecated 2665 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 2666 2667 /** 2668 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 2669 * instead 2670 */ 2671 @Deprecated 2672 public static final String PARENTAL_CONTROL_REDIRECT_URL = 2673 Secure.PARENTAL_CONTROL_REDIRECT_URL; 2674 2675 /** 2676 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 2677 */ 2678 @Deprecated 2679 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 2680 2681 /** 2682 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 2683 */ 2684 @Deprecated 2685 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 2686 2687 /** 2688 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 2689 */ 2690 @Deprecated 2691 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 2692 2693 /** 2694 * @deprecated Use 2695 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 2696 */ 2697 @Deprecated 2698 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 2699 2700 /** 2701 * @deprecated Use 2702 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 2703 */ 2704 @Deprecated 2705 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 2706 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 2707 2708 /** 2709 * @deprecated Use 2710 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 2711 */ 2712 @Deprecated 2713 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 2714 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 2715 2716 /** 2717 * @deprecated Use 2718 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 2719 */ 2720 @Deprecated 2721 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 2722 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 2723 2724 /** 2725 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 2726 * instead 2727 */ 2728 @Deprecated 2729 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 2730 2731 /** 2732 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 2733 */ 2734 @Deprecated 2735 public static final String WIFI_ON = Global.WIFI_ON; 2736 2737 /** 2738 * @deprecated Use 2739 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 2740 * instead 2741 */ 2742 @Deprecated 2743 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 2744 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 2745 2746 /** 2747 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 2748 */ 2749 @Deprecated 2750 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 2751 2752 /** 2753 * @deprecated Use 2754 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 2755 */ 2756 @Deprecated 2757 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 2758 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 2759 2760 /** 2761 * @deprecated Use 2762 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 2763 */ 2764 @Deprecated 2765 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 2766 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 2767 2768 /** 2769 * @deprecated Use 2770 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 2771 * instead 2772 */ 2773 @Deprecated 2774 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 2775 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 2776 2777 /** 2778 * @deprecated Use 2779 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 2780 */ 2781 @Deprecated 2782 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 2783 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 2784 2785 /** 2786 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 2787 * instead 2788 */ 2789 @Deprecated 2790 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 2791 2792 /** 2793 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 2794 */ 2795 @Deprecated 2796 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 2797 2798 /** 2799 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 2800 */ 2801 @Deprecated 2802 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 2803 2804 /** 2805 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 2806 * instead 2807 */ 2808 @Deprecated 2809 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 2810 2811 /** 2812 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 2813 * instead 2814 */ 2815 @Deprecated 2816 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 2817 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 2818 } 2819 2820 /** 2821 * Secure system settings, containing system preferences that applications 2822 * can read but are not allowed to write. These are for preferences that 2823 * the user must explicitly modify through the system UI or specialized 2824 * APIs for those values, not modified directly by applications. 2825 */ 2826 public static final class Secure extends NameValueTable { 2827 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; 2828 2829 /** 2830 * The content:// style URL for this table 2831 */ 2832 public static final Uri CONTENT_URI = 2833 Uri.parse("content://" + AUTHORITY + "/secure"); 2834 2835 // Populated lazily, guarded by class object: 2836 private static final NameValueCache sNameValueCache = new NameValueCache( 2837 SYS_PROP_SETTING_VERSION, 2838 CONTENT_URI, 2839 CALL_METHOD_GET_SECURE, 2840 CALL_METHOD_PUT_SECURE); 2841 2842 private static ILockSettings sLockSettings = null; 2843 2844 private static boolean sIsSystemProcess; 2845 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 2846 private static final HashSet<String> MOVED_TO_GLOBAL; 2847 static { 2848 MOVED_TO_LOCK_SETTINGS = new HashSet<String>(3); 2849 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 2850 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 2851 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 2852 2853 MOVED_TO_GLOBAL = new HashSet<String>(); 2854 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 2855 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 2856 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 2857 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 2858 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 2859 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 2860 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 2861 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 2862 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 2863 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 2864 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 2865 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 2866 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_DENSITY_FORCED); 2867 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 2868 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 2869 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 2870 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 2871 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 2872 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 2873 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 2874 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 2875 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 2876 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 2877 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 2878 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_REPORT_XT_OVER_DEV); 2879 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 2880 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 2881 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 2882 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 2883 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 2884 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 2885 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 2886 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 2887 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 2888 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 2889 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 2890 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 2891 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 2892 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 2893 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 2894 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 2895 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 2896 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 2897 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 2898 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 2899 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS); 2900 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 2901 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 2902 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 2903 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 2904 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 2905 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 2906 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 2907 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 2908 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 2909 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 2910 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 2911 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 2912 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 2913 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 2914 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 2915 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 2916 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 2917 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 2918 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 2919 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); 2920 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 2921 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); 2922 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 2923 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 2924 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 2925 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 2926 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 2927 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); 2928 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 2929 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 2930 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 2931 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 2932 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 2933 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 2934 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 2935 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 2936 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 2937 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 2938 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 2939 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 2940 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 2941 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 2942 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 2943 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 2944 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 2945 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 2946 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 2947 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 2948 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 2949 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 2950 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 2951 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 2952 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 2953 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 2954 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 2955 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 2956 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 2957 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 2958 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 2959 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 2960 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 2961 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 2962 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 2963 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 2964 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 2965 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 2966 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 2967 } 2968 2969 /** @hide */ 2970 public static void getMovedKeys(HashSet<String> outKeySet) { 2971 outKeySet.addAll(MOVED_TO_GLOBAL); 2972 } 2973 2974 /** 2975 * Look up a name in the database. 2976 * @param resolver to access the database with 2977 * @param name to look up in the table 2978 * @return the corresponding value, or null if not present 2979 */ 2980 public static String getString(ContentResolver resolver, String name) { 2981 return getStringForUser(resolver, name, UserHandle.myUserId()); 2982 } 2983 2984 /** @hide */ 2985 public static String getStringForUser(ContentResolver resolver, String name, 2986 int userHandle) { 2987 if (MOVED_TO_GLOBAL.contains(name)) { 2988 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 2989 + " to android.provider.Settings.Global."); 2990 return Global.getStringForUser(resolver, name, userHandle); 2991 } 2992 2993 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 2994 synchronized (Secure.class) { 2995 if (sLockSettings == null) { 2996 sLockSettings = ILockSettings.Stub.asInterface( 2997 (IBinder) ServiceManager.getService("lock_settings")); 2998 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 2999 } 3000 } 3001 if (sLockSettings != null && !sIsSystemProcess) { 3002 try { 3003 return sLockSettings.getString(name, "0", userHandle); 3004 } catch (RemoteException re) { 3005 // Fall through 3006 } 3007 } 3008 } 3009 3010 return sNameValueCache.getStringForUser(resolver, name, userHandle); 3011 } 3012 3013 /** 3014 * Store a name/value pair into the database. 3015 * @param resolver to access the database with 3016 * @param name to store 3017 * @param value to associate with the name 3018 * @return true if the value was set, false on database errors 3019 */ 3020 public static boolean putString(ContentResolver resolver, String name, String value) { 3021 return putStringForUser(resolver, name, value, UserHandle.myUserId()); 3022 } 3023 3024 /** @hide */ 3025 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 3026 int userHandle) { 3027 if (MOVED_TO_GLOBAL.contains(name)) { 3028 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3029 + " to android.provider.Settings.Global"); 3030 return Global.putStringForUser(resolver, name, value, userHandle); 3031 } 3032 return sNameValueCache.putStringForUser(resolver, name, value, userHandle); 3033 } 3034 3035 /** 3036 * Construct the content URI for a particular name/value pair, 3037 * useful for monitoring changes with a ContentObserver. 3038 * @param name to look up in the table 3039 * @return the corresponding content URI, or null if not present 3040 */ 3041 public static Uri getUriFor(String name) { 3042 if (MOVED_TO_GLOBAL.contains(name)) { 3043 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 3044 + " to android.provider.Settings.Global, returning global URI."); 3045 return Global.getUriFor(Global.CONTENT_URI, name); 3046 } 3047 return getUriFor(CONTENT_URI, name); 3048 } 3049 3050 /** 3051 * Convenience function for retrieving a single secure settings value 3052 * as an integer. Note that internally setting values are always 3053 * stored as strings; this function converts the string to an integer 3054 * for you. The default value will be returned if the setting is 3055 * not defined or not an integer. 3056 * 3057 * @param cr The ContentResolver to access. 3058 * @param name The name of the setting to retrieve. 3059 * @param def Value to return if the setting is not defined. 3060 * 3061 * @return The setting's current value, or 'def' if it is not defined 3062 * or not a valid integer. 3063 */ 3064 public static int getInt(ContentResolver cr, String name, int def) { 3065 return getIntForUser(cr, name, def, UserHandle.myUserId()); 3066 } 3067 3068 /** @hide */ 3069 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 3070 if (LOCATION_MODE.equals(name)) { 3071 // HACK ALERT: temporary hack to work around b/10491283. 3072 // TODO: once b/10491283 fixed, remove this hack 3073 return getLocationModeForUser(cr, userHandle); 3074 } 3075 String v = getStringForUser(cr, name, userHandle); 3076 try { 3077 return v != null ? Integer.parseInt(v) : def; 3078 } catch (NumberFormatException e) { 3079 return def; 3080 } 3081 } 3082 3083 /** 3084 * Convenience function for retrieving a single secure settings value 3085 * as an integer. Note that internally setting values are always 3086 * stored as strings; this function converts the string to an integer 3087 * for you. 3088 * <p> 3089 * This version does not take a default value. If the setting has not 3090 * been set, or the string value is not a number, 3091 * it throws {@link SettingNotFoundException}. 3092 * 3093 * @param cr The ContentResolver to access. 3094 * @param name The name of the setting to retrieve. 3095 * 3096 * @throws SettingNotFoundException Thrown if a setting by the given 3097 * name can't be found or the setting value is not an integer. 3098 * 3099 * @return The setting's current value. 3100 */ 3101 public static int getInt(ContentResolver cr, String name) 3102 throws SettingNotFoundException { 3103 return getIntForUser(cr, name, UserHandle.myUserId()); 3104 } 3105 3106 /** @hide */ 3107 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 3108 throws SettingNotFoundException { 3109 if (LOCATION_MODE.equals(name)) { 3110 // HACK ALERT: temporary hack to work around b/10491283. 3111 // TODO: once b/10491283 fixed, remove this hack 3112 return getLocationModeForUser(cr, userHandle); 3113 } 3114 String v = getStringForUser(cr, name, userHandle); 3115 try { 3116 return Integer.parseInt(v); 3117 } catch (NumberFormatException e) { 3118 throw new SettingNotFoundException(name); 3119 } 3120 } 3121 3122 /** 3123 * Convenience function for updating a single settings value as an 3124 * integer. This will either create a new entry in the table if the 3125 * given name does not exist, or modify the value of the existing row 3126 * with that name. Note that internally setting values are always 3127 * stored as strings, so this function converts the given value to a 3128 * string before storing it. 3129 * 3130 * @param cr The ContentResolver to access. 3131 * @param name The name of the setting to modify. 3132 * @param value The new value for the setting. 3133 * @return true if the value was set, false on database errors 3134 */ 3135 public static boolean putInt(ContentResolver cr, String name, int value) { 3136 return putIntForUser(cr, name, value, UserHandle.myUserId()); 3137 } 3138 3139 /** @hide */ 3140 public static boolean putIntForUser(ContentResolver cr, String name, int value, 3141 int userHandle) { 3142 if (LOCATION_MODE.equals(name)) { 3143 // HACK ALERT: temporary hack to work around b/10491283. 3144 // TODO: once b/10491283 fixed, remove this hack 3145 return setLocationModeForUser(cr, value, userHandle); 3146 } 3147 return putStringForUser(cr, name, Integer.toString(value), userHandle); 3148 } 3149 3150 /** 3151 * Convenience function for retrieving a single secure settings value 3152 * as a {@code long}. Note that internally setting values are always 3153 * stored as strings; this function converts the string to a {@code long} 3154 * for you. The default value will be returned if the setting is 3155 * not defined or not a {@code long}. 3156 * 3157 * @param cr The ContentResolver to access. 3158 * @param name The name of the setting to retrieve. 3159 * @param def Value to return if the setting is not defined. 3160 * 3161 * @return The setting's current value, or 'def' if it is not defined 3162 * or not a valid {@code long}. 3163 */ 3164 public static long getLong(ContentResolver cr, String name, long def) { 3165 return getLongForUser(cr, name, def, UserHandle.myUserId()); 3166 } 3167 3168 /** @hide */ 3169 public static long getLongForUser(ContentResolver cr, String name, long def, 3170 int userHandle) { 3171 String valString = getStringForUser(cr, name, userHandle); 3172 long value; 3173 try { 3174 value = valString != null ? Long.parseLong(valString) : def; 3175 } catch (NumberFormatException e) { 3176 value = def; 3177 } 3178 return value; 3179 } 3180 3181 /** 3182 * Convenience function for retrieving a single secure settings value 3183 * as a {@code long}. Note that internally setting values are always 3184 * stored as strings; this function converts the string to a {@code long} 3185 * for you. 3186 * <p> 3187 * This version does not take a default value. If the setting has not 3188 * been set, or the string value is not a number, 3189 * it throws {@link SettingNotFoundException}. 3190 * 3191 * @param cr The ContentResolver to access. 3192 * @param name The name of the setting to retrieve. 3193 * 3194 * @return The setting's current value. 3195 * @throws SettingNotFoundException Thrown if a setting by the given 3196 * name can't be found or the setting value is not an integer. 3197 */ 3198 public static long getLong(ContentResolver cr, String name) 3199 throws SettingNotFoundException { 3200 return getLongForUser(cr, name, UserHandle.myUserId()); 3201 } 3202 3203 /** @hide */ 3204 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 3205 throws SettingNotFoundException { 3206 String valString = getStringForUser(cr, name, userHandle); 3207 try { 3208 return Long.parseLong(valString); 3209 } catch (NumberFormatException e) { 3210 throw new SettingNotFoundException(name); 3211 } 3212 } 3213 3214 /** 3215 * Convenience function for updating a secure settings value as a long 3216 * integer. This will either create a new entry in the table if the 3217 * given name does not exist, or modify the value of the existing row 3218 * with that name. Note that internally setting values are always 3219 * stored as strings, so this function converts the given value to a 3220 * string before storing it. 3221 * 3222 * @param cr The ContentResolver to access. 3223 * @param name The name of the setting to modify. 3224 * @param value The new value for the setting. 3225 * @return true if the value was set, false on database errors 3226 */ 3227 public static boolean putLong(ContentResolver cr, String name, long value) { 3228 return putLongForUser(cr, name, value, UserHandle.myUserId()); 3229 } 3230 3231 /** @hide */ 3232 public static boolean putLongForUser(ContentResolver cr, String name, long value, 3233 int userHandle) { 3234 return putStringForUser(cr, name, Long.toString(value), userHandle); 3235 } 3236 3237 /** 3238 * Convenience function for retrieving a single secure settings value 3239 * as a floating point number. Note that internally setting values are 3240 * always stored as strings; this function converts the string to an 3241 * float for you. The default value will be returned if the setting 3242 * is not defined or not a valid float. 3243 * 3244 * @param cr The ContentResolver to access. 3245 * @param name The name of the setting to retrieve. 3246 * @param def Value to return if the setting is not defined. 3247 * 3248 * @return The setting's current value, or 'def' if it is not defined 3249 * or not a valid float. 3250 */ 3251 public static float getFloat(ContentResolver cr, String name, float def) { 3252 return getFloatForUser(cr, name, def, UserHandle.myUserId()); 3253 } 3254 3255 /** @hide */ 3256 public static float getFloatForUser(ContentResolver cr, String name, float def, 3257 int userHandle) { 3258 String v = getStringForUser(cr, name, userHandle); 3259 try { 3260 return v != null ? Float.parseFloat(v) : def; 3261 } catch (NumberFormatException e) { 3262 return def; 3263 } 3264 } 3265 3266 /** 3267 * Convenience function for retrieving a single secure settings value 3268 * as a float. Note that internally setting values are always 3269 * stored as strings; this function converts the string to a float 3270 * for you. 3271 * <p> 3272 * This version does not take a default value. If the setting has not 3273 * been set, or the string value is not a number, 3274 * it throws {@link SettingNotFoundException}. 3275 * 3276 * @param cr The ContentResolver to access. 3277 * @param name The name of the setting to retrieve. 3278 * 3279 * @throws SettingNotFoundException Thrown if a setting by the given 3280 * name can't be found or the setting value is not a float. 3281 * 3282 * @return The setting's current value. 3283 */ 3284 public static float getFloat(ContentResolver cr, String name) 3285 throws SettingNotFoundException { 3286 return getFloatForUser(cr, name, UserHandle.myUserId()); 3287 } 3288 3289 /** @hide */ 3290 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 3291 throws SettingNotFoundException { 3292 String v = getStringForUser(cr, name, userHandle); 3293 if (v == null) { 3294 throw new SettingNotFoundException(name); 3295 } 3296 try { 3297 return Float.parseFloat(v); 3298 } catch (NumberFormatException e) { 3299 throw new SettingNotFoundException(name); 3300 } 3301 } 3302 3303 /** 3304 * Convenience function for updating a single settings value as a 3305 * floating point number. This will either create a new entry in the 3306 * table if the given name does not exist, or modify the value of the 3307 * existing row with that name. Note that internally setting values 3308 * are always stored as strings, so this function converts the given 3309 * value to a string before storing it. 3310 * 3311 * @param cr The ContentResolver to access. 3312 * @param name The name of the setting to modify. 3313 * @param value The new value for the setting. 3314 * @return true if the value was set, false on database errors 3315 */ 3316 public static boolean putFloat(ContentResolver cr, String name, float value) { 3317 return putFloatForUser(cr, name, value, UserHandle.myUserId()); 3318 } 3319 3320 /** @hide */ 3321 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 3322 int userHandle) { 3323 return putStringForUser(cr, name, Float.toString(value), userHandle); 3324 } 3325 3326 /** 3327 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 3328 * instead 3329 */ 3330 @Deprecated 3331 public static final String DEVELOPMENT_SETTINGS_ENABLED = 3332 Global.DEVELOPMENT_SETTINGS_ENABLED; 3333 3334 /** 3335 * When the user has enable the option to have a "bug report" command 3336 * in the power menu. 3337 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 3338 * @hide 3339 */ 3340 @Deprecated 3341 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 3342 3343 /** 3344 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 3345 */ 3346 @Deprecated 3347 public static final String ADB_ENABLED = Global.ADB_ENABLED; 3348 3349 /** 3350 * Setting to allow mock locations and location provider status to be injected into the 3351 * LocationManager service for testing purposes during application development. These 3352 * locations and status values override actual location and status information generated 3353 * by network, gps, or other location providers. 3354 */ 3355 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 3356 3357 /** 3358 * A 64-bit number (as a hex string) that is randomly 3359 * generated when the user first sets up the device and should remain 3360 * constant for the lifetime of the user's device. The value may 3361 * change if a factory reset is performed on the device. 3362 * <p class="note"><strong>Note:</strong> When a device has <a 3363 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a> 3364 * (available on certain devices running Android 4.2 or higher), each user appears as a 3365 * completely separate device, so the {@code ANDROID_ID} value is unique to each 3366 * user.</p> 3367 */ 3368 public static final String ANDROID_ID = "android_id"; 3369 3370 /** 3371 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 3372 */ 3373 @Deprecated 3374 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 3375 3376 /** 3377 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 3378 */ 3379 @Deprecated 3380 public static final String DATA_ROAMING = Global.DATA_ROAMING; 3381 3382 /** 3383 * Setting to record the input method used by default, holding the ID 3384 * of the desired method. 3385 */ 3386 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 3387 3388 /** 3389 * Setting to record the input method subtype used by default, holding the ID 3390 * of the desired method. 3391 */ 3392 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 3393 "selected_input_method_subtype"; 3394 3395 /** 3396 * Setting to record the history of input method subtype, holding the pair of ID of IME 3397 * and its last used subtype. 3398 * @hide 3399 */ 3400 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 3401 "input_methods_subtype_history"; 3402 3403 /** 3404 * Setting to record the visibility of input method selector 3405 */ 3406 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 3407 "input_method_selector_visibility"; 3408 3409 /** 3410 * The currently selected voice interaction service flattened ComponentName. 3411 * @hide 3412 */ 3413 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 3414 3415 /** 3416 * bluetooth HCI snoop log configuration 3417 * @hide 3418 */ 3419 public static final String BLUETOOTH_HCI_LOG = 3420 "bluetooth_hci_log"; 3421 3422 /** 3423 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 3424 */ 3425 @Deprecated 3426 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 3427 3428 /** 3429 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 3430 * @hide 3431 */ 3432 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 3433 3434 /** 3435 * List of input methods that are currently enabled. This is a string 3436 * containing the IDs of all enabled input methods, each ID separated 3437 * by ':'. 3438 */ 3439 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 3440 3441 /** 3442 * List of system input methods that are currently disabled. This is a string 3443 * containing the IDs of all disabled input methods, each ID separated 3444 * by ':'. 3445 * @hide 3446 */ 3447 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 3448 3449 /** 3450 * Host name and port for global http proxy. Uses ':' seperator for 3451 * between host and port. 3452 * 3453 * @deprecated Use {@link Global#HTTP_PROXY} 3454 */ 3455 @Deprecated 3456 public static final String HTTP_PROXY = Global.HTTP_PROXY; 3457 3458 /** 3459 * Whether applications can be installed for this user via the system's 3460 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 3461 * 3462 * <p>1 = permit app installation via the system package installer intent 3463 * <p>0 = do not allow use of the package installer 3464 */ 3465 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 3466 3467 /** 3468 * Comma-separated list of location providers that activities may access. Do not rely on 3469 * this value being present in settings.db or on ContentObserver notifications on the 3470 * corresponding Uri. 3471 * 3472 * @deprecated use {@link #LOCATION_MODE} and 3473 * {@link LocationManager#MODE_CHANGED_ACTION} (or 3474 * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) 3475 */ 3476 @Deprecated 3477 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 3478 3479 /** 3480 * The degree of location access enabled by the user. 3481 * <p> 3482 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link 3483 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link 3484 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link 3485 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location 3486 * modes that might be added in the future. 3487 * <p> 3488 * Note: do not rely on this value being present in settings.db or on ContentObserver 3489 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} 3490 * to receive changes in this value. 3491 */ 3492 public static final String LOCATION_MODE = "location_mode"; 3493 3494 /** 3495 * Location access disabled. 3496 */ 3497 public static final int LOCATION_MODE_OFF = 0; 3498 /** 3499 * Network Location Provider disabled, but GPS and other sensors enabled. 3500 */ 3501 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 3502 /** 3503 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests 3504 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to 3505 * {@link android.location.Criteria#POWER_MEDIUM}. 3506 */ 3507 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 3508 /** 3509 * Best-effort location computation allowed. 3510 */ 3511 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 3512 3513 /** 3514 * A flag containing settings used for biometric weak 3515 * @hide 3516 */ 3517 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 3518 "lock_biometric_weak_flags"; 3519 3520 /** 3521 * Whether autolock is enabled (0 = false, 1 = true) 3522 */ 3523 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 3524 3525 /** 3526 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 3527 */ 3528 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 3529 3530 /** 3531 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 3532 * true) 3533 * 3534 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 3535 * lockscreen uses 3536 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 3537 */ 3538 @Deprecated 3539 public static final String 3540 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 3541 3542 /** 3543 * This preference allows the device to be locked given time after screen goes off, 3544 * subject to current DeviceAdmin policy limits. 3545 * @hide 3546 */ 3547 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 3548 3549 3550 /** 3551 * This preference contains the string that shows for owner info on LockScreen. 3552 * @hide 3553 * @deprecated 3554 */ 3555 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 3556 3557 /** 3558 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 3559 * @hide 3560 */ 3561 public static final String LOCK_SCREEN_APPWIDGET_IDS = 3562 "lock_screen_appwidget_ids"; 3563 3564 /** 3565 * List of enrolled fingerprint identifiers (comma-delimited). 3566 * @hide 3567 */ 3568 public static final String USER_FINGERPRINT_IDS = "user_fingerprint_ids"; 3569 3570 /** 3571 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 3572 * @hide 3573 */ 3574 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 3575 "lock_screen_fallback_appwidget_id"; 3576 3577 /** 3578 * Index of the lockscreen appwidget to restore, -1 if none. 3579 * @hide 3580 */ 3581 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 3582 "lock_screen_sticky_appwidget"; 3583 3584 /** 3585 * This preference enables showing the owner info on LockScreen. 3586 * @hide 3587 * @deprecated 3588 */ 3589 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 3590 "lock_screen_owner_info_enabled"; 3591 3592 /** 3593 * When set by a user, allows notifications to be shown atop a securely locked screen 3594 * in their full "private" form (same as when the device is unlocked). 3595 * @hide 3596 */ 3597 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 3598 "lock_screen_allow_private_notifications"; 3599 3600 /** 3601 * The Logging ID (a unique 64-bit value) as a hex string. 3602 * Used as a pseudonymous identifier for logging. 3603 * @deprecated This identifier is poorly initialized and has 3604 * many collisions. It should not be used. 3605 */ 3606 @Deprecated 3607 public static final String LOGGING_ID = "logging_id"; 3608 3609 /** 3610 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 3611 */ 3612 @Deprecated 3613 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 3614 3615 /** 3616 * No longer supported. 3617 */ 3618 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 3619 3620 /** 3621 * No longer supported. 3622 */ 3623 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 3624 3625 /** 3626 * No longer supported. 3627 */ 3628 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 3629 3630 /** 3631 * Settings classname to launch when Settings is clicked from All 3632 * Applications. Needed because of user testing between the old 3633 * and new Settings apps. 3634 */ 3635 // TODO: 881807 3636 public static final String SETTINGS_CLASSNAME = "settings_classname"; 3637 3638 /** 3639 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 3640 */ 3641 @Deprecated 3642 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 3643 3644 /** 3645 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 3646 */ 3647 @Deprecated 3648 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 3649 3650 /** 3651 * If accessibility is enabled. 3652 */ 3653 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 3654 3655 /** 3656 * If touch exploration is enabled. 3657 */ 3658 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 3659 3660 /** 3661 * List of the enabled accessibility providers. 3662 */ 3663 public static final String ENABLED_ACCESSIBILITY_SERVICES = 3664 "enabled_accessibility_services"; 3665 3666 /** 3667 * List of the accessibility services to which the user has granted 3668 * permission to put the device into touch exploration mode. 3669 * 3670 * @hide 3671 */ 3672 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 3673 "touch_exploration_granted_accessibility_services"; 3674 3675 /** 3676 * Whether to speak passwords while in accessibility mode. 3677 */ 3678 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 3679 3680 /** 3681 * If injection of accessibility enhancing JavaScript screen-reader 3682 * is enabled. 3683 * <p> 3684 * Note: The JavaScript based screen-reader is served by the 3685 * Google infrastructure and enable users with disabilities to 3686 * efficiently navigate in and explore web content. 3687 * </p> 3688 * <p> 3689 * This property represents a boolean value. 3690 * </p> 3691 * @hide 3692 */ 3693 public static final String ACCESSIBILITY_SCRIPT_INJECTION = 3694 "accessibility_script_injection"; 3695 3696 /** 3697 * The URL for the injected JavaScript based screen-reader used 3698 * for providing accessibility of content in WebView. 3699 * <p> 3700 * Note: The JavaScript based screen-reader is served by the 3701 * Google infrastructure and enable users with disabilities to 3702 * efficiently navigate in and explore web content. 3703 * </p> 3704 * <p> 3705 * This property represents a string value. 3706 * </p> 3707 * @hide 3708 */ 3709 public static final String ACCESSIBILITY_SCREEN_READER_URL = 3710 "accessibility_script_injection_url"; 3711 3712 /** 3713 * Key bindings for navigation in built-in accessibility support for web content. 3714 * <p> 3715 * Note: These key bindings are for the built-in accessibility navigation for 3716 * web content which is used as a fall back solution if JavaScript in a WebView 3717 * is not enabled or the user has not opted-in script injection from Google. 3718 * </p> 3719 * <p> 3720 * The bindings are separated by semi-colon. A binding is a mapping from 3721 * a key to a sequence of actions (for more details look at 3722 * android.webkit.AccessibilityInjector). A key is represented as the hexademical 3723 * string representation of an integer obtained from a meta state (optional) shifted 3724 * sixteen times left and bitwise ored with a key code. An action is represented 3725 * as a hexademical string representation of an integer where the first two digits 3726 * are navigation action index, the second, the third, and the fourth digit pairs 3727 * represent the action arguments. The separate actions in a binding are colon 3728 * separated. The key and the action sequence it maps to are separated by equals. 3729 * </p> 3730 * <p> 3731 * For example, the binding below maps the DPAD right button to traverse the 3732 * current navigation axis once without firing an accessibility event and to 3733 * perform the same traversal again but to fire an event: 3734 * <code> 3735 * 0x16=0x01000100:0x01000101; 3736 * </code> 3737 * </p> 3738 * <p> 3739 * The goal of this binding is to enable dynamic rebinding of keys to 3740 * navigation actions for web content without requiring a framework change. 3741 * </p> 3742 * <p> 3743 * This property represents a string value. 3744 * </p> 3745 * @hide 3746 */ 3747 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS = 3748 "accessibility_web_content_key_bindings"; 3749 3750 /** 3751 * Setting that specifies whether the display magnification is enabled. 3752 * Display magnifications allows the user to zoom in the display content 3753 * and is targeted to low vision users. The current magnification scale 3754 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 3755 * 3756 * @hide 3757 */ 3758 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 3759 "accessibility_display_magnification_enabled"; 3760 3761 /** 3762 * Setting that specifies what the display magnification scale is. 3763 * Display magnifications allows the user to zoom in the display 3764 * content and is targeted to low vision users. Whether a display 3765 * magnification is performed is controlled by 3766 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} 3767 * 3768 * @hide 3769 */ 3770 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 3771 "accessibility_display_magnification_scale"; 3772 3773 /** 3774 * Setting that specifies whether the display magnification should be 3775 * automatically updated. If this fearture is enabled the system will 3776 * exit magnification mode or pan the viewport when a context change 3777 * occurs. For example, on staring a new activity or rotating the screen, 3778 * the system may zoom out so the user can see the new context he is in. 3779 * Another example is on showing a window that is not visible in the 3780 * magnified viewport the system may pan the viewport to make the window 3781 * the has popped up so the user knows that the context has changed. 3782 * Whether a screen magnification is performed is controlled by 3783 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} 3784 * 3785 * @hide 3786 */ 3787 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 3788 "accessibility_display_magnification_auto_update"; 3789 3790 /** 3791 * Setting that specifies whether timed text (captions) should be 3792 * displayed in video content. Text display properties are controlled by 3793 * the following settings: 3794 * <ul> 3795 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 3796 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 3797 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 3798 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 3799 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 3800 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 3801 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 3802 * </ul> 3803 * 3804 * @hide 3805 */ 3806 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 3807 "accessibility_captioning_enabled"; 3808 3809 /** 3810 * Setting that specifies the language for captions as a locale string, 3811 * e.g. en_US. 3812 * 3813 * @see java.util.Locale#toString 3814 * @hide 3815 */ 3816 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 3817 "accessibility_captioning_locale"; 3818 3819 /** 3820 * Integer property that specifies the preset style for captions, one 3821 * of: 3822 * <ul> 3823 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 3824 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 3825 * </ul> 3826 * 3827 * @see java.util.Locale#toString 3828 * @hide 3829 */ 3830 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 3831 "accessibility_captioning_preset"; 3832 3833 /** 3834 * Integer property that specifes the background color for captions as a 3835 * packed 32-bit color. 3836 * 3837 * @see android.graphics.Color#argb 3838 * @hide 3839 */ 3840 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 3841 "accessibility_captioning_background_color"; 3842 3843 /** 3844 * Integer property that specifes the foreground color for captions as a 3845 * packed 32-bit color. 3846 * 3847 * @see android.graphics.Color#argb 3848 * @hide 3849 */ 3850 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 3851 "accessibility_captioning_foreground_color"; 3852 3853 /** 3854 * Integer property that specifes the edge type for captions, one of: 3855 * <ul> 3856 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 3857 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 3858 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 3859 * </ul> 3860 * 3861 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 3862 * @hide 3863 */ 3864 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 3865 "accessibility_captioning_edge_type"; 3866 3867 /** 3868 * Integer property that specifes the edge color for captions as a 3869 * packed 32-bit color. 3870 * 3871 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 3872 * @see android.graphics.Color#argb 3873 * @hide 3874 */ 3875 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 3876 "accessibility_captioning_edge_color"; 3877 3878 /** 3879 * Integer property that specifes the window color for captions as a 3880 * packed 32-bit color. 3881 * 3882 * @see android.graphics.Color#argb 3883 * @hide 3884 */ 3885 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 3886 "accessibility_captioning_window_color"; 3887 3888 /** 3889 * String property that specifies the typeface for captions, one of: 3890 * <ul> 3891 * <li>DEFAULT 3892 * <li>MONOSPACE 3893 * <li>SANS_SERIF 3894 * <li>SERIF 3895 * </ul> 3896 * 3897 * @see android.graphics.Typeface 3898 * @hide 3899 */ 3900 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 3901 "accessibility_captioning_typeface"; 3902 3903 /** 3904 * Floating point property that specifies font scaling for captions. 3905 * 3906 * @hide 3907 */ 3908 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 3909 "accessibility_captioning_font_scale"; 3910 3911 /** 3912 * Setting that specifies whether the quick setting tile for display 3913 * color inversion is enabled. 3914 * 3915 * @hide 3916 */ 3917 public static final String ACCESSIBILITY_DISPLAY_INVERSION_QUICK_SETTING_ENABLED = 3918 "accessibility_display_inversion_quick_setting_enabled"; 3919 3920 /** 3921 * Setting that specifies whether display color inversion is enabled. 3922 */ 3923 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 3924 "accessibility_display_inversion_enabled"; 3925 3926 /** 3927 * Setting that specifies whether the quick setting tile for display 3928 * color space adjustment is enabled. 3929 * 3930 * @hide 3931 */ 3932 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_QUICK_SETTING_ENABLED = 3933 "accessibility_display_daltonizer_quick_setting_enabled"; 3934 3935 /** 3936 * Setting that specifies whether display color space adjustment is 3937 * enabled. 3938 * 3939 * @hide 3940 */ 3941 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 3942 "accessibility_display_daltonizer_enabled"; 3943 3944 /** 3945 * Integer property that specifies the type of color space adjustment to 3946 * perform. Valid values are defined in AccessibilityManager. 3947 * 3948 * @hide 3949 */ 3950 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 3951 "accessibility_display_daltonizer"; 3952 3953 /** 3954 * The timout for considering a press to be a long press in milliseconds. 3955 * @hide 3956 */ 3957 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 3958 3959 /** 3960 * List of the enabled print services. 3961 * @hide 3962 */ 3963 public static final String ENABLED_PRINT_SERVICES = 3964 "enabled_print_services"; 3965 3966 /** 3967 * List of the system print services we enabled on first boot. On 3968 * first boot we enable all system, i.e. bundled print services, 3969 * once, so they work out-of-the-box. 3970 * @hide 3971 */ 3972 public static final String ENABLED_ON_FIRST_BOOT_SYSTEM_PRINT_SERVICES = 3973 "enabled_on_first_boot_system_print_services"; 3974 3975 /** 3976 * Setting to always use the default text-to-speech settings regardless 3977 * of the application settings. 3978 * 1 = override application settings, 3979 * 0 = use application settings (if specified). 3980 * 3981 * @deprecated The value of this setting is no longer respected by 3982 * the framework text to speech APIs as of the Ice Cream Sandwich release. 3983 */ 3984 @Deprecated 3985 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 3986 3987 /** 3988 * Default text-to-speech engine speech rate. 100 = 1x 3989 */ 3990 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 3991 3992 /** 3993 * Default text-to-speech engine pitch. 100 = 1x 3994 */ 3995 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 3996 3997 /** 3998 * Default text-to-speech engine. 3999 */ 4000 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 4001 4002 /** 4003 * Default text-to-speech language. 4004 * 4005 * @deprecated this setting is no longer in use, as of the Ice Cream 4006 * Sandwich release. Apps should never need to read this setting directly, 4007 * instead can query the TextToSpeech framework classes for the default 4008 * locale. {@link TextToSpeech#getLanguage()}. 4009 */ 4010 @Deprecated 4011 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 4012 4013 /** 4014 * Default text-to-speech country. 4015 * 4016 * @deprecated this setting is no longer in use, as of the Ice Cream 4017 * Sandwich release. Apps should never need to read this setting directly, 4018 * instead can query the TextToSpeech framework classes for the default 4019 * locale. {@link TextToSpeech#getLanguage()}. 4020 */ 4021 @Deprecated 4022 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 4023 4024 /** 4025 * Default text-to-speech locale variant. 4026 * 4027 * @deprecated this setting is no longer in use, as of the Ice Cream 4028 * Sandwich release. Apps should never need to read this setting directly, 4029 * instead can query the TextToSpeech framework classes for the 4030 * locale that is in use {@link TextToSpeech#getLanguage()}. 4031 */ 4032 @Deprecated 4033 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 4034 4035 /** 4036 * Stores the default tts locales on a per engine basis. Stored as 4037 * a comma seperated list of values, each value being of the form 4038 * {@code engine_name:locale} for example, 4039 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 4040 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 4041 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 4042 * setting directly, and can query the TextToSpeech framework classes 4043 * for the locale that is in use. 4044 * 4045 * @hide 4046 */ 4047 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 4048 4049 /** 4050 * Space delimited list of plugin packages that are enabled. 4051 */ 4052 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 4053 4054 /** 4055 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 4056 * instead. 4057 */ 4058 @Deprecated 4059 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 4060 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 4061 4062 /** 4063 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 4064 * instead. 4065 */ 4066 @Deprecated 4067 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 4068 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 4069 4070 /** 4071 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 4072 * instead. 4073 */ 4074 @Deprecated 4075 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 4076 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 4077 4078 /** 4079 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 4080 * instead. 4081 */ 4082 @Deprecated 4083 public static final String WIFI_ON = Global.WIFI_ON; 4084 4085 /** 4086 * The acceptable packet loss percentage (range 0 - 100) before trying 4087 * another AP on the same network. 4088 * @deprecated This setting is not used. 4089 */ 4090 @Deprecated 4091 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 4092 "wifi_watchdog_acceptable_packet_loss_percentage"; 4093 4094 /** 4095 * The number of access points required for a network in order for the 4096 * watchdog to monitor it. 4097 * @deprecated This setting is not used. 4098 */ 4099 @Deprecated 4100 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 4101 4102 /** 4103 * The delay between background checks. 4104 * @deprecated This setting is not used. 4105 */ 4106 @Deprecated 4107 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 4108 "wifi_watchdog_background_check_delay_ms"; 4109 4110 /** 4111 * Whether the Wi-Fi watchdog is enabled for background checking even 4112 * after it thinks the user has connected to a good access point. 4113 * @deprecated This setting is not used. 4114 */ 4115 @Deprecated 4116 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 4117 "wifi_watchdog_background_check_enabled"; 4118 4119 /** 4120 * The timeout for a background ping 4121 * @deprecated This setting is not used. 4122 */ 4123 @Deprecated 4124 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 4125 "wifi_watchdog_background_check_timeout_ms"; 4126 4127 /** 4128 * The number of initial pings to perform that *may* be ignored if they 4129 * fail. Again, if these fail, they will *not* be used in packet loss 4130 * calculation. For example, one network always seemed to time out for 4131 * the first couple pings, so this is set to 3 by default. 4132 * @deprecated This setting is not used. 4133 */ 4134 @Deprecated 4135 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 4136 "wifi_watchdog_initial_ignored_ping_count"; 4137 4138 /** 4139 * The maximum number of access points (per network) to attempt to test. 4140 * If this number is reached, the watchdog will no longer monitor the 4141 * initial connection state for the network. This is a safeguard for 4142 * networks containing multiple APs whose DNS does not respond to pings. 4143 * @deprecated This setting is not used. 4144 */ 4145 @Deprecated 4146 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 4147 4148 /** 4149 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 4150 */ 4151 @Deprecated 4152 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 4153 4154 /** 4155 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 4156 * @deprecated This setting is not used. 4157 */ 4158 @Deprecated 4159 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 4160 4161 /** 4162 * The number of pings to test if an access point is a good connection. 4163 * @deprecated This setting is not used. 4164 */ 4165 @Deprecated 4166 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 4167 4168 /** 4169 * The delay between pings. 4170 * @deprecated This setting is not used. 4171 */ 4172 @Deprecated 4173 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 4174 4175 /** 4176 * The timeout per ping. 4177 * @deprecated This setting is not used. 4178 */ 4179 @Deprecated 4180 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 4181 4182 /** 4183 * @deprecated Use 4184 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 4185 */ 4186 @Deprecated 4187 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 4188 4189 /** 4190 * @deprecated Use 4191 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 4192 */ 4193 @Deprecated 4194 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 4195 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 4196 4197 /** 4198 * Whether background data usage is allowed. 4199 * 4200 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 4201 * availability of background data depends on several 4202 * combined factors. When background data is unavailable, 4203 * {@link ConnectivityManager#getActiveNetworkInfo()} will 4204 * now appear disconnected. 4205 */ 4206 @Deprecated 4207 public static final String BACKGROUND_DATA = "background_data"; 4208 4209 /** 4210 * Origins for which browsers should allow geolocation by default. 4211 * The value is a space-separated list of origins. 4212 */ 4213 public static final String ALLOWED_GEOLOCATION_ORIGINS 4214 = "allowed_geolocation_origins"; 4215 4216 /** 4217 * The preferred TTY mode 0 = TTy Off, CDMA default 4218 * 1 = TTY Full 4219 * 2 = TTY HCO 4220 * 3 = TTY VCO 4221 * @hide 4222 */ 4223 public static final String PREFERRED_TTY_MODE = 4224 "preferred_tty_mode"; 4225 4226 /** 4227 * Whether the enhanced voice privacy mode is enabled. 4228 * 0 = normal voice privacy 4229 * 1 = enhanced voice privacy 4230 * @hide 4231 */ 4232 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 4233 4234 /** 4235 * Whether the TTY mode mode is enabled. 4236 * 0 = disabled 4237 * 1 = enabled 4238 * @hide 4239 */ 4240 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 4241 4242 /** 4243 * Controls whether settings backup is enabled. 4244 * Type: int ( 0 = disabled, 1 = enabled ) 4245 * @hide 4246 */ 4247 public static final String BACKUP_ENABLED = "backup_enabled"; 4248 4249 /** 4250 * Controls whether application data is automatically restored from backup 4251 * at install time. 4252 * Type: int ( 0 = disabled, 1 = enabled ) 4253 * @hide 4254 */ 4255 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 4256 4257 /** 4258 * Indicates whether settings backup has been fully provisioned. 4259 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 4260 * @hide 4261 */ 4262 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 4263 4264 /** 4265 * Component of the transport to use for backup/restore. 4266 * @hide 4267 */ 4268 public static final String BACKUP_TRANSPORT = "backup_transport"; 4269 4270 /** 4271 * Version for which the setup wizard was last shown. Bumped for 4272 * each release when there is new setup information to show. 4273 * @hide 4274 */ 4275 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 4276 4277 /** 4278 * The interval in milliseconds after which Wi-Fi is considered idle. 4279 * When idle, it is possible for the device to be switched from Wi-Fi to 4280 * the mobile data network. 4281 * @hide 4282 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 4283 * instead. 4284 */ 4285 @Deprecated 4286 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 4287 4288 /** 4289 * The global search provider chosen by the user (if multiple global 4290 * search providers are installed). This will be the provider returned 4291 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 4292 * installed. This setting is stored as a flattened component name as 4293 * per {@link ComponentName#flattenToString()}. 4294 * 4295 * @hide 4296 */ 4297 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 4298 "search_global_search_activity"; 4299 4300 /** 4301 * The number of promoted sources in GlobalSearch. 4302 * @hide 4303 */ 4304 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 4305 /** 4306 * The maximum number of suggestions returned by GlobalSearch. 4307 * @hide 4308 */ 4309 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 4310 /** 4311 * The number of suggestions GlobalSearch will ask each non-web search source for. 4312 * @hide 4313 */ 4314 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 4315 /** 4316 * The number of suggestions the GlobalSearch will ask the web search source for. 4317 * @hide 4318 */ 4319 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 4320 "search_web_results_override_limit"; 4321 /** 4322 * The number of milliseconds that GlobalSearch will wait for suggestions from 4323 * promoted sources before continuing with all other sources. 4324 * @hide 4325 */ 4326 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 4327 "search_promoted_source_deadline_millis"; 4328 /** 4329 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 4330 * @hide 4331 */ 4332 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 4333 /** 4334 * The maximum number of milliseconds that GlobalSearch shows the previous results 4335 * after receiving a new query. 4336 * @hide 4337 */ 4338 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 4339 /** 4340 * The maximum age of log data used for shortcuts in GlobalSearch. 4341 * @hide 4342 */ 4343 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 4344 /** 4345 * The maximum age of log data used for source ranking in GlobalSearch. 4346 * @hide 4347 */ 4348 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 4349 "search_max_source_event_age_millis"; 4350 /** 4351 * The minimum number of impressions needed to rank a source in GlobalSearch. 4352 * @hide 4353 */ 4354 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 4355 "search_min_impressions_for_source_ranking"; 4356 /** 4357 * The minimum number of clicks needed to rank a source in GlobalSearch. 4358 * @hide 4359 */ 4360 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 4361 "search_min_clicks_for_source_ranking"; 4362 /** 4363 * The maximum number of shortcuts shown by GlobalSearch. 4364 * @hide 4365 */ 4366 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 4367 /** 4368 * The size of the core thread pool for suggestion queries in GlobalSearch. 4369 * @hide 4370 */ 4371 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 4372 "search_query_thread_core_pool_size"; 4373 /** 4374 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 4375 * @hide 4376 */ 4377 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 4378 "search_query_thread_max_pool_size"; 4379 /** 4380 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 4381 * @hide 4382 */ 4383 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 4384 "search_shortcut_refresh_core_pool_size"; 4385 /** 4386 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 4387 * @hide 4388 */ 4389 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 4390 "search_shortcut_refresh_max_pool_size"; 4391 /** 4392 * The maximun time that excess threads in the GlobalSeach thread pools will 4393 * wait before terminating. 4394 * @hide 4395 */ 4396 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 4397 "search_thread_keepalive_seconds"; 4398 /** 4399 * The maximum number of concurrent suggestion queries to each source. 4400 * @hide 4401 */ 4402 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 4403 "search_per_source_concurrent_query_limit"; 4404 4405 /** 4406 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true) 4407 * @hide 4408 */ 4409 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 4410 4411 /** 4412 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 4413 * @hide 4414 */ 4415 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 4416 4417 /** 4418 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 4419 * @hide 4420 */ 4421 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 4422 4423 /** 4424 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 4425 * @hide 4426 */ 4427 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 4428 4429 /** 4430 * If nonzero, ANRs in invisible background processes bring up a dialog. 4431 * Otherwise, the process will be silently killed. 4432 * @hide 4433 */ 4434 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 4435 4436 /** 4437 * (Experimental). If nonzero, WebView uses data reduction proxy to save network 4438 * bandwidth. Otherwise, WebView does not use data reduction proxy. 4439 * @hide 4440 */ 4441 public static final String WEBVIEW_DATA_REDUCTION_PROXY = "webview_data_reduction_proxy"; 4442 4443 /** 4444 * The {@link ComponentName} string of the service to be used as the voice recognition 4445 * service. 4446 * 4447 * @hide 4448 */ 4449 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 4450 4451 /** 4452 * Stores whether an user has consented to have apps verified through PAM. 4453 * The value is boolean (1 or 0). 4454 * 4455 * @hide 4456 */ 4457 public static final String PACKAGE_VERIFIER_USER_CONSENT = 4458 "package_verifier_user_consent"; 4459 4460 /** 4461 * The {@link ComponentName} string of the selected spell checker service which is 4462 * one of the services managed by the text service manager. 4463 * 4464 * @hide 4465 */ 4466 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 4467 4468 /** 4469 * The {@link ComponentName} string of the selected subtype of the selected spell checker 4470 * service which is one of the services managed by the text service manager. 4471 * 4472 * @hide 4473 */ 4474 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 4475 "selected_spell_checker_subtype"; 4476 4477 /** 4478 * The {@link ComponentName} string whether spell checker is enabled or not. 4479 * 4480 * @hide 4481 */ 4482 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 4483 4484 /** 4485 * What happens when the user presses the Power button while in-call 4486 * and the screen is on.<br/> 4487 * <b>Values:</b><br/> 4488 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 4489 * 2 - The Power button hangs up the current call.<br/> 4490 * 4491 * @hide 4492 */ 4493 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 4494 4495 /** 4496 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 4497 * @hide 4498 */ 4499 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 4500 4501 /** 4502 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 4503 * @hide 4504 */ 4505 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 4506 4507 /** 4508 * INCALL_POWER_BUTTON_BEHAVIOR default value. 4509 * @hide 4510 */ 4511 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 4512 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 4513 4514 /** 4515 * Whether the device should wake when the wake gesture sensor detects motion. 4516 * @hide 4517 */ 4518 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 4519 4520 /** 4521 * The current night mode that has been selected by the user. Owned 4522 * and controlled by UiModeManagerService. Constants are as per 4523 * UiModeManager. 4524 * @hide 4525 */ 4526 public static final String UI_NIGHT_MODE = "ui_night_mode"; 4527 4528 /** 4529 * Whether screensavers are enabled. 4530 * @hide 4531 */ 4532 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 4533 4534 /** 4535 * The user's chosen screensaver components. 4536 * 4537 * These will be launched by the PhoneWindowManager after a timeout when not on 4538 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 4539 * @hide 4540 */ 4541 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 4542 4543 /** 4544 * If screensavers are enabled, whether the screensaver should be automatically launched 4545 * when the device is inserted into a (desk) dock. 4546 * @hide 4547 */ 4548 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 4549 4550 /** 4551 * If screensavers are enabled, whether the screensaver should be automatically launched 4552 * when the screen times out when not on battery. 4553 * @hide 4554 */ 4555 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 4556 4557 /** 4558 * If screensavers are enabled, the default screensaver component. 4559 * @hide 4560 */ 4561 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 4562 4563 /** 4564 * The default NFC payment component 4565 * @hide 4566 */ 4567 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 4568 4569 /** 4570 * Whether NFC payment is handled by the foreground application or a default. 4571 * @hide 4572 */ 4573 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 4574 4575 /** 4576 * Specifies the package name currently configured to be the primary sms application 4577 * @hide 4578 */ 4579 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 4580 4581 /** 4582 * Name of a package that the current user has explicitly allowed to see all of that 4583 * user's notifications. 4584 * 4585 * @hide 4586 */ 4587 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 4588 4589 /** 4590 * @hide 4591 */ 4592 public static final String ENABLED_CONDITION_PROVIDERS = "enabled_condition_providers"; 4593 4594 /** @hide */ 4595 public static final String BAR_SERVICE_COMPONENT = "bar_service_component"; 4596 4597 /** @hide */ 4598 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 4599 4600 /** 4601 * This is the query URI for finding a print service to install. 4602 * 4603 * @hide 4604 */ 4605 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 4606 4607 /** 4608 * This is the query URI for finding a NFC payment service to install. 4609 * 4610 * @hide 4611 */ 4612 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 4613 4614 /** 4615 * If enabled, apps should try to skip any introductory hints on first launch. This might 4616 * apply to users that are already familiar with the environment or temporary users. 4617 * <p> 4618 * Type : int (0 to show hints, 1 to skip showing hints) 4619 */ 4620 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 4621 4622 /** 4623 * This are the settings to be backed up. 4624 * 4625 * NOTE: Settings are backed up and restored in the order they appear 4626 * in this array. If you have one setting depending on another, 4627 * make sure that they are ordered appropriately. 4628 * 4629 * @hide 4630 */ 4631 public static final String[] SETTINGS_TO_BACKUP = { 4632 BUGREPORT_IN_POWER_MENU, // moved to global 4633 ALLOW_MOCK_LOCATION, 4634 PARENTAL_CONTROL_ENABLED, 4635 PARENTAL_CONTROL_REDIRECT_URL, 4636 USB_MASS_STORAGE_ENABLED, // moved to global 4637 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 4638 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, 4639 ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE, 4640 ACCESSIBILITY_SCRIPT_INJECTION, 4641 BACKUP_AUTO_RESTORE, 4642 ENABLED_ACCESSIBILITY_SERVICES, 4643 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, 4644 TOUCH_EXPLORATION_ENABLED, 4645 ACCESSIBILITY_ENABLED, 4646 ACCESSIBILITY_SPEAK_PASSWORD, 4647 ACCESSIBILITY_CAPTIONING_ENABLED, 4648 ACCESSIBILITY_CAPTIONING_LOCALE, 4649 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, 4650 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, 4651 ACCESSIBILITY_CAPTIONING_EDGE_TYPE, 4652 ACCESSIBILITY_CAPTIONING_EDGE_COLOR, 4653 ACCESSIBILITY_CAPTIONING_TYPEFACE, 4654 ACCESSIBILITY_CAPTIONING_FONT_SCALE, 4655 TTS_USE_DEFAULTS, 4656 TTS_DEFAULT_RATE, 4657 TTS_DEFAULT_PITCH, 4658 TTS_DEFAULT_SYNTH, 4659 TTS_DEFAULT_LANG, 4660 TTS_DEFAULT_COUNTRY, 4661 TTS_ENABLED_PLUGINS, 4662 TTS_DEFAULT_LOCALE, 4663 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global 4664 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global 4665 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global 4666 MOUNT_PLAY_NOTIFICATION_SND, 4667 MOUNT_UMS_AUTOSTART, 4668 MOUNT_UMS_PROMPT, 4669 MOUNT_UMS_NOTIFY_ENABLED, 4670 UI_NIGHT_MODE 4671 }; 4672 4673 /** 4674 * Helper method for determining if a location provider is enabled. 4675 * 4676 * @param cr the content resolver to use 4677 * @param provider the location provider to query 4678 * @return true if the provider is enabled 4679 * 4680 * @deprecated use {@link #LOCATION_MODE} or 4681 * {@link LocationManager#isProviderEnabled(String)} 4682 */ 4683 @Deprecated 4684 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 4685 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId()); 4686 } 4687 4688 /** 4689 * Helper method for determining if a location provider is enabled. 4690 * @param cr the content resolver to use 4691 * @param provider the location provider to query 4692 * @param userId the userId to query 4693 * @return true if the provider is enabled 4694 * @deprecated use {@link #LOCATION_MODE} or 4695 * {@link LocationManager#isProviderEnabled(String)} 4696 * @hide 4697 */ 4698 @Deprecated 4699 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) { 4700 String allowedProviders = Settings.Secure.getStringForUser(cr, 4701 LOCATION_PROVIDERS_ALLOWED, userId); 4702 return TextUtils.delimitedStringContains(allowedProviders, ',', provider); 4703 } 4704 4705 /** 4706 * Thread-safe method for enabling or disabling a single location provider. 4707 * @param cr the content resolver to use 4708 * @param provider the location provider to enable or disable 4709 * @param enabled true if the provider should be enabled 4710 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE} 4711 */ 4712 @Deprecated 4713 public static final void setLocationProviderEnabled(ContentResolver cr, 4714 String provider, boolean enabled) { 4715 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId()); 4716 } 4717 4718 /** 4719 * Thread-safe method for enabling or disabling a single location provider. 4720 * 4721 * @param cr the content resolver to use 4722 * @param provider the location provider to enable or disable 4723 * @param enabled true if the provider should be enabled 4724 * @param userId the userId for which to enable/disable providers 4725 * @return true if the value was set, false on database errors 4726 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and 4727 * {@link #LOCATION_MODE} 4728 * @hide 4729 */ 4730 @Deprecated 4731 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, 4732 String provider, boolean enabled, int userId) { 4733 synchronized (mLocationSettingsLock) { 4734 // to ensure thread safety, we write the provider name with a '+' or '-' 4735 // and let the SettingsProvider handle it rather than reading and modifying 4736 // the list of enabled providers. 4737 if (enabled) { 4738 provider = "+" + provider; 4739 } else { 4740 provider = "-" + provider; 4741 } 4742 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, 4743 userId); 4744 } 4745 } 4746 4747 /** 4748 * Thread-safe method for setting the location mode to one of 4749 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 4750 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. 4751 * 4752 * @param cr the content resolver to use 4753 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} 4754 * @param userId the userId for which to change mode 4755 * @return true if the value was set, false on database errors 4756 * 4757 * @throws IllegalArgumentException if mode is not one of the supported values 4758 */ 4759 private static final boolean setLocationModeForUser(ContentResolver cr, int mode, 4760 int userId) { 4761 synchronized (mLocationSettingsLock) { 4762 boolean gps = false; 4763 boolean network = false; 4764 switch (mode) { 4765 case LOCATION_MODE_OFF: 4766 break; 4767 case LOCATION_MODE_SENSORS_ONLY: 4768 gps = true; 4769 break; 4770 case LOCATION_MODE_BATTERY_SAVING: 4771 network = true; 4772 break; 4773 case LOCATION_MODE_HIGH_ACCURACY: 4774 gps = true; 4775 network = true; 4776 break; 4777 default: 4778 throw new IllegalArgumentException("Invalid location mode: " + mode); 4779 } 4780 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( 4781 cr, LocationManager.GPS_PROVIDER, gps, userId); 4782 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( 4783 cr, LocationManager.NETWORK_PROVIDER, network, userId); 4784 return gpsSuccess && nlpSuccess; 4785 } 4786 } 4787 4788 /** 4789 * Thread-safe method for reading the location mode, returns one of 4790 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 4791 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. 4792 * 4793 * @param cr the content resolver to use 4794 * @param userId the userId for which to read the mode 4795 * @return the location mode 4796 */ 4797 private static final int getLocationModeForUser(ContentResolver cr, int userId) { 4798 synchronized (mLocationSettingsLock) { 4799 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( 4800 cr, LocationManager.GPS_PROVIDER, userId); 4801 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( 4802 cr, LocationManager.NETWORK_PROVIDER, userId); 4803 if (gpsEnabled && networkEnabled) { 4804 return LOCATION_MODE_HIGH_ACCURACY; 4805 } else if (gpsEnabled) { 4806 return LOCATION_MODE_SENSORS_ONLY; 4807 } else if (networkEnabled) { 4808 return LOCATION_MODE_BATTERY_SAVING; 4809 } else { 4810 return LOCATION_MODE_OFF; 4811 } 4812 } 4813 } 4814 } 4815 4816 /** 4817 * Global system settings, containing preferences that always apply identically 4818 * to all defined users. Applications can read these but are not allowed to write; 4819 * like the "Secure" settings, these are for preferences that the user must 4820 * explicitly modify through the system UI or specialized APIs for those values. 4821 */ 4822 public static final class Global extends NameValueTable { 4823 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_global_version"; 4824 4825 /** 4826 * The content:// style URL for global secure settings items. Not public. 4827 */ 4828 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 4829 4830 /** 4831 * Setting whether the global gesture for enabling accessibility is enabled. 4832 * If this gesture is enabled the user will be able to perfrom it to enable 4833 * the accessibility state without visiting the settings app. 4834 * @hide 4835 */ 4836 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 4837 "enable_accessibility_global_gesture_enabled"; 4838 4839 /** 4840 * Whether Airplane Mode is on. 4841 */ 4842 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 4843 4844 /** 4845 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 4846 */ 4847 public static final String RADIO_BLUETOOTH = "bluetooth"; 4848 4849 /** 4850 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 4851 */ 4852 public static final String RADIO_WIFI = "wifi"; 4853 4854 /** 4855 * {@hide} 4856 */ 4857 public static final String RADIO_WIMAX = "wimax"; 4858 /** 4859 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 4860 */ 4861 public static final String RADIO_CELL = "cell"; 4862 4863 /** 4864 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 4865 */ 4866 public static final String RADIO_NFC = "nfc"; 4867 4868 /** 4869 * A comma separated list of radios that need to be disabled when airplane mode 4870 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 4871 * included in the comma separated list. 4872 */ 4873 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 4874 4875 /** 4876 * A comma separated list of radios that should to be disabled when airplane mode 4877 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 4878 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 4879 * will be turned off when entering airplane mode, but the user will be able to reenable 4880 * Wifi in the Settings app. 4881 * 4882 * {@hide} 4883 */ 4884 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 4885 4886 /** 4887 * The policy for deciding when Wi-Fi should go to sleep (which will in 4888 * turn switch to using the mobile data as an Internet connection). 4889 * <p> 4890 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 4891 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 4892 * {@link #WIFI_SLEEP_POLICY_NEVER}. 4893 */ 4894 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 4895 4896 /** 4897 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 4898 * policy, which is to sleep shortly after the turning off 4899 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 4900 */ 4901 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 4902 4903 /** 4904 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 4905 * the device is on battery, and never go to sleep when the device is 4906 * plugged in. 4907 */ 4908 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 4909 4910 /** 4911 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 4912 */ 4913 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 4914 4915 /** 4916 * Value to specify if the user prefers the date, time and time zone 4917 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 4918 */ 4919 public static final String AUTO_TIME = "auto_time"; 4920 4921 /** 4922 * Value to specify if the user prefers the time zone 4923 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 4924 */ 4925 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 4926 4927 /** 4928 * URI for the car dock "in" event sound. 4929 * @hide 4930 */ 4931 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 4932 4933 /** 4934 * URI for the car dock "out" event sound. 4935 * @hide 4936 */ 4937 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 4938 4939 /** 4940 * URI for the desk dock "in" event sound. 4941 * @hide 4942 */ 4943 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 4944 4945 /** 4946 * URI for the desk dock "out" event sound. 4947 * @hide 4948 */ 4949 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 4950 4951 /** 4952 * Whether to play a sound for dock events. 4953 * @hide 4954 */ 4955 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 4956 4957 /** 4958 * URI for the "device locked" (keyguard shown) sound. 4959 * @hide 4960 */ 4961 public static final String LOCK_SOUND = "lock_sound"; 4962 4963 /** 4964 * URI for the "device unlocked" sound. 4965 * @hide 4966 */ 4967 public static final String UNLOCK_SOUND = "unlock_sound"; 4968 4969 /** 4970 * URI for the low battery sound file. 4971 * @hide 4972 */ 4973 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 4974 4975 /** 4976 * Whether to play a sound for low-battery alerts. 4977 * @hide 4978 */ 4979 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 4980 4981 /** 4982 * URI for the "wireless charging started" sound. 4983 * @hide 4984 */ 4985 public static final String WIRELESS_CHARGING_STARTED_SOUND = 4986 "wireless_charging_started_sound"; 4987 4988 /** 4989 * Whether we keep the device on while the device is plugged in. 4990 * Supported values are: 4991 * <ul> 4992 * <li>{@code 0} to never stay on while plugged in</li> 4993 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 4994 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 4995 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 4996 * </ul> 4997 * These values can be OR-ed together. 4998 */ 4999 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 5000 5001 /** 5002 * When the user has enable the option to have a "bug report" command 5003 * in the power menu. 5004 * @hide 5005 */ 5006 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 5007 5008 /** 5009 * Whether ADB is enabled. 5010 */ 5011 public static final String ADB_ENABLED = "adb_enabled"; 5012 5013 /** 5014 * Whether assisted GPS should be enabled or not. 5015 * @hide 5016 */ 5017 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 5018 5019 /** 5020 * Whether bluetooth is enabled/disabled 5021 * 0=disabled. 1=enabled. 5022 */ 5023 public static final String BLUETOOTH_ON = "bluetooth_on"; 5024 5025 /** 5026 * CDMA Cell Broadcast SMS 5027 * 0 = CDMA Cell Broadcast SMS disabled 5028 * 1 = CDMA Cell Broadcast SMS enabled 5029 * @hide 5030 */ 5031 public static final String CDMA_CELL_BROADCAST_SMS = 5032 "cdma_cell_broadcast_sms"; 5033 5034 /** 5035 * The CDMA roaming mode 0 = Home Networks, CDMA default 5036 * 1 = Roaming on Affiliated networks 5037 * 2 = Roaming on any networks 5038 * @hide 5039 */ 5040 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 5041 5042 /** 5043 * The CDMA subscription mode 0 = RUIM/SIM (default) 5044 * 1 = NV 5045 * @hide 5046 */ 5047 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 5048 5049 /** Inactivity timeout to track mobile data activity. 5050 * 5051 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 5052 * infer the data activity of mobile network. After a period of no activity on mobile 5053 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 5054 * intent is fired to indicate a transition of network status from "active" to "idle". Any 5055 * subsequent activity on mobile networks triggers the firing of {@code 5056 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 5057 * 5058 * Network activity refers to transmitting or receiving data on the network interfaces. 5059 * 5060 * Tracking is disabled if set to zero or negative value. 5061 * 5062 * @hide 5063 */ 5064 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 5065 5066 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 5067 * but for Wifi network. 5068 * @hide 5069 */ 5070 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 5071 5072 /** 5073 * Whether or not data roaming is enabled. (0 = false, 1 = true) 5074 */ 5075 public static final String DATA_ROAMING = "data_roaming"; 5076 5077 /** 5078 * The value passed to a Mobile DataConnection via bringUp which defines the 5079 * number of retries to preform when setting up the initial connection. The default 5080 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 5081 * @hide 5082 */ 5083 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 5084 5085 /** 5086 * Whether user has enabled development settings. 5087 */ 5088 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 5089 5090 /** 5091 * Whether the device has been provisioned (0 = false, 1 = true) 5092 */ 5093 public static final String DEVICE_PROVISIONED = "device_provisioned"; 5094 5095 /** 5096 * The saved value for WindowManagerService.setForcedDisplayDensity(). 5097 * One integer in dpi. If unset, then use the real display density. 5098 * @hide 5099 */ 5100 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 5101 5102 /** 5103 * The saved value for WindowManagerService.setForcedDisplaySize(). 5104 * Two integers separated by a comma. If unset, then use the real display size. 5105 * @hide 5106 */ 5107 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 5108 5109 /** 5110 * The maximum size, in bytes, of a download that the download manager will transfer over 5111 * a non-wifi connection. 5112 * @hide 5113 */ 5114 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 5115 "download_manager_max_bytes_over_mobile"; 5116 5117 /** 5118 * The recommended maximum size, in bytes, of a download that the download manager should 5119 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 5120 * have the option to start the download over the mobile connection anyway. 5121 * @hide 5122 */ 5123 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 5124 "download_manager_recommended_max_bytes_over_mobile"; 5125 5126 /** 5127 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 5128 */ 5129 @Deprecated 5130 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 5131 5132 /** 5133 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 5134 * sent or processed. (0 = false, 1 = true) 5135 * @hide 5136 */ 5137 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 5138 5139 /** 5140 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted, 5141 * and the output is redirected to AV Receiver connected via 5142 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}. 5143 * @hide 5144 */ 5145 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled"; 5146 5147 /** 5148 * Whether TV will automatically turn on upon reception of the CEC command 5149 * <Text View On> or <Image View On>. (0 = false, 1 = true) 5150 * @hide 5151 */ 5152 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 5153 "hdmi_control_auto_wakeup_enabled"; 5154 5155 /** 5156 * Whether TV will also turn off other CEC devices when it goes to standby mode. 5157 * (0 = false, 1 = true) 5158 * @hide 5159 */ 5160 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 5161 "hdmi_control_auto_device_off_enabled"; 5162 5163 /** 5164 * Whether TV will switch to MHL port when a mobile device is plugged in. 5165 * (0 = false, 1 = true) 5166 * @hide 5167 */ 5168 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 5169 5170 /** 5171 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 5172 * @hide 5173 */ 5174 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 5175 5176 /** 5177 * Whether mobile data connections are allowed by the user. See 5178 * ConnectivityManager for more info. 5179 * @hide 5180 */ 5181 public static final String MOBILE_DATA = "mobile_data"; 5182 5183 /** {@hide} */ 5184 public static final String NETSTATS_ENABLED = "netstats_enabled"; 5185 /** {@hide} */ 5186 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 5187 /** {@hide} */ 5188 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 5189 /** {@hide} */ 5190 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 5191 /** {@hide} */ 5192 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 5193 /** {@hide} */ 5194 public static final String NETSTATS_REPORT_XT_OVER_DEV = "netstats_report_xt_over_dev"; 5195 5196 /** {@hide} */ 5197 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 5198 /** {@hide} */ 5199 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 5200 /** {@hide} */ 5201 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 5202 /** {@hide} */ 5203 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 5204 5205 /** {@hide} */ 5206 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 5207 /** {@hide} */ 5208 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 5209 /** {@hide} */ 5210 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 5211 /** {@hide} */ 5212 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 5213 5214 /** {@hide} */ 5215 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; 5216 /** {@hide} */ 5217 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; 5218 /** {@hide} */ 5219 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 5220 /** {@hide} */ 5221 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 5222 5223 /** 5224 * User preference for which network(s) should be used. Only the 5225 * connectivity service should touch this. 5226 */ 5227 public static final String NETWORK_PREFERENCE = "network_preference"; 5228 5229 /** 5230 * Which package name to use for network scoring. If null, or if the package is not a valid 5231 * scorer app, external network scores will neither be requested nor accepted. 5232 * @hide 5233 */ 5234 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 5235 5236 /** 5237 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 5238 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 5239 * exceeded. 5240 * @hide 5241 */ 5242 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 5243 5244 /** 5245 * The length of time in milli-seconds that automatic small adjustments to 5246 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 5247 * @hide 5248 */ 5249 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 5250 5251 /** Preferred NTP server. {@hide} */ 5252 public static final String NTP_SERVER = "ntp_server"; 5253 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 5254 public static final String NTP_TIMEOUT = "ntp_timeout"; 5255 5256 /** 5257 * Whether the package manager should send package verification broadcasts for verifiers to 5258 * review apps prior to installation. 5259 * 1 = request apps to be verified prior to installation, if a verifier exists. 5260 * 0 = do not verify apps before installation 5261 * @hide 5262 */ 5263 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; 5264 5265 /** Timeout for package verification. 5266 * @hide */ 5267 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 5268 5269 /** Default response code for package verification. 5270 * @hide */ 5271 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 5272 5273 /** 5274 * Show package verification setting in the Settings app. 5275 * 1 = show (default) 5276 * 0 = hide 5277 * @hide 5278 */ 5279 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 5280 5281 /** 5282 * Run package verificaiton on apps installed through ADB/ADT/USB 5283 * 1 = perform package verification on ADB installs (default) 5284 * 0 = bypass package verification on ADB installs 5285 * @hide 5286 */ 5287 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 5288 5289 /** 5290 * The interval in milliseconds at which to check packet counts on the 5291 * mobile data interface when screen is on, to detect possible data 5292 * connection problems. 5293 * @hide 5294 */ 5295 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 5296 "pdp_watchdog_poll_interval_ms"; 5297 5298 /** 5299 * The interval in milliseconds at which to check packet counts on the 5300 * mobile data interface when screen is off, to detect possible data 5301 * connection problems. 5302 * @hide 5303 */ 5304 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 5305 "pdp_watchdog_long_poll_interval_ms"; 5306 5307 /** 5308 * The interval in milliseconds at which to check packet counts on the 5309 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 5310 * outgoing packets has been reached without incoming packets. 5311 * @hide 5312 */ 5313 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 5314 "pdp_watchdog_error_poll_interval_ms"; 5315 5316 /** 5317 * The number of outgoing packets sent without seeing an incoming packet 5318 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 5319 * device is logged to the event log 5320 * @hide 5321 */ 5322 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 5323 "pdp_watchdog_trigger_packet_count"; 5324 5325 /** 5326 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 5327 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 5328 * attempting data connection recovery. 5329 * @hide 5330 */ 5331 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 5332 "pdp_watchdog_error_poll_count"; 5333 5334 /** 5335 * The number of failed PDP reset attempts before moving to something more 5336 * drastic: re-registering to the network. 5337 * @hide 5338 */ 5339 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 5340 "pdp_watchdog_max_pdp_reset_fail_count"; 5341 5342 /** 5343 * A positive value indicates how often the SamplingProfiler 5344 * should take snapshots. Zero value means SamplingProfiler 5345 * is disabled. 5346 * 5347 * @hide 5348 */ 5349 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms"; 5350 5351 /** 5352 * URL to open browser on to allow user to manage a prepay account 5353 * @hide 5354 */ 5355 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 5356 "setup_prepaid_data_service_url"; 5357 5358 /** 5359 * URL to attempt a GET on to see if this is a prepay device 5360 * @hide 5361 */ 5362 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 5363 "setup_prepaid_detection_target_url"; 5364 5365 /** 5366 * Host to check for a redirect to after an attempt to GET 5367 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 5368 * this is a prepaid device with zero balance.) 5369 * @hide 5370 */ 5371 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 5372 "setup_prepaid_detection_redir_host"; 5373 5374 /** 5375 * The interval in milliseconds at which to check the number of SMS sent out without asking 5376 * for use permit, to limit the un-authorized SMS usage. 5377 * 5378 * @hide 5379 */ 5380 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 5381 "sms_outgoing_check_interval_ms"; 5382 5383 /** 5384 * The number of outgoing SMS sent without asking for user permit (of {@link 5385 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 5386 * 5387 * @hide 5388 */ 5389 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 5390 "sms_outgoing_check_max_count"; 5391 5392 /** 5393 * Used to disable SMS short code confirmation - defaults to true. 5394 * True indcates we will do the check, etc. Set to false to disable. 5395 * @see com.android.internal.telephony.SmsUsageMonitor 5396 * @hide 5397 */ 5398 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 5399 5400 /** 5401 * Used to select which country we use to determine premium sms codes. 5402 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 5403 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 5404 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 5405 * @hide 5406 */ 5407 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 5408 5409 /** 5410 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value 5411 * @hide 5412 */ 5413 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 5414 5415 /** 5416 * Used to disable Tethering on a device - defaults to true 5417 * @hide 5418 */ 5419 public static final String TETHER_SUPPORTED = "tether_supported"; 5420 5421 /** 5422 * Used to require DUN APN on the device or not - defaults to a build config value 5423 * which defaults to false 5424 * @hide 5425 */ 5426 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 5427 5428 /** 5429 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 5430 * corresponding build config values are set it will override the APN DB 5431 * values. 5432 * Consists of a comma seperated list of strings: 5433 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 5434 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" 5435 * @hide 5436 */ 5437 public static final String TETHER_DUN_APN = "tether_dun_apn"; 5438 5439 /** 5440 * USB Mass Storage Enabled 5441 */ 5442 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 5443 5444 /** 5445 * If this setting is set (to anything), then all references 5446 * to Gmail on the device must change to Google Mail. 5447 */ 5448 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 5449 5450 /** 5451 * Webview Data reduction proxy key. 5452 * @hide 5453 */ 5454 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 5455 "webview_data_reduction_proxy_key"; 5456 5457 /** 5458 * Whether Wifi display is enabled/disabled 5459 * 0=disabled. 1=enabled. 5460 * @hide 5461 */ 5462 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 5463 5464 /** 5465 * Whether Wifi display certification mode is enabled/disabled 5466 * 0=disabled. 1=enabled. 5467 * @hide 5468 */ 5469 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 5470 "wifi_display_certification_on"; 5471 5472 /** 5473 * WPS Configuration method used by Wifi display, this setting only 5474 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 5475 * 5476 * Possible values are: 5477 * 5478 * WpsInfo.INVALID: use default WPS method chosen by framework 5479 * WpsInfo.PBC : use Push button 5480 * WpsInfo.KEYPAD : use Keypad 5481 * WpsInfo.DISPLAY: use Display 5482 * @hide 5483 */ 5484 public static final String WIFI_DISPLAY_WPS_CONFIG = 5485 "wifi_display_wps_config"; 5486 5487 /** 5488 * Whether to notify the user of open networks. 5489 * <p> 5490 * If not connected and the scan results have an open network, we will 5491 * put this notification up. If we attempt to connect to a network or 5492 * the open network(s) disappear, we remove the notification. When we 5493 * show the notification, we will not show it again for 5494 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 5495 */ 5496 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5497 "wifi_networks_available_notification_on"; 5498 /** 5499 * {@hide} 5500 */ 5501 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5502 "wimax_networks_available_notification_on"; 5503 5504 /** 5505 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 5506 * Connecting to a network will reset the timer. 5507 */ 5508 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 5509 "wifi_networks_available_repeat_delay"; 5510 5511 /** 5512 * 802.11 country code in ISO 3166 format 5513 * @hide 5514 */ 5515 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 5516 5517 /** 5518 * The interval in milliseconds to issue wake up scans when wifi needs 5519 * to connect. This is necessary to connect to an access point when 5520 * device is on the move and the screen is off. 5521 * @hide 5522 */ 5523 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 5524 "wifi_framework_scan_interval_ms"; 5525 5526 /** 5527 * The interval in milliseconds after which Wi-Fi is considered idle. 5528 * When idle, it is possible for the device to be switched from Wi-Fi to 5529 * the mobile data network. 5530 * @hide 5531 */ 5532 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 5533 5534 /** 5535 * When the number of open networks exceeds this number, the 5536 * least-recently-used excess networks will be removed. 5537 */ 5538 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 5539 5540 /** 5541 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 5542 */ 5543 public static final String WIFI_ON = "wifi_on"; 5544 5545 /** 5546 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 5547 * @hide 5548 */ 5549 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 5550 "wifi_scan_always_enabled"; 5551 5552 /** 5553 * Used to save the Wifi_ON state prior to tethering. 5554 * This state will be checked to restore Wifi after 5555 * the user turns off tethering. 5556 * 5557 * @hide 5558 */ 5559 public static final String WIFI_SAVED_STATE = "wifi_saved_state"; 5560 5561 /** 5562 * The interval in milliseconds to scan as used by the wifi supplicant 5563 * @hide 5564 */ 5565 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 5566 "wifi_supplicant_scan_interval_ms"; 5567 5568 /** 5569 * whether frameworks handles wifi auto-join 5570 * @hide 5571 */ 5572 public static final String WIFI_ENHANCED_AUTO_JOIN = 5573 "wifi_enhanced_auto_join"; 5574 5575 /** 5576 * whether settings show RSSI 5577 * @hide 5578 */ 5579 public static final String WIFI_NETWORK_SHOW_RSSI = 5580 "wifi_network_show_rssi"; 5581 5582 /** 5583 * The interval in milliseconds to scan at supplicant when p2p is connected 5584 * @hide 5585 */ 5586 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 5587 "wifi_scan_interval_p2p_connected_ms"; 5588 5589 /** 5590 * Whether the Wi-Fi watchdog is enabled. 5591 */ 5592 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 5593 5594 /** 5595 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 5596 * the setting needs to be set to 0 to disable it. 5597 * @hide 5598 */ 5599 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 5600 "wifi_watchdog_poor_network_test_enabled"; 5601 5602 /** 5603 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and 5604 * needs to be set to 0 to disable it. 5605 * @hide 5606 */ 5607 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = 5608 "wifi_suspend_optimizations_enabled"; 5609 5610 /** 5611 * The maximum number of times we will retry a connection to an access 5612 * point for which we have failed in acquiring an IP address from DHCP. 5613 * A value of N means that we will make N+1 connection attempts in all. 5614 */ 5615 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 5616 5617 /** 5618 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 5619 * data connectivity to be established after a disconnect from Wi-Fi. 5620 */ 5621 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 5622 "wifi_mobile_data_transition_wakelock_timeout_ms"; 5623 5624 /** 5625 * The operational wifi frequency band 5626 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 5627 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 5628 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 5629 * 5630 * @hide 5631 */ 5632 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 5633 5634 /** 5635 * The Wi-Fi peer-to-peer device name 5636 * @hide 5637 */ 5638 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 5639 5640 /** 5641 * The min time between wifi disable and wifi enable 5642 * @hide 5643 */ 5644 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; 5645 5646 /** 5647 * The number of milliseconds to delay when checking for data stalls during 5648 * non-aggressive detection. (screen is turned off.) 5649 * @hide 5650 */ 5651 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 5652 "data_stall_alarm_non_aggressive_delay_in_ms"; 5653 5654 /** 5655 * The number of milliseconds to delay when checking for data stalls during 5656 * aggressive detection. (screen on or suspected data stall) 5657 * @hide 5658 */ 5659 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 5660 "data_stall_alarm_aggressive_delay_in_ms"; 5661 5662 /** 5663 * The number of milliseconds to allow the provisioning apn to remain active 5664 * @hide 5665 */ 5666 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 5667 "provisioning_apn_alarm_delay_in_ms"; 5668 5669 /** 5670 * The interval in milliseconds at which to check gprs registration 5671 * after the first registration mismatch of gprs and voice service, 5672 * to detect possible data network registration problems. 5673 * 5674 * @hide 5675 */ 5676 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 5677 "gprs_register_check_period_ms"; 5678 5679 /** 5680 * Nonzero causes Log.wtf() to crash. 5681 * @hide 5682 */ 5683 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 5684 5685 /** 5686 * Ringer mode. This is used internally, changing this value will not 5687 * change the ringer mode. See AudioManager. 5688 */ 5689 public static final String MODE_RINGER = "mode_ringer"; 5690 5691 /** 5692 * Overlay display devices setting. 5693 * The associated value is a specially formatted string that describes the 5694 * size and density of simulated secondary display devices. 5695 * <p> 5696 * Format: {width}x{height}/{dpi};... 5697 * </p><p> 5698 * Example: 5699 * <ul> 5700 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 5701 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first 5702 * at 1080p and the second at 720p.</li> 5703 * <li>If the value is empty, then no overlay display devices are created.</li> 5704 * </ul></p> 5705 * 5706 * @hide 5707 */ 5708 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 5709 5710 /** 5711 * Threshold values for the duration and level of a discharge cycle, 5712 * under which we log discharge cycle info. 5713 * 5714 * @hide 5715 */ 5716 public static final String 5717 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 5718 5719 /** @hide */ 5720 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 5721 5722 /** 5723 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 5724 * intents on application crashes and ANRs. If this is disabled, the 5725 * crash/ANR dialog will never display the "Report" button. 5726 * <p> 5727 * Type: int (0 = disallow, 1 = allow) 5728 * 5729 * @hide 5730 */ 5731 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 5732 5733 /** 5734 * Maximum age of entries kept by {@link DropBoxManager}. 5735 * 5736 * @hide 5737 */ 5738 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 5739 5740 /** 5741 * Maximum number of entry files which {@link DropBoxManager} will keep 5742 * around. 5743 * 5744 * @hide 5745 */ 5746 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 5747 5748 /** 5749 * Maximum amount of disk space used by {@link DropBoxManager} no matter 5750 * what. 5751 * 5752 * @hide 5753 */ 5754 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 5755 5756 /** 5757 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 5758 * will use. 5759 * 5760 * @hide 5761 */ 5762 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 5763 5764 /** 5765 * Percent of total disk which {@link DropBoxManager} will never dip 5766 * into. 5767 * 5768 * @hide 5769 */ 5770 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 5771 5772 /** 5773 * Prefix for per-tag dropbox disable/enable settings. 5774 * 5775 * @hide 5776 */ 5777 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 5778 5779 /** 5780 * Lines of logcat to include with system crash/ANR/etc. reports, as a 5781 * prefix of the dropbox tag of the report type. For example, 5782 * "logcat_for_system_server_anr" controls the lines of logcat captured 5783 * with system server ANR reports. 0 to disable. 5784 * 5785 * @hide 5786 */ 5787 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 5788 5789 /** 5790 * The interval in minutes after which the amount of free storage left 5791 * on the device is logged to the event log 5792 * 5793 * @hide 5794 */ 5795 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 5796 5797 /** 5798 * Threshold for the amount of change in disk free space required to 5799 * report the amount of free space. Used to prevent spamming the logs 5800 * when the disk free space isn't changing frequently. 5801 * 5802 * @hide 5803 */ 5804 public static final String 5805 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 5806 5807 /** 5808 * Minimum percentage of free storage on the device that is used to 5809 * determine if the device is running low on storage. The default is 10. 5810 * <p> 5811 * Say this value is set to 10, the device is considered running low on 5812 * storage if 90% or more of the device storage is filled up. 5813 * 5814 * @hide 5815 */ 5816 public static final String 5817 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 5818 5819 /** 5820 * Maximum byte size of the low storage threshold. This is to ensure 5821 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 5822 * overly large threshold for large storage devices. Currently this must 5823 * be less than 2GB. This default is 500MB. 5824 * 5825 * @hide 5826 */ 5827 public static final String 5828 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 5829 5830 /** 5831 * Minimum bytes of free storage on the device before the data partition 5832 * is considered full. By default, 1 MB is reserved to avoid system-wide 5833 * SQLite disk full exceptions. 5834 * 5835 * @hide 5836 */ 5837 public static final String 5838 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 5839 5840 /** 5841 * The maximum reconnect delay for short network outages or when the 5842 * network is suspended due to phone use. 5843 * 5844 * @hide 5845 */ 5846 public static final String 5847 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 5848 5849 /** 5850 * The number of milliseconds to delay before sending out 5851 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. 5852 * 5853 * @hide 5854 */ 5855 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 5856 5857 5858 /** 5859 * Network sampling interval, in seconds. We'll generate link information 5860 * about bytes/packets sent and error rates based on data sampled in this interval 5861 * 5862 * @hide 5863 */ 5864 5865 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 5866 "connectivity_sampling_interval_in_seconds"; 5867 5868 /** 5869 * The series of successively longer delays used in retrying to download PAC file. 5870 * Last delay is used between successful PAC downloads. 5871 * 5872 * @hide 5873 */ 5874 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 5875 5876 /** 5877 * Setting to turn off captive portal detection. Feature is enabled by 5878 * default and the setting needs to be set to 0 to disable it. 5879 * 5880 * @hide 5881 */ 5882 public static final String 5883 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 5884 5885 /** 5886 * The server used for captive portal detection upon a new conection. A 5887 * 204 response code from the server is used for validation. 5888 * 5889 * @hide 5890 */ 5891 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 5892 5893 /** 5894 * Whether network service discovery is enabled. 5895 * 5896 * @hide 5897 */ 5898 public static final String NSD_ON = "nsd_on"; 5899 5900 /** 5901 * Let user pick default install location. 5902 * 5903 * @hide 5904 */ 5905 public static final String SET_INSTALL_LOCATION = "set_install_location"; 5906 5907 /** 5908 * Default install location value. 5909 * 0 = auto, let system decide 5910 * 1 = internal 5911 * 2 = sdcard 5912 * @hide 5913 */ 5914 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 5915 5916 /** 5917 * ms during which to consume extra events related to Inet connection 5918 * condition after a transtion to fully-connected 5919 * 5920 * @hide 5921 */ 5922 public static final String 5923 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 5924 5925 /** 5926 * ms during which to consume extra events related to Inet connection 5927 * condtion after a transtion to partly-connected 5928 * 5929 * @hide 5930 */ 5931 public static final String 5932 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 5933 5934 /** {@hide} */ 5935 public static final String 5936 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 5937 5938 /** 5939 * Host name and port for global http proxy. Uses ':' seperator for 5940 * between host and port. 5941 */ 5942 public static final String HTTP_PROXY = "http_proxy"; 5943 5944 /** 5945 * Host name for global http proxy. Set via ConnectivityManager. 5946 * 5947 * @hide 5948 */ 5949 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 5950 5951 /** 5952 * Integer host port for global http proxy. Set via ConnectivityManager. 5953 * 5954 * @hide 5955 */ 5956 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 5957 5958 /** 5959 * Exclusion list for global proxy. This string contains a list of 5960 * comma-separated domains where the global proxy does not apply. 5961 * Domains should be listed in a comma- separated list. Example of 5962 * acceptable formats: ".domain1.com,my.domain2.com" Use 5963 * ConnectivityManager to set/get. 5964 * 5965 * @hide 5966 */ 5967 public static final String 5968 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 5969 5970 /** 5971 * The location PAC File for the proxy. 5972 * @hide 5973 */ 5974 public static final String 5975 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 5976 5977 /** 5978 * Enables the UI setting to allow the user to specify the global HTTP 5979 * proxy and associated exclusion list. 5980 * 5981 * @hide 5982 */ 5983 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 5984 5985 /** 5986 * Setting for default DNS in case nobody suggests one 5987 * 5988 * @hide 5989 */ 5990 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 5991 5992 /** {@hide} */ 5993 public static final String 5994 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 5995 /** {@hide} */ 5996 public static final String 5997 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 5998 /** {@hide} */ 5999 public static final String 6000 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 6001 /** {@hide} */ 6002 public static final String 6003 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 6004 6005 /** 6006 * Get the key that retrieves a bluetooth headset's priority. 6007 * @hide 6008 */ 6009 public static final String getBluetoothHeadsetPriorityKey(String address) { 6010 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 6011 } 6012 6013 /** 6014 * Get the key that retrieves a bluetooth a2dp sink's priority. 6015 * @hide 6016 */ 6017 public static final String getBluetoothA2dpSinkPriorityKey(String address) { 6018 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 6019 } 6020 6021 /** 6022 * Get the key that retrieves a bluetooth Input Device's priority. 6023 * @hide 6024 */ 6025 public static final String getBluetoothInputDevicePriorityKey(String address) { 6026 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 6027 } 6028 6029 /** 6030 * Get the key that retrieves a bluetooth map priority. 6031 * @hide 6032 */ 6033 public static final String getBluetoothMapPriorityKey(String address) { 6034 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 6035 } 6036 /** 6037 * Scaling factor for normal window animations. Setting to 0 will 6038 * disable window animations. 6039 */ 6040 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 6041 6042 /** 6043 * Scaling factor for activity transition animations. Setting to 0 will 6044 * disable window animations. 6045 */ 6046 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 6047 6048 /** 6049 * Scaling factor for Animator-based animations. This affects both the 6050 * start delay and duration of all such animations. Setting to 0 will 6051 * cause animations to end immediately. The default value is 1. 6052 */ 6053 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 6054 6055 /** 6056 * Scaling factor for normal window animations. Setting to 0 will 6057 * disable window animations. 6058 * 6059 * @hide 6060 */ 6061 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 6062 6063 /** 6064 * If 0, the compatibility mode is off for all applications. 6065 * If 1, older applications run under compatibility mode. 6066 * TODO: remove this settings before code freeze (bug/1907571) 6067 * @hide 6068 */ 6069 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 6070 6071 /** 6072 * CDMA only settings 6073 * Emergency Tone 0 = Off 6074 * 1 = Alert 6075 * 2 = Vibrate 6076 * @hide 6077 */ 6078 public static final String EMERGENCY_TONE = "emergency_tone"; 6079 6080 /** 6081 * CDMA only settings 6082 * Whether the auto retry is enabled. The value is 6083 * boolean (1 or 0). 6084 * @hide 6085 */ 6086 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 6087 6088 /** 6089 * The preferred network mode 7 = Global 6090 * 6 = EvDo only 6091 * 5 = CDMA w/o EvDo 6092 * 4 = CDMA / EvDo auto 6093 * 3 = GSM / WCDMA auto 6094 * 2 = WCDMA only 6095 * 1 = GSM only 6096 * 0 = GSM / WCDMA preferred 6097 * @hide 6098 */ 6099 public static final String PREFERRED_NETWORK_MODE = 6100 "preferred_network_mode"; 6101 6102 /** 6103 * Name of an application package to be debugged. 6104 */ 6105 public static final String DEBUG_APP = "debug_app"; 6106 6107 /** 6108 * If 1, when launching DEBUG_APP it will wait for the debugger before 6109 * starting user code. If 0, it will run normally. 6110 */ 6111 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 6112 6113 /** 6114 * Control whether the process CPU usage meter should be shown. 6115 */ 6116 public static final String SHOW_PROCESSES = "show_processes"; 6117 6118 /** 6119 * If 1 low power mode is enabled. 6120 * @hide 6121 */ 6122 public static final String LOW_POWER_MODE = "low_power"; 6123 6124 /** 6125 * Battery level [1-99] at which low power mode automatically turns on. 6126 * If 0, it will not automatically turn on. 6127 * @hide 6128 */ 6129 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 6130 6131 /** 6132 * If 1, the activity manager will aggressively finish activities and 6133 * processes as soon as they are no longer needed. If 0, the normal 6134 * extended lifetime is used. 6135 */ 6136 public static final String ALWAYS_FINISH_ACTIVITIES = 6137 "always_finish_activities"; 6138 6139 /** 6140 * Use Dock audio output for media: 6141 * 0 = disabled 6142 * 1 = enabled 6143 * @hide 6144 */ 6145 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 6146 6147 /** 6148 * Persisted safe headphone volume management state by AudioService 6149 * @hide 6150 */ 6151 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 6152 6153 /** 6154 * URL for tzinfo (time zone) updates 6155 * @hide 6156 */ 6157 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 6158 6159 /** 6160 * URL for tzinfo (time zone) update metadata 6161 * @hide 6162 */ 6163 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 6164 6165 /** 6166 * URL for selinux (mandatory access control) updates 6167 * @hide 6168 */ 6169 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 6170 6171 /** 6172 * URL for selinux (mandatory access control) update metadata 6173 * @hide 6174 */ 6175 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 6176 6177 /** 6178 * URL for sms short code updates 6179 * @hide 6180 */ 6181 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 6182 "sms_short_codes_content_url"; 6183 6184 /** 6185 * URL for sms short code update metadata 6186 * @hide 6187 */ 6188 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 6189 "sms_short_codes_metadata_url"; 6190 6191 /** 6192 * URL for cert pinlist updates 6193 * @hide 6194 */ 6195 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 6196 6197 /** 6198 * URL for cert pinlist updates 6199 * @hide 6200 */ 6201 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 6202 6203 /** 6204 * URL for intent firewall updates 6205 * @hide 6206 */ 6207 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 6208 "intent_firewall_content_url"; 6209 6210 /** 6211 * URL for intent firewall update metadata 6212 * @hide 6213 */ 6214 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 6215 "intent_firewall_metadata_url"; 6216 6217 /** 6218 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 6219 * @hide 6220 */ 6221 public static final String SELINUX_STATUS = "selinux_status"; 6222 6223 /** 6224 * Developer setting to force RTL layout. 6225 * @hide 6226 */ 6227 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 6228 6229 /** 6230 * Milliseconds after screen-off after which low battery sounds will be silenced. 6231 * 6232 * If zero, battery sounds will always play. 6233 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 6234 * 6235 * @hide 6236 */ 6237 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 6238 6239 /** 6240 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 6241 * the caller is done with this, they should call {@link ContentResolver#delete(Uri)} to 6242 * clean up any value that they may have written. 6243 * 6244 * @hide 6245 */ 6246 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 6247 6248 /** 6249 * Defines global runtime overrides to window policy. 6250 * 6251 * See {@link com.android.internal.policy.impl.PolicyControl} for value format. 6252 * 6253 * @hide 6254 */ 6255 public static final String POLICY_CONTROL = "policy_control"; 6256 6257 6258 /** 6259 * This preference enables notification display even over a securely 6260 * locked screen. 6261 * @hide 6262 */ 6263 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 6264 "lock_screen_show_notifications"; 6265 6266 /** 6267 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 6268 * or ZEN_MODE_NO_INTERRUPTIONS. 6269 * 6270 * @hide 6271 */ 6272 public static final String ZEN_MODE = "zen_mode"; 6273 6274 /** @hide */ public static final int ZEN_MODE_OFF = 0; 6275 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 6276 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 6277 6278 /** @hide */ public static String zenModeToString(int mode) { 6279 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 6280 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 6281 return "ZEN_MODE_OFF"; 6282 } 6283 6284 /** 6285 * Opaque value, changes when persisted zen mode configuration changes. 6286 * 6287 * @hide 6288 */ 6289 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 6290 6291 /** 6292 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 6293 * 6294 * @hide 6295 */ 6296 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 6297 "heads_up_notifications_enabled"; 6298 6299 /** @hide */ public static final int HEADS_UP_OFF = 0; 6300 /** @hide */ public static final int HEADS_UP_ON = 1; 6301 6302 /** 6303 * The name of the device 6304 * 6305 * @hide 6306 */ 6307 public static final String DEVICE_NAME = "device_name"; 6308 6309 /** 6310 * Whether it should be possible to create a guest user on the device. 6311 * <p> 6312 * Type: int (0 for disabled, 1 for enabled) 6313 * @hide 6314 */ 6315 public static final String GUEST_USER_ENABLED = "guest_user_enabled"; 6316 6317 /** 6318 * Settings to backup. This is here so that it's in the same place as the settings 6319 * keys and easy to update. 6320 * 6321 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System 6322 * and Secure as well. This is because those tables drive both backup and 6323 * restore, and restore needs to properly whitelist keys that used to live 6324 * in those namespaces. The keys will only actually be backed up / restored 6325 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). 6326 * 6327 * NOTE: Settings are backed up and restored in the order they appear 6328 * in this array. If you have one setting depending on another, 6329 * make sure that they are ordered appropriately. 6330 * 6331 * @hide 6332 */ 6333 public static final String[] SETTINGS_TO_BACKUP = { 6334 BUGREPORT_IN_POWER_MENU, 6335 STAY_ON_WHILE_PLUGGED_IN, 6336 AUTO_TIME, 6337 AUTO_TIME_ZONE, 6338 POWER_SOUNDS_ENABLED, 6339 DOCK_SOUNDS_ENABLED, 6340 USB_MASS_STORAGE_ENABLED, 6341 ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED, 6342 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 6343 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 6344 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 6345 WIFI_NUM_OPEN_NETWORKS_KEPT, 6346 EMERGENCY_TONE, 6347 CALL_AUTO_RETRY, 6348 DOCK_AUDIO_MEDIA_ENABLED 6349 }; 6350 6351 // Populated lazily, guarded by class object: 6352 private static NameValueCache sNameValueCache = new NameValueCache( 6353 SYS_PROP_SETTING_VERSION, 6354 CONTENT_URI, 6355 CALL_METHOD_GET_GLOBAL, 6356 CALL_METHOD_PUT_GLOBAL); 6357 6358 // Certain settings have been moved from global to the per-user secure namespace 6359 private static final HashSet<String> MOVED_TO_SECURE; 6360 static { 6361 MOVED_TO_SECURE = new HashSet<String>(1); 6362 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); 6363 } 6364 6365 /** 6366 * Look up a name in the database. 6367 * @param resolver to access the database with 6368 * @param name to look up in the table 6369 * @return the corresponding value, or null if not present 6370 */ 6371 public static String getString(ContentResolver resolver, String name) { 6372 return getStringForUser(resolver, name, UserHandle.myUserId()); 6373 } 6374 6375 /** @hide */ 6376 public static String getStringForUser(ContentResolver resolver, String name, 6377 int userHandle) { 6378 if (MOVED_TO_SECURE.contains(name)) { 6379 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 6380 + " to android.provider.Settings.Secure, returning read-only value."); 6381 return Secure.getStringForUser(resolver, name, userHandle); 6382 } 6383 return sNameValueCache.getStringForUser(resolver, name, userHandle); 6384 } 6385 6386 /** 6387 * Store a name/value pair into the database. 6388 * @param resolver to access the database with 6389 * @param name to store 6390 * @param value to associate with the name 6391 * @return true if the value was set, false on database errors 6392 */ 6393 public static boolean putString(ContentResolver resolver, 6394 String name, String value) { 6395 return putStringForUser(resolver, name, value, UserHandle.myUserId()); 6396 } 6397 6398 /** @hide */ 6399 public static boolean putStringForUser(ContentResolver resolver, 6400 String name, String value, int userHandle) { 6401 if (LOCAL_LOGV) { 6402 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 6403 + " for " + userHandle); 6404 } 6405 // Global and Secure have the same access policy so we can forward writes 6406 if (MOVED_TO_SECURE.contains(name)) { 6407 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 6408 + " to android.provider.Settings.Secure, value is unchanged."); 6409 return Secure.putStringForUser(resolver, name, value, userHandle); 6410 } 6411 return sNameValueCache.putStringForUser(resolver, name, value, userHandle); 6412 } 6413 6414 /** 6415 * Construct the content URI for a particular name/value pair, 6416 * useful for monitoring changes with a ContentObserver. 6417 * @param name to look up in the table 6418 * @return the corresponding content URI, or null if not present 6419 */ 6420 public static Uri getUriFor(String name) { 6421 return getUriFor(CONTENT_URI, name); 6422 } 6423 6424 /** 6425 * Convenience function for retrieving a single secure settings value 6426 * as an integer. Note that internally setting values are always 6427 * stored as strings; this function converts the string to an integer 6428 * for you. The default value will be returned if the setting is 6429 * not defined or not an integer. 6430 * 6431 * @param cr The ContentResolver to access. 6432 * @param name The name of the setting to retrieve. 6433 * @param def Value to return if the setting is not defined. 6434 * 6435 * @return The setting's current value, or 'def' if it is not defined 6436 * or not a valid integer. 6437 */ 6438 public static int getInt(ContentResolver cr, String name, int def) { 6439 String v = getString(cr, name); 6440 try { 6441 return v != null ? Integer.parseInt(v) : def; 6442 } catch (NumberFormatException e) { 6443 return def; 6444 } 6445 } 6446 6447 /** 6448 * Convenience function for retrieving a single secure settings value 6449 * as an integer. Note that internally setting values are always 6450 * stored as strings; this function converts the string to an integer 6451 * for you. 6452 * <p> 6453 * This version does not take a default value. If the setting has not 6454 * been set, or the string value is not a number, 6455 * it throws {@link SettingNotFoundException}. 6456 * 6457 * @param cr The ContentResolver to access. 6458 * @param name The name of the setting to retrieve. 6459 * 6460 * @throws SettingNotFoundException Thrown if a setting by the given 6461 * name can't be found or the setting value is not an integer. 6462 * 6463 * @return The setting's current value. 6464 */ 6465 public static int getInt(ContentResolver cr, String name) 6466 throws SettingNotFoundException { 6467 String v = getString(cr, name); 6468 try { 6469 return Integer.parseInt(v); 6470 } catch (NumberFormatException e) { 6471 throw new SettingNotFoundException(name); 6472 } 6473 } 6474 6475 /** 6476 * Convenience function for updating a single settings value as an 6477 * integer. This will either create a new entry in the table if the 6478 * given name does not exist, or modify the value of the existing row 6479 * with that name. Note that internally setting values are always 6480 * stored as strings, so this function converts the given value to a 6481 * string before storing it. 6482 * 6483 * @param cr The ContentResolver to access. 6484 * @param name The name of the setting to modify. 6485 * @param value The new value for the setting. 6486 * @return true if the value was set, false on database errors 6487 */ 6488 public static boolean putInt(ContentResolver cr, String name, int value) { 6489 return putString(cr, name, Integer.toString(value)); 6490 } 6491 6492 /** 6493 * Convenience function for retrieving a single secure settings value 6494 * as a {@code long}. Note that internally setting values are always 6495 * stored as strings; this function converts the string to a {@code long} 6496 * for you. The default value will be returned if the setting is 6497 * not defined or not a {@code long}. 6498 * 6499 * @param cr The ContentResolver to access. 6500 * @param name The name of the setting to retrieve. 6501 * @param def Value to return if the setting is not defined. 6502 * 6503 * @return The setting's current value, or 'def' if it is not defined 6504 * or not a valid {@code long}. 6505 */ 6506 public static long getLong(ContentResolver cr, String name, long def) { 6507 String valString = getString(cr, name); 6508 long value; 6509 try { 6510 value = valString != null ? Long.parseLong(valString) : def; 6511 } catch (NumberFormatException e) { 6512 value = def; 6513 } 6514 return value; 6515 } 6516 6517 /** 6518 * Convenience function for retrieving a single secure settings value 6519 * as a {@code long}. Note that internally setting values are always 6520 * stored as strings; this function converts the string to a {@code long} 6521 * for you. 6522 * <p> 6523 * This version does not take a default value. If the setting has not 6524 * been set, or the string value is not a number, 6525 * it throws {@link SettingNotFoundException}. 6526 * 6527 * @param cr The ContentResolver to access. 6528 * @param name The name of the setting to retrieve. 6529 * 6530 * @return The setting's current value. 6531 * @throws SettingNotFoundException Thrown if a setting by the given 6532 * name can't be found or the setting value is not an integer. 6533 */ 6534 public static long getLong(ContentResolver cr, String name) 6535 throws SettingNotFoundException { 6536 String valString = getString(cr, name); 6537 try { 6538 return Long.parseLong(valString); 6539 } catch (NumberFormatException e) { 6540 throw new SettingNotFoundException(name); 6541 } 6542 } 6543 6544 /** 6545 * Convenience function for updating a secure settings value as a long 6546 * integer. This will either create a new entry in the table if the 6547 * given name does not exist, or modify the value of the existing row 6548 * with that name. Note that internally setting values are always 6549 * stored as strings, so this function converts the given value to a 6550 * string before storing it. 6551 * 6552 * @param cr The ContentResolver to access. 6553 * @param name The name of the setting to modify. 6554 * @param value The new value for the setting. 6555 * @return true if the value was set, false on database errors 6556 */ 6557 public static boolean putLong(ContentResolver cr, String name, long value) { 6558 return putString(cr, name, Long.toString(value)); 6559 } 6560 6561 /** 6562 * Convenience function for retrieving a single secure settings value 6563 * as a floating point number. Note that internally setting values are 6564 * always stored as strings; this function converts the string to an 6565 * float for you. The default value will be returned if the setting 6566 * is not defined or not a valid float. 6567 * 6568 * @param cr The ContentResolver to access. 6569 * @param name The name of the setting to retrieve. 6570 * @param def Value to return if the setting is not defined. 6571 * 6572 * @return The setting's current value, or 'def' if it is not defined 6573 * or not a valid float. 6574 */ 6575 public static float getFloat(ContentResolver cr, String name, float def) { 6576 String v = getString(cr, name); 6577 try { 6578 return v != null ? Float.parseFloat(v) : def; 6579 } catch (NumberFormatException e) { 6580 return def; 6581 } 6582 } 6583 6584 /** 6585 * Convenience function for retrieving a single secure settings value 6586 * as a float. Note that internally setting values are always 6587 * stored as strings; this function converts the string to a float 6588 * for you. 6589 * <p> 6590 * This version does not take a default value. If the setting has not 6591 * been set, or the string value is not a number, 6592 * it throws {@link SettingNotFoundException}. 6593 * 6594 * @param cr The ContentResolver to access. 6595 * @param name The name of the setting to retrieve. 6596 * 6597 * @throws SettingNotFoundException Thrown if a setting by the given 6598 * name can't be found or the setting value is not a float. 6599 * 6600 * @return The setting's current value. 6601 */ 6602 public static float getFloat(ContentResolver cr, String name) 6603 throws SettingNotFoundException { 6604 String v = getString(cr, name); 6605 if (v == null) { 6606 throw new SettingNotFoundException(name); 6607 } 6608 try { 6609 return Float.parseFloat(v); 6610 } catch (NumberFormatException e) { 6611 throw new SettingNotFoundException(name); 6612 } 6613 } 6614 6615 /** 6616 * Convenience function for updating a single settings value as a 6617 * floating point number. This will either create a new entry in the 6618 * table if the given name does not exist, or modify the value of the 6619 * existing row with that name. Note that internally setting values 6620 * are always stored as strings, so this function converts the given 6621 * value to a string before storing it. 6622 * 6623 * @param cr The ContentResolver to access. 6624 * @param name The name of the setting to modify. 6625 * @param value The new value for the setting. 6626 * @return true if the value was set, false on database errors 6627 */ 6628 public static boolean putFloat(ContentResolver cr, String name, float value) { 6629 return putString(cr, name, Float.toString(value)); 6630 } 6631 6632 6633 /** 6634 * Subscription to be used for voice call on a multi sim device. The supported values 6635 * are 0 = SUB1, 1 = SUB2 and etc. 6636 * @hide 6637 */ 6638 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 6639 6640 /** 6641 * Used to provide option to user to select subscription during dial. 6642 * The supported values are 0 = disable or 1 = enable prompt. 6643 * @hide 6644 */ 6645 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 6646 6647 /** 6648 * Subscription to be used for data call on a multi sim device. The supported values 6649 * are 0 = SUB1, 1 = SUB2 and etc. 6650 * @hide 6651 */ 6652 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 6653 6654 /** 6655 * Subscription to be used for SMS on a multi sim device. The supported values 6656 * are 0 = SUB1, 1 = SUB2 and etc. 6657 * @hide 6658 */ 6659 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 6660 6661 /** 6662 * Used to provide option to user to select subscription during send SMS. 6663 * The value 1 - enable, 0 - disable 6664 * @hide 6665 */ 6666 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 6667 6668 6669 6670 /** User preferred subscriptions setting. 6671 * This holds the details of the user selected subscription from the card and 6672 * the activation status. Each settings string have the coma separated values 6673 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 6674 * @hide 6675 */ 6676 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 6677 "user_preferred_sub2","user_preferred_sub3"}; 6678 } 6679 6680 /** 6681 * User-defined bookmarks and shortcuts. The target of each bookmark is an 6682 * Intent URL, allowing it to be either a web page or a particular 6683 * application activity. 6684 * 6685 * @hide 6686 */ 6687 public static final class Bookmarks implements BaseColumns 6688 { 6689 private static final String TAG = "Bookmarks"; 6690 6691 /** 6692 * The content:// style URL for this table 6693 */ 6694 public static final Uri CONTENT_URI = 6695 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 6696 6697 /** 6698 * The row ID. 6699 * <p>Type: INTEGER</p> 6700 */ 6701 public static final String ID = "_id"; 6702 6703 /** 6704 * Descriptive name of the bookmark that can be displayed to the user. 6705 * If this is empty, the title should be resolved at display time (use 6706 * {@link #getTitle(Context, Cursor)} any time you want to display the 6707 * title of a bookmark.) 6708 * <P> 6709 * Type: TEXT 6710 * </P> 6711 */ 6712 public static final String TITLE = "title"; 6713 6714 /** 6715 * Arbitrary string (displayed to the user) that allows bookmarks to be 6716 * organized into categories. There are some special names for 6717 * standard folders, which all start with '@'. The label displayed for 6718 * the folder changes with the locale (via {@link #getLabelForFolder}) but 6719 * the folder name does not change so you can consistently query for 6720 * the folder regardless of the current locale. 6721 * 6722 * <P>Type: TEXT</P> 6723 * 6724 */ 6725 public static final String FOLDER = "folder"; 6726 6727 /** 6728 * The Intent URL of the bookmark, describing what it points to. This 6729 * value is given to {@link android.content.Intent#getIntent} to create 6730 * an Intent that can be launched. 6731 * <P>Type: TEXT</P> 6732 */ 6733 public static final String INTENT = "intent"; 6734 6735 /** 6736 * Optional shortcut character associated with this bookmark. 6737 * <P>Type: INTEGER</P> 6738 */ 6739 public static final String SHORTCUT = "shortcut"; 6740 6741 /** 6742 * The order in which the bookmark should be displayed 6743 * <P>Type: INTEGER</P> 6744 */ 6745 public static final String ORDERING = "ordering"; 6746 6747 private static final String[] sIntentProjection = { INTENT }; 6748 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 6749 private static final String sShortcutSelection = SHORTCUT + "=?"; 6750 6751 /** 6752 * Convenience function to retrieve the bookmarked Intent for a 6753 * particular shortcut key. 6754 * 6755 * @param cr The ContentResolver to query. 6756 * @param shortcut The shortcut key. 6757 * 6758 * @return Intent The bookmarked URL, or null if there is no bookmark 6759 * matching the given shortcut. 6760 */ 6761 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 6762 { 6763 Intent intent = null; 6764 6765 Cursor c = cr.query(CONTENT_URI, 6766 sIntentProjection, sShortcutSelection, 6767 new String[] { String.valueOf((int) shortcut) }, ORDERING); 6768 // Keep trying until we find a valid shortcut 6769 try { 6770 while (intent == null && c.moveToNext()) { 6771 try { 6772 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 6773 intent = Intent.parseUri(intentURI, 0); 6774 } catch (java.net.URISyntaxException e) { 6775 // The stored URL is bad... ignore it. 6776 } catch (IllegalArgumentException e) { 6777 // Column not found 6778 Log.w(TAG, "Intent column not found", e); 6779 } 6780 } 6781 } finally { 6782 if (c != null) c.close(); 6783 } 6784 6785 return intent; 6786 } 6787 6788 /** 6789 * Add a new bookmark to the system. 6790 * 6791 * @param cr The ContentResolver to query. 6792 * @param intent The desired target of the bookmark. 6793 * @param title Bookmark title that is shown to the user; null if none 6794 * or it should be resolved to the intent's title. 6795 * @param folder Folder in which to place the bookmark; null if none. 6796 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 6797 * this is non-zero and there is an existing bookmark entry 6798 * with this same shortcut, then that existing shortcut is 6799 * cleared (the bookmark is not removed). 6800 * @return The unique content URL for the new bookmark entry. 6801 */ 6802 public static Uri add(ContentResolver cr, 6803 Intent intent, 6804 String title, 6805 String folder, 6806 char shortcut, 6807 int ordering) 6808 { 6809 // If a shortcut is supplied, and it is already defined for 6810 // another bookmark, then remove the old definition. 6811 if (shortcut != 0) { 6812 cr.delete(CONTENT_URI, sShortcutSelection, 6813 new String[] { String.valueOf((int) shortcut) }); 6814 } 6815 6816 ContentValues values = new ContentValues(); 6817 if (title != null) values.put(TITLE, title); 6818 if (folder != null) values.put(FOLDER, folder); 6819 values.put(INTENT, intent.toUri(0)); 6820 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 6821 values.put(ORDERING, ordering); 6822 return cr.insert(CONTENT_URI, values); 6823 } 6824 6825 /** 6826 * Return the folder name as it should be displayed to the user. This 6827 * takes care of localizing special folders. 6828 * 6829 * @param r Resources object for current locale; only need access to 6830 * system resources. 6831 * @param folder The value found in the {@link #FOLDER} column. 6832 * 6833 * @return CharSequence The label for this folder that should be shown 6834 * to the user. 6835 */ 6836 public static CharSequence getLabelForFolder(Resources r, String folder) { 6837 return folder; 6838 } 6839 6840 /** 6841 * Return the title as it should be displayed to the user. This takes 6842 * care of localizing bookmarks that point to activities. 6843 * 6844 * @param context A context. 6845 * @param cursor A cursor pointing to the row whose title should be 6846 * returned. The cursor must contain at least the {@link #TITLE} 6847 * and {@link #INTENT} columns. 6848 * @return A title that is localized and can be displayed to the user, 6849 * or the empty string if one could not be found. 6850 */ 6851 public static CharSequence getTitle(Context context, Cursor cursor) { 6852 int titleColumn = cursor.getColumnIndex(TITLE); 6853 int intentColumn = cursor.getColumnIndex(INTENT); 6854 if (titleColumn == -1 || intentColumn == -1) { 6855 throw new IllegalArgumentException( 6856 "The cursor must contain the TITLE and INTENT columns."); 6857 } 6858 6859 String title = cursor.getString(titleColumn); 6860 if (!TextUtils.isEmpty(title)) { 6861 return title; 6862 } 6863 6864 String intentUri = cursor.getString(intentColumn); 6865 if (TextUtils.isEmpty(intentUri)) { 6866 return ""; 6867 } 6868 6869 Intent intent; 6870 try { 6871 intent = Intent.parseUri(intentUri, 0); 6872 } catch (URISyntaxException e) { 6873 return ""; 6874 } 6875 6876 PackageManager packageManager = context.getPackageManager(); 6877 ResolveInfo info = packageManager.resolveActivity(intent, 0); 6878 return info != null ? info.loadLabel(packageManager) : ""; 6879 } 6880 } 6881 6882 /** 6883 * Returns the device ID that we should use when connecting to the mobile gtalk server. 6884 * This is a string like "android-0x1242", where the hex string is the Android ID obtained 6885 * from the GoogleLoginService. 6886 * 6887 * @param androidId The Android ID for this device. 6888 * @return The device ID that should be used when connecting to the mobile gtalk server. 6889 * @hide 6890 */ 6891 public static String getGTalkDeviceId(long androidId) { 6892 return "android-" + Long.toHexString(androidId); 6893 } 6894} 6895