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