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