Settings.java revision 925a7d8f062c2ef275ccb7579889d6f83d0d378e
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.RemoteException; 40import android.os.SystemProperties; 41import android.speech.tts.TextToSpeech; 42import android.text.TextUtils; 43import android.util.AndroidException; 44import android.util.Log; 45import android.view.WindowOrientationListener; 46 47import java.net.URISyntaxException; 48import java.util.HashMap; 49import java.util.HashSet; 50 51/** 52 * The Settings provider contains global system-level device preferences. 53 */ 54public final class Settings { 55 56 // Intent actions for Settings 57 58 /** 59 * Activity Action: Show system settings. 60 * <p> 61 * Input: Nothing. 62 * <p> 63 * Output: Nothing. 64 */ 65 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 66 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 67 68 /** 69 * Activity Action: Show settings to allow configuration of APNs. 70 * <p> 71 * Input: Nothing. 72 * <p> 73 * Output: Nothing. 74 */ 75 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 76 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 77 78 /** 79 * Activity Action: Show settings to allow configuration of current location 80 * sources. 81 * <p> 82 * In some cases, a matching Activity may not exist, so ensure you 83 * safeguard against this. 84 * <p> 85 * Input: Nothing. 86 * <p> 87 * Output: Nothing. 88 */ 89 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 90 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 91 "android.settings.LOCATION_SOURCE_SETTINGS"; 92 93 /** 94 * Activity Action: Show settings to allow configuration of wireless controls 95 * such as Wi-Fi, Bluetooth and Mobile networks. 96 * <p> 97 * In some cases, a matching Activity may not exist, so ensure you 98 * safeguard against this. 99 * <p> 100 * Input: Nothing. 101 * <p> 102 * Output: Nothing. 103 */ 104 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 105 public static final String ACTION_WIRELESS_SETTINGS = 106 "android.settings.WIRELESS_SETTINGS"; 107 108 /** 109 * Activity Action: Show settings to allow entering/exiting airplane mode. 110 * <p> 111 * In some cases, a matching Activity may not exist, so ensure you 112 * safeguard against this. 113 * <p> 114 * Input: Nothing. 115 * <p> 116 * Output: Nothing. 117 */ 118 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 119 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 120 "android.settings.AIRPLANE_MODE_SETTINGS"; 121 122 /** 123 * Activity Action: Show settings for accessibility modules. 124 * <p> 125 * In some cases, a matching Activity may not exist, so ensure you 126 * safeguard against this. 127 * <p> 128 * Input: Nothing. 129 * <p> 130 * Output: Nothing. 131 */ 132 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 133 public static final String ACTION_ACCESSIBILITY_SETTINGS = 134 "android.settings.ACCESSIBILITY_SETTINGS"; 135 136 /** 137 * Activity Action: Show settings to allow configuration of security and 138 * location privacy. 139 * <p> 140 * In some cases, a matching Activity may not exist, so ensure you 141 * safeguard against this. 142 * <p> 143 * Input: Nothing. 144 * <p> 145 * Output: Nothing. 146 */ 147 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 148 public static final String ACTION_SECURITY_SETTINGS = 149 "android.settings.SECURITY_SETTINGS"; 150 151 /** 152 * Activity Action: Show settings to allow configuration of privacy options. 153 * <p> 154 * In some cases, a matching Activity may not exist, so ensure you 155 * safeguard against this. 156 * <p> 157 * Input: Nothing. 158 * <p> 159 * Output: Nothing. 160 */ 161 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 162 public static final String ACTION_PRIVACY_SETTINGS = 163 "android.settings.PRIVACY_SETTINGS"; 164 165 /** 166 * Activity Action: Show settings to allow configuration of Wi-Fi. 167 168 * <p> 169 * In some cases, a matching Activity may not exist, so ensure you 170 * safeguard against this. 171 * <p> 172 * Input: Nothing. 173 * <p> 174 * Output: Nothing. 175 176 */ 177 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 178 public static final String ACTION_WIFI_SETTINGS = 179 "android.settings.WIFI_SETTINGS"; 180 181 /** 182 * Activity Action: Show settings to allow configuration of a static IP 183 * address for Wi-Fi. 184 * <p> 185 * In some cases, a matching Activity may not exist, so ensure you safeguard 186 * against this. 187 * <p> 188 * Input: Nothing. 189 * <p> 190 * Output: Nothing. 191 */ 192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 193 public static final String ACTION_WIFI_IP_SETTINGS = 194 "android.settings.WIFI_IP_SETTINGS"; 195 196 /** 197 * Activity Action: Show settings to allow configuration of Bluetooth. 198 * <p> 199 * In some cases, a matching Activity may not exist, so ensure you 200 * safeguard against this. 201 * <p> 202 * Input: Nothing. 203 * <p> 204 * Output: Nothing. 205 */ 206 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 207 public static final String ACTION_BLUETOOTH_SETTINGS = 208 "android.settings.BLUETOOTH_SETTINGS"; 209 210 /** 211 * Activity Action: Show settings to allow configuration of date and time. 212 * <p> 213 * In some cases, a matching Activity may not exist, so ensure you 214 * safeguard against this. 215 * <p> 216 * Input: Nothing. 217 * <p> 218 * Output: Nothing. 219 */ 220 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 221 public static final String ACTION_DATE_SETTINGS = 222 "android.settings.DATE_SETTINGS"; 223 224 /** 225 * Activity Action: Show settings to allow configuration of sound and volume. 226 * <p> 227 * In some cases, a matching Activity may not exist, so ensure you 228 * safeguard against this. 229 * <p> 230 * Input: Nothing. 231 * <p> 232 * Output: Nothing. 233 */ 234 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 235 public static final String ACTION_SOUND_SETTINGS = 236 "android.settings.SOUND_SETTINGS"; 237 238 /** 239 * Activity Action: Show settings to allow configuration of display. 240 * <p> 241 * In some cases, a matching Activity may not exist, so ensure you 242 * safeguard against this. 243 * <p> 244 * Input: Nothing. 245 * <p> 246 * Output: Nothing. 247 */ 248 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 249 public static final String ACTION_DISPLAY_SETTINGS = 250 "android.settings.DISPLAY_SETTINGS"; 251 252 /** 253 * Activity Action: Show settings to allow configuration of locale. 254 * <p> 255 * In some cases, a matching Activity may not exist, so ensure you 256 * safeguard against this. 257 * <p> 258 * Input: Nothing. 259 * <p> 260 * Output: Nothing. 261 */ 262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 263 public static final String ACTION_LOCALE_SETTINGS = 264 "android.settings.LOCALE_SETTINGS"; 265 266 /** 267 * Activity Action: Show settings to configure input methods, in particular 268 * allowing the user to enable input methods. 269 * <p> 270 * In some cases, a matching Activity may not exist, so ensure you 271 * safeguard against this. 272 * <p> 273 * Input: Nothing. 274 * <p> 275 * Output: Nothing. 276 */ 277 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 278 public static final String ACTION_INPUT_METHOD_SETTINGS = 279 "android.settings.INPUT_METHOD_SETTINGS"; 280 281 /** 282 * Activity Action: Show settings to enable/disable input method subtypes. 283 * <p> 284 * In some cases, a matching Activity may not exist, so ensure you 285 * safeguard against this. 286 * <p> 287 * To tell which input method's subtypes are displayed in the settings, add 288 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 289 * If there is no extra in this Intent, subtypes from all installed input methods 290 * will be displayed in the settings. 291 * 292 * @see android.view.inputmethod.InputMethodInfo#getId 293 * <p> 294 * Input: Nothing. 295 * <p> 296 * Output: Nothing. 297 */ 298 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 299 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 300 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 301 302 /** 303 * Activity Action: Show a dialog to select input method. 304 * <p> 305 * In some cases, a matching Activity may not exist, so ensure you 306 * safeguard against this. 307 * <p> 308 * Input: Nothing. 309 * <p> 310 * Output: Nothing. 311 * @hide 312 */ 313 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 314 public static final String ACTION_SHOW_INPUT_METHOD_PICKER = 315 "android.settings.SHOW_INPUT_METHOD_PICKER"; 316 317 /** 318 * Activity Action: Show settings to manage the user input dictionary. 319 * <p> 320 * In some cases, a matching Activity may not exist, so ensure you 321 * safeguard against this. 322 * <p> 323 * Input: Nothing. 324 * <p> 325 * Output: Nothing. 326 */ 327 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 328 public static final String ACTION_USER_DICTIONARY_SETTINGS = 329 "android.settings.USER_DICTIONARY_SETTINGS"; 330 331 /** 332 * Activity Action: Adds a word to the user dictionary. 333 * <p> 334 * In some cases, a matching Activity may not exist, so ensure you 335 * safeguard against this. 336 * <p> 337 * Input: An extra with key <code>word</code> that contains the word 338 * that should be added to the dictionary. 339 * <p> 340 * Output: Nothing. 341 * 342 * @hide 343 */ 344 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 345 public static final String ACTION_USER_DICTIONARY_INSERT = 346 "com.android.settings.USER_DICTIONARY_INSERT"; 347 348 /** 349 * Activity Action: Show settings to allow configuration of application-related settings. 350 * <p> 351 * In some cases, a matching Activity may not exist, so ensure you 352 * safeguard against this. 353 * <p> 354 * Input: Nothing. 355 * <p> 356 * Output: Nothing. 357 */ 358 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 359 public static final String ACTION_APPLICATION_SETTINGS = 360 "android.settings.APPLICATION_SETTINGS"; 361 362 /** 363 * Activity Action: Show settings to allow configuration of application 364 * development-related settings. 365 * <p> 366 * In some cases, a matching Activity may not exist, so ensure you safeguard 367 * against this. 368 * <p> 369 * Input: Nothing. 370 * <p> 371 * Output: Nothing. 372 */ 373 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 374 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 375 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 376 377 /** 378 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 379 * <p> 380 * In some cases, a matching Activity may not exist, so ensure you 381 * safeguard against this. 382 * <p> 383 * Input: Nothing. 384 * <p> 385 * Output: Nothing. 386 */ 387 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 388 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 389 "android.settings.QUICK_LAUNCH_SETTINGS"; 390 391 /** 392 * Activity Action: Show settings to manage installed applications. 393 * <p> 394 * In some cases, a matching Activity may not exist, so ensure you 395 * safeguard against this. 396 * <p> 397 * Input: Nothing. 398 * <p> 399 * Output: Nothing. 400 */ 401 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 402 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 403 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 404 405 /** 406 * Activity Action: Show settings to manage all applications. 407 * <p> 408 * In some cases, a matching Activity may not exist, so ensure you 409 * safeguard against this. 410 * <p> 411 * Input: Nothing. 412 * <p> 413 * Output: Nothing. 414 */ 415 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 416 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 417 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 418 419 /** 420 * Activity Action: Show screen of details about a particular application. 421 * <p> 422 * In some cases, a matching Activity may not exist, so ensure you 423 * safeguard against this. 424 * <p> 425 * Input: The Intent's data URI specifies the application package name 426 * to be shown, with the "package" scheme. That is "package:com.my.app". 427 * <p> 428 * Output: Nothing. 429 */ 430 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 431 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 432 "android.settings.APPLICATION_DETAILS_SETTINGS"; 433 434 /** 435 * Activity Action: Show settings for system update functionality. 436 * <p> 437 * In some cases, a matching Activity may not exist, so ensure you 438 * safeguard against this. 439 * <p> 440 * Input: Nothing. 441 * <p> 442 * Output: Nothing. 443 * 444 * @hide 445 */ 446 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 447 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 448 "android.settings.SYSTEM_UPDATE_SETTINGS"; 449 450 /** 451 * Activity Action: Show settings to allow configuration of sync settings. 452 * <p> 453 * In some cases, a matching Activity may not exist, so ensure you 454 * safeguard against this. 455 * <p> 456 * The account types available to add via the add account button may be restricted by adding an 457 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 458 * authorities. Only account types which can sync with that content provider will be offered to 459 * the user. 460 * <p> 461 * Input: Nothing. 462 * <p> 463 * Output: Nothing. 464 */ 465 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 466 public static final String ACTION_SYNC_SETTINGS = 467 "android.settings.SYNC_SETTINGS"; 468 469 /** 470 * Activity Action: Show add account screen for creating a new account. 471 * <p> 472 * In some cases, a matching Activity may not exist, so ensure you 473 * safeguard against this. 474 * <p> 475 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 476 * extra to the Intent with one or more syncable content provider's authorities. Only account 477 * types which can sync with that content provider will be offered to the user. 478 * <p> 479 * Input: Nothing. 480 * <p> 481 * Output: Nothing. 482 */ 483 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 484 public static final String ACTION_ADD_ACCOUNT = 485 "android.settings.ADD_ACCOUNT_SETTINGS"; 486 487 /** 488 * Activity Action: Show settings for selecting the network operator. 489 * <p> 490 * In some cases, a matching Activity may not exist, so ensure you 491 * safeguard against this. 492 * <p> 493 * Input: Nothing. 494 * <p> 495 * Output: Nothing. 496 */ 497 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 498 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 499 "android.settings.NETWORK_OPERATOR_SETTINGS"; 500 501 /** 502 * Activity Action: Show settings for selection of 2G/3G. 503 * <p> 504 * In some cases, a matching Activity may not exist, so ensure you 505 * safeguard against this. 506 * <p> 507 * Input: Nothing. 508 * <p> 509 * Output: Nothing. 510 */ 511 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 512 public static final String ACTION_DATA_ROAMING_SETTINGS = 513 "android.settings.DATA_ROAMING_SETTINGS"; 514 515 /** 516 * Activity Action: Show settings for internal storage. 517 * <p> 518 * In some cases, a matching Activity may not exist, so ensure you 519 * safeguard against this. 520 * <p> 521 * Input: Nothing. 522 * <p> 523 * Output: Nothing. 524 */ 525 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 526 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 527 "android.settings.INTERNAL_STORAGE_SETTINGS"; 528 /** 529 * Activity Action: Show settings for memory card storage. 530 * <p> 531 * In some cases, a matching Activity may not exist, so ensure you 532 * safeguard against this. 533 * <p> 534 * Input: Nothing. 535 * <p> 536 * Output: Nothing. 537 */ 538 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 539 public static final String ACTION_MEMORY_CARD_SETTINGS = 540 "android.settings.MEMORY_CARD_SETTINGS"; 541 542 /** 543 * Activity Action: Show settings for global search. 544 * <p> 545 * In some cases, a matching Activity may not exist, so ensure you 546 * safeguard against this. 547 * <p> 548 * Input: Nothing. 549 * <p> 550 * Output: Nothing 551 */ 552 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 553 public static final String ACTION_SEARCH_SETTINGS = 554 "android.search.action.SEARCH_SETTINGS"; 555 556 /** 557 * Activity Action: Show general device information settings (serial 558 * number, software version, phone number, etc.). 559 * <p> 560 * In some cases, a matching Activity may not exist, so ensure you 561 * safeguard against this. 562 * <p> 563 * Input: Nothing. 564 * <p> 565 * Output: Nothing 566 */ 567 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 568 public static final String ACTION_DEVICE_INFO_SETTINGS = 569 "android.settings.DEVICE_INFO_SETTINGS"; 570 571 /** 572 * Activity Action: Show NFC settings. 573 * <p> 574 * This shows UI that allows NFC to be turned on or off. 575 * <p> 576 * In some cases, a matching Activity may not exist, so ensure you 577 * safeguard against this. 578 * <p> 579 * Input: Nothing. 580 * <p> 581 * Output: Nothing 582 * @see android.nfc.NfcAdapter#isEnabled() 583 */ 584 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 585 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 586 587 /** 588 * Activity Action: Show NFC Sharing settings. 589 * <p> 590 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 591 * off. 592 * <p> 593 * In some cases, a matching Activity may not exist, so ensure you 594 * safeguard against this. 595 * <p> 596 * Input: Nothing. 597 * <p> 598 * Output: Nothing 599 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 600 */ 601 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 602 public static final String ACTION_NFCSHARING_SETTINGS = 603 "android.settings.NFCSHARING_SETTINGS"; 604 605 // End of Intent actions for Settings 606 607 /** 608 * @hide - Private call() method on SettingsProvider to read from 'system' table. 609 */ 610 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 611 612 /** 613 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 614 */ 615 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 616 617 /** 618 * Activity Extra: Limit available options in launched activity based on the given authority. 619 * <p> 620 * This can be passed as an extra field in an Activity Intent with one or more syncable content 621 * provider's authorities as a String[]. This field is used by some intents to alter the 622 * behavior of the called activity. 623 * <p> 624 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 625 * on the authority given. 626 */ 627 public static final String EXTRA_AUTHORITIES = 628 "authorities"; 629 630 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 631 632 private static final String JID_RESOURCE_PREFIX = "android"; 633 634 public static final String AUTHORITY = "settings"; 635 636 private static final String TAG = "Settings"; 637 private static final boolean LOCAL_LOGV = false || false; 638 639 public static class SettingNotFoundException extends AndroidException { 640 public SettingNotFoundException(String msg) { 641 super(msg); 642 } 643 } 644 645 /** 646 * Common base for tables of name/value settings. 647 */ 648 public static class NameValueTable implements BaseColumns { 649 public static final String NAME = "name"; 650 public static final String VALUE = "value"; 651 652 protected static boolean putString(ContentResolver resolver, Uri uri, 653 String name, String value) { 654 // The database will take care of replacing duplicates. 655 try { 656 ContentValues values = new ContentValues(); 657 values.put(NAME, name); 658 values.put(VALUE, value); 659 resolver.insert(uri, values); 660 return true; 661 } catch (SQLException e) { 662 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 663 return false; 664 } 665 } 666 667 public static Uri getUriFor(Uri uri, String name) { 668 return Uri.withAppendedPath(uri, name); 669 } 670 } 671 672 // Thread-safe. 673 private static class NameValueCache { 674 private final String mVersionSystemProperty; 675 private final Uri mUri; 676 677 private static final String[] SELECT_VALUE = 678 new String[] { Settings.NameValueTable.VALUE }; 679 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 680 681 // Must synchronize on 'this' to access mValues and mValuesVersion. 682 private final HashMap<String, String> mValues = new HashMap<String, String>(); 683 private long mValuesVersion = 0; 684 685 // Initially null; set lazily and held forever. Synchronized on 'this'. 686 private IContentProvider mContentProvider = null; 687 688 // The method we'll call (or null, to not use) on the provider 689 // for the fast path of retrieving settings. 690 private final String mCallCommand; 691 692 public NameValueCache(String versionSystemProperty, Uri uri, String callCommand) { 693 mVersionSystemProperty = versionSystemProperty; 694 mUri = uri; 695 mCallCommand = callCommand; 696 } 697 698 public String getString(ContentResolver cr, String name) { 699 long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0); 700 701 synchronized (this) { 702 if (mValuesVersion != newValuesVersion) { 703 if (LOCAL_LOGV) { 704 Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current " + 705 newValuesVersion + " != cached " + mValuesVersion); 706 } 707 708 mValues.clear(); 709 mValuesVersion = newValuesVersion; 710 } 711 712 if (mValues.containsKey(name)) { 713 return mValues.get(name); // Could be null, that's OK -- negative caching 714 } 715 } 716 717 IContentProvider cp = null; 718 synchronized (this) { 719 cp = mContentProvider; 720 if (cp == null) { 721 cp = mContentProvider = cr.acquireProvider(mUri.getAuthority()); 722 } 723 } 724 725 // Try the fast path first, not using query(). If this 726 // fails (alternate Settings provider that doesn't support 727 // this interface?) then we fall back to the query/table 728 // interface. 729 if (mCallCommand != null) { 730 try { 731 Bundle b = cp.call(mCallCommand, name, null); 732 if (b != null) { 733 String value = b.getPairValue(); 734 synchronized (this) { 735 mValues.put(name, value); 736 } 737 return value; 738 } 739 // If the response Bundle is null, we fall through 740 // to the query interface below. 741 } catch (RemoteException e) { 742 // Not supported by the remote side? Fall through 743 // to query(). 744 } 745 } 746 747 Cursor c = null; 748 try { 749 c = cp.query(mUri, SELECT_VALUE, NAME_EQ_PLACEHOLDER, 750 new String[]{name}, null, null); 751 if (c == null) { 752 Log.w(TAG, "Can't get key " + name + " from " + mUri); 753 return null; 754 } 755 756 String value = c.moveToNext() ? c.getString(0) : null; 757 synchronized (this) { 758 mValues.put(name, value); 759 } 760 if (LOCAL_LOGV) { 761 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 762 name + " = " + (value == null ? "(null)" : value)); 763 } 764 return value; 765 } catch (RemoteException e) { 766 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 767 return null; // Return null, but don't cache it. 768 } finally { 769 if (c != null) c.close(); 770 } 771 } 772 } 773 774 /** 775 * System settings, containing miscellaneous system preferences. This 776 * table holds simple name/value pairs. There are convenience 777 * functions for accessing individual settings entries. 778 */ 779 public static final class System extends NameValueTable { 780 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; 781 782 // Populated lazily, guarded by class object: 783 private static NameValueCache sNameValueCache = null; 784 785 private static final HashSet<String> MOVED_TO_SECURE; 786 static { 787 MOVED_TO_SECURE = new HashSet<String>(30); 788 MOVED_TO_SECURE.add(Secure.ADB_ENABLED); 789 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 790 MOVED_TO_SECURE.add(Secure.BLUETOOTH_ON); 791 MOVED_TO_SECURE.add(Secure.DATA_ROAMING); 792 MOVED_TO_SECURE.add(Secure.DEVICE_PROVISIONED); 793 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 794 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 795 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 796 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 797 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 798 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 799 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 800 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 801 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 802 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 803 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 804 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 805 MOVED_TO_SECURE.add(Secure.USB_MASS_STORAGE_ENABLED); 806 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 807 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 808 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 809 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 810 MOVED_TO_SECURE.add(Secure.WIFI_ON); 811 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 812 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 813 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 814 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 815 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 816 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 817 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 818 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 819 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 820 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 821 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 822 } 823 824 /** 825 * Look up a name in the database. 826 * @param resolver to access the database with 827 * @param name to look up in the table 828 * @return the corresponding value, or null if not present 829 */ 830 public synchronized static String getString(ContentResolver resolver, String name) { 831 if (MOVED_TO_SECURE.contains(name)) { 832 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 833 + " to android.provider.Settings.Secure, returning read-only value."); 834 return Secure.getString(resolver, name); 835 } 836 if (sNameValueCache == null) { 837 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI, 838 CALL_METHOD_GET_SYSTEM); 839 } 840 return sNameValueCache.getString(resolver, name); 841 } 842 843 /** 844 * Store a name/value pair into the database. 845 * @param resolver to access the database with 846 * @param name to store 847 * @param value to associate with the name 848 * @return true if the value was set, false on database errors 849 */ 850 public static boolean putString(ContentResolver resolver, String name, String value) { 851 if (MOVED_TO_SECURE.contains(name)) { 852 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 853 + " to android.provider.Settings.Secure, value is unchanged."); 854 return false; 855 } 856 return putString(resolver, CONTENT_URI, name, value); 857 } 858 859 /** 860 * Construct the content URI for a particular name/value pair, 861 * useful for monitoring changes with a ContentObserver. 862 * @param name to look up in the table 863 * @return the corresponding content URI, or null if not present 864 */ 865 public static Uri getUriFor(String name) { 866 if (MOVED_TO_SECURE.contains(name)) { 867 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 868 + " to android.provider.Settings.Secure, returning Secure URI."); 869 return Secure.getUriFor(Secure.CONTENT_URI, name); 870 } 871 return getUriFor(CONTENT_URI, name); 872 } 873 874 /** 875 * Convenience function for retrieving a single system settings value 876 * as an integer. Note that internally setting values are always 877 * stored as strings; this function converts the string to an integer 878 * for you. The default value will be returned if the setting is 879 * not defined or not an integer. 880 * 881 * @param cr The ContentResolver to access. 882 * @param name The name of the setting to retrieve. 883 * @param def Value to return if the setting is not defined. 884 * 885 * @return The setting's current value, or 'def' if it is not defined 886 * or not a valid integer. 887 */ 888 public static int getInt(ContentResolver cr, String name, int def) { 889 String v = getString(cr, name); 890 try { 891 return v != null ? Integer.parseInt(v) : def; 892 } catch (NumberFormatException e) { 893 return def; 894 } 895 } 896 897 /** 898 * Convenience function for retrieving a single system settings value 899 * as an integer. Note that internally setting values are always 900 * stored as strings; this function converts the string to an integer 901 * for you. 902 * <p> 903 * This version does not take a default value. If the setting has not 904 * been set, or the string value is not a number, 905 * it throws {@link SettingNotFoundException}. 906 * 907 * @param cr The ContentResolver to access. 908 * @param name The name of the setting to retrieve. 909 * 910 * @throws SettingNotFoundException Thrown if a setting by the given 911 * name can't be found or the setting value is not an integer. 912 * 913 * @return The setting's current value. 914 */ 915 public static int getInt(ContentResolver cr, String name) 916 throws SettingNotFoundException { 917 String v = getString(cr, name); 918 try { 919 return Integer.parseInt(v); 920 } catch (NumberFormatException e) { 921 throw new SettingNotFoundException(name); 922 } 923 } 924 925 /** 926 * Convenience function for updating a single settings value as an 927 * integer. This will either create a new entry in the table if the 928 * given name does not exist, or modify the value of the existing row 929 * with that name. Note that internally setting values are always 930 * stored as strings, so this function converts the given value to a 931 * string before storing it. 932 * 933 * @param cr The ContentResolver to access. 934 * @param name The name of the setting to modify. 935 * @param value The new value for the setting. 936 * @return true if the value was set, false on database errors 937 */ 938 public static boolean putInt(ContentResolver cr, String name, int value) { 939 return putString(cr, name, Integer.toString(value)); 940 } 941 942 /** 943 * Convenience function for retrieving a single system settings value 944 * as a {@code long}. Note that internally setting values are always 945 * stored as strings; this function converts the string to a {@code long} 946 * for you. The default value will be returned if the setting is 947 * not defined or not a {@code long}. 948 * 949 * @param cr The ContentResolver to access. 950 * @param name The name of the setting to retrieve. 951 * @param def Value to return if the setting is not defined. 952 * 953 * @return The setting's current value, or 'def' if it is not defined 954 * or not a valid {@code long}. 955 */ 956 public static long getLong(ContentResolver cr, String name, long def) { 957 String valString = getString(cr, name); 958 long value; 959 try { 960 value = valString != null ? Long.parseLong(valString) : def; 961 } catch (NumberFormatException e) { 962 value = def; 963 } 964 return value; 965 } 966 967 /** 968 * Convenience function for retrieving a single system settings value 969 * as a {@code long}. Note that internally setting values are always 970 * stored as strings; this function converts the string to a {@code long} 971 * for you. 972 * <p> 973 * This version does not take a default value. If the setting has not 974 * been set, or the string value is not a number, 975 * it throws {@link SettingNotFoundException}. 976 * 977 * @param cr The ContentResolver to access. 978 * @param name The name of the setting to retrieve. 979 * 980 * @return The setting's current value. 981 * @throws SettingNotFoundException Thrown if a setting by the given 982 * name can't be found or the setting value is not an integer. 983 */ 984 public static long getLong(ContentResolver cr, String name) 985 throws SettingNotFoundException { 986 String valString = getString(cr, name); 987 try { 988 return Long.parseLong(valString); 989 } catch (NumberFormatException e) { 990 throw new SettingNotFoundException(name); 991 } 992 } 993 994 /** 995 * Convenience function for updating a single settings value as a long 996 * integer. This will either create a new entry in the table if the 997 * given name does not exist, or modify the value of the existing row 998 * with that name. Note that internally setting values are always 999 * stored as strings, so this function converts the given value to a 1000 * string before storing it. 1001 * 1002 * @param cr The ContentResolver to access. 1003 * @param name The name of the setting to modify. 1004 * @param value The new value for the setting. 1005 * @return true if the value was set, false on database errors 1006 */ 1007 public static boolean putLong(ContentResolver cr, String name, long value) { 1008 return putString(cr, name, Long.toString(value)); 1009 } 1010 1011 /** 1012 * Convenience function for retrieving a single system settings value 1013 * as a floating point number. Note that internally setting values are 1014 * always stored as strings; this function converts the string to an 1015 * float for you. The default value will be returned if the setting 1016 * is not defined or not a valid float. 1017 * 1018 * @param cr The ContentResolver to access. 1019 * @param name The name of the setting to retrieve. 1020 * @param def Value to return if the setting is not defined. 1021 * 1022 * @return The setting's current value, or 'def' if it is not defined 1023 * or not a valid float. 1024 */ 1025 public static float getFloat(ContentResolver cr, String name, float def) { 1026 String v = getString(cr, name); 1027 try { 1028 return v != null ? Float.parseFloat(v) : def; 1029 } catch (NumberFormatException e) { 1030 return def; 1031 } 1032 } 1033 1034 /** 1035 * Convenience function for retrieving a single system settings value 1036 * as a float. Note that internally setting values are always 1037 * stored as strings; this function converts the string to a float 1038 * for you. 1039 * <p> 1040 * This version does not take a default value. If the setting has not 1041 * been set, or the string value is not a number, 1042 * it throws {@link SettingNotFoundException}. 1043 * 1044 * @param cr The ContentResolver to access. 1045 * @param name The name of the setting to retrieve. 1046 * 1047 * @throws SettingNotFoundException Thrown if a setting by the given 1048 * name can't be found or the setting value is not a float. 1049 * 1050 * @return The setting's current value. 1051 */ 1052 public static float getFloat(ContentResolver cr, String name) 1053 throws SettingNotFoundException { 1054 String v = getString(cr, name); 1055 if (v == null) { 1056 throw new SettingNotFoundException(name); 1057 } 1058 try { 1059 return Float.parseFloat(v); 1060 } catch (NumberFormatException e) { 1061 throw new SettingNotFoundException(name); 1062 } 1063 } 1064 1065 /** 1066 * Convenience function for updating a single settings value as a 1067 * floating point number. This will either create a new entry in the 1068 * table if the given name does not exist, or modify the value of the 1069 * existing row with that name. Note that internally setting values 1070 * are always stored as strings, so this function converts the given 1071 * value to a string before storing it. 1072 * 1073 * @param cr The ContentResolver to access. 1074 * @param name The name of the setting to modify. 1075 * @param value The new value for the setting. 1076 * @return true if the value was set, false on database errors 1077 */ 1078 public static boolean putFloat(ContentResolver cr, String name, float value) { 1079 return putString(cr, name, Float.toString(value)); 1080 } 1081 1082 /** 1083 * Convenience function to read all of the current 1084 * configuration-related settings into a 1085 * {@link Configuration} object. 1086 * 1087 * @param cr The ContentResolver to access. 1088 * @param outConfig Where to place the configuration settings. 1089 */ 1090 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 1091 outConfig.fontScale = Settings.System.getFloat( 1092 cr, FONT_SCALE, outConfig.fontScale); 1093 if (outConfig.fontScale < 0) { 1094 outConfig.fontScale = 1; 1095 } 1096 } 1097 1098 /** 1099 * @hide Erase the fields in the Configuration that should be applied 1100 * by the settings. 1101 */ 1102 public static void clearConfiguration(Configuration inoutConfig) { 1103 inoutConfig.fontScale = 0; 1104 } 1105 1106 /** 1107 * Convenience function to write a batch of configuration-related 1108 * settings from a {@link Configuration} object. 1109 * 1110 * @param cr The ContentResolver to access. 1111 * @param config The settings to write. 1112 * @return true if the values were set, false on database errors 1113 */ 1114 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 1115 return Settings.System.putFloat(cr, FONT_SCALE, config.fontScale); 1116 } 1117 1118 /** @hide */ 1119 public static boolean hasInterestingConfigurationChanges(int changes) { 1120 return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0; 1121 } 1122 1123 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 1124 return getInt(cr, SHOW_GTALK_SERVICE_STATUS, 0) != 0; 1125 } 1126 1127 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 1128 putInt(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0); 1129 } 1130 1131 /** 1132 * The content:// style URL for this table 1133 */ 1134 public static final Uri CONTENT_URI = 1135 Uri.parse("content://" + AUTHORITY + "/system"); 1136 1137 /** 1138 * Whether we keep the device on while the device is plugged in. 1139 * Supported values are: 1140 * <ul> 1141 * <li>{@code 0} to never stay on while plugged in</li> 1142 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 1143 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 1144 * </ul> 1145 * These values can be OR-ed together. 1146 */ 1147 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 1148 1149 /** 1150 * What happens when the user presses the end call button if they're not 1151 * on a call.<br/> 1152 * <b>Values:</b><br/> 1153 * 0 - The end button does nothing.<br/> 1154 * 1 - The end button goes to the home screen.<br/> 1155 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 1156 * 3 - The end button goes to the home screen. If the user is already on the 1157 * home screen, it puts the device to sleep. 1158 */ 1159 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 1160 1161 /** 1162 * END_BUTTON_BEHAVIOR value for "go home". 1163 * @hide 1164 */ 1165 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 1166 1167 /** 1168 * END_BUTTON_BEHAVIOR value for "go to sleep". 1169 * @hide 1170 */ 1171 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 1172 1173 /** 1174 * END_BUTTON_BEHAVIOR default value. 1175 * @hide 1176 */ 1177 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 1178 1179 /** 1180 * Is advanced settings mode turned on. 0 == no, 1 == yes 1181 * @hide 1182 */ 1183 public static final String ADVANCED_SETTINGS = "advanced_settings"; 1184 1185 /** 1186 * ADVANCED_SETTINGS default value. 1187 * @hide 1188 */ 1189 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 1190 1191 /** 1192 * Whether Airplane Mode is on. 1193 */ 1194 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 1195 1196 /** 1197 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 1198 */ 1199 public static final String RADIO_BLUETOOTH = "bluetooth"; 1200 1201 /** 1202 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 1203 */ 1204 public static final String RADIO_WIFI = "wifi"; 1205 1206 /** 1207 * {@hide} 1208 */ 1209 public static final String RADIO_WIMAX = "wimax"; 1210 /** 1211 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 1212 */ 1213 public static final String RADIO_CELL = "cell"; 1214 1215 /** 1216 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 1217 */ 1218 public static final String RADIO_NFC = "nfc"; 1219 1220 /** 1221 * A comma separated list of radios that need to be disabled when airplane mode 1222 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 1223 * included in the comma separated list. 1224 */ 1225 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 1226 1227 /** 1228 * A comma separated list of radios that should to be disabled when airplane mode 1229 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 1230 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 1231 * will be turned off when entering airplane mode, but the user will be able to reenable 1232 * Wifi in the Settings app. 1233 * 1234 * {@hide} 1235 */ 1236 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 1237 1238 /** 1239 * The policy for deciding when Wi-Fi should go to sleep (which will in 1240 * turn switch to using the mobile data as an Internet connection). 1241 * <p> 1242 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 1243 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 1244 * {@link #WIFI_SLEEP_POLICY_NEVER}. 1245 */ 1246 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 1247 1248 /** 1249 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 1250 * policy, which is to sleep shortly after the turning off 1251 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 1252 */ 1253 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 1254 1255 /** 1256 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 1257 * the device is on battery, and never go to sleep when the device is 1258 * plugged in. 1259 */ 1260 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 1261 1262 /** 1263 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 1264 */ 1265 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 1266 1267 //TODO: deprecate static IP constants 1268 /** 1269 * Whether to use static IP and other static network attributes. 1270 * <p> 1271 * Set to 1 for true and 0 for false. 1272 */ 1273 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 1274 1275 /** 1276 * The static IP address. 1277 * <p> 1278 * Example: "192.168.1.51" 1279 */ 1280 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 1281 1282 /** 1283 * If using static IP, the gateway's IP address. 1284 * <p> 1285 * Example: "192.168.1.1" 1286 */ 1287 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 1288 1289 /** 1290 * If using static IP, the net mask. 1291 * <p> 1292 * Example: "255.255.255.0" 1293 */ 1294 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 1295 1296 /** 1297 * If using static IP, the primary DNS's IP address. 1298 * <p> 1299 * Example: "192.168.1.1" 1300 */ 1301 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 1302 1303 /** 1304 * If using static IP, the secondary DNS's IP address. 1305 * <p> 1306 * Example: "192.168.1.2" 1307 */ 1308 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 1309 1310 1311 /** 1312 * Determines whether remote devices may discover and/or connect to 1313 * this device. 1314 * <P>Type: INT</P> 1315 * 2 -- discoverable and connectable 1316 * 1 -- connectable but not discoverable 1317 * 0 -- neither connectable nor discoverable 1318 */ 1319 public static final String BLUETOOTH_DISCOVERABILITY = 1320 "bluetooth_discoverability"; 1321 1322 /** 1323 * Bluetooth discoverability timeout. If this value is nonzero, then 1324 * Bluetooth becomes discoverable for a certain number of seconds, 1325 * after which is becomes simply connectable. The value is in seconds. 1326 */ 1327 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 1328 "bluetooth_discoverability_timeout"; 1329 1330 /** 1331 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 1332 * instead 1333 */ 1334 @Deprecated 1335 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 1336 1337 /** 1338 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 1339 * instead 1340 */ 1341 @Deprecated 1342 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 1343 1344 /** 1345 * @deprecated Use 1346 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 1347 * instead 1348 */ 1349 @Deprecated 1350 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 1351 "lock_pattern_tactile_feedback_enabled"; 1352 1353 1354 /** 1355 * A formatted string of the next alarm that is set, or the empty string 1356 * if there is no alarm set. 1357 */ 1358 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 1359 1360 /** 1361 * Scaling factor for fonts, float. 1362 */ 1363 public static final String FONT_SCALE = "font_scale"; 1364 1365 /** 1366 * Name of an application package to be debugged. 1367 */ 1368 public static final String DEBUG_APP = "debug_app"; 1369 1370 /** 1371 * If 1, when launching DEBUG_APP it will wait for the debugger before 1372 * starting user code. If 0, it will run normally. 1373 */ 1374 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 1375 1376 /** 1377 * Whether or not to dim the screen. 0=no 1=yes 1378 */ 1379 public static final String DIM_SCREEN = "dim_screen"; 1380 1381 /** 1382 * The timeout before the screen turns off. 1383 */ 1384 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 1385 1386 /** 1387 * If 0, the compatibility mode is off for all applications. 1388 * If 1, older applications run under compatibility mode. 1389 * TODO: remove this settings before code freeze (bug/1907571) 1390 * @hide 1391 */ 1392 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 1393 1394 /** 1395 * The screen backlight brightness between 0 and 255. 1396 */ 1397 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 1398 1399 /** 1400 * Control whether to enable automatic brightness mode. 1401 */ 1402 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 1403 1404 /** 1405 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 1406 * or less (<0.0 >-1.0) bright. 1407 */ 1408 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 1409 1410 /** 1411 * SCREEN_BRIGHTNESS_MODE value for manual mode. 1412 */ 1413 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 1414 1415 /** 1416 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 1417 */ 1418 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 1419 1420 /** 1421 * Control whether the process CPU usage meter should be shown. 1422 */ 1423 public static final String SHOW_PROCESSES = "show_processes"; 1424 1425 /** 1426 * If 1, the activity manager will aggressively finish activities and 1427 * processes as soon as they are no longer needed. If 0, the normal 1428 * extended lifetime is used. 1429 */ 1430 public static final String ALWAYS_FINISH_ACTIVITIES = 1431 "always_finish_activities"; 1432 1433 1434 /** 1435 * Ringer mode. This is used internally, changing this value will not 1436 * change the ringer mode. See AudioManager. 1437 */ 1438 public static final String MODE_RINGER = "mode_ringer"; 1439 1440 /** 1441 * Determines which streams are affected by ringer mode changes. The 1442 * stream type's bit should be set to 1 if it should be muted when going 1443 * into an inaudible ringer mode. 1444 */ 1445 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 1446 1447 /** 1448 * Determines which streams are affected by mute. The 1449 * stream type's bit should be set to 1 if it should be muted when a mute request 1450 * is received. 1451 */ 1452 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 1453 1454 /** 1455 * Whether vibrate is on for different events. This is used internally, 1456 * changing this value will not change the vibrate. See AudioManager. 1457 */ 1458 public static final String VIBRATE_ON = "vibrate_on"; 1459 1460 /** 1461 * Ringer volume. This is used internally, changing this value will not 1462 * change the volume. See AudioManager. 1463 */ 1464 public static final String VOLUME_RING = "volume_ring"; 1465 1466 /** 1467 * System/notifications volume. This is used internally, changing this 1468 * value will not change the volume. See AudioManager. 1469 */ 1470 public static final String VOLUME_SYSTEM = "volume_system"; 1471 1472 /** 1473 * Voice call volume. This is used internally, changing this value will 1474 * not change the volume. See AudioManager. 1475 */ 1476 public static final String VOLUME_VOICE = "volume_voice"; 1477 1478 /** 1479 * Music/media/gaming volume. This is used internally, changing this 1480 * value will not change the volume. See AudioManager. 1481 */ 1482 public static final String VOLUME_MUSIC = "volume_music"; 1483 1484 /** 1485 * Alarm volume. This is used internally, changing this 1486 * value will not change the volume. See AudioManager. 1487 */ 1488 public static final String VOLUME_ALARM = "volume_alarm"; 1489 1490 /** 1491 * Notification volume. This is used internally, changing this 1492 * value will not change the volume. See AudioManager. 1493 */ 1494 public static final String VOLUME_NOTIFICATION = "volume_notification"; 1495 1496 /** 1497 * Bluetooth Headset volume. This is used internally, changing this value will 1498 * not change the volume. See AudioManager. 1499 */ 1500 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 1501 1502 /** 1503 * Master volume (float in the range 0.0f to 1.0f). 1504 * @hide 1505 */ 1506 public static final String VOLUME_MASTER = "volume_master"; 1507 1508 /** 1509 * Whether the notifications should use the ring volume (value of 1) or a separate 1510 * notification volume (value of 0). In most cases, users will have this enabled so the 1511 * notification and ringer volumes will be the same. However, power users can disable this 1512 * and use the separate notification volume control. 1513 * <p> 1514 * Note: This is a one-off setting that will be removed in the future when there is profile 1515 * support. For this reason, it is kept hidden from the public APIs. 1516 * 1517 * @hide 1518 * @deprecated 1519 */ 1520 @Deprecated 1521 public static final String NOTIFICATIONS_USE_RING_VOLUME = 1522 "notifications_use_ring_volume"; 1523 1524 /** 1525 * Whether silent mode should allow vibration feedback. This is used 1526 * internally in AudioService and the Sound settings activity to 1527 * coordinate decoupling of vibrate and silent modes. This setting 1528 * will likely be removed in a future release with support for 1529 * audio/vibe feedback profiles. 1530 * 1531 * @hide 1532 */ 1533 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 1534 1535 /** 1536 * The mapping of stream type (integer) to its setting. 1537 */ 1538 public static final String[] VOLUME_SETTINGS = { 1539 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 1540 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 1541 }; 1542 1543 /** 1544 * Appended to various volume related settings to record the previous 1545 * values before they the settings were affected by a silent/vibrate 1546 * ringer mode change. 1547 */ 1548 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 1549 1550 /** 1551 * Persistent store for the system-wide default ringtone URI. 1552 * <p> 1553 * If you need to play the default ringtone at any given time, it is recommended 1554 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 1555 * to the set default ringtone at the time of playing. 1556 * 1557 * @see #DEFAULT_RINGTONE_URI 1558 */ 1559 public static final String RINGTONE = "ringtone"; 1560 1561 /** 1562 * A {@link Uri} that will point to the current default ringtone at any 1563 * given time. 1564 * <p> 1565 * If the current default ringtone is in the DRM provider and the caller 1566 * does not have permission, the exception will be a 1567 * FileNotFoundException. 1568 */ 1569 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 1570 1571 /** 1572 * Persistent store for the system-wide default notification sound. 1573 * 1574 * @see #RINGTONE 1575 * @see #DEFAULT_NOTIFICATION_URI 1576 */ 1577 public static final String NOTIFICATION_SOUND = "notification_sound"; 1578 1579 /** 1580 * A {@link Uri} that will point to the current default notification 1581 * sound at any given time. 1582 * 1583 * @see #DEFAULT_RINGTONE_URI 1584 */ 1585 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 1586 1587 /** 1588 * Persistent store for the system-wide default alarm alert. 1589 * 1590 * @see #RINGTONE 1591 * @see #DEFAULT_ALARM_ALERT_URI 1592 */ 1593 public static final String ALARM_ALERT = "alarm_alert"; 1594 1595 /** 1596 * A {@link Uri} that will point to the current default alarm alert at 1597 * any given time. 1598 * 1599 * @see #DEFAULT_ALARM_ALERT_URI 1600 */ 1601 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 1602 1603 /** 1604 * Persistent store for the system default media button event receiver. 1605 * 1606 * @hide 1607 */ 1608 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 1609 1610 /** 1611 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 1612 */ 1613 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 1614 1615 /** 1616 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 1617 */ 1618 public static final String TEXT_AUTO_CAPS = "auto_caps"; 1619 1620 /** 1621 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 1622 * feature converts two spaces to a "." and space. 1623 */ 1624 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 1625 1626 /** 1627 * Setting to showing password characters in text editors. 1 = On, 0 = Off 1628 */ 1629 public static final String TEXT_SHOW_PASSWORD = "show_password"; 1630 1631 public static final String SHOW_GTALK_SERVICE_STATUS = 1632 "SHOW_GTALK_SERVICE_STATUS"; 1633 1634 /** 1635 * Name of activity to use for wallpaper on the home screen. 1636 */ 1637 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 1638 1639 /** 1640 * Value to specify if the user prefers the date, time and time zone 1641 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 1642 */ 1643 public static final String AUTO_TIME = "auto_time"; 1644 1645 /** 1646 * Value to specify if the user prefers the time zone 1647 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 1648 */ 1649 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 1650 1651 /** 1652 * Display times as 12 or 24 hours 1653 * 12 1654 * 24 1655 */ 1656 public static final String TIME_12_24 = "time_12_24"; 1657 1658 /** 1659 * Date format string 1660 * mm/dd/yyyy 1661 * dd/mm/yyyy 1662 * yyyy/mm/dd 1663 */ 1664 public static final String DATE_FORMAT = "date_format"; 1665 1666 /** 1667 * Whether the setup wizard has been run before (on first boot), or if 1668 * it still needs to be run. 1669 * 1670 * nonzero = it has been run in the past 1671 * 0 = it has not been run in the past 1672 */ 1673 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 1674 1675 /** 1676 * Scaling factor for normal window animations. Setting to 0 will disable window 1677 * animations. 1678 */ 1679 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 1680 1681 /** 1682 * Scaling factor for activity transition animations. Setting to 0 will disable window 1683 * animations. 1684 */ 1685 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 1686 1687 /** 1688 * Scaling factor for Animator-based animations. This affects both the start delay and 1689 * duration of all such animations. Setting to 0 will cause animations to end immediately. 1690 * The default value is 1. 1691 */ 1692 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 1693 1694 /** 1695 * Scaling factor for normal window animations. Setting to 0 will disable window 1696 * animations. 1697 * @hide 1698 */ 1699 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 1700 1701 /** 1702 * Control whether the accelerometer will be used to change screen 1703 * orientation. If 0, it will not be used unless explicitly requested 1704 * by the application; if 1, it will be used by default unless explicitly 1705 * disabled by the application. 1706 */ 1707 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 1708 1709 /** 1710 * Default screen rotation when no other policy applies. 1711 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 1712 * preference, this rotation value will be used. Must be one of the 1713 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 1714 * 1715 * @see Display#getRotation 1716 */ 1717 public static final String USER_ROTATION = "user_rotation"; 1718 1719 /** 1720 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 1721 * boolean (1 or 0). 1722 */ 1723 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 1724 1725 /** 1726 * CDMA only settings 1727 * DTMF tone type played by the dialer when dialing. 1728 * 0 = Normal 1729 * 1 = Long 1730 * @hide 1731 */ 1732 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 1733 1734 /** 1735 * CDMA only settings 1736 * Emergency Tone 0 = Off 1737 * 1 = Alert 1738 * 2 = Vibrate 1739 * @hide 1740 */ 1741 public static final String EMERGENCY_TONE = "emergency_tone"; 1742 1743 /** 1744 * CDMA only settings 1745 * Whether the auto retry is enabled. The value is 1746 * boolean (1 or 0). 1747 * @hide 1748 */ 1749 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 1750 1751 /** 1752 * Whether the hearing aid is enabled. The value is 1753 * boolean (1 or 0). 1754 * @hide 1755 */ 1756 public static final String HEARING_AID = "hearing_aid"; 1757 1758 /** 1759 * CDMA only settings 1760 * TTY Mode 1761 * 0 = OFF 1762 * 1 = FULL 1763 * 2 = VCO 1764 * 3 = HCO 1765 * @hide 1766 */ 1767 public static final String TTY_MODE = "tty_mode"; 1768 1769 /** 1770 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 1771 * boolean (1 or 0). 1772 */ 1773 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 1774 1775 /** 1776 * Whether the haptic feedback (long presses, ...) are enabled. The value is 1777 * boolean (1 or 0). 1778 */ 1779 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 1780 1781 /** 1782 * @deprecated Each application that shows web suggestions should have its own 1783 * setting for this. 1784 */ 1785 @Deprecated 1786 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 1787 1788 /** 1789 * Whether the notification LED should repeatedly flash when a notification is 1790 * pending. The value is boolean (1 or 0). 1791 * @hide 1792 */ 1793 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 1794 1795 /** 1796 * Show pointer location on screen? 1797 * 0 = no 1798 * 1 = yes 1799 * @hide 1800 */ 1801 public static final String POINTER_LOCATION = "pointer_location"; 1802 1803 /** 1804 * Show touch positions on screen? 1805 * 0 = no 1806 * 1 = yes 1807 * @hide 1808 */ 1809 public static final String SHOW_TOUCHES = "show_touches"; 1810 1811 /** 1812 * Log raw orientation data from {@link WindowOrientationListener} for use with the 1813 * orientationplot.py tool. 1814 * 0 = no 1815 * 1 = yes 1816 * @hide 1817 */ 1818 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 1819 "window_orientation_listener_log"; 1820 1821 /** 1822 * Whether to play a sound for low-battery alerts. 1823 * @hide 1824 */ 1825 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 1826 1827 /** 1828 * Whether to play a sound for dock events. 1829 * @hide 1830 */ 1831 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 1832 1833 /** 1834 * Whether to play sounds when the keyguard is shown and dismissed. 1835 * @hide 1836 */ 1837 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 1838 1839 /** 1840 * Whether the lockscreen should be completely disabled. 1841 * @hide 1842 */ 1843 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 1844 1845 /** 1846 * URI for the low battery sound file. 1847 * @hide 1848 */ 1849 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 1850 1851 /** 1852 * URI for the desk dock "in" event sound. 1853 * @hide 1854 */ 1855 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 1856 1857 /** 1858 * URI for the desk dock "out" event sound. 1859 * @hide 1860 */ 1861 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 1862 1863 /** 1864 * URI for the car dock "in" event sound. 1865 * @hide 1866 */ 1867 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 1868 1869 /** 1870 * URI for the car dock "out" event sound. 1871 * @hide 1872 */ 1873 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 1874 1875 /** 1876 * URI for the "device locked" (keyguard shown) sound. 1877 * @hide 1878 */ 1879 public static final String LOCK_SOUND = "lock_sound"; 1880 1881 /** 1882 * URI for the "device unlocked" (keyguard dismissed) sound. 1883 * @hide 1884 */ 1885 public static final String UNLOCK_SOUND = "unlock_sound"; 1886 1887 /** 1888 * Receive incoming SIP calls? 1889 * 0 = no 1890 * 1 = yes 1891 * @hide 1892 */ 1893 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 1894 1895 /** 1896 * Call Preference String. 1897 * "SIP_ALWAYS" : Always use SIP with network access 1898 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 1899 * "SIP_ASK_ME_EACH_TIME" : Always ask me each time 1900 * @hide 1901 */ 1902 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 1903 1904 /** 1905 * One of the sip call options: Always use SIP with network access. 1906 * @hide 1907 */ 1908 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 1909 1910 /** 1911 * One of the sip call options: Only if destination is a SIP address. 1912 * @hide 1913 */ 1914 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 1915 1916 /** 1917 * One of the sip call options: Always ask me each time. 1918 * @hide 1919 */ 1920 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 1921 1922 /** 1923 * Pointer speed setting. 1924 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 1925 * -7 = slowest 1926 * 0 = default speed 1927 * +7 = fastest 1928 * @hide 1929 */ 1930 public static final String POINTER_SPEED = "pointer_speed"; 1931 1932 /** 1933 * Settings to backup. This is here so that it's in the same place as the settings 1934 * keys and easy to update. 1935 * 1936 * NOTE: Settings are backed up and restored in the order they appear 1937 * in this array. If you have one setting depending on another, 1938 * make sure that they are ordered appropriately. 1939 * 1940 * @hide 1941 */ 1942 public static final String[] SETTINGS_TO_BACKUP = { 1943 STAY_ON_WHILE_PLUGGED_IN, 1944 WIFI_USE_STATIC_IP, 1945 WIFI_STATIC_IP, 1946 WIFI_STATIC_GATEWAY, 1947 WIFI_STATIC_NETMASK, 1948 WIFI_STATIC_DNS1, 1949 WIFI_STATIC_DNS2, 1950 BLUETOOTH_DISCOVERABILITY, 1951 BLUETOOTH_DISCOVERABILITY_TIMEOUT, 1952 DIM_SCREEN, 1953 SCREEN_OFF_TIMEOUT, 1954 SCREEN_BRIGHTNESS, 1955 SCREEN_BRIGHTNESS_MODE, 1956 SCREEN_AUTO_BRIGHTNESS_ADJ, 1957 VIBRATE_ON, 1958 MODE_RINGER, 1959 MODE_RINGER_STREAMS_AFFECTED, 1960 MUTE_STREAMS_AFFECTED, 1961 VOLUME_VOICE, 1962 VOLUME_SYSTEM, 1963 VOLUME_RING, 1964 VOLUME_MUSIC, 1965 VOLUME_ALARM, 1966 VOLUME_NOTIFICATION, 1967 VOLUME_BLUETOOTH_SCO, 1968 VOLUME_VOICE + APPEND_FOR_LAST_AUDIBLE, 1969 VOLUME_SYSTEM + APPEND_FOR_LAST_AUDIBLE, 1970 VOLUME_RING + APPEND_FOR_LAST_AUDIBLE, 1971 VOLUME_MUSIC + APPEND_FOR_LAST_AUDIBLE, 1972 VOLUME_ALARM + APPEND_FOR_LAST_AUDIBLE, 1973 VOLUME_NOTIFICATION + APPEND_FOR_LAST_AUDIBLE, 1974 VOLUME_BLUETOOTH_SCO + APPEND_FOR_LAST_AUDIBLE, 1975 VIBRATE_IN_SILENT, 1976 TEXT_AUTO_REPLACE, 1977 TEXT_AUTO_CAPS, 1978 TEXT_AUTO_PUNCTUATE, 1979 TEXT_SHOW_PASSWORD, 1980 AUTO_TIME, 1981 AUTO_TIME_ZONE, 1982 TIME_12_24, 1983 DATE_FORMAT, 1984 ACCELEROMETER_ROTATION, 1985 USER_ROTATION, 1986 DTMF_TONE_WHEN_DIALING, 1987 DTMF_TONE_TYPE_WHEN_DIALING, 1988 EMERGENCY_TONE, 1989 CALL_AUTO_RETRY, 1990 HEARING_AID, 1991 TTY_MODE, 1992 SOUND_EFFECTS_ENABLED, 1993 HAPTIC_FEEDBACK_ENABLED, 1994 POWER_SOUNDS_ENABLED, 1995 DOCK_SOUNDS_ENABLED, 1996 LOCKSCREEN_SOUNDS_ENABLED, 1997 SHOW_WEB_SUGGESTIONS, 1998 NOTIFICATION_LIGHT_PULSE, 1999 SIP_CALL_OPTIONS, 2000 SIP_RECEIVE_CALLS, 2001 POINTER_SPEED, 2002 }; 2003 2004 // Settings moved to Settings.Secure 2005 2006 /** 2007 * @deprecated Use {@link android.provider.Settings.Secure#ADB_ENABLED} 2008 * instead 2009 */ 2010 @Deprecated 2011 public static final String ADB_ENABLED = Secure.ADB_ENABLED; 2012 2013 /** 2014 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 2015 */ 2016 @Deprecated 2017 public static final String ANDROID_ID = Secure.ANDROID_ID; 2018 2019 /** 2020 * @deprecated Use {@link android.provider.Settings.Secure#BLUETOOTH_ON} instead 2021 */ 2022 @Deprecated 2023 public static final String BLUETOOTH_ON = Secure.BLUETOOTH_ON; 2024 2025 /** 2026 * @deprecated Use {@link android.provider.Settings.Secure#DATA_ROAMING} instead 2027 */ 2028 @Deprecated 2029 public static final String DATA_ROAMING = Secure.DATA_ROAMING; 2030 2031 /** 2032 * @deprecated Use {@link android.provider.Settings.Secure#DEVICE_PROVISIONED} instead 2033 */ 2034 @Deprecated 2035 public static final String DEVICE_PROVISIONED = Secure.DEVICE_PROVISIONED; 2036 2037 /** 2038 * @deprecated Use {@link android.provider.Settings.Secure#HTTP_PROXY} instead 2039 */ 2040 @Deprecated 2041 public static final String HTTP_PROXY = Secure.HTTP_PROXY; 2042 2043 /** 2044 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 2045 */ 2046 @Deprecated 2047 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 2048 2049 /** 2050 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 2051 * instead 2052 */ 2053 @Deprecated 2054 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 2055 2056 /** 2057 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 2058 */ 2059 @Deprecated 2060 public static final String LOGGING_ID = Secure.LOGGING_ID; 2061 2062 /** 2063 * @deprecated Use {@link android.provider.Settings.Secure#NETWORK_PREFERENCE} instead 2064 */ 2065 @Deprecated 2066 public static final String NETWORK_PREFERENCE = Secure.NETWORK_PREFERENCE; 2067 2068 /** 2069 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 2070 * instead 2071 */ 2072 @Deprecated 2073 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 2074 2075 /** 2076 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 2077 * instead 2078 */ 2079 @Deprecated 2080 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 2081 2082 /** 2083 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 2084 * instead 2085 */ 2086 @Deprecated 2087 public static final String PARENTAL_CONTROL_REDIRECT_URL = 2088 Secure.PARENTAL_CONTROL_REDIRECT_URL; 2089 2090 /** 2091 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 2092 */ 2093 @Deprecated 2094 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 2095 2096 /** 2097 * @deprecated Use {@link android.provider.Settings.Secure#USB_MASS_STORAGE_ENABLED} instead 2098 */ 2099 @Deprecated 2100 public static final String USB_MASS_STORAGE_ENABLED = Secure.USB_MASS_STORAGE_ENABLED; 2101 2102 /** 2103 * @deprecated Use {@link android.provider.Settings.Secure#USE_GOOGLE_MAIL} instead 2104 */ 2105 @Deprecated 2106 public static final String USE_GOOGLE_MAIL = Secure.USE_GOOGLE_MAIL; 2107 2108 /** 2109 * @deprecated Use 2110 * {@link android.provider.Settings.Secure#WIFI_MAX_DHCP_RETRY_COUNT} instead 2111 */ 2112 @Deprecated 2113 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Secure.WIFI_MAX_DHCP_RETRY_COUNT; 2114 2115 /** 2116 * @deprecated Use 2117 * {@link android.provider.Settings.Secure#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 2118 */ 2119 @Deprecated 2120 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 2121 Secure.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 2122 2123 /** 2124 * @deprecated Use 2125 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 2126 */ 2127 @Deprecated 2128 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 2129 Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 2130 2131 /** 2132 * @deprecated Use 2133 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 2134 */ 2135 @Deprecated 2136 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 2137 Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 2138 2139 /** 2140 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_NUM_OPEN_NETWORKS_KEPT} 2141 * instead 2142 */ 2143 @Deprecated 2144 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Secure.WIFI_NUM_OPEN_NETWORKS_KEPT; 2145 2146 /** 2147 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_ON} instead 2148 */ 2149 @Deprecated 2150 public static final String WIFI_ON = Secure.WIFI_ON; 2151 2152 /** 2153 * @deprecated Use 2154 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 2155 * instead 2156 */ 2157 @Deprecated 2158 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 2159 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 2160 2161 /** 2162 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 2163 */ 2164 @Deprecated 2165 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 2166 2167 /** 2168 * @deprecated Use 2169 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 2170 */ 2171 @Deprecated 2172 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 2173 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 2174 2175 /** 2176 * @deprecated Use 2177 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 2178 */ 2179 @Deprecated 2180 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 2181 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 2182 2183 /** 2184 * @deprecated Use 2185 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 2186 * instead 2187 */ 2188 @Deprecated 2189 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 2190 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 2191 2192 /** 2193 * @deprecated Use 2194 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 2195 */ 2196 @Deprecated 2197 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 2198 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 2199 2200 /** 2201 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 2202 * instead 2203 */ 2204 @Deprecated 2205 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 2206 2207 /** 2208 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ON} instead 2209 */ 2210 @Deprecated 2211 public static final String WIFI_WATCHDOG_ON = Secure.WIFI_WATCHDOG_ON; 2212 2213 /** 2214 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 2215 */ 2216 @Deprecated 2217 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 2218 2219 /** 2220 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 2221 * instead 2222 */ 2223 @Deprecated 2224 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 2225 2226 /** 2227 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 2228 * instead 2229 */ 2230 @Deprecated 2231 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 2232 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 2233 } 2234 2235 /** 2236 * Secure system settings, containing system preferences that applications 2237 * can read but are not allowed to write. These are for preferences that 2238 * the user must explicitly modify through the system UI or specialized 2239 * APIs for those values, not modified directly by applications. 2240 */ 2241 public static final class Secure extends NameValueTable { 2242 public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; 2243 2244 // Populated lazily, guarded by class object: 2245 private static NameValueCache sNameValueCache = null; 2246 2247 /** 2248 * Look up a name in the database. 2249 * @param resolver to access the database with 2250 * @param name to look up in the table 2251 * @return the corresponding value, or null if not present 2252 */ 2253 public synchronized static String getString(ContentResolver resolver, String name) { 2254 if (sNameValueCache == null) { 2255 sNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI, 2256 CALL_METHOD_GET_SECURE); 2257 } 2258 return sNameValueCache.getString(resolver, name); 2259 } 2260 2261 /** 2262 * Store a name/value pair into the database. 2263 * @param resolver to access the database with 2264 * @param name to store 2265 * @param value to associate with the name 2266 * @return true if the value was set, false on database errors 2267 */ 2268 public static boolean putString(ContentResolver resolver, 2269 String name, String value) { 2270 return putString(resolver, CONTENT_URI, name, value); 2271 } 2272 2273 /** 2274 * Construct the content URI for a particular name/value pair, 2275 * useful for monitoring changes with a ContentObserver. 2276 * @param name to look up in the table 2277 * @return the corresponding content URI, or null if not present 2278 */ 2279 public static Uri getUriFor(String name) { 2280 return getUriFor(CONTENT_URI, name); 2281 } 2282 2283 /** 2284 * Convenience function for retrieving a single secure settings value 2285 * as an integer. Note that internally setting values are always 2286 * stored as strings; this function converts the string to an integer 2287 * for you. The default value will be returned if the setting is 2288 * not defined or not an integer. 2289 * 2290 * @param cr The ContentResolver to access. 2291 * @param name The name of the setting to retrieve. 2292 * @param def Value to return if the setting is not defined. 2293 * 2294 * @return The setting's current value, or 'def' if it is not defined 2295 * or not a valid integer. 2296 */ 2297 public static int getInt(ContentResolver cr, String name, int def) { 2298 String v = getString(cr, name); 2299 try { 2300 return v != null ? Integer.parseInt(v) : def; 2301 } catch (NumberFormatException e) { 2302 return def; 2303 } 2304 } 2305 2306 /** 2307 * Convenience function for retrieving a single secure settings value 2308 * as an integer. Note that internally setting values are always 2309 * stored as strings; this function converts the string to an integer 2310 * for you. 2311 * <p> 2312 * This version does not take a default value. If the setting has not 2313 * been set, or the string value is not a number, 2314 * it throws {@link SettingNotFoundException}. 2315 * 2316 * @param cr The ContentResolver to access. 2317 * @param name The name of the setting to retrieve. 2318 * 2319 * @throws SettingNotFoundException Thrown if a setting by the given 2320 * name can't be found or the setting value is not an integer. 2321 * 2322 * @return The setting's current value. 2323 */ 2324 public static int getInt(ContentResolver cr, String name) 2325 throws SettingNotFoundException { 2326 String v = getString(cr, name); 2327 try { 2328 return Integer.parseInt(v); 2329 } catch (NumberFormatException e) { 2330 throw new SettingNotFoundException(name); 2331 } 2332 } 2333 2334 /** 2335 * Convenience function for updating a single settings value as an 2336 * integer. This will either create a new entry in the table if the 2337 * given name does not exist, or modify the value of the existing row 2338 * with that name. Note that internally setting values are always 2339 * stored as strings, so this function converts the given value to a 2340 * string before storing it. 2341 * 2342 * @param cr The ContentResolver to access. 2343 * @param name The name of the setting to modify. 2344 * @param value The new value for the setting. 2345 * @return true if the value was set, false on database errors 2346 */ 2347 public static boolean putInt(ContentResolver cr, String name, int value) { 2348 return putString(cr, name, Integer.toString(value)); 2349 } 2350 2351 /** 2352 * Convenience function for retrieving a single secure settings value 2353 * as a {@code long}. Note that internally setting values are always 2354 * stored as strings; this function converts the string to a {@code long} 2355 * for you. The default value will be returned if the setting is 2356 * not defined or not a {@code long}. 2357 * 2358 * @param cr The ContentResolver to access. 2359 * @param name The name of the setting to retrieve. 2360 * @param def Value to return if the setting is not defined. 2361 * 2362 * @return The setting's current value, or 'def' if it is not defined 2363 * or not a valid {@code long}. 2364 */ 2365 public static long getLong(ContentResolver cr, String name, long def) { 2366 String valString = getString(cr, name); 2367 long value; 2368 try { 2369 value = valString != null ? Long.parseLong(valString) : def; 2370 } catch (NumberFormatException e) { 2371 value = def; 2372 } 2373 return value; 2374 } 2375 2376 /** 2377 * Convenience function for retrieving a single secure settings value 2378 * as a {@code long}. Note that internally setting values are always 2379 * stored as strings; this function converts the string to a {@code long} 2380 * for you. 2381 * <p> 2382 * This version does not take a default value. If the setting has not 2383 * been set, or the string value is not a number, 2384 * it throws {@link SettingNotFoundException}. 2385 * 2386 * @param cr The ContentResolver to access. 2387 * @param name The name of the setting to retrieve. 2388 * 2389 * @return The setting's current value. 2390 * @throws SettingNotFoundException Thrown if a setting by the given 2391 * name can't be found or the setting value is not an integer. 2392 */ 2393 public static long getLong(ContentResolver cr, String name) 2394 throws SettingNotFoundException { 2395 String valString = getString(cr, name); 2396 try { 2397 return Long.parseLong(valString); 2398 } catch (NumberFormatException e) { 2399 throw new SettingNotFoundException(name); 2400 } 2401 } 2402 2403 /** 2404 * Convenience function for updating a secure settings value as a long 2405 * integer. This will either create a new entry in the table if the 2406 * given name does not exist, or modify the value of the existing row 2407 * with that name. Note that internally setting values are always 2408 * stored as strings, so this function converts the given value to a 2409 * string before storing it. 2410 * 2411 * @param cr The ContentResolver to access. 2412 * @param name The name of the setting to modify. 2413 * @param value The new value for the setting. 2414 * @return true if the value was set, false on database errors 2415 */ 2416 public static boolean putLong(ContentResolver cr, String name, long value) { 2417 return putString(cr, name, Long.toString(value)); 2418 } 2419 2420 /** 2421 * Convenience function for retrieving a single secure settings value 2422 * as a floating point number. Note that internally setting values are 2423 * always stored as strings; this function converts the string to an 2424 * float for you. The default value will be returned if the setting 2425 * is not defined or not a valid float. 2426 * 2427 * @param cr The ContentResolver to access. 2428 * @param name The name of the setting to retrieve. 2429 * @param def Value to return if the setting is not defined. 2430 * 2431 * @return The setting's current value, or 'def' if it is not defined 2432 * or not a valid float. 2433 */ 2434 public static float getFloat(ContentResolver cr, String name, float def) { 2435 String v = getString(cr, name); 2436 try { 2437 return v != null ? Float.parseFloat(v) : def; 2438 } catch (NumberFormatException e) { 2439 return def; 2440 } 2441 } 2442 2443 /** 2444 * Convenience function for retrieving a single secure settings value 2445 * as a float. Note that internally setting values are always 2446 * stored as strings; this function converts the string to a float 2447 * for you. 2448 * <p> 2449 * This version does not take a default value. If the setting has not 2450 * been set, or the string value is not a number, 2451 * it throws {@link SettingNotFoundException}. 2452 * 2453 * @param cr The ContentResolver to access. 2454 * @param name The name of the setting to retrieve. 2455 * 2456 * @throws SettingNotFoundException Thrown if a setting by the given 2457 * name can't be found or the setting value is not a float. 2458 * 2459 * @return The setting's current value. 2460 */ 2461 public static float getFloat(ContentResolver cr, String name) 2462 throws SettingNotFoundException { 2463 String v = getString(cr, name); 2464 if (v == null) { 2465 throw new SettingNotFoundException(name); 2466 } 2467 try { 2468 return Float.parseFloat(v); 2469 } catch (NumberFormatException e) { 2470 throw new SettingNotFoundException(name); 2471 } 2472 } 2473 2474 /** 2475 * Convenience function for updating a single settings value as a 2476 * floating point number. This will either create a new entry in the 2477 * table if the given name does not exist, or modify the value of the 2478 * existing row with that name. Note that internally setting values 2479 * are always stored as strings, so this function converts the given 2480 * value to a string before storing it. 2481 * 2482 * @param cr The ContentResolver to access. 2483 * @param name The name of the setting to modify. 2484 * @param value The new value for the setting. 2485 * @return true if the value was set, false on database errors 2486 */ 2487 public static boolean putFloat(ContentResolver cr, String name, float value) { 2488 return putString(cr, name, Float.toString(value)); 2489 } 2490 2491 /** 2492 * The content:// style URL for this table 2493 */ 2494 public static final Uri CONTENT_URI = 2495 Uri.parse("content://" + AUTHORITY + "/secure"); 2496 2497 /** 2498 * Whether user has enabled development settings. 2499 */ 2500 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 2501 2502 /** 2503 * Whether ADB is enabled. 2504 */ 2505 public static final String ADB_ENABLED = "adb_enabled"; 2506 2507 /** 2508 * Setting to allow mock locations and location provider status to be injected into the 2509 * LocationManager service for testing purposes during application development. These 2510 * locations and status values override actual location and status information generated 2511 * by network, gps, or other location providers. 2512 */ 2513 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 2514 2515 /** 2516 * A 64-bit number (as a hex string) that is randomly 2517 * generated on the device's first boot and should remain 2518 * constant for the lifetime of the device. (The value may 2519 * change if a factory reset is performed on the device.) 2520 */ 2521 public static final String ANDROID_ID = "android_id"; 2522 2523 /** 2524 * Whether bluetooth is enabled/disabled 2525 * 0=disabled. 1=enabled. 2526 */ 2527 public static final String BLUETOOTH_ON = "bluetooth_on"; 2528 2529 /** 2530 * Get the key that retrieves a bluetooth headset's priority. 2531 * @hide 2532 */ 2533 public static final String getBluetoothHeadsetPriorityKey(String address) { 2534 return ("bluetooth_headset_priority_" + address.toUpperCase()); 2535 } 2536 2537 /** 2538 * Get the key that retrieves a bluetooth a2dp sink's priority. 2539 * @hide 2540 */ 2541 public static final String getBluetoothA2dpSinkPriorityKey(String address) { 2542 return ("bluetooth_a2dp_sink_priority_" + address.toUpperCase()); 2543 } 2544 2545 /** 2546 * Get the key that retrieves a bluetooth Input Device's priority. 2547 * @hide 2548 */ 2549 public static final String getBluetoothInputDevicePriorityKey(String address) { 2550 return ("bluetooth_input_device_priority_" + address.toUpperCase()); 2551 } 2552 2553 /** 2554 * Whether or not data roaming is enabled. (0 = false, 1 = true) 2555 */ 2556 public static final String DATA_ROAMING = "data_roaming"; 2557 2558 /** 2559 * Setting to record the input method used by default, holding the ID 2560 * of the desired method. 2561 */ 2562 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 2563 2564 /** 2565 * Setting to record the input method subtype used by default, holding the ID 2566 * of the desired method. 2567 */ 2568 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 2569 "selected_input_method_subtype"; 2570 2571 /** 2572 * Setting to record the history of input method subtype, holding the pair of ID of IME 2573 * and its last used subtype. 2574 * @hide 2575 */ 2576 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 2577 "input_methods_subtype_history"; 2578 2579 /** 2580 * Setting to record the visibility of input method selector 2581 */ 2582 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 2583 "input_method_selector_visibility"; 2584 2585 /** 2586 * Whether the device has been provisioned (0 = false, 1 = true) 2587 */ 2588 public static final String DEVICE_PROVISIONED = "device_provisioned"; 2589 2590 /** 2591 * List of input methods that are currently enabled. This is a string 2592 * containing the IDs of all enabled input methods, each ID separated 2593 * by ':'. 2594 */ 2595 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 2596 2597 /** 2598 * List of system input methods that are currently disabled. This is a string 2599 * containing the IDs of all disabled input methods, each ID separated 2600 * by ':'. 2601 * @hide 2602 */ 2603 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 2604 2605 /** 2606 * Host name and port for global http proxy. Uses ':' seperator for between host and port 2607 * TODO - deprecate in favor of global_http_proxy_host, etc 2608 */ 2609 public static final String HTTP_PROXY = "http_proxy"; 2610 2611 /** 2612 * Host name for global http proxy. Set via ConnectivityManager. 2613 * @hide 2614 */ 2615 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 2616 2617 /** 2618 * Integer host port for global http proxy. Set via ConnectivityManager. 2619 * @hide 2620 */ 2621 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 2622 2623 /** 2624 * Exclusion list for global proxy. This string contains a list of comma-separated 2625 * domains where the global proxy does not apply. Domains should be listed in a comma- 2626 * separated list. Example of acceptable formats: ".domain1.com,my.domain2.com" 2627 * Use ConnectivityManager to set/get. 2628 * @hide 2629 */ 2630 public static final String GLOBAL_HTTP_PROXY_EXCLUSION_LIST = 2631 "global_http_proxy_exclusion_list"; 2632 2633 /** 2634 * Enables the UI setting to allow the user to specify the global HTTP proxy 2635 * and associated exclusion list. 2636 * @hide 2637 */ 2638 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 2639 2640 /** 2641 * Setting for default DNS in case nobody suggests one 2642 * @hide 2643 */ 2644 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 2645 2646 /** 2647 * Whether the package installer should allow installation of apps downloaded from 2648 * sources other than Google Play. 2649 * 2650 * 1 = allow installing from other sources 2651 * 0 = only allow installing from Google Play 2652 */ 2653 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 2654 2655 /** 2656 * Comma-separated list of location providers that activities may access. 2657 */ 2658 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 2659 2660 /** 2661 * A flag containing settings used for biometric weak 2662 * @hide 2663 */ 2664 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 2665 "lock_biometric_weak_flags"; 2666 2667 /** 2668 * Whether autolock is enabled (0 = false, 1 = true) 2669 */ 2670 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 2671 2672 /** 2673 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 2674 */ 2675 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 2676 2677 /** 2678 * Whether lock pattern will vibrate as user enters (0 = false, 1 = true) 2679 */ 2680 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 2681 "lock_pattern_tactile_feedback_enabled"; 2682 2683 /** 2684 * This preference allows the device to be locked given time after screen goes off, 2685 * subject to current DeviceAdmin policy limits. 2686 * @hide 2687 */ 2688 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 2689 2690 2691 /** 2692 * This preference contains the string that shows for owner info on LockScren. 2693 * @hide 2694 */ 2695 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 2696 2697 /** 2698 * This preference enables showing the owner info on LockScren. 2699 * @hide 2700 */ 2701 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 2702 "lock_screen_owner_info_enabled"; 2703 2704 /** 2705 * The saved value for WindowManagerService.setForcedDisplaySize(). 2706 * Two integers separated by a comma. If unset, then use the real display size. 2707 * @hide 2708 */ 2709 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 2710 2711 /** 2712 * Whether assisted GPS should be enabled or not. 2713 * @hide 2714 */ 2715 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 2716 2717 /** 2718 * The Logging ID (a unique 64-bit value) as a hex string. 2719 * Used as a pseudonymous identifier for logging. 2720 * @deprecated This identifier is poorly initialized and has 2721 * many collisions. It should not be used. 2722 */ 2723 @Deprecated 2724 public static final String LOGGING_ID = "logging_id"; 2725 2726 /** 2727 * User preference for which network(s) should be used. Only the 2728 * connectivity service should touch this. 2729 */ 2730 public static final String NETWORK_PREFERENCE = "network_preference"; 2731 2732 /** 2733 * Used to disable Tethering on a device - defaults to true 2734 * @hide 2735 */ 2736 public static final String TETHER_SUPPORTED = "tether_supported"; 2737 2738 /** 2739 * Used to require DUN APN on the device or not - defaults to a build config value 2740 * which defaults to false 2741 * @hide 2742 */ 2743 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 2744 2745 /** 2746 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 2747 * corresponding build config values are set it will override the APN DB 2748 * values. 2749 * Consists of a comma seperated list of strings: 2750 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 2751 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" 2752 * @hide 2753 */ 2754 public static final String TETHER_DUN_APN = "tether_dun_apn"; 2755 2756 /** 2757 * No longer supported. 2758 */ 2759 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 2760 2761 /** 2762 * No longer supported. 2763 */ 2764 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 2765 2766 /** 2767 * No longer supported. 2768 */ 2769 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 2770 2771 /** 2772 * A positive value indicates how often the SamplingProfiler 2773 * should take snapshots. Zero value means SamplingProfiler 2774 * is disabled. 2775 * 2776 * @hide 2777 */ 2778 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms"; 2779 2780 /** 2781 * Settings classname to launch when Settings is clicked from All 2782 * Applications. Needed because of user testing between the old 2783 * and new Settings apps. 2784 */ 2785 // TODO: 881807 2786 public static final String SETTINGS_CLASSNAME = "settings_classname"; 2787 2788 /** 2789 * USB Mass Storage Enabled 2790 */ 2791 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 2792 2793 /** 2794 * If this setting is set (to anything), then all references 2795 * to Gmail on the device must change to Google Mail. 2796 */ 2797 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 2798 2799 /** 2800 * If accessibility is enabled. 2801 */ 2802 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 2803 2804 /** 2805 * If touch exploration is enabled. 2806 */ 2807 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 2808 2809 /** 2810 * List of the enabled accessibility providers. 2811 */ 2812 public static final String ENABLED_ACCESSIBILITY_SERVICES = 2813 "enabled_accessibility_services"; 2814 2815 /** 2816 * Whether to speak passwords while in accessibility mode. 2817 */ 2818 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 2819 2820 /** 2821 * If injection of accessibility enhancing JavaScript screen-reader 2822 * is enabled. 2823 * <p> 2824 * Note: The JavaScript based screen-reader is served by the 2825 * Google infrastructure and enable users with disabilities to 2826 * efficiantly navigate in and explore web content. 2827 * </p> 2828 * <p> 2829 * This property represents a boolean value. 2830 * </p> 2831 * @hide 2832 */ 2833 public static final String ACCESSIBILITY_SCRIPT_INJECTION = 2834 "accessibility_script_injection"; 2835 2836 /** 2837 * The URL for the injected JavaScript based screen-reader used 2838 * for providing accessiblity of content in WebView. 2839 * <p> 2840 * Note: The JavaScript based screen-reader is served by the 2841 * Google infrastructure and enable users with disabilities to 2842 * efficiently navigate in and explore web content. 2843 * </p> 2844 * <p> 2845 * This property represents a string value. 2846 * </p> 2847 * @hide 2848 */ 2849 public static final String ACCESSIBILITY_SCREEN_READER_URL = 2850 "accessibility_script_injection_url"; 2851 2852 /** 2853 * Key bindings for navigation in built-in accessibility support for web content. 2854 * <p> 2855 * Note: These key bindings are for the built-in accessibility navigation for 2856 * web content which is used as a fall back solution if JavaScript in a WebView 2857 * is not enabled or the user has not opted-in script injection from Google. 2858 * </p> 2859 * <p> 2860 * The bindings are separated by semi-colon. A binding is a mapping from 2861 * a key to a sequence of actions (for more details look at 2862 * android.webkit.AccessibilityInjector). A key is represented as the hexademical 2863 * string representation of an integer obtained from a meta state (optional) shifted 2864 * sixteen times left and bitwise ored with a key code. An action is represented 2865 * as a hexademical string representation of an integer where the first two digits 2866 * are navigation action index, the second, the third, and the fourth digit pairs 2867 * represent the action arguments. The separate actions in a binding are colon 2868 * separated. The key and the action sequence it maps to are separated by equals. 2869 * </p> 2870 * <p> 2871 * For example, the binding below maps the DPAD right button to traverse the 2872 * current navigation axis once without firing an accessibility event and to 2873 * perform the same traversal again but to fire an event: 2874 * <code> 2875 * 0x16=0x01000100:0x01000101; 2876 * </code> 2877 * </p> 2878 * <p> 2879 * The goal of this binding is to enable dynamic rebinding of keys to 2880 * navigation actions for web content without requiring a framework change. 2881 * </p> 2882 * <p> 2883 * This property represents a string value. 2884 * </p> 2885 * @hide 2886 */ 2887 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS = 2888 "accessibility_web_content_key_bindings"; 2889 2890 /** 2891 * The timout for considering a press to be a long press in milliseconds. 2892 * @hide 2893 */ 2894 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 2895 2896 /** 2897 * Setting to always use the default text-to-speech settings regardless 2898 * of the application settings. 2899 * 1 = override application settings, 2900 * 0 = use application settings (if specified). 2901 * 2902 * @deprecated The value of this setting is no longer respected by 2903 * the framework text to speech APIs as of the Ice Cream Sandwich release. 2904 */ 2905 @Deprecated 2906 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 2907 2908 /** 2909 * Default text-to-speech engine speech rate. 100 = 1x 2910 */ 2911 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 2912 2913 /** 2914 * Default text-to-speech engine pitch. 100 = 1x 2915 */ 2916 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 2917 2918 /** 2919 * Default text-to-speech engine. 2920 */ 2921 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 2922 2923 /** 2924 * Default text-to-speech language. 2925 * 2926 * @deprecated this setting is no longer in use, as of the Ice Cream 2927 * Sandwich release. Apps should never need to read this setting directly, 2928 * instead can query the TextToSpeech framework classes for the default 2929 * locale. {@link TextToSpeech#getLanguage()}. 2930 */ 2931 @Deprecated 2932 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 2933 2934 /** 2935 * Default text-to-speech country. 2936 * 2937 * @deprecated this setting is no longer in use, as of the Ice Cream 2938 * Sandwich release. Apps should never need to read this setting directly, 2939 * instead can query the TextToSpeech framework classes for the default 2940 * locale. {@link TextToSpeech#getLanguage()}. 2941 */ 2942 @Deprecated 2943 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 2944 2945 /** 2946 * Default text-to-speech locale variant. 2947 * 2948 * @deprecated this setting is no longer in use, as of the Ice Cream 2949 * Sandwich release. Apps should never need to read this setting directly, 2950 * instead can query the TextToSpeech framework classes for the 2951 * locale that is in use {@link TextToSpeech#getLanguage()}. 2952 */ 2953 @Deprecated 2954 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 2955 2956 /** 2957 * Stores the default tts locales on a per engine basis. Stored as 2958 * a comma seperated list of values, each value being of the form 2959 * {@code engine_name:locale} for example, 2960 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 2961 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 2962 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 2963 * setting directly, and can query the TextToSpeech framework classes 2964 * for the locale that is in use. 2965 * 2966 * @hide 2967 */ 2968 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 2969 2970 /** 2971 * Space delimited list of plugin packages that are enabled. 2972 */ 2973 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 2974 2975 /** 2976 * Whether to notify the user of open networks. 2977 * <p> 2978 * If not connected and the scan results have an open network, we will 2979 * put this notification up. If we attempt to connect to a network or 2980 * the open network(s) disappear, we remove the notification. When we 2981 * show the notification, we will not show it again for 2982 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 2983 */ 2984 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 2985 "wifi_networks_available_notification_on"; 2986 /** 2987 * {@hide} 2988 */ 2989 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 2990 "wimax_networks_available_notification_on"; 2991 2992 /** 2993 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 2994 * Connecting to a network will reset the timer. 2995 */ 2996 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 2997 "wifi_networks_available_repeat_delay"; 2998 2999 /** 3000 * 802.11 country code in ISO 3166 format 3001 * @hide 3002 */ 3003 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 3004 3005 3006 /** 3007 * When the number of open networks exceeds this number, the 3008 * least-recently-used excess networks will be removed. 3009 */ 3010 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 3011 3012 /** 3013 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 3014 */ 3015 public static final String WIFI_ON = "wifi_on"; 3016 3017 /** 3018 * Used to save the Wifi_ON state prior to tethering. 3019 * This state will be checked to restore Wifi after 3020 * the user turns off tethering. 3021 * 3022 * @hide 3023 */ 3024 public static final String WIFI_SAVED_STATE = "wifi_saved_state"; 3025 3026 /** 3027 * AP SSID 3028 * 3029 * @hide 3030 */ 3031 public static final String WIFI_AP_SSID = "wifi_ap_ssid"; 3032 3033 /** 3034 * AP security 3035 * 3036 * @hide 3037 */ 3038 public static final String WIFI_AP_SECURITY = "wifi_ap_security"; 3039 3040 /** 3041 * AP passphrase 3042 * 3043 * @hide 3044 */ 3045 public static final String WIFI_AP_PASSWD = "wifi_ap_passwd"; 3046 3047 /** 3048 * The acceptable packet loss percentage (range 0 - 100) before trying 3049 * another AP on the same network. 3050 */ 3051 @Deprecated 3052 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 3053 "wifi_watchdog_acceptable_packet_loss_percentage"; 3054 3055 /** 3056 * The number of access points required for a network in order for the 3057 * watchdog to monitor it. 3058 */ 3059 @Deprecated 3060 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 3061 3062 /** 3063 * The delay between background checks. 3064 */ 3065 @Deprecated 3066 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 3067 "wifi_watchdog_background_check_delay_ms"; 3068 3069 /** 3070 * Whether the Wi-Fi watchdog is enabled for background checking even 3071 * after it thinks the user has connected to a good access point. 3072 */ 3073 @Deprecated 3074 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 3075 "wifi_watchdog_background_check_enabled"; 3076 3077 /** 3078 * The timeout for a background ping 3079 */ 3080 @Deprecated 3081 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 3082 "wifi_watchdog_background_check_timeout_ms"; 3083 3084 /** 3085 * The number of initial pings to perform that *may* be ignored if they 3086 * fail. Again, if these fail, they will *not* be used in packet loss 3087 * calculation. For example, one network always seemed to time out for 3088 * the first couple pings, so this is set to 3 by default. 3089 */ 3090 @Deprecated 3091 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 3092 "wifi_watchdog_initial_ignored_ping_count"; 3093 3094 /** 3095 * The maximum number of access points (per network) to attempt to test. 3096 * If this number is reached, the watchdog will no longer monitor the 3097 * initial connection state for the network. This is a safeguard for 3098 * networks containing multiple APs whose DNS does not respond to pings. 3099 */ 3100 @Deprecated 3101 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 3102 3103 /** 3104 * Whether the Wi-Fi watchdog is enabled. 3105 */ 3106 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 3107 3108 /** 3109 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 3110 */ 3111 @Deprecated 3112 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 3113 3114 /** 3115 * The number of pings to test if an access point is a good connection. 3116 */ 3117 @Deprecated 3118 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 3119 3120 /** 3121 * The delay between pings. 3122 */ 3123 @Deprecated 3124 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 3125 3126 /** 3127 * The timeout per ping. 3128 */ 3129 @Deprecated 3130 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 3131 3132 /** 3133 * ms delay before rechecking an 'online' wifi connection when it is thought to be unstable. 3134 * @hide 3135 */ 3136 public static final String WIFI_WATCHDOG_ARP_CHECK_INTERVAL_MS = 3137 "wifi_watchdog_arp_interval_ms"; 3138 3139 /** 3140 * ms delay interval between rssi polling when the signal is known to be weak 3141 * @hide 3142 */ 3143 public static final String WIFI_WATCHDOG_RSSI_FETCH_INTERVAL_MS = 3144 "wifi_watchdog_rssi_fetch_interval_ms"; 3145 3146 3147 /** 3148 * ms delay before rechecking a connect SSID for walled garden with a http download. 3149 * @hide 3150 */ 3151 public static final String WIFI_WATCHDOG_WALLED_GARDEN_INTERVAL_MS = 3152 "wifi_watchdog_walled_garden_interval_ms"; 3153 3154 /** 3155 * Number of ARP pings per check. 3156 * @hide 3157 */ 3158 public static final String WIFI_WATCHDOG_NUM_ARP_PINGS = "wifi_watchdog_num_arp_pings"; 3159 3160 /** 3161 * Minimum number of responses to the arp pings to consider the test 'successful'. 3162 * @hide 3163 */ 3164 public static final String WIFI_WATCHDOG_MIN_ARP_RESPONSES = 3165 "wifi_watchdog_min_arp_responses"; 3166 3167 /** 3168 * Timeout on ARP pings 3169 * @hide 3170 */ 3171 public static final String WIFI_WATCHDOG_ARP_PING_TIMEOUT_MS = 3172 "wifi_watchdog_arp_ping_timeout_ms"; 3173 3174 /** 3175 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 3176 * the setting needs to be set to 0 to disable it. 3177 * @hide 3178 */ 3179 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 3180 "wifi_watchdog_poor_network_test_enabled"; 3181 3182 /** 3183 * Setting to turn off walled garden test on Wi-Fi. Feature is enabled by default and 3184 * the setting needs to be set to 0 to disable it. 3185 * @hide 3186 */ 3187 public static final String WIFI_WATCHDOG_WALLED_GARDEN_TEST_ENABLED = 3188 "wifi_watchdog_walled_garden_test_enabled"; 3189 3190 /** 3191 * The URL used for walled garden check upon a new conection. WifiWatchdogService 3192 * fetches the URL and checks to see if {@link #WIFI_WATCHDOG_WALLED_GARDEN_PATTERN} 3193 * is not part of the title string to notify the user on the presence of a walled garden. 3194 * @hide 3195 */ 3196 public static final String WIFI_WATCHDOG_WALLED_GARDEN_URL = 3197 "wifi_watchdog_walled_garden_url"; 3198 3199 /** 3200 * The maximum number of times we will retry a connection to an access 3201 * point for which we have failed in acquiring an IP address from DHCP. 3202 * A value of N means that we will make N+1 connection attempts in all. 3203 */ 3204 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 3205 3206 /** 3207 * The operational wifi frequency band 3208 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 3209 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 3210 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 3211 * 3212 * @hide 3213 */ 3214 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 3215 3216 /** 3217 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 3218 * data connectivity to be established after a disconnect from Wi-Fi. 3219 */ 3220 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 3221 "wifi_mobile_data_transition_wakelock_timeout_ms"; 3222 3223 /** 3224 * Whether background data usage is allowed by the user. See 3225 * ConnectivityManager for more info. 3226 */ 3227 @Deprecated 3228 public static final String BACKGROUND_DATA = "background_data"; 3229 3230 /** 3231 * Origins for which browsers should allow geolocation by default. 3232 * The value is a space-separated list of origins. 3233 */ 3234 public static final String ALLOWED_GEOLOCATION_ORIGINS 3235 = "allowed_geolocation_origins"; 3236 3237 /** 3238 * Whether mobile data connections are allowed by the user. See 3239 * ConnectivityManager for more info. 3240 * @hide 3241 */ 3242 public static final String MOBILE_DATA = "mobile_data"; 3243 3244 /** 3245 * The CDMA roaming mode 0 = Home Networks, CDMA default 3246 * 1 = Roaming on Affiliated networks 3247 * 2 = Roaming on any networks 3248 * @hide 3249 */ 3250 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 3251 3252 /** 3253 * The CDMA subscription mode 0 = RUIM/SIM (default) 3254 * 1 = NV 3255 * @hide 3256 */ 3257 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 3258 3259 /** 3260 * The preferred network mode 7 = Global 3261 * 6 = EvDo only 3262 * 5 = CDMA w/o EvDo 3263 * 4 = CDMA / EvDo auto 3264 * 3 = GSM / WCDMA auto 3265 * 2 = WCDMA only 3266 * 1 = GSM only 3267 * 0 = GSM / WCDMA preferred 3268 * @hide 3269 */ 3270 public static final String PREFERRED_NETWORK_MODE = 3271 "preferred_network_mode"; 3272 3273 /** 3274 * The preferred TTY mode 0 = TTy Off, CDMA default 3275 * 1 = TTY Full 3276 * 2 = TTY HCO 3277 * 3 = TTY VCO 3278 * @hide 3279 */ 3280 public static final String PREFERRED_TTY_MODE = 3281 "preferred_tty_mode"; 3282 3283 3284 /** 3285 * CDMA Cell Broadcast SMS 3286 * 0 = CDMA Cell Broadcast SMS disabled 3287 * 1 = CDMA Cell Broadcast SMS enabled 3288 * @hide 3289 */ 3290 public static final String CDMA_CELL_BROADCAST_SMS = 3291 "cdma_cell_broadcast_sms"; 3292 3293 /** 3294 * The cdma subscription 0 = Subscription from RUIM, when available 3295 * 1 = Subscription from NV 3296 * @hide 3297 */ 3298 public static final String PREFERRED_CDMA_SUBSCRIPTION = 3299 "preferred_cdma_subscription"; 3300 3301 /** 3302 * Whether the enhanced voice privacy mode is enabled. 3303 * 0 = normal voice privacy 3304 * 1 = enhanced voice privacy 3305 * @hide 3306 */ 3307 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 3308 3309 /** 3310 * Whether the TTY mode mode is enabled. 3311 * 0 = disabled 3312 * 1 = enabled 3313 * @hide 3314 */ 3315 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 3316 3317 /** 3318 * The number of milliseconds to delay before sending out Connectivyt Change broadcasts 3319 * @hide 3320 */ 3321 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 3322 3323 /** 3324 * Default value for CONNECTIVITY_CHANGE_DELAY in milliseconds. 3325 * @hide 3326 */ 3327 public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000; 3328 3329 /** 3330 * Controls whether settings backup is enabled. 3331 * Type: int ( 0 = disabled, 1 = enabled ) 3332 * @hide 3333 */ 3334 public static final String BACKUP_ENABLED = "backup_enabled"; 3335 3336 /** 3337 * Controls whether application data is automatically restored from backup 3338 * at install time. 3339 * Type: int ( 0 = disabled, 1 = enabled ) 3340 * @hide 3341 */ 3342 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 3343 3344 /** 3345 * Indicates whether settings backup has been fully provisioned. 3346 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 3347 * @hide 3348 */ 3349 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 3350 3351 /** 3352 * Component of the transport to use for backup/restore. 3353 * @hide 3354 */ 3355 public static final String BACKUP_TRANSPORT = "backup_transport"; 3356 3357 /** 3358 * Version for which the setup wizard was last shown. Bumped for 3359 * each release when there is new setup information to show. 3360 * @hide 3361 */ 3362 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 3363 3364 /** 3365 * How frequently (in seconds) to check the memory status of the 3366 * device. 3367 * @hide 3368 */ 3369 public static final String MEMCHECK_INTERVAL = "memcheck_interval"; 3370 3371 /** 3372 * Max frequency (in seconds) to log memory check stats, in realtime 3373 * seconds. This allows for throttling of logs when the device is 3374 * running for large amounts of time. 3375 * @hide 3376 */ 3377 public static final String MEMCHECK_LOG_REALTIME_INTERVAL = 3378 "memcheck_log_realtime_interval"; 3379 3380 /** 3381 * Boolean indicating whether rebooting due to system memory checks 3382 * is enabled. 3383 * @hide 3384 */ 3385 public static final String MEMCHECK_SYSTEM_ENABLED = "memcheck_system_enabled"; 3386 3387 /** 3388 * How many bytes the system process must be below to avoid scheduling 3389 * a soft reboot. This reboot will happen when it is next determined 3390 * to be a good time. 3391 * @hide 3392 */ 3393 public static final String MEMCHECK_SYSTEM_SOFT_THRESHOLD = "memcheck_system_soft"; 3394 3395 /** 3396 * How many bytes the system process must be below to avoid scheduling 3397 * a hard reboot. This reboot will happen immediately. 3398 * @hide 3399 */ 3400 public static final String MEMCHECK_SYSTEM_HARD_THRESHOLD = "memcheck_system_hard"; 3401 3402 /** 3403 * How many bytes the phone process must be below to avoid scheduling 3404 * a soft restart. This restart will happen when it is next determined 3405 * to be a good time. 3406 * @hide 3407 */ 3408 public static final String MEMCHECK_PHONE_SOFT_THRESHOLD = "memcheck_phone_soft"; 3409 3410 /** 3411 * How many bytes the phone process must be below to avoid scheduling 3412 * a hard restart. This restart will happen immediately. 3413 * @hide 3414 */ 3415 public static final String MEMCHECK_PHONE_HARD_THRESHOLD = "memcheck_phone_hard"; 3416 3417 /** 3418 * Boolean indicating whether restarting the phone process due to 3419 * memory checks is enabled. 3420 * @hide 3421 */ 3422 public static final String MEMCHECK_PHONE_ENABLED = "memcheck_phone_enabled"; 3423 3424 /** 3425 * First time during the day it is okay to kill processes 3426 * or reboot the device due to low memory situations. This number is 3427 * in seconds since midnight. 3428 * @hide 3429 */ 3430 public static final String MEMCHECK_EXEC_START_TIME = "memcheck_exec_start_time"; 3431 3432 /** 3433 * Last time during the day it is okay to kill processes 3434 * or reboot the device due to low memory situations. This number is 3435 * in seconds since midnight. 3436 * @hide 3437 */ 3438 public static final String MEMCHECK_EXEC_END_TIME = "memcheck_exec_end_time"; 3439 3440 /** 3441 * How long the screen must have been off in order to kill processes 3442 * or reboot. This number is in seconds. A value of -1 means to 3443 * entirely disregard whether the screen is on. 3444 * @hide 3445 */ 3446 public static final String MEMCHECK_MIN_SCREEN_OFF = "memcheck_min_screen_off"; 3447 3448 /** 3449 * How much time there must be until the next alarm in order to kill processes 3450 * or reboot. This number is in seconds. Note: this value must be 3451 * smaller than {@link #MEMCHECK_RECHECK_INTERVAL} or else it will 3452 * always see an alarm scheduled within its time. 3453 * @hide 3454 */ 3455 public static final String MEMCHECK_MIN_ALARM = "memcheck_min_alarm"; 3456 3457 /** 3458 * How frequently to check whether it is a good time to restart things, 3459 * if the device is in a bad state. This number is in seconds. Note: 3460 * this value must be larger than {@link #MEMCHECK_MIN_ALARM} or else 3461 * the alarm to schedule the recheck will always appear within the 3462 * minimum "do not execute now" time. 3463 * @hide 3464 */ 3465 public static final String MEMCHECK_RECHECK_INTERVAL = "memcheck_recheck_interval"; 3466 3467 /** 3468 * How frequently (in DAYS) to reboot the device. If 0, no reboots 3469 * will occur. 3470 * @hide 3471 */ 3472 public static final String REBOOT_INTERVAL = "reboot_interval"; 3473 3474 /** 3475 * First time during the day it is okay to force a reboot of the 3476 * device (if REBOOT_INTERVAL is set). This number is 3477 * in seconds since midnight. 3478 * @hide 3479 */ 3480 public static final String REBOOT_START_TIME = "reboot_start_time"; 3481 3482 /** 3483 * The window of time (in seconds) after each REBOOT_INTERVAL in which 3484 * a reboot can be executed. If 0, a reboot will always be executed at 3485 * exactly the given time. Otherwise, it will only be executed if 3486 * the device is idle within the window. 3487 * @hide 3488 */ 3489 public static final String REBOOT_WINDOW = "reboot_window"; 3490 3491 /** 3492 * Threshold values for the duration and level of a discharge cycle, under 3493 * which we log discharge cycle info. 3494 * @hide 3495 */ 3496 public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD = 3497 "battery_discharge_duration_threshold"; 3498 /** @hide */ 3499 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 3500 3501 /** 3502 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents 3503 * on application crashes and ANRs. If this is disabled, the crash/ANR dialog 3504 * will never display the "Report" button. 3505 * Type: int ( 0 = disallow, 1 = allow ) 3506 * @hide 3507 */ 3508 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 3509 3510 /** 3511 * Nonzero causes Log.wtf() to crash. 3512 * @hide 3513 */ 3514 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 3515 3516 /** 3517 * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}. 3518 * @hide 3519 */ 3520 public static final String DROPBOX_AGE_SECONDS = 3521 "dropbox_age_seconds"; 3522 /** 3523 * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around. 3524 * @hide 3525 */ 3526 public static final String DROPBOX_MAX_FILES = 3527 "dropbox_max_files"; 3528 /** 3529 * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what. 3530 * @hide 3531 */ 3532 public static final String DROPBOX_QUOTA_KB = 3533 "dropbox_quota_kb"; 3534 /** 3535 * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use. 3536 * @hide 3537 */ 3538 public static final String DROPBOX_QUOTA_PERCENT = 3539 "dropbox_quota_percent"; 3540 /** 3541 * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into. 3542 * @hide 3543 */ 3544 public static final String DROPBOX_RESERVE_PERCENT = 3545 "dropbox_reserve_percent"; 3546 /** 3547 * Prefix for per-tag dropbox disable/enable settings. 3548 * @hide 3549 */ 3550 public static final String DROPBOX_TAG_PREFIX = 3551 "dropbox:"; 3552 /** 3553 * Lines of logcat to include with system crash/ANR/etc. reports, 3554 * as a prefix of the dropbox tag of the report type. 3555 * For example, "logcat_for_system_server_anr" controls the lines 3556 * of logcat captured with system server ANR reports. 0 to disable. 3557 * @hide 3558 */ 3559 public static final String ERROR_LOGCAT_PREFIX = 3560 "logcat_for_"; 3561 3562 3563 /** 3564 * Screen timeout in milliseconds corresponding to the 3565 * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest 3566 * possible screen timeout behavior.) 3567 * @hide 3568 */ 3569 public static final String SHORT_KEYLIGHT_DELAY_MS = 3570 "short_keylight_delay_ms"; 3571 3572 /** 3573 * The interval in minutes after which the amount of free storage left on the 3574 * device is logged to the event log 3575 * @hide 3576 */ 3577 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = 3578 "sys_free_storage_log_interval"; 3579 3580 /** 3581 * Threshold for the amount of change in disk free space required to report the amount of 3582 * free space. Used to prevent spamming the logs when the disk free space isn't changing 3583 * frequently. 3584 * @hide 3585 */ 3586 public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD = 3587 "disk_free_change_reporting_threshold"; 3588 3589 3590 /** 3591 * Minimum percentage of free storage on the device that is used to determine if 3592 * the device is running low on storage. The default is 10. 3593 * <p>Say this value is set to 10, the device is considered running low on storage 3594 * if 90% or more of the device storage is filled up. 3595 * @hide 3596 */ 3597 public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE = 3598 "sys_storage_threshold_percentage"; 3599 3600 /** 3601 * Maximum byte size of the low storage threshold. This is to ensure 3602 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in 3603 * an overly large threshold for large storage devices. Currently this 3604 * must be less than 2GB. This default is 500MB. 3605 * @hide 3606 */ 3607 public static final String SYS_STORAGE_THRESHOLD_MAX_BYTES = 3608 "sys_storage_threshold_max_bytes"; 3609 3610 /** 3611 * Minimum bytes of free storage on the device before the data 3612 * partition is considered full. By default, 1 MB is reserved 3613 * to avoid system-wide SQLite disk full exceptions. 3614 * @hide 3615 */ 3616 public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES = 3617 "sys_storage_full_threshold_bytes"; 3618 3619 /** 3620 * The interval in milliseconds after which Wi-Fi is considered idle. 3621 * When idle, it is possible for the device to be switched from Wi-Fi to 3622 * the mobile data network. 3623 * @hide 3624 */ 3625 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 3626 3627 /** 3628 * The interval in milliseconds to issue wake up scans when wifi needs 3629 * to connect. This is necessary to connect to an access point when 3630 * device is on the move and the screen is off. 3631 * @hide 3632 */ 3633 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 3634 "wifi_framework_scan_interval_ms"; 3635 3636 /** 3637 * The interval in milliseconds to scan as used by the wifi supplicant 3638 * @hide 3639 */ 3640 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 3641 "wifi_supplicant_scan_interval_ms"; 3642 3643 /** 3644 * The interval in milliseconds at which to check packet counts on the 3645 * mobile data interface when screen is on, to detect possible data 3646 * connection problems. 3647 * @hide 3648 */ 3649 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 3650 "pdp_watchdog_poll_interval_ms"; 3651 3652 /** 3653 * The interval in milliseconds at which to check packet counts on the 3654 * mobile data interface when screen is off, to detect possible data 3655 * connection problems. 3656 * @hide 3657 */ 3658 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 3659 "pdp_watchdog_long_poll_interval_ms"; 3660 3661 /** 3662 * The interval in milliseconds at which to check packet counts on the 3663 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 3664 * outgoing packets has been reached without incoming packets. 3665 * @hide 3666 */ 3667 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 3668 "pdp_watchdog_error_poll_interval_ms"; 3669 3670 /** 3671 * The number of outgoing packets sent without seeing an incoming packet 3672 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 3673 * device is logged to the event log 3674 * @hide 3675 */ 3676 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 3677 "pdp_watchdog_trigger_packet_count"; 3678 3679 /** 3680 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 3681 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 3682 * attempting data connection recovery. 3683 * @hide 3684 */ 3685 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 3686 "pdp_watchdog_error_poll_count"; 3687 3688 /** 3689 * The number of failed PDP reset attempts before moving to something more 3690 * drastic: re-registering to the network. 3691 * @hide 3692 */ 3693 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 3694 "pdp_watchdog_max_pdp_reset_fail_count"; 3695 3696 /** 3697 * The number of milliseconds to delay when checking for data stalls during 3698 * non-aggressive detection. (screen is turned off.) 3699 * @hide 3700 */ 3701 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 3702 "data_stall_alarm_non_aggressive_delay_in_ms"; 3703 3704 /** 3705 * The number of milliseconds to delay when checking for data stalls during 3706 * aggressive detection. (screen on or suspected data stall) 3707 * @hide 3708 */ 3709 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 3710 "data_stall_alarm_aggressive_delay_in_ms"; 3711 3712 /** 3713 * The interval in milliseconds at which to check gprs registration 3714 * after the first registration mismatch of gprs and voice service, 3715 * to detect possible data network registration problems. 3716 * 3717 * @hide 3718 */ 3719 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 3720 "gprs_register_check_period_ms"; 3721 3722 /** 3723 * The length of time in milli-seconds that automatic small adjustments to 3724 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 3725 * @hide 3726 */ 3727 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 3728 3729 /** 3730 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 3731 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 3732 * exceeded. 3733 * @hide 3734 */ 3735 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 3736 3737 /** 3738 * The maximum reconnect delay for short network outages or when the network is suspended 3739 * due to phone use. 3740 * @hide 3741 */ 3742 public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS = 3743 "sync_max_retry_delay_in_seconds"; 3744 3745 /** 3746 * The interval in milliseconds at which to check the number of SMS sent 3747 * out without asking for use permit, to limit the un-authorized SMS 3748 * usage. 3749 * @hide 3750 */ 3751 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 3752 "sms_outgoing_check_interval_ms"; 3753 3754 /** 3755 * The number of outgoing SMS sent without asking for user permit 3756 * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS} 3757 * @hide 3758 */ 3759 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 3760 "sms_outgoing_check_max_count"; 3761 3762 /** 3763 * The global search provider chosen by the user (if multiple global 3764 * search providers are installed). This will be the provider returned 3765 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 3766 * installed. This setting is stored as a flattened component name as 3767 * per {@link ComponentName#flattenToString()}. 3768 * 3769 * @hide 3770 */ 3771 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 3772 "search_global_search_activity"; 3773 3774 /** 3775 * The number of promoted sources in GlobalSearch. 3776 * @hide 3777 */ 3778 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 3779 /** 3780 * The maximum number of suggestions returned by GlobalSearch. 3781 * @hide 3782 */ 3783 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 3784 /** 3785 * The number of suggestions GlobalSearch will ask each non-web search source for. 3786 * @hide 3787 */ 3788 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 3789 /** 3790 * The number of suggestions the GlobalSearch will ask the web search source for. 3791 * @hide 3792 */ 3793 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 3794 "search_web_results_override_limit"; 3795 /** 3796 * The number of milliseconds that GlobalSearch will wait for suggestions from 3797 * promoted sources before continuing with all other sources. 3798 * @hide 3799 */ 3800 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 3801 "search_promoted_source_deadline_millis"; 3802 /** 3803 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 3804 * @hide 3805 */ 3806 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 3807 /** 3808 * The maximum number of milliseconds that GlobalSearch shows the previous results 3809 * after receiving a new query. 3810 * @hide 3811 */ 3812 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 3813 /** 3814 * The maximum age of log data used for shortcuts in GlobalSearch. 3815 * @hide 3816 */ 3817 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 3818 /** 3819 * The maximum age of log data used for source ranking in GlobalSearch. 3820 * @hide 3821 */ 3822 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 3823 "search_max_source_event_age_millis"; 3824 /** 3825 * The minimum number of impressions needed to rank a source in GlobalSearch. 3826 * @hide 3827 */ 3828 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 3829 "search_min_impressions_for_source_ranking"; 3830 /** 3831 * The minimum number of clicks needed to rank a source in GlobalSearch. 3832 * @hide 3833 */ 3834 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 3835 "search_min_clicks_for_source_ranking"; 3836 /** 3837 * The maximum number of shortcuts shown by GlobalSearch. 3838 * @hide 3839 */ 3840 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 3841 /** 3842 * The size of the core thread pool for suggestion queries in GlobalSearch. 3843 * @hide 3844 */ 3845 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 3846 "search_query_thread_core_pool_size"; 3847 /** 3848 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 3849 * @hide 3850 */ 3851 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 3852 "search_query_thread_max_pool_size"; 3853 /** 3854 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 3855 * @hide 3856 */ 3857 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 3858 "search_shortcut_refresh_core_pool_size"; 3859 /** 3860 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 3861 * @hide 3862 */ 3863 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 3864 "search_shortcut_refresh_max_pool_size"; 3865 /** 3866 * The maximun time that excess threads in the GlobalSeach thread pools will 3867 * wait before terminating. 3868 * @hide 3869 */ 3870 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 3871 "search_thread_keepalive_seconds"; 3872 /** 3873 * The maximum number of concurrent suggestion queries to each source. 3874 * @hide 3875 */ 3876 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 3877 "search_per_source_concurrent_query_limit"; 3878 3879 /** 3880 * Whether or not alert sounds are played on MountService events. (0 = false, 1 = true) 3881 * @hide 3882 */ 3883 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 3884 3885 /** 3886 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 3887 * @hide 3888 */ 3889 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 3890 3891 /** 3892 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 3893 * @hide 3894 */ 3895 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 3896 3897 /** 3898 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 3899 * @hide 3900 */ 3901 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 3902 3903 /** 3904 * If nonzero, ANRs in invisible background processes bring up a dialog. 3905 * Otherwise, the process will be silently killed. 3906 * @hide 3907 */ 3908 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 3909 3910 /** 3911 * The {@link ComponentName} string of the service to be used as the voice recognition 3912 * service. 3913 * 3914 * @hide 3915 */ 3916 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 3917 3918 3919 /** 3920 * The {@link ComponentName} string of the selected spell checker service which is 3921 * one of the services managed by the text service manager. 3922 * 3923 * @hide 3924 */ 3925 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 3926 3927 /** 3928 * The {@link ComponentName} string of the selected subtype of the selected spell checker 3929 * service which is one of the services managed by the text service manager. 3930 * 3931 * @hide 3932 */ 3933 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 3934 "selected_spell_checker_subtype"; 3935 3936 /** 3937 * The {@link ComponentName} string whether spell checker is enabled or not. 3938 * 3939 * @hide 3940 */ 3941 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 3942 3943 /** 3944 * What happens when the user presses the Power button while in-call 3945 * and the screen is on.<br/> 3946 * <b>Values:</b><br/> 3947 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 3948 * 2 - The Power button hangs up the current call.<br/> 3949 * 3950 * @hide 3951 */ 3952 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 3953 3954 /** 3955 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 3956 * @hide 3957 */ 3958 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 3959 3960 /** 3961 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 3962 * @hide 3963 */ 3964 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 3965 3966 /** 3967 * INCALL_POWER_BUTTON_BEHAVIOR default value. 3968 * @hide 3969 */ 3970 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 3971 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 3972 3973 /** 3974 * The current night mode that has been selected by the user. Owned 3975 * and controlled by UiModeManagerService. Constants are as per 3976 * UiModeManager. 3977 * @hide 3978 */ 3979 public static final String UI_NIGHT_MODE = "ui_night_mode"; 3980 3981 /** 3982 * Let user pick default install location. 3983 * @hide 3984 */ 3985 public static final String SET_INSTALL_LOCATION = "set_install_location"; 3986 3987 /** 3988 * Default install location value. 3989 * 0 = auto, let system decide 3990 * 1 = internal 3991 * 2 = sdcard 3992 * @hide 3993 */ 3994 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 3995 3996 /** 3997 * The bandwidth throttle polling freqency in seconds 3998 * @hide 3999 */ 4000 public static final String THROTTLE_POLLING_SEC = "throttle_polling_sec"; 4001 4002 /** 4003 * The bandwidth throttle threshold (long) 4004 * @hide 4005 */ 4006 public static final String THROTTLE_THRESHOLD_BYTES = "throttle_threshold_bytes"; 4007 4008 /** 4009 * The bandwidth throttle value (kbps) 4010 * @hide 4011 */ 4012 public static final String THROTTLE_VALUE_KBITSPS = "throttle_value_kbitsps"; 4013 4014 /** 4015 * The bandwidth throttle reset calendar day (1-28) 4016 * @hide 4017 */ 4018 public static final String THROTTLE_RESET_DAY = "throttle_reset_day"; 4019 4020 /** 4021 * The throttling notifications we should send 4022 * @hide 4023 */ 4024 public static final String THROTTLE_NOTIFICATION_TYPE = "throttle_notification_type"; 4025 4026 /** 4027 * Help URI for data throttling policy 4028 * @hide 4029 */ 4030 public static final String THROTTLE_HELP_URI = "throttle_help_uri"; 4031 4032 /** 4033 * The length of time in Sec that we allow our notion of NTP time 4034 * to be cached before we refresh it 4035 * @hide 4036 */ 4037 public static final String THROTTLE_MAX_NTP_CACHE_AGE_SEC = 4038 "throttle_max_ntp_cache_age_sec"; 4039 4040 /** 4041 * The maximum size, in bytes, of a download that the download manager will transfer over 4042 * a non-wifi connection. 4043 * @hide 4044 */ 4045 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 4046 "download_manager_max_bytes_over_mobile"; 4047 4048 /** 4049 * The recommended maximum size, in bytes, of a download that the download manager should 4050 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 4051 * have the option to start the download over the mobile connection anyway. 4052 * @hide 4053 */ 4054 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 4055 "download_manager_recommended_max_bytes_over_mobile"; 4056 4057 /** 4058 * ms during which to consume extra events related to Inet connection condition 4059 * after a transtion to fully-connected 4060 * @hide 4061 */ 4062 public static final String INET_CONDITION_DEBOUNCE_UP_DELAY = 4063 "inet_condition_debounce_up_delay"; 4064 4065 /** 4066 * ms during which to consume extra events related to Inet connection condtion 4067 * after a transtion to partly-connected 4068 * @hide 4069 */ 4070 public static final String INET_CONDITION_DEBOUNCE_DOWN_DELAY = 4071 "inet_condition_debounce_down_delay"; 4072 4073 /** 4074 * URL to open browser on to allow user to manage a prepay account 4075 * @hide 4076 */ 4077 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 4078 "setup_prepaid_data_service_url"; 4079 4080 /** 4081 * URL to attempt a GET on to see if this is a prepay device 4082 * @hide 4083 */ 4084 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 4085 "setup_prepaid_detection_target_url"; 4086 4087 /** 4088 * Host to check for a redirect to after an attempt to GET 4089 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 4090 * this is a prepaid device with zero balance.) 4091 * @hide 4092 */ 4093 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 4094 "setup_prepaid_detection_redir_host"; 4095 4096 /** 4097 * Whether the screensaver is enabled. 4098 * @hide 4099 */ 4100 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 4101 4102 /** 4103 * The user's chosen screensaver component. 4104 * 4105 * This component will be launched by the PhoneWindowManager after a timeout when not on 4106 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 4107 * @hide 4108 */ 4109 public static final String SCREENSAVER_COMPONENT = "screensaver_component"; 4110 4111 /** 4112 * Whether the screensaver should be automatically launched when the device is inserted 4113 * into a (desk) dock. 4114 * @hide 4115 */ 4116 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 4117 4118 /** {@hide} */ 4119 public static final String NETSTATS_ENABLED = "netstats_enabled"; 4120 /** {@hide} */ 4121 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 4122 /** {@hide} */ 4123 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 4124 /** {@hide} */ 4125 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 4126 /** {@hide} */ 4127 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 4128 4129 /** {@hide} */ 4130 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 4131 /** {@hide} */ 4132 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 4133 /** {@hide} */ 4134 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 4135 /** {@hide} */ 4136 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 4137 4138 /** {@hide} */ 4139 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 4140 /** {@hide} */ 4141 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 4142 /** {@hide} */ 4143 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 4144 /** {@hide} */ 4145 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 4146 4147 /** {@hide} */ 4148 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; 4149 /** {@hide} */ 4150 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; 4151 /** {@hide} */ 4152 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 4153 /** {@hide} */ 4154 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 4155 4156 /** Preferred NTP server. {@hide} */ 4157 public static final String NTP_SERVER = "ntp_server"; 4158 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 4159 public static final String NTP_TIMEOUT = "ntp_timeout"; 4160 4161 /** Autofill server address (Used in WebView/browser). {@hide} */ 4162 public static final String WEB_AUTOFILL_QUERY_URL = 4163 "web_autofill_query_url"; 4164 4165 /** Whether package verification is enabled. {@hide} */ 4166 public static final String PACKAGE_VERIFIER_ENABLE = "verifier_enable"; 4167 4168 /** Timeout for package verification. {@hide} */ 4169 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 4170 4171 /** 4172 * Duration in milliseconds before pre-authorized URIs for the contacts 4173 * provider should expire. 4174 * @hide 4175 */ 4176 public static final String CONTACTS_PREAUTH_URI_EXPIRATION = 4177 "contacts_preauth_uri_expiration"; 4178 4179 /** 4180 * This are the settings to be backed up. 4181 * 4182 * NOTE: Settings are backed up and restored in the order they appear 4183 * in this array. If you have one setting depending on another, 4184 * make sure that they are ordered appropriately. 4185 * 4186 * @hide 4187 */ 4188 public static final String[] SETTINGS_TO_BACKUP = { 4189 ADB_ENABLED, 4190 ALLOW_MOCK_LOCATION, 4191 PARENTAL_CONTROL_ENABLED, 4192 PARENTAL_CONTROL_REDIRECT_URL, 4193 USB_MASS_STORAGE_ENABLED, 4194 ACCESSIBILITY_SCRIPT_INJECTION, 4195 BACKUP_AUTO_RESTORE, 4196 ENABLED_ACCESSIBILITY_SERVICES, 4197 TOUCH_EXPLORATION_ENABLED, 4198 ACCESSIBILITY_ENABLED, 4199 ACCESSIBILITY_SPEAK_PASSWORD, 4200 TTS_USE_DEFAULTS, 4201 TTS_DEFAULT_RATE, 4202 TTS_DEFAULT_PITCH, 4203 TTS_DEFAULT_SYNTH, 4204 TTS_DEFAULT_LANG, 4205 TTS_DEFAULT_COUNTRY, 4206 TTS_ENABLED_PLUGINS, 4207 TTS_DEFAULT_LOCALE, 4208 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 4209 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 4210 WIFI_NUM_OPEN_NETWORKS_KEPT, 4211 MOUNT_PLAY_NOTIFICATION_SND, 4212 MOUNT_UMS_AUTOSTART, 4213 MOUNT_UMS_PROMPT, 4214 MOUNT_UMS_NOTIFY_ENABLED, 4215 UI_NIGHT_MODE, 4216 LOCK_SCREEN_OWNER_INFO, 4217 LOCK_SCREEN_OWNER_INFO_ENABLED 4218 }; 4219 4220 /** 4221 * Helper method for determining if a location provider is enabled. 4222 * @param cr the content resolver to use 4223 * @param provider the location provider to query 4224 * @return true if the provider is enabled 4225 */ 4226 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 4227 String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED); 4228 return TextUtils.delimitedStringContains(allowedProviders, ',', provider); 4229 } 4230 4231 /** 4232 * Thread-safe method for enabling or disabling a single location provider. 4233 * @param cr the content resolver to use 4234 * @param provider the location provider to enable or disable 4235 * @param enabled true if the provider should be enabled 4236 */ 4237 public static final void setLocationProviderEnabled(ContentResolver cr, 4238 String provider, boolean enabled) { 4239 // to ensure thread safety, we write the provider name with a '+' or '-' 4240 // and let the SettingsProvider handle it rather than reading and modifying 4241 // the list of enabled providers. 4242 if (enabled) { 4243 provider = "+" + provider; 4244 } else { 4245 provider = "-" + provider; 4246 } 4247 putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider); 4248 } 4249 } 4250 4251 /** 4252 * User-defined bookmarks and shortcuts. The target of each bookmark is an 4253 * Intent URL, allowing it to be either a web page or a particular 4254 * application activity. 4255 * 4256 * @hide 4257 */ 4258 public static final class Bookmarks implements BaseColumns 4259 { 4260 private static final String TAG = "Bookmarks"; 4261 4262 /** 4263 * The content:// style URL for this table 4264 */ 4265 public static final Uri CONTENT_URI = 4266 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 4267 4268 /** 4269 * The row ID. 4270 * <p>Type: INTEGER</p> 4271 */ 4272 public static final String ID = "_id"; 4273 4274 /** 4275 * Descriptive name of the bookmark that can be displayed to the user. 4276 * If this is empty, the title should be resolved at display time (use 4277 * {@link #getTitle(Context, Cursor)} any time you want to display the 4278 * title of a bookmark.) 4279 * <P> 4280 * Type: TEXT 4281 * </P> 4282 */ 4283 public static final String TITLE = "title"; 4284 4285 /** 4286 * Arbitrary string (displayed to the user) that allows bookmarks to be 4287 * organized into categories. There are some special names for 4288 * standard folders, which all start with '@'. The label displayed for 4289 * the folder changes with the locale (via {@link #getLabelForFolder}) but 4290 * the folder name does not change so you can consistently query for 4291 * the folder regardless of the current locale. 4292 * 4293 * <P>Type: TEXT</P> 4294 * 4295 */ 4296 public static final String FOLDER = "folder"; 4297 4298 /** 4299 * The Intent URL of the bookmark, describing what it points to. This 4300 * value is given to {@link android.content.Intent#getIntent} to create 4301 * an Intent that can be launched. 4302 * <P>Type: TEXT</P> 4303 */ 4304 public static final String INTENT = "intent"; 4305 4306 /** 4307 * Optional shortcut character associated with this bookmark. 4308 * <P>Type: INTEGER</P> 4309 */ 4310 public static final String SHORTCUT = "shortcut"; 4311 4312 /** 4313 * The order in which the bookmark should be displayed 4314 * <P>Type: INTEGER</P> 4315 */ 4316 public static final String ORDERING = "ordering"; 4317 4318 private static final String[] sIntentProjection = { INTENT }; 4319 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 4320 private static final String sShortcutSelection = SHORTCUT + "=?"; 4321 4322 /** 4323 * Convenience function to retrieve the bookmarked Intent for a 4324 * particular shortcut key. 4325 * 4326 * @param cr The ContentResolver to query. 4327 * @param shortcut The shortcut key. 4328 * 4329 * @return Intent The bookmarked URL, or null if there is no bookmark 4330 * matching the given shortcut. 4331 */ 4332 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 4333 { 4334 Intent intent = null; 4335 4336 Cursor c = cr.query(CONTENT_URI, 4337 sIntentProjection, sShortcutSelection, 4338 new String[] { String.valueOf((int) shortcut) }, ORDERING); 4339 // Keep trying until we find a valid shortcut 4340 try { 4341 while (intent == null && c.moveToNext()) { 4342 try { 4343 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 4344 intent = Intent.parseUri(intentURI, 0); 4345 } catch (java.net.URISyntaxException e) { 4346 // The stored URL is bad... ignore it. 4347 } catch (IllegalArgumentException e) { 4348 // Column not found 4349 Log.w(TAG, "Intent column not found", e); 4350 } 4351 } 4352 } finally { 4353 if (c != null) c.close(); 4354 } 4355 4356 return intent; 4357 } 4358 4359 /** 4360 * Add a new bookmark to the system. 4361 * 4362 * @param cr The ContentResolver to query. 4363 * @param intent The desired target of the bookmark. 4364 * @param title Bookmark title that is shown to the user; null if none 4365 * or it should be resolved to the intent's title. 4366 * @param folder Folder in which to place the bookmark; null if none. 4367 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 4368 * this is non-zero and there is an existing bookmark entry 4369 * with this same shortcut, then that existing shortcut is 4370 * cleared (the bookmark is not removed). 4371 * @return The unique content URL for the new bookmark entry. 4372 */ 4373 public static Uri add(ContentResolver cr, 4374 Intent intent, 4375 String title, 4376 String folder, 4377 char shortcut, 4378 int ordering) 4379 { 4380 // If a shortcut is supplied, and it is already defined for 4381 // another bookmark, then remove the old definition. 4382 if (shortcut != 0) { 4383 cr.delete(CONTENT_URI, sShortcutSelection, 4384 new String[] { String.valueOf((int) shortcut) }); 4385 } 4386 4387 ContentValues values = new ContentValues(); 4388 if (title != null) values.put(TITLE, title); 4389 if (folder != null) values.put(FOLDER, folder); 4390 values.put(INTENT, intent.toUri(0)); 4391 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 4392 values.put(ORDERING, ordering); 4393 return cr.insert(CONTENT_URI, values); 4394 } 4395 4396 /** 4397 * Return the folder name as it should be displayed to the user. This 4398 * takes care of localizing special folders. 4399 * 4400 * @param r Resources object for current locale; only need access to 4401 * system resources. 4402 * @param folder The value found in the {@link #FOLDER} column. 4403 * 4404 * @return CharSequence The label for this folder that should be shown 4405 * to the user. 4406 */ 4407 public static CharSequence getLabelForFolder(Resources r, String folder) { 4408 return folder; 4409 } 4410 4411 /** 4412 * Return the title as it should be displayed to the user. This takes 4413 * care of localizing bookmarks that point to activities. 4414 * 4415 * @param context A context. 4416 * @param cursor A cursor pointing to the row whose title should be 4417 * returned. The cursor must contain at least the {@link #TITLE} 4418 * and {@link #INTENT} columns. 4419 * @return A title that is localized and can be displayed to the user, 4420 * or the empty string if one could not be found. 4421 */ 4422 public static CharSequence getTitle(Context context, Cursor cursor) { 4423 int titleColumn = cursor.getColumnIndex(TITLE); 4424 int intentColumn = cursor.getColumnIndex(INTENT); 4425 if (titleColumn == -1 || intentColumn == -1) { 4426 throw new IllegalArgumentException( 4427 "The cursor must contain the TITLE and INTENT columns."); 4428 } 4429 4430 String title = cursor.getString(titleColumn); 4431 if (!TextUtils.isEmpty(title)) { 4432 return title; 4433 } 4434 4435 String intentUri = cursor.getString(intentColumn); 4436 if (TextUtils.isEmpty(intentUri)) { 4437 return ""; 4438 } 4439 4440 Intent intent; 4441 try { 4442 intent = Intent.parseUri(intentUri, 0); 4443 } catch (URISyntaxException e) { 4444 return ""; 4445 } 4446 4447 PackageManager packageManager = context.getPackageManager(); 4448 ResolveInfo info = packageManager.resolveActivity(intent, 0); 4449 return info != null ? info.loadLabel(packageManager) : ""; 4450 } 4451 } 4452 4453 /** 4454 * Returns the device ID that we should use when connecting to the mobile gtalk server. 4455 * This is a string like "android-0x1242", where the hex string is the Android ID obtained 4456 * from the GoogleLoginService. 4457 * 4458 * @param androidId The Android ID for this device. 4459 * @return The device ID that should be used when connecting to the mobile gtalk server. 4460 * @hide 4461 */ 4462 public static String getGTalkDeviceId(long androidId) { 4463 return "android-" + Long.toHexString(androidId); 4464 } 4465} 4466