Settings.java revision 798cccb659321dc60ef4dab87e64834b6c891620
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.Manifest; 20import android.annotation.IntDef; 21import android.annotation.IntRange; 22import android.annotation.NonNull; 23import android.annotation.Nullable; 24import android.annotation.RequiresPermission; 25import android.annotation.SdkConstant; 26import android.annotation.SdkConstant.SdkConstantType; 27import android.annotation.SystemApi; 28import android.annotation.TestApi; 29import android.annotation.UserIdInt; 30import android.app.ActivityThread; 31import android.app.AppOpsManager; 32import android.app.Application; 33import android.app.NotificationChannel; 34import android.app.SearchManager; 35import android.app.WallpaperManager; 36import android.content.ComponentName; 37import android.content.ContentResolver; 38import android.content.ContentValues; 39import android.content.Context; 40import android.content.IContentProvider; 41import android.content.Intent; 42import android.content.pm.ActivityInfo; 43import android.content.pm.PackageManager; 44import android.content.pm.ResolveInfo; 45import android.content.res.Configuration; 46import android.content.res.Resources; 47import android.database.Cursor; 48import android.database.SQLException; 49import android.location.LocationManager; 50import android.net.ConnectivityManager; 51import android.net.NetworkScoreManager; 52import android.net.Uri; 53import android.net.wifi.WifiManager; 54import android.os.BatteryManager; 55import android.os.Binder; 56import android.os.Build.VERSION_CODES; 57import android.os.Bundle; 58import android.os.DropBoxManager; 59import android.os.IBinder; 60import android.os.LocaleList; 61import android.os.Process; 62import android.os.RemoteException; 63import android.os.ResultReceiver; 64import android.os.ServiceManager; 65import android.os.UserHandle; 66import android.speech.tts.TextToSpeech; 67import android.text.TextUtils; 68import android.util.AndroidException; 69import android.util.ArrayMap; 70import android.util.ArraySet; 71import android.util.Log; 72import android.util.MemoryIntArray; 73 74import com.android.internal.annotations.GuardedBy; 75import com.android.internal.util.ArrayUtils; 76import com.android.internal.widget.ILockSettings; 77 78import java.io.IOException; 79import java.lang.annotation.Retention; 80import java.lang.annotation.RetentionPolicy; 81import java.net.URISyntaxException; 82import java.text.SimpleDateFormat; 83import java.util.HashMap; 84import java.util.HashSet; 85import java.util.Locale; 86import java.util.Map; 87import java.util.Set; 88 89/** 90 * The Settings provider contains global system-level device preferences. 91 */ 92public final class Settings { 93 94 // Intent actions for Settings 95 96 /** 97 * Activity Action: Show system settings. 98 * <p> 99 * Input: Nothing. 100 * <p> 101 * Output: Nothing. 102 */ 103 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 104 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 105 106 /** 107 * Activity Action: Show settings to allow configuration of APNs. 108 * <p> 109 * Input: Nothing. 110 * <p> 111 * Output: Nothing. 112 */ 113 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 114 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 115 116 /** 117 * Activity Action: Show settings to allow configuration of current location 118 * sources. 119 * <p> 120 * In some cases, a matching Activity may not exist, so ensure you 121 * safeguard against this. 122 * <p> 123 * Input: Nothing. 124 * <p> 125 * Output: Nothing. 126 */ 127 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 128 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 129 "android.settings.LOCATION_SOURCE_SETTINGS"; 130 131 /** 132 * Activity Action: Show settings to allow configuration of users. 133 * <p> 134 * In some cases, a matching Activity may not exist, so ensure you 135 * safeguard against this. 136 * <p> 137 * Input: Nothing. 138 * <p> 139 * Output: Nothing. 140 * @hide 141 */ 142 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 143 public static final String ACTION_USER_SETTINGS = 144 "android.settings.USER_SETTINGS"; 145 146 /** 147 * Activity Action: Show settings to allow configuration of wireless controls 148 * such as Wi-Fi, Bluetooth and Mobile networks. 149 * <p> 150 * In some cases, a matching Activity may not exist, so ensure you 151 * safeguard against this. 152 * <p> 153 * Input: Nothing. 154 * <p> 155 * Output: Nothing. 156 */ 157 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 158 public static final String ACTION_WIRELESS_SETTINGS = 159 "android.settings.WIRELESS_SETTINGS"; 160 161 /** 162 * Activity Action: Show tether provisioning activity. 163 * 164 * <p> 165 * In some cases, a matching Activity may not exist, so ensure you 166 * safeguard against this. 167 * <p> 168 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type 169 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should 170 * contain a {@link ResultReceiver} which will be called back with a tether result code. 171 * <p> 172 * Output: The result of the provisioning check. 173 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, 174 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. 175 * 176 * @hide 177 */ 178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 179 public static final String ACTION_TETHER_PROVISIONING = 180 "android.settings.TETHER_PROVISIONING_UI"; 181 182 /** 183 * Activity Action: Show settings to allow entering/exiting airplane mode. 184 * <p> 185 * In some cases, a matching Activity may not exist, so ensure you 186 * safeguard against this. 187 * <p> 188 * Input: Nothing. 189 * <p> 190 * Output: Nothing. 191 */ 192 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 193 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 194 "android.settings.AIRPLANE_MODE_SETTINGS"; 195 196 /** 197 * Activity Action: Modify Airplane mode settings using a voice command. 198 * <p> 199 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 200 * <p> 201 * This intent MUST be started using 202 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 203 * startVoiceActivity}. 204 * <p> 205 * Note: The activity implementing this intent MUST verify that 206 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 207 * modifying the setting. 208 * <p> 209 * Input: To tell which state airplane mode should be set to, add the 210 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. 211 * If the extra is not included, no changes will be made. 212 * <p> 213 * Output: Nothing. 214 */ 215 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 216 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = 217 "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; 218 219 /** 220 * Activity Action: Show settings for accessibility modules. 221 * <p> 222 * In some cases, a matching Activity may not exist, so ensure you 223 * safeguard against this. 224 * <p> 225 * Input: Nothing. 226 * <p> 227 * Output: Nothing. 228 */ 229 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 230 public static final String ACTION_ACCESSIBILITY_SETTINGS = 231 "android.settings.ACCESSIBILITY_SETTINGS"; 232 233 /** 234 * Activity Action: Show settings to control access to usage information. 235 * <p> 236 * In some cases, a matching Activity may not exist, so ensure you 237 * safeguard against this. 238 * <p> 239 * Input: Nothing. 240 * <p> 241 * Output: Nothing. 242 */ 243 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 244 public static final String ACTION_USAGE_ACCESS_SETTINGS = 245 "android.settings.USAGE_ACCESS_SETTINGS"; 246 247 /** 248 * Activity Category: Show application settings related to usage access. 249 * <p> 250 * An activity that provides a user interface for adjusting usage access related 251 * preferences for its containing application. Optional but recommended for apps that 252 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. 253 * <p> 254 * The activity may define meta-data to describe what usage access is 255 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which 256 * will be displayed in Settings. 257 * <p> 258 * Input: Nothing. 259 * <p> 260 * Output: Nothing. 261 */ 262 @SdkConstant(SdkConstantType.INTENT_CATEGORY) 263 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = 264 "android.intent.category.USAGE_ACCESS_CONFIG"; 265 266 /** 267 * Metadata key: Reason for needing usage access. 268 * <p> 269 * A key for metadata attached to an activity that receives action 270 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the 271 * user as description of how the app uses usage access. 272 * <p> 273 */ 274 public static final String METADATA_USAGE_ACCESS_REASON = 275 "android.settings.metadata.USAGE_ACCESS_REASON"; 276 277 /** 278 * Activity Action: Show settings to allow configuration of security and 279 * location privacy. 280 * <p> 281 * In some cases, a matching Activity may not exist, so ensure you 282 * safeguard against this. 283 * <p> 284 * Input: Nothing. 285 * <p> 286 * Output: Nothing. 287 */ 288 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 289 public static final String ACTION_SECURITY_SETTINGS = 290 "android.settings.SECURITY_SETTINGS"; 291 292 /** 293 * Activity Action: Show settings to allow configuration of trusted external sources 294 * <p> 295 * In some cases, a matching Activity may not exist, so ensure you 296 * safeguard against this. 297 * <p> 298 * Input: Nothing. 299 * <p> 300 * Output: Nothing. 301 */ 302 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 303 public static final String ACTION_MANAGE_EXTERNAL_SOURCES = 304 "android.settings.action.MANAGE_EXTERNAL_SOURCES"; 305 306 /** 307 * Activity Action: Show trusted credentials settings, opening to the user tab, 308 * to allow management of installed credentials. 309 * <p> 310 * In some cases, a matching Activity may not exist, so ensure you 311 * safeguard against this. 312 * <p> 313 * Input: Nothing. 314 * <p> 315 * Output: Nothing. 316 * @hide 317 */ 318 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 319 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 320 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 321 322 /** 323 * Activity Action: Show dialog explaining that an installed CA cert may enable 324 * monitoring of encrypted network traffic. 325 * <p> 326 * In some cases, a matching Activity may not exist, so ensure you 327 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the 328 * number of certificates. 329 * <p> 330 * Input: Nothing. 331 * <p> 332 * Output: Nothing. 333 * @hide 334 */ 335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 336 public static final String ACTION_MONITORING_CERT_INFO = 337 "com.android.settings.MONITORING_CERT_INFO"; 338 339 /** 340 * Activity Action: Show settings to allow configuration of privacy options. 341 * <p> 342 * In some cases, a matching Activity may not exist, so ensure you 343 * safeguard against this. 344 * <p> 345 * Input: Nothing. 346 * <p> 347 * Output: Nothing. 348 */ 349 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 350 public static final String ACTION_PRIVACY_SETTINGS = 351 "android.settings.PRIVACY_SETTINGS"; 352 353 /** 354 * Activity Action: Show settings to allow configuration of VPN. 355 * <p> 356 * In some cases, a matching Activity may not exist, so ensure you 357 * safeguard against this. 358 * <p> 359 * Input: Nothing. 360 * <p> 361 * Output: Nothing. 362 */ 363 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 364 public static final String ACTION_VPN_SETTINGS = 365 "android.settings.VPN_SETTINGS"; 366 367 /** 368 * Activity Action: Show settings to allow configuration of Wi-Fi. 369 * <p> 370 * In some cases, a matching Activity may not exist, so ensure you 371 * safeguard against this. 372 * <p> 373 * Input: Nothing. 374 * <p> 375 * Output: Nothing. 376 */ 377 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 378 public static final String ACTION_WIFI_SETTINGS = 379 "android.settings.WIFI_SETTINGS"; 380 381 /** 382 * Activity Action: Show settings to allow configuration of a static IP 383 * address for Wi-Fi. 384 * <p> 385 * In some cases, a matching Activity may not exist, so ensure you safeguard 386 * against this. 387 * <p> 388 * Input: Nothing. 389 * <p> 390 * Output: Nothing. 391 */ 392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 393 public static final String ACTION_WIFI_IP_SETTINGS = 394 "android.settings.WIFI_IP_SETTINGS"; 395 396 /** 397 * Activity Action: Show settings to allow the configuration of Wi-Fi features. 398 * <p> 399 * In some cases, a matching Activity may not exist, so ensure you 400 * safeguard against this. 401 * <p> 402 * Input: Nothing. 403 * <p> 404 * Output: Nothing. 405 * @hide 406 */ 407 @SystemApi 408 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 409 public static final String ACTION_CONFIGURE_WIFI_SETTINGS = 410 "android.settings.CONFIGURE_WIFI_SETTINGS"; 411 412 /** 413 * Activity Action: Show settings to allow configuration of Wi-Fi saved networks. 414 * <p> 415 * In some cases, a matching Activity may not exist, so ensure you 416 * safeguard against this. 417 * <p> 418 * Input: Nothing. 419 * <p> 420 * Output: Nothing. 421 * @hide 422 */ 423 @SystemApi 424 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 425 public static final String ACTION_WIFI_SAVED_NETWORK_SETTINGS = 426 "android.settings.WIFI_SAVED_NETWORK_SETTINGS"; 427 428 /** 429 * Activity Action: Show settings to allow configuration of Bluetooth. 430 * <p> 431 * In some cases, a matching Activity may not exist, so ensure you 432 * safeguard against this. 433 * <p> 434 * Input: Nothing. 435 * <p> 436 * Output: Nothing. 437 */ 438 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 439 public static final String ACTION_BLUETOOTH_SETTINGS = 440 "android.settings.BLUETOOTH_SETTINGS"; 441 442 /** 443 * Activity Action: Show settings to allow configuration of cast endpoints. 444 * <p> 445 * In some cases, a matching Activity may not exist, so ensure you 446 * safeguard against this. 447 * <p> 448 * Input: Nothing. 449 * <p> 450 * Output: Nothing. 451 */ 452 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 453 public static final String ACTION_CAST_SETTINGS = 454 "android.settings.CAST_SETTINGS"; 455 456 /** 457 * Activity Action: Show settings to allow configuration of date and time. 458 * <p> 459 * In some cases, a matching Activity may not exist, so ensure you 460 * safeguard against this. 461 * <p> 462 * Input: Nothing. 463 * <p> 464 * Output: Nothing. 465 */ 466 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 467 public static final String ACTION_DATE_SETTINGS = 468 "android.settings.DATE_SETTINGS"; 469 470 /** 471 * Activity Action: Show settings to allow configuration of sound and volume. 472 * <p> 473 * In some cases, a matching Activity may not exist, so ensure you 474 * safeguard against this. 475 * <p> 476 * Input: Nothing. 477 * <p> 478 * Output: Nothing. 479 */ 480 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 481 public static final String ACTION_SOUND_SETTINGS = 482 "android.settings.SOUND_SETTINGS"; 483 484 /** 485 * Activity Action: Show settings to allow configuration of display. 486 * <p> 487 * In some cases, a matching Activity may not exist, so ensure you 488 * safeguard against this. 489 * <p> 490 * Input: Nothing. 491 * <p> 492 * Output: Nothing. 493 */ 494 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 495 public static final String ACTION_DISPLAY_SETTINGS = 496 "android.settings.DISPLAY_SETTINGS"; 497 498 /** 499 * Activity Action: Show settings to allow configuration of Night display. 500 * <p> 501 * In some cases, a matching Activity may not exist, so ensure you 502 * safeguard against this. 503 * <p> 504 * Input: Nothing. 505 * <p> 506 * Output: Nothing. 507 * 508 * @hide 509 */ 510 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 511 public static final String ACTION_NIGHT_DISPLAY_SETTINGS = 512 "android.settings.NIGHT_DISPLAY_SETTINGS"; 513 514 /** 515 * Activity Action: Show settings to allow configuration of locale. 516 * <p> 517 * In some cases, a matching Activity may not exist, so ensure you 518 * safeguard against this. 519 * <p> 520 * Input: Nothing. 521 * <p> 522 * Output: Nothing. 523 */ 524 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 525 public static final String ACTION_LOCALE_SETTINGS = 526 "android.settings.LOCALE_SETTINGS"; 527 528 /** 529 * Activity Action: Show settings to configure input methods, in particular 530 * allowing the user to enable input methods. 531 * <p> 532 * In some cases, a matching Activity may not exist, so ensure you 533 * safeguard against this. 534 * <p> 535 * Input: Nothing. 536 * <p> 537 * Output: Nothing. 538 */ 539 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 540 public static final String ACTION_VOICE_INPUT_SETTINGS = 541 "android.settings.VOICE_INPUT_SETTINGS"; 542 543 /** 544 * Activity Action: Show settings to configure input methods, in particular 545 * allowing the user to enable input methods. 546 * <p> 547 * In some cases, a matching Activity may not exist, so ensure you 548 * safeguard against this. 549 * <p> 550 * Input: Nothing. 551 * <p> 552 * Output: Nothing. 553 */ 554 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 555 public static final String ACTION_INPUT_METHOD_SETTINGS = 556 "android.settings.INPUT_METHOD_SETTINGS"; 557 558 /** 559 * Activity Action: Show settings to enable/disable input method subtypes. 560 * <p> 561 * In some cases, a matching Activity may not exist, so ensure you 562 * safeguard against this. 563 * <p> 564 * To tell which input method's subtypes are displayed in the settings, add 565 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 566 * If there is no extra in this Intent, subtypes from all installed input methods 567 * will be displayed in the settings. 568 * 569 * @see android.view.inputmethod.InputMethodInfo#getId 570 * <p> 571 * Input: Nothing. 572 * <p> 573 * Output: Nothing. 574 */ 575 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 576 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 577 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 578 579 /** 580 * Activity Action: Show a dialog to select input method. 581 * <p> 582 * In some cases, a matching Activity may not exist, so ensure you 583 * safeguard against this. 584 * <p> 585 * Input: Nothing. 586 * <p> 587 * Output: Nothing. 588 * @hide 589 */ 590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 591 public static final String ACTION_SHOW_INPUT_METHOD_PICKER = 592 "android.settings.SHOW_INPUT_METHOD_PICKER"; 593 594 /** 595 * Activity Action: Show settings to manage the user input dictionary. 596 * <p> 597 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 598 * it is guaranteed there will always be an appropriate implementation for this Intent action. 599 * In prior releases of the platform this was optional, so ensure you safeguard against it. 600 * <p> 601 * Input: Nothing. 602 * <p> 603 * Output: Nothing. 604 */ 605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 606 public static final String ACTION_USER_DICTIONARY_SETTINGS = 607 "android.settings.USER_DICTIONARY_SETTINGS"; 608 609 /** 610 * Activity Action: Show settings to configure the hardware keyboard. 611 * <p> 612 * In some cases, a matching Activity may not exist, so ensure you 613 * safeguard against this. 614 * <p> 615 * Input: Nothing. 616 * <p> 617 * Output: Nothing. 618 */ 619 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 620 public static final String ACTION_HARD_KEYBOARD_SETTINGS = 621 "android.settings.HARD_KEYBOARD_SETTINGS"; 622 623 /** 624 * Activity Action: Adds a word to the user dictionary. 625 * <p> 626 * In some cases, a matching Activity may not exist, so ensure you 627 * safeguard against this. 628 * <p> 629 * Input: An extra with key <code>word</code> that contains the word 630 * that should be added to the dictionary. 631 * <p> 632 * Output: Nothing. 633 * 634 * @hide 635 */ 636 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 637 public static final String ACTION_USER_DICTIONARY_INSERT = 638 "com.android.settings.USER_DICTIONARY_INSERT"; 639 640 /** 641 * Activity Action: Show settings to allow configuration of application-related settings. 642 * <p> 643 * In some cases, a matching Activity may not exist, so ensure you 644 * safeguard against this. 645 * <p> 646 * Input: Nothing. 647 * <p> 648 * Output: Nothing. 649 */ 650 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 651 public static final String ACTION_APPLICATION_SETTINGS = 652 "android.settings.APPLICATION_SETTINGS"; 653 654 /** 655 * Activity Action: Show settings to allow configuration of application 656 * development-related settings. As of 657 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 658 * a required part of the platform. 659 * <p> 660 * Input: Nothing. 661 * <p> 662 * Output: Nothing. 663 */ 664 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 665 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 666 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 667 668 /** 669 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 670 * <p> 671 * In some cases, a matching Activity may not exist, so ensure you 672 * safeguard against this. 673 * <p> 674 * Input: Nothing. 675 * <p> 676 * Output: Nothing. 677 */ 678 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 679 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 680 "android.settings.QUICK_LAUNCH_SETTINGS"; 681 682 /** 683 * Activity Action: Show settings to manage installed applications. 684 * <p> 685 * In some cases, a matching Activity may not exist, so ensure you 686 * safeguard against this. 687 * <p> 688 * Input: Nothing. 689 * <p> 690 * Output: Nothing. 691 */ 692 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 693 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 694 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 695 696 /** 697 * Activity Action: Show settings to manage all applications. 698 * <p> 699 * In some cases, a matching Activity may not exist, so ensure you 700 * safeguard against this. 701 * <p> 702 * Input: Nothing. 703 * <p> 704 * Output: Nothing. 705 */ 706 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 707 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 708 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 709 710 /** 711 * Activity Action: Show screen for controlling which apps can draw on top of other apps. 712 * <p> 713 * In some cases, a matching Activity may not exist, so ensure you 714 * safeguard against this. 715 * <p> 716 * Input: Optionally, the Intent's data URI can specify the application package name to 717 * directly invoke the management GUI specific to the package name. For example 718 * "package:com.my.app". 719 * <p> 720 * Output: Nothing. 721 */ 722 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 723 public static final String ACTION_MANAGE_OVERLAY_PERMISSION = 724 "android.settings.action.MANAGE_OVERLAY_PERMISSION"; 725 726 /** 727 * Activity Action: Show screen for controlling which apps are allowed to write/modify 728 * system settings. 729 * <p> 730 * In some cases, a matching Activity may not exist, so ensure you 731 * safeguard against this. 732 * <p> 733 * Input: Optionally, the Intent's data URI can specify the application package name to 734 * directly invoke the management GUI specific to the package name. For example 735 * "package:com.my.app". 736 * <p> 737 * Output: Nothing. 738 */ 739 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 740 public static final String ACTION_MANAGE_WRITE_SETTINGS = 741 "android.settings.action.MANAGE_WRITE_SETTINGS"; 742 743 /** 744 * Activity Action: Show screen of details about a particular application. 745 * <p> 746 * In some cases, a matching Activity may not exist, so ensure you 747 * safeguard against this. 748 * <p> 749 * Input: The Intent's data URI specifies the application package name 750 * to be shown, with the "package" scheme. That is "package:com.my.app". 751 * <p> 752 * Output: Nothing. 753 */ 754 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 755 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 756 "android.settings.APPLICATION_DETAILS_SETTINGS"; 757 758 /** 759 * Activity Action: Show screen for controlling which apps can ignore battery optimizations. 760 * <p> 761 * Input: Nothing. 762 * <p> 763 * Output: Nothing. 764 * <p> 765 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 766 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 767 * already ignoring optimizations. You can use 768 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you 769 * on this list. 770 */ 771 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 772 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 773 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; 774 775 /** 776 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, 777 * put them on the whitelist of apps shown by 778 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also 779 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} 780 * permission. 781 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities 782 * provided by the platform for applications to operate correctly in the various power 783 * saving modes. This is only for unusual applications that need to deeply control their own 784 * execution, at the potential expense of the user's battery life. Note that these applications 785 * greatly run the risk of showing to the user as high power consumers on their device.</p> 786 * <p> 787 * Input: The Intent's data URI must specify the application package name 788 * to be shown, with the "package" scheme. That is "package:com.my.app". 789 * <p> 790 * Output: Nothing. 791 * <p> 792 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 793 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 794 * already ignoring optimizations. 795 */ 796 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 797 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 798 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; 799 800 /** 801 * Activity Action: Show screen for controlling background data 802 * restrictions for a particular application. 803 * <p> 804 * Input: Intent's data URI set with an application name, using the 805 * "package" schema (like "package:com.my.app"). 806 * 807 * <p> 808 * Output: Nothing. 809 * <p> 810 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus 811 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the 812 * status of the background data restrictions for them. 813 */ 814 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 815 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 816 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; 817 818 /** 819 * @hide 820 * Activity Action: Show the "app ops" settings screen. 821 * <p> 822 * Input: Nothing. 823 * <p> 824 * Output: Nothing. 825 */ 826 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 827 public static final String ACTION_APP_OPS_SETTINGS = 828 "android.settings.APP_OPS_SETTINGS"; 829 830 /** 831 * Activity Action: Show settings for system update functionality. 832 * <p> 833 * In some cases, a matching Activity may not exist, so ensure you 834 * safeguard against this. 835 * <p> 836 * Input: Nothing. 837 * <p> 838 * Output: Nothing. 839 * 840 * @hide 841 */ 842 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 843 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 844 "android.settings.SYSTEM_UPDATE_SETTINGS"; 845 846 /** 847 * Activity Action: Show settings for managed profile settings. 848 * <p> 849 * In some cases, a matching Activity may not exist, so ensure you 850 * safeguard against this. 851 * <p> 852 * Input: Nothing. 853 * <p> 854 * Output: Nothing. 855 * 856 * @hide 857 */ 858 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 859 public static final String ACTION_MANAGED_PROFILE_SETTINGS = 860 "android.settings.MANAGED_PROFILE_SETTINGS"; 861 862 /** 863 * Activity Action: Show settings to allow configuration of sync settings. 864 * <p> 865 * In some cases, a matching Activity may not exist, so ensure you 866 * safeguard against this. 867 * <p> 868 * The account types available to add via the add account button may be restricted by adding an 869 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 870 * authorities. Only account types which can sync with that content provider will be offered to 871 * the user. 872 * <p> 873 * Input: Nothing. 874 * <p> 875 * Output: Nothing. 876 */ 877 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 878 public static final String ACTION_SYNC_SETTINGS = 879 "android.settings.SYNC_SETTINGS"; 880 881 /** 882 * Activity Action: Show add account screen for creating a new account. 883 * <p> 884 * In some cases, a matching Activity may not exist, so ensure you 885 * safeguard against this. 886 * <p> 887 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 888 * extra to the Intent with one or more syncable content provider's authorities. Only account 889 * types which can sync with that content provider will be offered to the user. 890 * <p> 891 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 892 * Intent with one or more account types. 893 * <p> 894 * Input: Nothing. 895 * <p> 896 * Output: Nothing. 897 */ 898 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 899 public static final String ACTION_ADD_ACCOUNT = 900 "android.settings.ADD_ACCOUNT_SETTINGS"; 901 902 /** 903 * Activity Action: Show settings for selecting the network operator. 904 * <p> 905 * In some cases, a matching Activity may not exist, so ensure you 906 * safeguard against this. 907 * <p> 908 * Input: Nothing. 909 * <p> 910 * Output: Nothing. 911 */ 912 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 913 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 914 "android.settings.NETWORK_OPERATOR_SETTINGS"; 915 916 /** 917 * Activity Action: Show settings for selection of 2G/3G. 918 * <p> 919 * In some cases, a matching Activity may not exist, so ensure you 920 * safeguard against this. 921 * <p> 922 * Input: Nothing. 923 * <p> 924 * Output: Nothing. 925 */ 926 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 927 public static final String ACTION_DATA_ROAMING_SETTINGS = 928 "android.settings.DATA_ROAMING_SETTINGS"; 929 930 /** 931 * Activity Action: Show settings for internal storage. 932 * <p> 933 * In some cases, a matching Activity may not exist, so ensure you 934 * safeguard against this. 935 * <p> 936 * Input: Nothing. 937 * <p> 938 * Output: Nothing. 939 */ 940 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 941 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 942 "android.settings.INTERNAL_STORAGE_SETTINGS"; 943 /** 944 * Activity Action: Show settings for memory card storage. 945 * <p> 946 * In some cases, a matching Activity may not exist, so ensure you 947 * safeguard against this. 948 * <p> 949 * Input: Nothing. 950 * <p> 951 * Output: Nothing. 952 */ 953 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 954 public static final String ACTION_MEMORY_CARD_SETTINGS = 955 "android.settings.MEMORY_CARD_SETTINGS"; 956 957 /** 958 * Activity Action: Show settings for global search. 959 * <p> 960 * In some cases, a matching Activity may not exist, so ensure you 961 * safeguard against this. 962 * <p> 963 * Input: Nothing. 964 * <p> 965 * Output: Nothing 966 */ 967 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 968 public static final String ACTION_SEARCH_SETTINGS = 969 "android.search.action.SEARCH_SETTINGS"; 970 971 /** 972 * Activity Action: Show general device information settings (serial 973 * number, software version, phone number, etc.). 974 * <p> 975 * In some cases, a matching Activity may not exist, so ensure you 976 * safeguard against this. 977 * <p> 978 * Input: Nothing. 979 * <p> 980 * Output: Nothing 981 */ 982 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 983 public static final String ACTION_DEVICE_INFO_SETTINGS = 984 "android.settings.DEVICE_INFO_SETTINGS"; 985 986 /** 987 * Activity Action: Show NFC settings. 988 * <p> 989 * This shows UI that allows NFC to be turned on or off. 990 * <p> 991 * In some cases, a matching Activity may not exist, so ensure you 992 * safeguard against this. 993 * <p> 994 * Input: Nothing. 995 * <p> 996 * Output: Nothing 997 * @see android.nfc.NfcAdapter#isEnabled() 998 */ 999 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1000 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 1001 1002 /** 1003 * Activity Action: Show NFC Sharing settings. 1004 * <p> 1005 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 1006 * off. 1007 * <p> 1008 * In some cases, a matching Activity may not exist, so ensure you 1009 * safeguard against this. 1010 * <p> 1011 * Input: Nothing. 1012 * <p> 1013 * Output: Nothing 1014 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 1015 */ 1016 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1017 public static final String ACTION_NFCSHARING_SETTINGS = 1018 "android.settings.NFCSHARING_SETTINGS"; 1019 1020 /** 1021 * Activity Action: Show NFC Tap & Pay settings 1022 * <p> 1023 * This shows UI that allows the user to configure Tap&Pay 1024 * settings. 1025 * <p> 1026 * In some cases, a matching Activity may not exist, so ensure you 1027 * safeguard against this. 1028 * <p> 1029 * Input: Nothing. 1030 * <p> 1031 * Output: Nothing 1032 */ 1033 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1034 public static final String ACTION_NFC_PAYMENT_SETTINGS = 1035 "android.settings.NFC_PAYMENT_SETTINGS"; 1036 1037 /** 1038 * Activity Action: Show Daydream settings. 1039 * <p> 1040 * In some cases, a matching Activity may not exist, so ensure you 1041 * safeguard against this. 1042 * <p> 1043 * Input: Nothing. 1044 * <p> 1045 * Output: Nothing. 1046 * @see android.service.dreams.DreamService 1047 */ 1048 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1049 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 1050 1051 /** 1052 * Activity Action: Show Notification listener settings. 1053 * <p> 1054 * In some cases, a matching Activity may not exist, so ensure you 1055 * safeguard against this. 1056 * <p> 1057 * Input: Nothing. 1058 * <p> 1059 * Output: Nothing. 1060 * @see android.service.notification.NotificationListenerService 1061 */ 1062 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1063 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 1064 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 1065 1066 /** 1067 * Activity Action: Show Do Not Disturb access settings. 1068 * <p> 1069 * Users can grant and deny access to Do Not Disturb configuration from here. 1070 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1071 * details. 1072 * <p> 1073 * Input: Nothing. 1074 * <p> 1075 * Output: Nothing. 1076 */ 1077 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1078 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS 1079 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; 1080 1081 /** 1082 * @hide 1083 */ 1084 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1085 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 1086 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 1087 1088 /** 1089 * Activity Action: Show settings for video captioning. 1090 * <p> 1091 * In some cases, a matching Activity may not exist, so ensure you safeguard 1092 * against this. 1093 * <p> 1094 * Input: Nothing. 1095 * <p> 1096 * Output: Nothing. 1097 */ 1098 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1099 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 1100 1101 /** 1102 * Activity Action: Show the top level print settings. 1103 * <p> 1104 * In some cases, a matching Activity may not exist, so ensure you 1105 * safeguard against this. 1106 * <p> 1107 * Input: Nothing. 1108 * <p> 1109 * Output: Nothing. 1110 */ 1111 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1112 public static final String ACTION_PRINT_SETTINGS = 1113 "android.settings.ACTION_PRINT_SETTINGS"; 1114 1115 /** 1116 * Activity Action: Show Zen Mode configuration settings. 1117 * 1118 * @hide 1119 */ 1120 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1121 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 1122 1123 /** 1124 * Activity Action: Show Zen Mode priority configuration settings. 1125 */ 1126 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1127 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS 1128 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; 1129 1130 /** 1131 * Activity Action: Show Zen Mode automation configuration settings. 1132 * 1133 * @hide 1134 */ 1135 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1136 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS 1137 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; 1138 1139 /** 1140 * Activity Action: Modify do not disturb mode settings. 1141 * <p> 1142 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1143 * <p> 1144 * This intent MUST be started using 1145 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1146 * startVoiceActivity}. 1147 * <p> 1148 * Note: The Activity implementing this intent MUST verify that 1149 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. 1150 * returns true before modifying the setting. 1151 * <p> 1152 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate 1153 * how long the user wishes to avoid interruptions for. The optional 1154 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is 1155 * enabling or disabling do not disturb mode. If either extra is not included, the 1156 * user maybe asked to provide the value. 1157 * <p> 1158 * Output: Nothing. 1159 */ 1160 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1161 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 1162 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; 1163 1164 /** 1165 * Activity Action: Show Zen Mode schedule rule configuration settings. 1166 * 1167 * @hide 1168 */ 1169 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1170 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS 1171 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; 1172 1173 /** 1174 * Activity Action: Show Zen Mode event rule configuration settings. 1175 * 1176 * @hide 1177 */ 1178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1179 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS 1180 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; 1181 1182 /** 1183 * Activity Action: Show Zen Mode external rule configuration settings. 1184 * 1185 * @hide 1186 */ 1187 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1188 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS 1189 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; 1190 1191 /** 1192 * Activity Action: Show the regulatory information screen for the device. 1193 * <p> 1194 * In some cases, a matching Activity may not exist, so ensure you safeguard 1195 * against this. 1196 * <p> 1197 * Input: Nothing. 1198 * <p> 1199 * Output: Nothing. 1200 */ 1201 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1202 public static final String 1203 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 1204 1205 /** 1206 * Activity Action: Show Device Name Settings. 1207 * <p> 1208 * In some cases, a matching Activity may not exist, so ensure you safeguard 1209 * against this. 1210 * 1211 * @hide 1212 */ 1213 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1214 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 1215 1216 /** 1217 * Activity Action: Show pairing settings. 1218 * <p> 1219 * In some cases, a matching Activity may not exist, so ensure you safeguard 1220 * against this. 1221 * 1222 * @hide 1223 */ 1224 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1225 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 1226 1227 /** 1228 * Activity Action: Show battery saver settings. 1229 * <p> 1230 * In some cases, a matching Activity may not exist, so ensure you safeguard 1231 * against this. 1232 */ 1233 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1234 public static final String ACTION_BATTERY_SAVER_SETTINGS 1235 = "android.settings.BATTERY_SAVER_SETTINGS"; 1236 1237 /** 1238 * Activity Action: Modify Battery Saver mode setting using a voice command. 1239 * <p> 1240 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1241 * <p> 1242 * This intent MUST be started using 1243 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1244 * startVoiceActivity}. 1245 * <p> 1246 * Note: The activity implementing this intent MUST verify that 1247 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 1248 * modifying the setting. 1249 * <p> 1250 * Input: To tell which state batter saver mode should be set to, add the 1251 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. 1252 * If the extra is not included, no changes will be made. 1253 * <p> 1254 * Output: Nothing. 1255 */ 1256 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1257 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 1258 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; 1259 1260 /** 1261 * Activity Action: Show Home selection settings. If there are multiple activities 1262 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 1263 * to pick your preferred activity. 1264 */ 1265 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1266 public static final String ACTION_HOME_SETTINGS 1267 = "android.settings.HOME_SETTINGS"; 1268 1269 /** 1270 * Activity Action: Show Default apps settings. 1271 * <p> 1272 * In some cases, a matching Activity may not exist, so ensure you 1273 * safeguard against this. 1274 * <p> 1275 * Input: Nothing. 1276 * <p> 1277 * Output: Nothing. 1278 */ 1279 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1280 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS 1281 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; 1282 1283 /** 1284 * Activity Action: Show notification settings. 1285 * 1286 * @hide 1287 */ 1288 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1289 public static final String ACTION_NOTIFICATION_SETTINGS 1290 = "android.settings.NOTIFICATION_SETTINGS"; 1291 1292 /** 1293 * Activity Action: Show notification settings for a single app. 1294 * <p> 1295 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1296 * Input: Optionally, {@link #EXTRA_CHANNEL_ID}, to highlight that channel. 1297 * <p> 1298 * Output: Nothing. 1299 */ 1300 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1301 public static final String ACTION_APP_NOTIFICATION_SETTINGS 1302 = "android.settings.APP_NOTIFICATION_SETTINGS"; 1303 1304 /** 1305 * Activity Action: Show notification settings for a single {@link NotificationChannel}. 1306 * <p> 1307 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1308 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. 1309 * <p> 1310 * Output: Nothing. 1311 */ 1312 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1313 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS 1314 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; 1315 1316 /** 1317 * Activity Extra: The package owner of the notification channel settings to display. 1318 * <p> 1319 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1320 */ 1321 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; 1322 1323 /** 1324 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings 1325 * to display. 1326 * <p> 1327 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1328 */ 1329 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; 1330 1331 /** 1332 * Activity Action: Show notification redaction settings. 1333 * 1334 * @hide 1335 */ 1336 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1337 public static final String ACTION_APP_NOTIFICATION_REDACTION 1338 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; 1339 1340 /** @hide */ public static final String EXTRA_APP_UID = "app_uid"; 1341 1342 /** 1343 * Activity Action: Show a dialog with disabled by policy message. 1344 * <p> If an user action is disabled by policy, this dialog can be triggered to let 1345 * the user know about this. 1346 * <p> 1347 * Input: Nothing. 1348 * <p> 1349 * Output: Nothing. 1350 * 1351 * @hide 1352 */ 1353 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1354 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS 1355 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; 1356 1357 /** 1358 * Activity Action: Show a dialog for remote bugreport flow. 1359 * <p> 1360 * Input: Nothing. 1361 * <p> 1362 * Output: Nothing. 1363 * 1364 * @hide 1365 */ 1366 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1367 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG 1368 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; 1369 1370 /** 1371 * Activity Action: Show VR listener settings. 1372 * <p> 1373 * Input: Nothing. 1374 * <p> 1375 * Output: Nothing. 1376 * 1377 * @see android.service.vr.VrListenerService 1378 */ 1379 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1380 public static final String ACTION_VR_LISTENER_SETTINGS 1381 = "android.settings.VR_LISTENER_SETTINGS"; 1382 1383 /** 1384 * Activity Action: Show Picture-in-picture settings. 1385 * <p> 1386 * Input: Nothing. 1387 * <p> 1388 * Output: Nothing. 1389 * 1390 * @hide 1391 */ 1392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1393 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS 1394 = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; 1395 1396 /** 1397 * Activity Action: Show Storage Manager settings. 1398 * <p> 1399 * Input: Nothing. 1400 * <p> 1401 * Output: Nothing. 1402 * 1403 * @hide 1404 */ 1405 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1406 public static final String ACTION_STORAGE_MANAGER_SETTINGS 1407 = "android.settings.STORAGE_MANAGER_SETTINGS"; 1408 1409 /** 1410 * Activity Action: Allows user to select current webview implementation. 1411 * <p> 1412 * Input: Nothing. 1413 * <p> 1414 * Output: Nothing. 1415 */ 1416 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1417 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; 1418 1419 /** 1420 * Activity Action: Show enterprise privacy section. 1421 * <p> 1422 * Input: Nothing. 1423 * <p> 1424 * Output: Nothing. 1425 * @hide 1426 */ 1427 @SystemApi 1428 @TestApi 1429 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1430 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS 1431 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; 1432 1433 // End of Intent actions for Settings 1434 1435 /** 1436 * @hide - Private call() method on SettingsProvider to read from 'system' table. 1437 */ 1438 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 1439 1440 /** 1441 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 1442 */ 1443 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 1444 1445 /** 1446 * @hide - Private call() method on SettingsProvider to read from 'global' table. 1447 */ 1448 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 1449 1450 /** 1451 * @hide - Specifies that the caller of the fast-path call()-based flow tracks 1452 * the settings generation in order to cache values locally. If this key is 1453 * mapped to a <code>null</code> string extra in the request bundle, the response 1454 * bundle will contain the same key mapped to a parcelable extra which would be 1455 * an {@link android.util.MemoryIntArray}. The response will also contain an 1456 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the 1457 * index in the array clients should use to lookup the generation. For efficiency 1458 * the caller should request the generation tracking memory array only if it 1459 * doesn't already have it. 1460 * 1461 * @see #CALL_METHOD_GENERATION_INDEX_KEY 1462 */ 1463 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; 1464 1465 /** 1466 * @hide Key with the location in the {@link android.util.MemoryIntArray} where 1467 * to look up the generation id of the backing table. The value is an integer. 1468 * 1469 * @see #CALL_METHOD_TRACK_GENERATION_KEY 1470 */ 1471 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; 1472 1473 /** 1474 * @hide Key with the settings table generation. The value is an integer. 1475 * 1476 * @see #CALL_METHOD_TRACK_GENERATION_KEY 1477 */ 1478 public static final String CALL_METHOD_GENERATION_KEY = "_generation"; 1479 1480 /** 1481 * @hide - User handle argument extra to the fast-path call()-based requests 1482 */ 1483 public static final String CALL_METHOD_USER_KEY = "_user"; 1484 1485 /** 1486 * @hide - Boolean argument extra to the fast-path call()-based requests 1487 */ 1488 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; 1489 1490 /** 1491 * @hide - User handle argument extra to the fast-path call()-based requests 1492 */ 1493 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; 1494 1495 /** 1496 * @hide - String argument extra to the fast-path call()-based requests 1497 */ 1498 public static final String CALL_METHOD_TAG_KEY = "_tag"; 1499 1500 /** @hide - Private call() method to write to 'system' table */ 1501 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 1502 1503 /** @hide - Private call() method to write to 'secure' table */ 1504 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 1505 1506 /** @hide - Private call() method to write to 'global' table */ 1507 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 1508 1509 /** @hide - Private call() method to reset to defaults the 'global' table */ 1510 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; 1511 1512 /** @hide - Private call() method to reset to defaults the 'secure' table */ 1513 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; 1514 1515 /** 1516 * Activity Extra: Limit available options in launched activity based on the given authority. 1517 * <p> 1518 * This can be passed as an extra field in an Activity Intent with one or more syncable content 1519 * provider's authorities as a String[]. This field is used by some intents to alter the 1520 * behavior of the called activity. 1521 * <p> 1522 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 1523 * on the authority given. 1524 */ 1525 public static final String EXTRA_AUTHORITIES = "authorities"; 1526 1527 /** 1528 * Activity Extra: Limit available options in launched activity based on the given account 1529 * types. 1530 * <p> 1531 * This can be passed as an extra field in an Activity Intent with one or more account types 1532 * as a String[]. This field is used by some intents to alter the behavior of the called 1533 * activity. 1534 * <p> 1535 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 1536 * list. 1537 */ 1538 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 1539 1540 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 1541 1542 /** 1543 * Activity Extra: The device identifier to act upon. 1544 * <p> 1545 * This can be passed as an extra field in an Activity Intent with a single 1546 * InputDeviceIdentifier. This field is used by some activities to jump straight into the 1547 * settings for the given device. 1548 * <p> 1549 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout 1550 * dialog for the given device. 1551 * @hide 1552 */ 1553 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; 1554 1555 /** 1556 * Activity Extra: Enable or disable Airplane Mode. 1557 * <p> 1558 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} 1559 * intent as a boolean to indicate if it should be enabled. 1560 */ 1561 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; 1562 1563 /** 1564 * Activity Extra: Enable or disable Battery saver mode. 1565 * <p> 1566 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} 1567 * intent as a boolean to indicate if it should be enabled. 1568 */ 1569 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = 1570 "android.settings.extra.battery_saver_mode_enabled"; 1571 1572 /** 1573 * Activity Extra: Enable or disable Do Not Disturb mode. 1574 * <p> 1575 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 1576 * intent as a boolean to indicate if it should be enabled. 1577 */ 1578 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = 1579 "android.settings.extra.do_not_disturb_mode_enabled"; 1580 1581 /** 1582 * Activity Extra: How many minutes to enable do not disturb mode for. 1583 * <p> 1584 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 1585 * intent to indicate how long do not disturb mode should be enabled for. 1586 */ 1587 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = 1588 "android.settings.extra.do_not_disturb_mode_minutes"; 1589 1590 /** 1591 * Reset mode: reset to defaults only settings changed by the 1592 * calling package. If there is a default set the setting 1593 * will be set to it, otherwise the setting will be deleted. 1594 * This is the only type of reset available to non-system clients. 1595 * @hide 1596 */ 1597 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; 1598 1599 /** 1600 * Reset mode: reset all settings set by untrusted packages, which is 1601 * packages that aren't a part of the system, to the current defaults. 1602 * If there is a default set the setting will be set to it, otherwise 1603 * the setting will be deleted. This mode is only available to the system. 1604 * @hide 1605 */ 1606 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; 1607 1608 /** 1609 * Reset mode: delete all settings set by untrusted packages, which is 1610 * packages that aren't a part of the system. If a setting is set by an 1611 * untrusted package it will be deleted if its default is not provided 1612 * by the system, otherwise the setting will be set to its default. 1613 * This mode is only available to the system. 1614 * @hide 1615 */ 1616 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; 1617 1618 /** 1619 * Reset mode: reset all settings to defaults specified by trusted 1620 * packages, which is packages that are a part of the system, and 1621 * delete all settings set by untrusted packages. If a setting has 1622 * a default set by a system package it will be set to the default, 1623 * otherwise the setting will be deleted. This mode is only available 1624 * to the system. 1625 * @hide 1626 */ 1627 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; 1628 1629 /** @hide */ 1630 @Retention(RetentionPolicy.SOURCE) 1631 @IntDef({ 1632 RESET_MODE_PACKAGE_DEFAULTS, 1633 RESET_MODE_UNTRUSTED_DEFAULTS, 1634 RESET_MODE_UNTRUSTED_CHANGES, 1635 RESET_MODE_TRUSTED_DEFAULTS 1636 }) 1637 public @interface ResetMode{} 1638 1639 /** 1640 * Activity Extra: Number of certificates 1641 * <p> 1642 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} 1643 * intent to indicate the number of certificates 1644 * @hide 1645 */ 1646 public static final String EXTRA_NUMBER_OF_CERTIFICATES = 1647 "android.settings.extra.number_of_certificates"; 1648 1649 private static final String JID_RESOURCE_PREFIX = "android"; 1650 1651 public static final String AUTHORITY = "settings"; 1652 1653 private static final String TAG = "Settings"; 1654 private static final boolean LOCAL_LOGV = false; 1655 1656 // Lock ensures that when enabling/disabling the master location switch, we don't end up 1657 // with a partial enable/disable state in multi-threaded situations. 1658 private static final Object mLocationSettingsLock = new Object(); 1659 1660 // Used in system server calling uid workaround in call() 1661 private static boolean sInSystemServer = false; 1662 private static final Object sInSystemServerLock = new Object(); 1663 1664 /** @hide */ 1665 public static void setInSystemServer() { 1666 synchronized (sInSystemServerLock) { 1667 sInSystemServer = true; 1668 } 1669 } 1670 1671 /** @hide */ 1672 public static boolean isInSystemServer() { 1673 synchronized (sInSystemServerLock) { 1674 return sInSystemServer; 1675 } 1676 } 1677 1678 public static class SettingNotFoundException extends AndroidException { 1679 public SettingNotFoundException(String msg) { 1680 super(msg); 1681 } 1682 } 1683 1684 /** 1685 * Common base for tables of name/value settings. 1686 */ 1687 public static class NameValueTable implements BaseColumns { 1688 public static final String NAME = "name"; 1689 public static final String VALUE = "value"; 1690 1691 protected static boolean putString(ContentResolver resolver, Uri uri, 1692 String name, String value) { 1693 // The database will take care of replacing duplicates. 1694 try { 1695 ContentValues values = new ContentValues(); 1696 values.put(NAME, name); 1697 values.put(VALUE, value); 1698 resolver.insert(uri, values); 1699 return true; 1700 } catch (SQLException e) { 1701 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 1702 return false; 1703 } 1704 } 1705 1706 public static Uri getUriFor(Uri uri, String name) { 1707 return Uri.withAppendedPath(uri, name); 1708 } 1709 } 1710 1711 private static final class GenerationTracker { 1712 private final MemoryIntArray mArray; 1713 private final Runnable mErrorHandler; 1714 private final int mIndex; 1715 private int mCurrentGeneration; 1716 1717 public GenerationTracker(@NonNull MemoryIntArray array, int index, 1718 int generation, Runnable errorHandler) { 1719 mArray = array; 1720 mIndex = index; 1721 mErrorHandler = errorHandler; 1722 mCurrentGeneration = generation; 1723 } 1724 1725 public boolean isGenerationChanged() { 1726 final int currentGeneration = readCurrentGeneration(); 1727 if (currentGeneration >= 0) { 1728 if (currentGeneration == mCurrentGeneration) { 1729 return false; 1730 } 1731 mCurrentGeneration = currentGeneration; 1732 } 1733 return true; 1734 } 1735 1736 private int readCurrentGeneration() { 1737 try { 1738 return mArray.get(mIndex); 1739 } catch (IOException e) { 1740 Log.e(TAG, "Error getting current generation", e); 1741 if (mErrorHandler != null) { 1742 mErrorHandler.run(); 1743 } 1744 } 1745 return -1; 1746 } 1747 1748 public void destroy() { 1749 try { 1750 mArray.close(); 1751 } catch (IOException e) { 1752 Log.e(TAG, "Error closing backing array", e); 1753 if (mErrorHandler != null) { 1754 mErrorHandler.run(); 1755 } 1756 } 1757 } 1758 } 1759 1760 private static final class ContentProviderHolder { 1761 private final Object mLock = new Object(); 1762 1763 @GuardedBy("mLock") 1764 private final Uri mUri; 1765 @GuardedBy("mLock") 1766 private IContentProvider mContentProvider; 1767 1768 public ContentProviderHolder(Uri uri) { 1769 mUri = uri; 1770 } 1771 1772 public IContentProvider getProvider(ContentResolver contentResolver) { 1773 synchronized (mLock) { 1774 if (mContentProvider == null) { 1775 mContentProvider = contentResolver 1776 .acquireProvider(mUri.getAuthority()); 1777 } 1778 return mContentProvider; 1779 } 1780 } 1781 } 1782 1783 // Thread-safe. 1784 private static class NameValueCache { 1785 private static final boolean DEBUG = false; 1786 1787 private static final String[] SELECT_VALUE_PROJECTION = new String[] { 1788 Settings.NameValueTable.VALUE 1789 }; 1790 1791 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 1792 1793 // Must synchronize on 'this' to access mValues and mValuesVersion. 1794 private final HashMap<String, String> mValues = new HashMap<>(); 1795 1796 private final Uri mUri; 1797 private final ContentProviderHolder mProviderHolder; 1798 1799 // The method we'll call (or null, to not use) on the provider 1800 // for the fast path of retrieving settings. 1801 private final String mCallGetCommand; 1802 private final String mCallSetCommand; 1803 1804 @GuardedBy("this") 1805 private GenerationTracker mGenerationTracker; 1806 1807 public NameValueCache(Uri uri, String getCommand, String setCommand, 1808 ContentProviderHolder providerHolder) { 1809 mUri = uri; 1810 mCallGetCommand = getCommand; 1811 mCallSetCommand = setCommand; 1812 mProviderHolder = providerHolder; 1813 } 1814 1815 public boolean putStringForUser(ContentResolver cr, String name, String value, 1816 String tag, boolean makeDefault, final int userHandle) { 1817 try { 1818 Bundle arg = new Bundle(); 1819 arg.putString(Settings.NameValueTable.VALUE, value); 1820 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 1821 if (tag != null) { 1822 arg.putString(CALL_METHOD_TAG_KEY, tag); 1823 } 1824 if (makeDefault) { 1825 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); 1826 } 1827 IContentProvider cp = mProviderHolder.getProvider(cr); 1828 cp.call(cr.getPackageName(), mCallSetCommand, name, arg); 1829 } catch (RemoteException e) { 1830 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 1831 return false; 1832 } 1833 return true; 1834 } 1835 1836 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 1837 final boolean isSelf = (userHandle == UserHandle.myUserId()); 1838 if (isSelf) { 1839 synchronized (NameValueCache.this) { 1840 if (mGenerationTracker != null) { 1841 if (mGenerationTracker.isGenerationChanged()) { 1842 if (DEBUG) { 1843 Log.i(TAG, "Generation changed for type:" 1844 + mUri.getPath() + " in package:" 1845 + cr.getPackageName() +" and user:" + userHandle); 1846 } 1847 mValues.clear(); 1848 } else if (mValues.containsKey(name)) { 1849 return mValues.get(name); 1850 } 1851 } 1852 } 1853 } else { 1854 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 1855 + " by user " + UserHandle.myUserId() + " so skipping cache"); 1856 } 1857 1858 IContentProvider cp = mProviderHolder.getProvider(cr); 1859 1860 // Try the fast path first, not using query(). If this 1861 // fails (alternate Settings provider that doesn't support 1862 // this interface?) then we fall back to the query/table 1863 // interface. 1864 if (mCallGetCommand != null) { 1865 try { 1866 Bundle args = null; 1867 if (!isSelf) { 1868 args = new Bundle(); 1869 args.putInt(CALL_METHOD_USER_KEY, userHandle); 1870 } 1871 boolean needsGenerationTracker = false; 1872 synchronized (NameValueCache.this) { 1873 if (isSelf && mGenerationTracker == null) { 1874 needsGenerationTracker = true; 1875 if (args == null) { 1876 args = new Bundle(); 1877 } 1878 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 1879 if (DEBUG) { 1880 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() 1881 + " in package:" + cr.getPackageName() +" and user:" 1882 + userHandle); 1883 } 1884 } 1885 } 1886 Bundle b; 1887 // If we're in system server and in a binder transaction we need to clear the 1888 // calling uid. This works around code in system server that did not call 1889 // clearCallingIdentity, previously this wasn't needed because reading settings 1890 // did not do permission checking but thats no longer the case. 1891 // Long term this should be removed and callers should properly call 1892 // clearCallingIdentity or use a ContentResolver from the caller as needed. 1893 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 1894 final long token = Binder.clearCallingIdentity(); 1895 try { 1896 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); 1897 } finally { 1898 Binder.restoreCallingIdentity(token); 1899 } 1900 } else { 1901 b = cp.call(cr.getPackageName(), mCallGetCommand, name, args); 1902 } 1903 if (b != null) { 1904 String value = b.getString(Settings.NameValueTable.VALUE); 1905 // Don't update our cache for reads of other users' data 1906 if (isSelf) { 1907 synchronized (NameValueCache.this) { 1908 if (needsGenerationTracker) { 1909 MemoryIntArray array = b.getParcelable( 1910 CALL_METHOD_TRACK_GENERATION_KEY); 1911 final int index = b.getInt( 1912 CALL_METHOD_GENERATION_INDEX_KEY, -1); 1913 if (array != null && index >= 0) { 1914 final int generation = b.getInt( 1915 CALL_METHOD_GENERATION_KEY, 0); 1916 if (DEBUG) { 1917 Log.i(TAG, "Received generation tracker for type:" 1918 + mUri.getPath() + " in package:" 1919 + cr.getPackageName() + " and user:" 1920 + userHandle + " with index:" + index); 1921 } 1922 if (mGenerationTracker != null) { 1923 mGenerationTracker.destroy(); 1924 } 1925 mGenerationTracker = new GenerationTracker(array, index, 1926 generation, () -> { 1927 synchronized (NameValueCache.this) { 1928 Log.e(TAG, "Error accessing generation" 1929 + " tracker - removing"); 1930 if (mGenerationTracker != null) { 1931 GenerationTracker generationTracker = 1932 mGenerationTracker; 1933 mGenerationTracker = null; 1934 generationTracker.destroy(); 1935 mValues.clear(); 1936 } 1937 } 1938 }); 1939 } 1940 } 1941 mValues.put(name, value); 1942 } 1943 } else { 1944 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 1945 + " by " + UserHandle.myUserId() 1946 + " so not updating cache"); 1947 } 1948 return value; 1949 } 1950 // If the response Bundle is null, we fall through 1951 // to the query interface below. 1952 } catch (RemoteException e) { 1953 // Not supported by the remote side? Fall through 1954 // to query(). 1955 } 1956 } 1957 1958 Cursor c = null; 1959 try { 1960 Bundle queryArgs = ContentResolver.createSqlQueryBundle( 1961 NAME_EQ_PLACEHOLDER, new String[]{name}, null); 1962 // Same workaround as above. 1963 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 1964 final long token = Binder.clearCallingIdentity(); 1965 try { 1966 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, 1967 null); 1968 } finally { 1969 Binder.restoreCallingIdentity(token); 1970 } 1971 } else { 1972 c = cp.query(cr.getPackageName(), mUri, SELECT_VALUE_PROJECTION, queryArgs, 1973 null); 1974 } 1975 if (c == null) { 1976 Log.w(TAG, "Can't get key " + name + " from " + mUri); 1977 return null; 1978 } 1979 1980 String value = c.moveToNext() ? c.getString(0) : null; 1981 synchronized (NameValueCache.this) { 1982 mValues.put(name, value); 1983 } 1984 if (LOCAL_LOGV) { 1985 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 1986 name + " = " + (value == null ? "(null)" : value)); 1987 } 1988 return value; 1989 } catch (RemoteException e) { 1990 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 1991 return null; // Return null, but don't cache it. 1992 } finally { 1993 if (c != null) c.close(); 1994 } 1995 } 1996 } 1997 1998 /** 1999 * Checks if the specified context can draw on top of other apps. As of API 2000 * level 23, an app cannot draw on top of other apps unless it declares the 2001 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its 2002 * manifest, <em>and</em> the user specifically grants the app this 2003 * capability. To prompt the user to grant this approval, the app must send an 2004 * intent with the action 2005 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which 2006 * causes the system to display a permission management screen. 2007 * 2008 * @param context App context. 2009 * @return true if the specified context can draw on top of other apps, false otherwise 2010 */ 2011 public static boolean canDrawOverlays(Context context) { 2012 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), 2013 context.getOpPackageName(), false); 2014 } 2015 2016 /** 2017 * System settings, containing miscellaneous system preferences. This 2018 * table holds simple name/value pairs. There are convenience 2019 * functions for accessing individual settings entries. 2020 */ 2021 public static final class System extends NameValueTable { 2022 private static final float DEFAULT_FONT_SCALE = 1.0f; 2023 2024 /** @hide */ 2025 public static interface Validator { 2026 public boolean validate(String value); 2027 } 2028 2029 /** 2030 * The content:// style URL for this table 2031 */ 2032 public static final Uri CONTENT_URI = 2033 Uri.parse("content://" + AUTHORITY + "/system"); 2034 2035 private static final ContentProviderHolder sProviderHolder = 2036 new ContentProviderHolder(CONTENT_URI); 2037 2038 private static final NameValueCache sNameValueCache = new NameValueCache( 2039 CONTENT_URI, 2040 CALL_METHOD_GET_SYSTEM, 2041 CALL_METHOD_PUT_SYSTEM, 2042 sProviderHolder); 2043 2044 private static final HashSet<String> MOVED_TO_SECURE; 2045 static { 2046 MOVED_TO_SECURE = new HashSet<>(30); 2047 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 2048 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 2049 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 2050 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 2051 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 2052 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 2053 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 2054 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 2055 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 2056 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 2057 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 2058 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 2059 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 2060 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 2061 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 2062 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 2063 MOVED_TO_SECURE.add(Secure.WIFI_ON); 2064 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 2065 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 2066 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 2067 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 2068 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 2069 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 2070 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 2071 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 2072 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 2073 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 2074 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 2075 2076 // At one time in System, then Global, but now back in Secure 2077 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 2078 } 2079 2080 private static final HashSet<String> MOVED_TO_GLOBAL; 2081 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 2082 static { 2083 MOVED_TO_GLOBAL = new HashSet<>(); 2084 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); 2085 2086 // these were originally in system but migrated to secure in the past, 2087 // so are duplicated in the Secure.* namespace 2088 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 2089 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 2090 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 2091 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 2092 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 2093 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 2094 2095 // these are moving directly from system to global 2096 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 2097 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 2098 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 2099 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 2100 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 2101 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 2102 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 2103 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 2104 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 2105 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 2106 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 2107 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 2108 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 2109 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 2110 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 2111 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 2112 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 2113 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 2114 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 2115 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 2116 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 2117 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 2118 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 2119 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 2120 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 2121 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 2122 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 2123 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 2124 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 2125 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 2126 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 2127 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 2128 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 2129 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 2130 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 2131 } 2132 2133 private static final Validator sBooleanValidator = 2134 new DiscreteValueValidator(new String[] {"0", "1"}); 2135 2136 private static final Validator sNonNegativeIntegerValidator = new Validator() { 2137 @Override 2138 public boolean validate(String value) { 2139 try { 2140 return Integer.parseInt(value) >= 0; 2141 } catch (NumberFormatException e) { 2142 return false; 2143 } 2144 } 2145 }; 2146 2147 private static final Validator sUriValidator = new Validator() { 2148 @Override 2149 public boolean validate(String value) { 2150 try { 2151 Uri.decode(value); 2152 return true; 2153 } catch (IllegalArgumentException e) { 2154 return false; 2155 } 2156 } 2157 }; 2158 2159 private static final Validator sLenientIpAddressValidator = new Validator() { 2160 private static final int MAX_IPV6_LENGTH = 45; 2161 2162 @Override 2163 public boolean validate(String value) { 2164 return value.length() <= MAX_IPV6_LENGTH; 2165 } 2166 }; 2167 2168 /** @hide */ 2169 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 2170 outKeySet.addAll(MOVED_TO_GLOBAL); 2171 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 2172 } 2173 2174 /** @hide */ 2175 public static void getMovedToSecureSettings(Set<String> outKeySet) { 2176 outKeySet.addAll(MOVED_TO_SECURE); 2177 } 2178 2179 /** @hide */ 2180 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 2181 outKeySet.addAll(MOVED_TO_GLOBAL); 2182 } 2183 2184 /** 2185 * Look up a name in the database. 2186 * @param resolver to access the database with 2187 * @param name to look up in the table 2188 * @return the corresponding value, or null if not present 2189 */ 2190 public static String getString(ContentResolver resolver, String name) { 2191 return getStringForUser(resolver, name, UserHandle.myUserId()); 2192 } 2193 2194 /** @hide */ 2195 public static String getStringForUser(ContentResolver resolver, String name, 2196 int userHandle) { 2197 if (MOVED_TO_SECURE.contains(name)) { 2198 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2199 + " to android.provider.Settings.Secure, returning read-only value."); 2200 return Secure.getStringForUser(resolver, name, userHandle); 2201 } 2202 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2203 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2204 + " to android.provider.Settings.Global, returning read-only value."); 2205 return Global.getStringForUser(resolver, name, userHandle); 2206 } 2207 return sNameValueCache.getStringForUser(resolver, name, userHandle); 2208 } 2209 2210 /** 2211 * Store a name/value pair into the database. 2212 * @param resolver to access the database with 2213 * @param name to store 2214 * @param value to associate with the name 2215 * @return true if the value was set, false on database errors 2216 */ 2217 public static boolean putString(ContentResolver resolver, String name, String value) { 2218 return putStringForUser(resolver, name, value, UserHandle.myUserId()); 2219 } 2220 2221 /** @hide */ 2222 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 2223 int userHandle) { 2224 if (MOVED_TO_SECURE.contains(name)) { 2225 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2226 + " to android.provider.Settings.Secure, value is unchanged."); 2227 return false; 2228 } 2229 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2230 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2231 + " to android.provider.Settings.Global, value is unchanged."); 2232 return false; 2233 } 2234 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle); 2235 } 2236 2237 /** 2238 * Construct the content URI for a particular name/value pair, 2239 * useful for monitoring changes with a ContentObserver. 2240 * @param name to look up in the table 2241 * @return the corresponding content URI, or null if not present 2242 */ 2243 public static Uri getUriFor(String name) { 2244 if (MOVED_TO_SECURE.contains(name)) { 2245 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2246 + " to android.provider.Settings.Secure, returning Secure URI."); 2247 return Secure.getUriFor(Secure.CONTENT_URI, name); 2248 } 2249 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 2250 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 2251 + " to android.provider.Settings.Global, returning read-only global URI."); 2252 return Global.getUriFor(Global.CONTENT_URI, name); 2253 } 2254 return getUriFor(CONTENT_URI, name); 2255 } 2256 2257 /** 2258 * Convenience function for retrieving a single system settings value 2259 * as an integer. Note that internally setting values are always 2260 * stored as strings; this function converts the string to an integer 2261 * for you. The default value will be returned if the setting is 2262 * not defined or not an integer. 2263 * 2264 * @param cr The ContentResolver to access. 2265 * @param name The name of the setting to retrieve. 2266 * @param def Value to return if the setting is not defined. 2267 * 2268 * @return The setting's current value, or 'def' if it is not defined 2269 * or not a valid integer. 2270 */ 2271 public static int getInt(ContentResolver cr, String name, int def) { 2272 return getIntForUser(cr, name, def, UserHandle.myUserId()); 2273 } 2274 2275 /** @hide */ 2276 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 2277 String v = getStringForUser(cr, name, userHandle); 2278 try { 2279 return v != null ? Integer.parseInt(v) : def; 2280 } catch (NumberFormatException e) { 2281 return def; 2282 } 2283 } 2284 2285 /** 2286 * Convenience function for retrieving a single system settings value 2287 * as an integer. Note that internally setting values are always 2288 * stored as strings; this function converts the string to an integer 2289 * for you. 2290 * <p> 2291 * This version does not take a default value. If the setting has not 2292 * been set, or the string value is not a number, 2293 * it throws {@link SettingNotFoundException}. 2294 * 2295 * @param cr The ContentResolver to access. 2296 * @param name The name of the setting to retrieve. 2297 * 2298 * @throws SettingNotFoundException Thrown if a setting by the given 2299 * name can't be found or the setting value is not an integer. 2300 * 2301 * @return The setting's current value. 2302 */ 2303 public static int getInt(ContentResolver cr, String name) 2304 throws SettingNotFoundException { 2305 return getIntForUser(cr, name, UserHandle.myUserId()); 2306 } 2307 2308 /** @hide */ 2309 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 2310 throws SettingNotFoundException { 2311 String v = getStringForUser(cr, name, userHandle); 2312 try { 2313 return Integer.parseInt(v); 2314 } catch (NumberFormatException e) { 2315 throw new SettingNotFoundException(name); 2316 } 2317 } 2318 2319 /** 2320 * Convenience function for updating a single settings value as an 2321 * integer. This will either create a new entry in the table if the 2322 * given name does not exist, or modify the value of the existing row 2323 * with that name. Note that internally setting values are always 2324 * stored as strings, so this function converts the given value to a 2325 * string before storing it. 2326 * 2327 * @param cr The ContentResolver to access. 2328 * @param name The name of the setting to modify. 2329 * @param value The new value for the setting. 2330 * @return true if the value was set, false on database errors 2331 */ 2332 public static boolean putInt(ContentResolver cr, String name, int value) { 2333 return putIntForUser(cr, name, value, UserHandle.myUserId()); 2334 } 2335 2336 /** @hide */ 2337 public static boolean putIntForUser(ContentResolver cr, String name, int value, 2338 int userHandle) { 2339 return putStringForUser(cr, name, Integer.toString(value), userHandle); 2340 } 2341 2342 /** 2343 * Convenience function for retrieving a single system settings value 2344 * as a {@code long}. Note that internally setting values are always 2345 * stored as strings; this function converts the string to a {@code long} 2346 * for you. The default value will be returned if the setting is 2347 * not defined or not a {@code long}. 2348 * 2349 * @param cr The ContentResolver to access. 2350 * @param name The name of the setting to retrieve. 2351 * @param def Value to return if the setting is not defined. 2352 * 2353 * @return The setting's current value, or 'def' if it is not defined 2354 * or not a valid {@code long}. 2355 */ 2356 public static long getLong(ContentResolver cr, String name, long def) { 2357 return getLongForUser(cr, name, def, UserHandle.myUserId()); 2358 } 2359 2360 /** @hide */ 2361 public static long getLongForUser(ContentResolver cr, String name, long def, 2362 int userHandle) { 2363 String valString = getStringForUser(cr, name, userHandle); 2364 long value; 2365 try { 2366 value = valString != null ? Long.parseLong(valString) : def; 2367 } catch (NumberFormatException e) { 2368 value = def; 2369 } 2370 return value; 2371 } 2372 2373 /** 2374 * Convenience function for retrieving a single system settings value 2375 * as a {@code long}. Note that internally setting values are always 2376 * stored as strings; this function converts the string to a {@code long} 2377 * for you. 2378 * <p> 2379 * This version does not take a default value. If the setting has not 2380 * been set, or the string value is not a number, 2381 * it throws {@link SettingNotFoundException}. 2382 * 2383 * @param cr The ContentResolver to access. 2384 * @param name The name of the setting to retrieve. 2385 * 2386 * @return The setting's current value. 2387 * @throws SettingNotFoundException Thrown if a setting by the given 2388 * name can't be found or the setting value is not an integer. 2389 */ 2390 public static long getLong(ContentResolver cr, String name) 2391 throws SettingNotFoundException { 2392 return getLongForUser(cr, name, UserHandle.myUserId()); 2393 } 2394 2395 /** @hide */ 2396 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 2397 throws SettingNotFoundException { 2398 String valString = getStringForUser(cr, name, userHandle); 2399 try { 2400 return Long.parseLong(valString); 2401 } catch (NumberFormatException e) { 2402 throw new SettingNotFoundException(name); 2403 } 2404 } 2405 2406 /** 2407 * Convenience function for updating a single settings value as a long 2408 * integer. This will either create a new entry in the table if the 2409 * given name does not exist, or modify the value of the existing row 2410 * with that name. Note that internally setting values are always 2411 * stored as strings, so this function converts the given value to a 2412 * string before storing it. 2413 * 2414 * @param cr The ContentResolver to access. 2415 * @param name The name of the setting to modify. 2416 * @param value The new value for the setting. 2417 * @return true if the value was set, false on database errors 2418 */ 2419 public static boolean putLong(ContentResolver cr, String name, long value) { 2420 return putLongForUser(cr, name, value, UserHandle.myUserId()); 2421 } 2422 2423 /** @hide */ 2424 public static boolean putLongForUser(ContentResolver cr, String name, long value, 2425 int userHandle) { 2426 return putStringForUser(cr, name, Long.toString(value), userHandle); 2427 } 2428 2429 /** 2430 * Convenience function for retrieving a single system settings value 2431 * as a floating point number. Note that internally setting values are 2432 * always stored as strings; this function converts the string to an 2433 * float for you. The default value will be returned if the setting 2434 * is not defined or not a valid float. 2435 * 2436 * @param cr The ContentResolver to access. 2437 * @param name The name of the setting to retrieve. 2438 * @param def Value to return if the setting is not defined. 2439 * 2440 * @return The setting's current value, or 'def' if it is not defined 2441 * or not a valid float. 2442 */ 2443 public static float getFloat(ContentResolver cr, String name, float def) { 2444 return getFloatForUser(cr, name, def, UserHandle.myUserId()); 2445 } 2446 2447 /** @hide */ 2448 public static float getFloatForUser(ContentResolver cr, String name, float def, 2449 int userHandle) { 2450 String v = getStringForUser(cr, name, userHandle); 2451 try { 2452 return v != null ? Float.parseFloat(v) : def; 2453 } catch (NumberFormatException e) { 2454 return def; 2455 } 2456 } 2457 2458 /** 2459 * Convenience function for retrieving a single system settings value 2460 * as a float. Note that internally setting values are always 2461 * stored as strings; this function converts the string to a float 2462 * for you. 2463 * <p> 2464 * This version does not take a default value. If the setting has not 2465 * been set, or the string value is not a number, 2466 * it throws {@link SettingNotFoundException}. 2467 * 2468 * @param cr The ContentResolver to access. 2469 * @param name The name of the setting to retrieve. 2470 * 2471 * @throws SettingNotFoundException Thrown if a setting by the given 2472 * name can't be found or the setting value is not a float. 2473 * 2474 * @return The setting's current value. 2475 */ 2476 public static float getFloat(ContentResolver cr, String name) 2477 throws SettingNotFoundException { 2478 return getFloatForUser(cr, name, UserHandle.myUserId()); 2479 } 2480 2481 /** @hide */ 2482 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 2483 throws SettingNotFoundException { 2484 String v = getStringForUser(cr, name, userHandle); 2485 if (v == null) { 2486 throw new SettingNotFoundException(name); 2487 } 2488 try { 2489 return Float.parseFloat(v); 2490 } catch (NumberFormatException e) { 2491 throw new SettingNotFoundException(name); 2492 } 2493 } 2494 2495 /** 2496 * Convenience function for updating a single settings value as a 2497 * floating point number. This will either create a new entry in the 2498 * table if the given name does not exist, or modify the value of the 2499 * existing row with that name. Note that internally setting values 2500 * are always stored as strings, so this function converts the given 2501 * value to a string before storing it. 2502 * 2503 * @param cr The ContentResolver to access. 2504 * @param name The name of the setting to modify. 2505 * @param value The new value for the setting. 2506 * @return true if the value was set, false on database errors 2507 */ 2508 public static boolean putFloat(ContentResolver cr, String name, float value) { 2509 return putFloatForUser(cr, name, value, UserHandle.myUserId()); 2510 } 2511 2512 /** @hide */ 2513 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 2514 int userHandle) { 2515 return putStringForUser(cr, name, Float.toString(value), userHandle); 2516 } 2517 2518 /** 2519 * Convenience function to read all of the current 2520 * configuration-related settings into a 2521 * {@link Configuration} object. 2522 * 2523 * @param cr The ContentResolver to access. 2524 * @param outConfig Where to place the configuration settings. 2525 */ 2526 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 2527 adjustConfigurationForUser(cr, outConfig, UserHandle.myUserId(), 2528 false /* updateSettingsIfEmpty */); 2529 } 2530 2531 /** @hide */ 2532 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, 2533 int userHandle, boolean updateSettingsIfEmpty) { 2534 outConfig.fontScale = Settings.System.getFloatForUser( 2535 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); 2536 if (outConfig.fontScale < 0) { 2537 outConfig.fontScale = DEFAULT_FONT_SCALE; 2538 } 2539 2540 final String localeValue = 2541 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); 2542 if (localeValue != null) { 2543 outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); 2544 } else { 2545 // Do not update configuration with emtpy settings since we need to take over the 2546 // locale list of previous user if the settings value is empty. This happens when a 2547 // new user is created. 2548 2549 if (updateSettingsIfEmpty) { 2550 // Make current configuration persistent. This is necessary the first time a 2551 // user log in. At the first login, the configuration settings are empty, so we 2552 // need to store the adjusted configuration as the initial settings. 2553 Settings.System.putStringForUser( 2554 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), 2555 userHandle); 2556 } 2557 } 2558 } 2559 2560 /** 2561 * @hide Erase the fields in the Configuration that should be applied 2562 * by the settings. 2563 */ 2564 public static void clearConfiguration(Configuration inoutConfig) { 2565 inoutConfig.fontScale = 0; 2566 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { 2567 inoutConfig.clearLocales(); 2568 } 2569 } 2570 2571 /** 2572 * Convenience function to write a batch of configuration-related 2573 * settings from a {@link Configuration} object. 2574 * 2575 * @param cr The ContentResolver to access. 2576 * @param config The settings to write. 2577 * @return true if the values were set, false on database errors 2578 */ 2579 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 2580 return putConfigurationForUser(cr, config, UserHandle.myUserId()); 2581 } 2582 2583 /** @hide */ 2584 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 2585 int userHandle) { 2586 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && 2587 Settings.System.putStringForUser( 2588 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); 2589 } 2590 2591 /** @hide */ 2592 public static boolean hasInterestingConfigurationChanges(int changes) { 2593 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || 2594 (changes & ActivityInfo.CONFIG_LOCALE) != 0; 2595 } 2596 2597 /** @deprecated - Do not use */ 2598 @Deprecated 2599 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 2600 return getShowGTalkServiceStatusForUser(cr, UserHandle.myUserId()); 2601 } 2602 2603 /** 2604 * @hide 2605 * @deprecated - Do not use 2606 */ 2607 @Deprecated 2608 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 2609 int userHandle) { 2610 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 2611 } 2612 2613 /** @deprecated - Do not use */ 2614 @Deprecated 2615 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 2616 setShowGTalkServiceStatusForUser(cr, flag, UserHandle.myUserId()); 2617 } 2618 2619 /** 2620 * @hide 2621 * @deprecated - Do not use 2622 */ 2623 @Deprecated 2624 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 2625 int userHandle) { 2626 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 2627 } 2628 2629 private static final class DiscreteValueValidator implements Validator { 2630 private final String[] mValues; 2631 2632 public DiscreteValueValidator(String[] values) { 2633 mValues = values; 2634 } 2635 2636 @Override 2637 public boolean validate(String value) { 2638 return ArrayUtils.contains(mValues, value); 2639 } 2640 } 2641 2642 private static final class InclusiveIntegerRangeValidator implements Validator { 2643 private final int mMin; 2644 private final int mMax; 2645 2646 public InclusiveIntegerRangeValidator(int min, int max) { 2647 mMin = min; 2648 mMax = max; 2649 } 2650 2651 @Override 2652 public boolean validate(String value) { 2653 try { 2654 final int intValue = Integer.parseInt(value); 2655 return intValue >= mMin && intValue <= mMax; 2656 } catch (NumberFormatException e) { 2657 return false; 2658 } 2659 } 2660 } 2661 2662 private static final class InclusiveFloatRangeValidator implements Validator { 2663 private final float mMin; 2664 private final float mMax; 2665 2666 public InclusiveFloatRangeValidator(float min, float max) { 2667 mMin = min; 2668 mMax = max; 2669 } 2670 2671 @Override 2672 public boolean validate(String value) { 2673 try { 2674 final float floatValue = Float.parseFloat(value); 2675 return floatValue >= mMin && floatValue <= mMax; 2676 } catch (NumberFormatException e) { 2677 return false; 2678 } 2679 } 2680 } 2681 2682 /** 2683 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 2684 */ 2685 @Deprecated 2686 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 2687 2688 /** 2689 * What happens when the user presses the end call button if they're not 2690 * on a call.<br/> 2691 * <b>Values:</b><br/> 2692 * 0 - The end button does nothing.<br/> 2693 * 1 - The end button goes to the home screen.<br/> 2694 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 2695 * 3 - The end button goes to the home screen. If the user is already on the 2696 * home screen, it puts the device to sleep. 2697 */ 2698 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 2699 2700 private static final Validator END_BUTTON_BEHAVIOR_VALIDATOR = 2701 new InclusiveIntegerRangeValidator(0, 3); 2702 2703 /** 2704 * END_BUTTON_BEHAVIOR value for "go home". 2705 * @hide 2706 */ 2707 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 2708 2709 /** 2710 * END_BUTTON_BEHAVIOR value for "go to sleep". 2711 * @hide 2712 */ 2713 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 2714 2715 /** 2716 * END_BUTTON_BEHAVIOR default value. 2717 * @hide 2718 */ 2719 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 2720 2721 /** 2722 * Is advanced settings mode turned on. 0 == no, 1 == yes 2723 * @hide 2724 */ 2725 public static final String ADVANCED_SETTINGS = "advanced_settings"; 2726 2727 private static final Validator ADVANCED_SETTINGS_VALIDATOR = sBooleanValidator; 2728 2729 /** 2730 * ADVANCED_SETTINGS default value. 2731 * @hide 2732 */ 2733 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 2734 2735 /** 2736 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 2737 */ 2738 @Deprecated 2739 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 2740 2741 /** 2742 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 2743 */ 2744 @Deprecated 2745 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 2746 2747 /** 2748 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 2749 */ 2750 @Deprecated 2751 public static final String RADIO_WIFI = Global.RADIO_WIFI; 2752 2753 /** 2754 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 2755 * {@hide} 2756 */ 2757 @Deprecated 2758 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 2759 2760 /** 2761 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 2762 */ 2763 @Deprecated 2764 public static final String RADIO_CELL = Global.RADIO_CELL; 2765 2766 /** 2767 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 2768 */ 2769 @Deprecated 2770 public static final String RADIO_NFC = Global.RADIO_NFC; 2771 2772 /** 2773 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 2774 */ 2775 @Deprecated 2776 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 2777 2778 /** 2779 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 2780 * 2781 * {@hide} 2782 */ 2783 @Deprecated 2784 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 2785 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 2786 2787 /** 2788 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 2789 */ 2790 @Deprecated 2791 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 2792 2793 /** 2794 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 2795 */ 2796 @Deprecated 2797 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 2798 2799 /** 2800 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 2801 */ 2802 @Deprecated 2803 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 2804 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 2805 2806 /** 2807 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 2808 */ 2809 @Deprecated 2810 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 2811 2812 /** 2813 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 2814 */ 2815 @Deprecated 2816 public static final String MODE_RINGER = Global.MODE_RINGER; 2817 2818 /** 2819 * Whether to use static IP and other static network attributes. 2820 * <p> 2821 * Set to 1 for true and 0 for false. 2822 * 2823 * @deprecated Use {@link WifiManager} instead 2824 */ 2825 @Deprecated 2826 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 2827 2828 private static final Validator WIFI_USE_STATIC_IP_VALIDATOR = sBooleanValidator; 2829 2830 /** 2831 * The static IP address. 2832 * <p> 2833 * Example: "192.168.1.51" 2834 * 2835 * @deprecated Use {@link WifiManager} instead 2836 */ 2837 @Deprecated 2838 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 2839 2840 private static final Validator WIFI_STATIC_IP_VALIDATOR = sLenientIpAddressValidator; 2841 2842 /** 2843 * If using static IP, the gateway's IP address. 2844 * <p> 2845 * Example: "192.168.1.1" 2846 * 2847 * @deprecated Use {@link WifiManager} instead 2848 */ 2849 @Deprecated 2850 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 2851 2852 private static final Validator WIFI_STATIC_GATEWAY_VALIDATOR = sLenientIpAddressValidator; 2853 2854 /** 2855 * If using static IP, the net mask. 2856 * <p> 2857 * Example: "255.255.255.0" 2858 * 2859 * @deprecated Use {@link WifiManager} instead 2860 */ 2861 @Deprecated 2862 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 2863 2864 private static final Validator WIFI_STATIC_NETMASK_VALIDATOR = sLenientIpAddressValidator; 2865 2866 /** 2867 * If using static IP, the primary DNS's IP address. 2868 * <p> 2869 * Example: "192.168.1.1" 2870 * 2871 * @deprecated Use {@link WifiManager} instead 2872 */ 2873 @Deprecated 2874 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 2875 2876 private static final Validator WIFI_STATIC_DNS1_VALIDATOR = sLenientIpAddressValidator; 2877 2878 /** 2879 * If using static IP, the secondary DNS's IP address. 2880 * <p> 2881 * Example: "192.168.1.2" 2882 * 2883 * @deprecated Use {@link WifiManager} instead 2884 */ 2885 @Deprecated 2886 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 2887 2888 private static final Validator WIFI_STATIC_DNS2_VALIDATOR = sLenientIpAddressValidator; 2889 2890 /** 2891 * Determines whether remote devices may discover and/or connect to 2892 * this device. 2893 * <P>Type: INT</P> 2894 * 2 -- discoverable and connectable 2895 * 1 -- connectable but not discoverable 2896 * 0 -- neither connectable nor discoverable 2897 */ 2898 public static final String BLUETOOTH_DISCOVERABILITY = 2899 "bluetooth_discoverability"; 2900 2901 private static final Validator BLUETOOTH_DISCOVERABILITY_VALIDATOR = 2902 new InclusiveIntegerRangeValidator(0, 2); 2903 2904 /** 2905 * Bluetooth discoverability timeout. If this value is nonzero, then 2906 * Bluetooth becomes discoverable for a certain number of seconds, 2907 * after which is becomes simply connectable. The value is in seconds. 2908 */ 2909 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 2910 "bluetooth_discoverability_timeout"; 2911 2912 private static final Validator BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR = 2913 sNonNegativeIntegerValidator; 2914 2915 /** 2916 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 2917 * instead 2918 */ 2919 @Deprecated 2920 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 2921 2922 /** 2923 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 2924 * instead 2925 */ 2926 @Deprecated 2927 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 2928 2929 /** 2930 * @deprecated Use 2931 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 2932 * instead 2933 */ 2934 @Deprecated 2935 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 2936 "lock_pattern_tactile_feedback_enabled"; 2937 2938 /** 2939 * A formatted string of the next alarm that is set, or the empty string 2940 * if there is no alarm set. 2941 * 2942 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 2943 */ 2944 @Deprecated 2945 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 2946 2947 private static final Validator NEXT_ALARM_FORMATTED_VALIDATOR = new Validator() { 2948 private static final int MAX_LENGTH = 1000; 2949 2950 @Override 2951 public boolean validate(String value) { 2952 // TODO: No idea what the correct format is. 2953 return value == null || value.length() < MAX_LENGTH; 2954 } 2955 }; 2956 2957 /** 2958 * Scaling factor for fonts, float. 2959 */ 2960 public static final String FONT_SCALE = "font_scale"; 2961 2962 private static final Validator FONT_SCALE_VALIDATOR = new Validator() { 2963 @Override 2964 public boolean validate(String value) { 2965 try { 2966 return Float.parseFloat(value) >= 0; 2967 } catch (NumberFormatException e) { 2968 return false; 2969 } 2970 } 2971 }; 2972 2973 /** 2974 * The serialized system locale value. 2975 * 2976 * Do not use this value directory. 2977 * To get system locale, use {@link LocaleList#getDefault} instead. 2978 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} 2979 * instead. 2980 * @hide 2981 */ 2982 public static final String SYSTEM_LOCALES = "system_locales"; 2983 2984 2985 /** 2986 * Name of an application package to be debugged. 2987 * 2988 * @deprecated Use {@link Global#DEBUG_APP} instead 2989 */ 2990 @Deprecated 2991 public static final String DEBUG_APP = Global.DEBUG_APP; 2992 2993 /** 2994 * If 1, when launching DEBUG_APP it will wait for the debugger before 2995 * starting user code. If 0, it will run normally. 2996 * 2997 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 2998 */ 2999 @Deprecated 3000 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 3001 3002 /** 3003 * Whether or not to dim the screen. 0=no 1=yes 3004 * @deprecated This setting is no longer used. 3005 */ 3006 @Deprecated 3007 public static final String DIM_SCREEN = "dim_screen"; 3008 3009 private static final Validator DIM_SCREEN_VALIDATOR = sBooleanValidator; 3010 3011 /** 3012 * The amount of time in milliseconds before the device goes to sleep or begins 3013 * to dream after a period of inactivity. This value is also known as the 3014 * user activity timeout period since the screen isn't necessarily turned off 3015 * when it expires. 3016 */ 3017 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 3018 3019 private static final Validator SCREEN_OFF_TIMEOUT_VALIDATOR = sNonNegativeIntegerValidator; 3020 3021 /** 3022 * The screen backlight brightness between 0 and 255. 3023 */ 3024 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 3025 3026 private static final Validator SCREEN_BRIGHTNESS_VALIDATOR = 3027 new InclusiveIntegerRangeValidator(0, 255); 3028 3029 /** 3030 * The screen backlight brightness between 0 and 255. 3031 * @hide 3032 */ 3033 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; 3034 3035 private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR = 3036 new InclusiveIntegerRangeValidator(0, 255); 3037 3038 /** 3039 * Control whether to enable automatic brightness mode. 3040 */ 3041 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 3042 3043 private static final Validator SCREEN_BRIGHTNESS_MODE_VALIDATOR = sBooleanValidator; 3044 3045 /** 3046 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 3047 * or less (<0.0 >-1.0) bright. 3048 * @hide 3049 */ 3050 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 3051 3052 private static final Validator SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR = 3053 new InclusiveFloatRangeValidator(-1, 1); 3054 3055 /** 3056 * SCREEN_BRIGHTNESS_MODE value for manual mode. 3057 */ 3058 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 3059 3060 /** 3061 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 3062 */ 3063 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 3064 3065 /** 3066 * Control whether the process CPU usage meter should be shown. 3067 * 3068 * @deprecated This functionality is no longer available as of 3069 * {@link android.os.Build.VERSION_CODES#N_MR1}. 3070 */ 3071 @Deprecated 3072 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 3073 3074 /** 3075 * If 1, the activity manager will aggressively finish activities and 3076 * processes as soon as they are no longer needed. If 0, the normal 3077 * extended lifetime is used. 3078 * 3079 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 3080 */ 3081 @Deprecated 3082 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 3083 3084 /** 3085 * Determines which streams are affected by ringer mode changes. The 3086 * stream type's bit should be set to 1 if it should be muted when going 3087 * into an inaudible ringer mode. 3088 */ 3089 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 3090 3091 private static final Validator MODE_RINGER_STREAMS_AFFECTED_VALIDATOR = 3092 sNonNegativeIntegerValidator; 3093 3094 /** 3095 * Determines which streams are affected by mute. The 3096 * stream type's bit should be set to 1 if it should be muted when a mute request 3097 * is received. 3098 */ 3099 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 3100 3101 private static final Validator MUTE_STREAMS_AFFECTED_VALIDATOR = 3102 sNonNegativeIntegerValidator; 3103 3104 /** 3105 * Whether vibrate is on for different events. This is used internally, 3106 * changing this value will not change the vibrate. See AudioManager. 3107 */ 3108 public static final String VIBRATE_ON = "vibrate_on"; 3109 3110 private static final Validator VIBRATE_ON_VALIDATOR = sBooleanValidator; 3111 3112 /** 3113 * If 1, redirects the system vibrator to all currently attached input devices 3114 * that support vibration. If there are no such input devices, then the system 3115 * vibrator is used instead. 3116 * If 0, does not register the system vibrator. 3117 * 3118 * This setting is mainly intended to provide a compatibility mechanism for 3119 * applications that only know about the system vibrator and do not use the 3120 * input device vibrator API. 3121 * 3122 * @hide 3123 */ 3124 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 3125 3126 private static final Validator VIBRATE_INPUT_DEVICES_VALIDATOR = sBooleanValidator; 3127 3128 /** 3129 * Ringer volume. This is used internally, changing this value will not 3130 * change the volume. See AudioManager. 3131 * 3132 * @removed Not used by anything since API 2. 3133 */ 3134 public static final String VOLUME_RING = "volume_ring"; 3135 3136 /** 3137 * System/notifications volume. This is used internally, changing this 3138 * value will not change the volume. See AudioManager. 3139 * 3140 * @removed Not used by anything since API 2. 3141 */ 3142 public static final String VOLUME_SYSTEM = "volume_system"; 3143 3144 /** 3145 * Voice call volume. This is used internally, changing this value will 3146 * not change the volume. See AudioManager. 3147 * 3148 * @removed Not used by anything since API 2. 3149 */ 3150 public static final String VOLUME_VOICE = "volume_voice"; 3151 3152 /** 3153 * Music/media/gaming volume. This is used internally, changing this 3154 * value will not change the volume. See AudioManager. 3155 * 3156 * @removed Not used by anything since API 2. 3157 */ 3158 public static final String VOLUME_MUSIC = "volume_music"; 3159 3160 /** 3161 * Alarm volume. This is used internally, changing this 3162 * value will not change the volume. See AudioManager. 3163 * 3164 * @removed Not used by anything since API 2. 3165 */ 3166 public static final String VOLUME_ALARM = "volume_alarm"; 3167 3168 /** 3169 * Notification volume. This is used internally, changing this 3170 * value will not change the volume. See AudioManager. 3171 * 3172 * @removed Not used by anything since API 2. 3173 */ 3174 public static final String VOLUME_NOTIFICATION = "volume_notification"; 3175 3176 /** 3177 * Bluetooth Headset volume. This is used internally, changing this value will 3178 * not change the volume. See AudioManager. 3179 * 3180 * @removed Not used by anything since API 2. 3181 */ 3182 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 3183 3184 /** 3185 * Master volume (float in the range 0.0f to 1.0f). 3186 * 3187 * @hide 3188 */ 3189 public static final String VOLUME_MASTER = "volume_master"; 3190 3191 /** 3192 * Master mono (int 1 = mono, 0 = normal). 3193 * 3194 * @hide 3195 */ 3196 public static final String MASTER_MONO = "master_mono"; 3197 3198 private static final Validator MASTER_MONO_VALIDATOR = sBooleanValidator; 3199 3200 /** 3201 * Whether the notifications should use the ring volume (value of 1) or 3202 * a separate notification volume (value of 0). In most cases, users 3203 * will have this enabled so the notification and ringer volumes will be 3204 * the same. However, power users can disable this and use the separate 3205 * notification volume control. 3206 * <p> 3207 * Note: This is a one-off setting that will be removed in the future 3208 * when there is profile support. For this reason, it is kept hidden 3209 * from the public APIs. 3210 * 3211 * @hide 3212 * @deprecated 3213 */ 3214 @Deprecated 3215 public static final String NOTIFICATIONS_USE_RING_VOLUME = 3216 "notifications_use_ring_volume"; 3217 3218 private static final Validator NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR = sBooleanValidator; 3219 3220 /** 3221 * Whether silent mode should allow vibration feedback. This is used 3222 * internally in AudioService and the Sound settings activity to 3223 * coordinate decoupling of vibrate and silent modes. This setting 3224 * will likely be removed in a future release with support for 3225 * audio/vibe feedback profiles. 3226 * 3227 * Not used anymore. On devices with vibrator, the user explicitly selects 3228 * silent or vibrate mode. 3229 * Kept for use by legacy database upgrade code in DatabaseHelper. 3230 * @hide 3231 */ 3232 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 3233 3234 private static final Validator VIBRATE_IN_SILENT_VALIDATOR = sBooleanValidator; 3235 3236 /** 3237 * The mapping of stream type (integer) to its setting. 3238 * 3239 * @removed Not used by anything since API 2. 3240 */ 3241 public static final String[] VOLUME_SETTINGS = { 3242 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 3243 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 3244 }; 3245 3246 /** 3247 * Appended to various volume related settings to record the previous 3248 * values before they the settings were affected by a silent/vibrate 3249 * ringer mode change. 3250 * 3251 * @removed Not used by anything since API 2. 3252 */ 3253 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 3254 3255 /** 3256 * Persistent store for the system-wide default ringtone URI. 3257 * <p> 3258 * If you need to play the default ringtone at any given time, it is recommended 3259 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 3260 * to the set default ringtone at the time of playing. 3261 * 3262 * @see #DEFAULT_RINGTONE_URI 3263 */ 3264 public static final String RINGTONE = "ringtone"; 3265 3266 private static final Validator RINGTONE_VALIDATOR = sUriValidator; 3267 3268 /** 3269 * A {@link Uri} that will point to the current default ringtone at any 3270 * given time. 3271 * <p> 3272 * If the current default ringtone is in the DRM provider and the caller 3273 * does not have permission, the exception will be a 3274 * FileNotFoundException. 3275 */ 3276 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 3277 3278 /** {@hide} */ 3279 public static final String RINGTONE_CACHE = "ringtone_cache"; 3280 /** {@hide} */ 3281 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); 3282 3283 /** 3284 * Persistent store for the system-wide default notification sound. 3285 * 3286 * @see #RINGTONE 3287 * @see #DEFAULT_NOTIFICATION_URI 3288 */ 3289 public static final String NOTIFICATION_SOUND = "notification_sound"; 3290 3291 private static final Validator NOTIFICATION_SOUND_VALIDATOR = sUriValidator; 3292 3293 /** 3294 * A {@link Uri} that will point to the current default notification 3295 * sound at any given time. 3296 * 3297 * @see #DEFAULT_RINGTONE_URI 3298 */ 3299 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 3300 3301 /** {@hide} */ 3302 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; 3303 /** {@hide} */ 3304 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); 3305 3306 /** 3307 * Persistent store for the system-wide default alarm alert. 3308 * 3309 * @see #RINGTONE 3310 * @see #DEFAULT_ALARM_ALERT_URI 3311 */ 3312 public static final String ALARM_ALERT = "alarm_alert"; 3313 3314 private static final Validator ALARM_ALERT_VALIDATOR = sUriValidator; 3315 3316 /** 3317 * A {@link Uri} that will point to the current default alarm alert at 3318 * any given time. 3319 * 3320 * @see #DEFAULT_ALARM_ALERT_URI 3321 */ 3322 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 3323 3324 /** {@hide} */ 3325 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; 3326 /** {@hide} */ 3327 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); 3328 3329 /** 3330 * Persistent store for the system default media button event receiver. 3331 * 3332 * @hide 3333 */ 3334 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 3335 3336 private static final Validator MEDIA_BUTTON_RECEIVER_VALIDATOR = new Validator() { 3337 @Override 3338 public boolean validate(String value) { 3339 try { 3340 ComponentName.unflattenFromString(value); 3341 return true; 3342 } catch (NullPointerException e) { 3343 return false; 3344 } 3345 } 3346 }; 3347 3348 /** 3349 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 3350 */ 3351 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 3352 3353 private static final Validator TEXT_AUTO_REPLACE_VALIDATOR = sBooleanValidator; 3354 3355 /** 3356 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 3357 */ 3358 public static final String TEXT_AUTO_CAPS = "auto_caps"; 3359 3360 private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator; 3361 3362 /** 3363 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 3364 * feature converts two spaces to a "." and space. 3365 */ 3366 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 3367 3368 private static final Validator TEXT_AUTO_PUNCTUATE_VALIDATOR = sBooleanValidator; 3369 3370 /** 3371 * Setting to showing password characters in text editors. 1 = On, 0 = Off 3372 */ 3373 public static final String TEXT_SHOW_PASSWORD = "show_password"; 3374 3375 private static final Validator TEXT_SHOW_PASSWORD_VALIDATOR = sBooleanValidator; 3376 3377 public static final String SHOW_GTALK_SERVICE_STATUS = 3378 "SHOW_GTALK_SERVICE_STATUS"; 3379 3380 private static final Validator SHOW_GTALK_SERVICE_STATUS_VALIDATOR = sBooleanValidator; 3381 3382 /** 3383 * Name of activity to use for wallpaper on the home screen. 3384 * 3385 * @deprecated Use {@link WallpaperManager} instead. 3386 */ 3387 @Deprecated 3388 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 3389 3390 private static final Validator WALLPAPER_ACTIVITY_VALIDATOR = new Validator() { 3391 private static final int MAX_LENGTH = 1000; 3392 3393 @Override 3394 public boolean validate(String value) { 3395 if (value != null && value.length() > MAX_LENGTH) { 3396 return false; 3397 } 3398 return ComponentName.unflattenFromString(value) != null; 3399 } 3400 }; 3401 3402 /** 3403 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 3404 * instead 3405 */ 3406 @Deprecated 3407 public static final String AUTO_TIME = Global.AUTO_TIME; 3408 3409 /** 3410 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 3411 * instead 3412 */ 3413 @Deprecated 3414 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 3415 3416 /** 3417 * Display times as 12 or 24 hours 3418 * 12 3419 * 24 3420 */ 3421 public static final String TIME_12_24 = "time_12_24"; 3422 3423 /** @hide */ 3424 public static final Validator TIME_12_24_VALIDATOR = 3425 new DiscreteValueValidator(new String[] {"12", "24"}); 3426 3427 /** 3428 * Date format string 3429 * mm/dd/yyyy 3430 * dd/mm/yyyy 3431 * yyyy/mm/dd 3432 */ 3433 public static final String DATE_FORMAT = "date_format"; 3434 3435 /** @hide */ 3436 public static final Validator DATE_FORMAT_VALIDATOR = new Validator() { 3437 @Override 3438 public boolean validate(String value) { 3439 try { 3440 new SimpleDateFormat(value); 3441 return true; 3442 } catch (IllegalArgumentException e) { 3443 return false; 3444 } 3445 } 3446 }; 3447 3448 /** 3449 * Whether the setup wizard has been run before (on first boot), or if 3450 * it still needs to be run. 3451 * 3452 * nonzero = it has been run in the past 3453 * 0 = it has not been run in the past 3454 */ 3455 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 3456 3457 /** @hide */ 3458 public static final Validator SETUP_WIZARD_HAS_RUN_VALIDATOR = sBooleanValidator; 3459 3460 /** 3461 * Scaling factor for normal window animations. Setting to 0 will disable window 3462 * animations. 3463 * 3464 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 3465 */ 3466 @Deprecated 3467 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 3468 3469 /** 3470 * Scaling factor for activity transition animations. Setting to 0 will disable window 3471 * animations. 3472 * 3473 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 3474 */ 3475 @Deprecated 3476 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 3477 3478 /** 3479 * Scaling factor for Animator-based animations. This affects both the start delay and 3480 * duration of all such animations. Setting to 0 will cause animations to end immediately. 3481 * The default value is 1. 3482 * 3483 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 3484 */ 3485 @Deprecated 3486 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 3487 3488 /** 3489 * Control whether the accelerometer will be used to change screen 3490 * orientation. If 0, it will not be used unless explicitly requested 3491 * by the application; if 1, it will be used by default unless explicitly 3492 * disabled by the application. 3493 */ 3494 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 3495 3496 /** @hide */ 3497 public static final Validator ACCELEROMETER_ROTATION_VALIDATOR = sBooleanValidator; 3498 3499 /** 3500 * Default screen rotation when no other policy applies. 3501 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 3502 * preference, this rotation value will be used. Must be one of the 3503 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 3504 * 3505 * @see android.view.Display#getRotation 3506 */ 3507 public static final String USER_ROTATION = "user_rotation"; 3508 3509 /** @hide */ 3510 public static final Validator USER_ROTATION_VALIDATOR = 3511 new InclusiveIntegerRangeValidator(0, 3); 3512 3513 /** 3514 * Control whether the rotation lock toggle in the System UI should be hidden. 3515 * Typically this is done for accessibility purposes to make it harder for 3516 * the user to accidentally toggle the rotation lock while the display rotation 3517 * has been locked for accessibility. 3518 * 3519 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 3520 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 3521 * 3522 * @hide 3523 */ 3524 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 3525 "hide_rotation_lock_toggle_for_accessibility"; 3526 3527 /** @hide */ 3528 public static final Validator HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR = 3529 sBooleanValidator; 3530 3531 /** 3532 * Whether the phone vibrates when it is ringing due to an incoming call. This will 3533 * be used by Phone and Setting apps; it shouldn't affect other apps. 3534 * The value is boolean (1 or 0). 3535 * 3536 * Note: this is not same as "vibrate on ring", which had been available until ICS. 3537 * It was about AudioManager's setting and thus affected all the applications which 3538 * relied on the setting, while this is purely about the vibration setting for incoming 3539 * calls. 3540 */ 3541 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 3542 3543 /** @hide */ 3544 public static final Validator VIBRATE_WHEN_RINGING_VALIDATOR = sBooleanValidator; 3545 3546 /** 3547 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 3548 * boolean (1 or 0). 3549 */ 3550 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 3551 3552 /** @hide */ 3553 public static final Validator DTMF_TONE_WHEN_DIALING_VALIDATOR = sBooleanValidator; 3554 3555 /** 3556 * CDMA only settings 3557 * DTMF tone type played by the dialer when dialing. 3558 * 0 = Normal 3559 * 1 = Long 3560 */ 3561 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 3562 3563 /** @hide */ 3564 public static final Validator DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR = sBooleanValidator; 3565 3566 /** 3567 * Whether the hearing aid is enabled. The value is 3568 * boolean (1 or 0). 3569 * @hide 3570 */ 3571 public static final String HEARING_AID = "hearing_aid"; 3572 3573 /** @hide */ 3574 public static final Validator HEARING_AID_VALIDATOR = sBooleanValidator; 3575 3576 /** 3577 * CDMA only settings 3578 * TTY Mode 3579 * 0 = OFF 3580 * 1 = FULL 3581 * 2 = VCO 3582 * 3 = HCO 3583 * @hide 3584 */ 3585 public static final String TTY_MODE = "tty_mode"; 3586 3587 /** @hide */ 3588 public static final Validator TTY_MODE_VALIDATOR = new InclusiveIntegerRangeValidator(0, 3); 3589 3590 /** 3591 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 3592 * boolean (1 or 0). 3593 */ 3594 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 3595 3596 /** @hide */ 3597 public static final Validator SOUND_EFFECTS_ENABLED_VALIDATOR = sBooleanValidator; 3598 3599 /** 3600 * Whether the haptic feedback (long presses, ...) are enabled. The value is 3601 * boolean (1 or 0). 3602 */ 3603 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 3604 3605 /** @hide */ 3606 public static final Validator HAPTIC_FEEDBACK_ENABLED_VALIDATOR = sBooleanValidator; 3607 3608 /** 3609 * @deprecated Each application that shows web suggestions should have its own 3610 * setting for this. 3611 */ 3612 @Deprecated 3613 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 3614 3615 /** @hide */ 3616 public static final Validator SHOW_WEB_SUGGESTIONS_VALIDATOR = sBooleanValidator; 3617 3618 /** 3619 * Whether the notification LED should repeatedly flash when a notification is 3620 * pending. The value is boolean (1 or 0). 3621 * @hide 3622 */ 3623 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 3624 3625 /** @hide */ 3626 public static final Validator NOTIFICATION_LIGHT_PULSE_VALIDATOR = sBooleanValidator; 3627 3628 /** 3629 * Show pointer location on screen? 3630 * 0 = no 3631 * 1 = yes 3632 * @hide 3633 */ 3634 public static final String POINTER_LOCATION = "pointer_location"; 3635 3636 /** @hide */ 3637 public static final Validator POINTER_LOCATION_VALIDATOR = sBooleanValidator; 3638 3639 /** 3640 * Show touch positions on screen? 3641 * 0 = no 3642 * 1 = yes 3643 * @hide 3644 */ 3645 public static final String SHOW_TOUCHES = "show_touches"; 3646 3647 /** @hide */ 3648 public static final Validator SHOW_TOUCHES_VALIDATOR = sBooleanValidator; 3649 3650 /** 3651 * Log raw orientation data from 3652 * {@link com.android.server.policy.WindowOrientationListener} for use with the 3653 * orientationplot.py tool. 3654 * 0 = no 3655 * 1 = yes 3656 * @hide 3657 */ 3658 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 3659 "window_orientation_listener_log"; 3660 3661 /** @hide */ 3662 public static final Validator WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR = sBooleanValidator; 3663 3664 /** 3665 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 3666 * instead 3667 * @hide 3668 */ 3669 @Deprecated 3670 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 3671 3672 /** 3673 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 3674 * instead 3675 * @hide 3676 */ 3677 @Deprecated 3678 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 3679 3680 /** 3681 * Whether to play sounds when the keyguard is shown and dismissed. 3682 * @hide 3683 */ 3684 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 3685 3686 /** @hide */ 3687 public static final Validator LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR = sBooleanValidator; 3688 3689 /** 3690 * Whether the lockscreen should be completely disabled. 3691 * @hide 3692 */ 3693 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 3694 3695 /** @hide */ 3696 public static final Validator LOCKSCREEN_DISABLED_VALIDATOR = sBooleanValidator; 3697 3698 /** 3699 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 3700 * instead 3701 * @hide 3702 */ 3703 @Deprecated 3704 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 3705 3706 /** 3707 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 3708 * instead 3709 * @hide 3710 */ 3711 @Deprecated 3712 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 3713 3714 /** 3715 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 3716 * instead 3717 * @hide 3718 */ 3719 @Deprecated 3720 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 3721 3722 /** 3723 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 3724 * instead 3725 * @hide 3726 */ 3727 @Deprecated 3728 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 3729 3730 /** 3731 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 3732 * instead 3733 * @hide 3734 */ 3735 @Deprecated 3736 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 3737 3738 /** 3739 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 3740 * instead 3741 * @hide 3742 */ 3743 @Deprecated 3744 public static final String LOCK_SOUND = Global.LOCK_SOUND; 3745 3746 /** 3747 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 3748 * instead 3749 * @hide 3750 */ 3751 @Deprecated 3752 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 3753 3754 /** 3755 * Receive incoming SIP calls? 3756 * 0 = no 3757 * 1 = yes 3758 * @hide 3759 */ 3760 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 3761 3762 /** @hide */ 3763 public static final Validator SIP_RECEIVE_CALLS_VALIDATOR = sBooleanValidator; 3764 3765 /** 3766 * Call Preference String. 3767 * "SIP_ALWAYS" : Always use SIP with network access 3768 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 3769 * @hide 3770 */ 3771 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 3772 3773 /** @hide */ 3774 public static final Validator SIP_CALL_OPTIONS_VALIDATOR = new DiscreteValueValidator( 3775 new String[] {"SIP_ALWAYS", "SIP_ADDRESS_ONLY"}); 3776 3777 /** 3778 * One of the sip call options: Always use SIP with network access. 3779 * @hide 3780 */ 3781 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 3782 3783 /** @hide */ 3784 public static final Validator SIP_ALWAYS_VALIDATOR = sBooleanValidator; 3785 3786 /** 3787 * One of the sip call options: Only if destination is a SIP address. 3788 * @hide 3789 */ 3790 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 3791 3792 /** @hide */ 3793 public static final Validator SIP_ADDRESS_ONLY_VALIDATOR = sBooleanValidator; 3794 3795 /** 3796 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that 3797 * the user should be prompted each time a call is made whether it should be placed using 3798 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with 3799 * SIP_ADDRESS_ONLY. 3800 * @hide 3801 */ 3802 @Deprecated 3803 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 3804 3805 /** @hide */ 3806 public static final Validator SIP_ASK_ME_EACH_TIME_VALIDATOR = sBooleanValidator; 3807 3808 /** 3809 * Pointer speed setting. 3810 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 3811 * -7 = slowest 3812 * 0 = default speed 3813 * +7 = fastest 3814 * @hide 3815 */ 3816 public static final String POINTER_SPEED = "pointer_speed"; 3817 3818 /** @hide */ 3819 public static final Validator POINTER_SPEED_VALIDATOR = 3820 new InclusiveFloatRangeValidator(-7, 7); 3821 3822 /** 3823 * Whether lock-to-app will be triggered by long-press on recents. 3824 * @hide 3825 */ 3826 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; 3827 3828 /** @hide */ 3829 public static final Validator LOCK_TO_APP_ENABLED_VALIDATOR = sBooleanValidator; 3830 3831 /** 3832 * I am the lolrus. 3833 * <p> 3834 * Nonzero values indicate that the user has a bukkit. 3835 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 3836 * @hide 3837 */ 3838 public static final String EGG_MODE = "egg_mode"; 3839 3840 /** @hide */ 3841 public static final Validator EGG_MODE_VALIDATOR = new Validator() { 3842 @Override 3843 public boolean validate(String value) { 3844 try { 3845 return Long.parseLong(value) >= 0; 3846 } catch (NumberFormatException e) { 3847 return false; 3848 } 3849 } 3850 }; 3851 3852 /** 3853 * IMPORTANT: If you add a new public settings you also have to add it to 3854 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add 3855 * it to PRIVATE_SETTINGS below. Also add a validator that can validate 3856 * the setting value. See an example above. 3857 */ 3858 3859 /** 3860 * Settings to backup. This is here so that it's in the same place as the settings 3861 * keys and easy to update. 3862 * 3863 * NOTE: Settings are backed up and restored in the order they appear 3864 * in this array. If you have one setting depending on another, 3865 * make sure that they are ordered appropriately. 3866 * 3867 * @hide 3868 */ 3869 public static final String[] SETTINGS_TO_BACKUP = { 3870 STAY_ON_WHILE_PLUGGED_IN, // moved to global 3871 WIFI_USE_STATIC_IP, 3872 WIFI_STATIC_IP, 3873 WIFI_STATIC_GATEWAY, 3874 WIFI_STATIC_NETMASK, 3875 WIFI_STATIC_DNS1, 3876 WIFI_STATIC_DNS2, 3877 BLUETOOTH_DISCOVERABILITY, 3878 BLUETOOTH_DISCOVERABILITY_TIMEOUT, 3879 FONT_SCALE, 3880 DIM_SCREEN, 3881 SCREEN_OFF_TIMEOUT, 3882 SCREEN_BRIGHTNESS, 3883 SCREEN_BRIGHTNESS_MODE, 3884 SCREEN_AUTO_BRIGHTNESS_ADJ, 3885 SCREEN_BRIGHTNESS_FOR_VR, 3886 VIBRATE_INPUT_DEVICES, 3887 MODE_RINGER_STREAMS_AFFECTED, 3888 TEXT_AUTO_REPLACE, 3889 TEXT_AUTO_CAPS, 3890 TEXT_AUTO_PUNCTUATE, 3891 TEXT_SHOW_PASSWORD, 3892 AUTO_TIME, // moved to global 3893 AUTO_TIME_ZONE, // moved to global 3894 TIME_12_24, 3895 DATE_FORMAT, 3896 DTMF_TONE_WHEN_DIALING, 3897 DTMF_TONE_TYPE_WHEN_DIALING, 3898 HEARING_AID, 3899 TTY_MODE, 3900 MASTER_MONO, 3901 SOUND_EFFECTS_ENABLED, 3902 HAPTIC_FEEDBACK_ENABLED, 3903 POWER_SOUNDS_ENABLED, // moved to global 3904 DOCK_SOUNDS_ENABLED, // moved to global 3905 LOCKSCREEN_SOUNDS_ENABLED, 3906 SHOW_WEB_SUGGESTIONS, 3907 SIP_CALL_OPTIONS, 3908 SIP_RECEIVE_CALLS, 3909 POINTER_SPEED, 3910 VIBRATE_WHEN_RINGING, 3911 RINGTONE, 3912 LOCK_TO_APP_ENABLED, 3913 NOTIFICATION_SOUND, 3914 ACCELEROMETER_ROTATION 3915 }; 3916 3917 /** 3918 * These are all public system settings 3919 * 3920 * @hide 3921 */ 3922 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); 3923 static { 3924 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); 3925 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); 3926 PUBLIC_SETTINGS.add(WIFI_STATIC_IP); 3927 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); 3928 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); 3929 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); 3930 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); 3931 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); 3932 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); 3933 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); 3934 PUBLIC_SETTINGS.add(FONT_SCALE); 3935 PUBLIC_SETTINGS.add(DIM_SCREEN); 3936 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); 3937 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); 3938 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); 3939 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); 3940 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); 3941 PUBLIC_SETTINGS.add(VIBRATE_ON); 3942 PUBLIC_SETTINGS.add(VOLUME_RING); 3943 PUBLIC_SETTINGS.add(VOLUME_SYSTEM); 3944 PUBLIC_SETTINGS.add(VOLUME_VOICE); 3945 PUBLIC_SETTINGS.add(VOLUME_MUSIC); 3946 PUBLIC_SETTINGS.add(VOLUME_ALARM); 3947 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); 3948 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); 3949 PUBLIC_SETTINGS.add(RINGTONE); 3950 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); 3951 PUBLIC_SETTINGS.add(ALARM_ALERT); 3952 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); 3953 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); 3954 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 3955 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); 3956 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); 3957 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); 3958 PUBLIC_SETTINGS.add(TIME_12_24); 3959 PUBLIC_SETTINGS.add(DATE_FORMAT); 3960 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); 3961 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); 3962 PUBLIC_SETTINGS.add(USER_ROTATION); 3963 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); 3964 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); 3965 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 3966 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); 3967 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); 3968 } 3969 3970 /** 3971 * These are all hidden system settings. 3972 * 3973 * @hide 3974 */ 3975 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); 3976 static { 3977 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); 3978 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); 3979 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); 3980 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); 3981 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); 3982 PRIVATE_SETTINGS.add(VOLUME_MASTER); 3983 PRIVATE_SETTINGS.add(MASTER_MONO); 3984 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); 3985 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); 3986 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); 3987 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); 3988 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); 3989 PRIVATE_SETTINGS.add(HEARING_AID); 3990 PRIVATE_SETTINGS.add(TTY_MODE); 3991 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); 3992 PRIVATE_SETTINGS.add(POINTER_LOCATION); 3993 PRIVATE_SETTINGS.add(SHOW_TOUCHES); 3994 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); 3995 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); 3996 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); 3997 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); 3998 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); 3999 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); 4000 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); 4001 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); 4002 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); 4003 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); 4004 PRIVATE_SETTINGS.add(LOCK_SOUND); 4005 PRIVATE_SETTINGS.add(UNLOCK_SOUND); 4006 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); 4007 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); 4008 PRIVATE_SETTINGS.add(SIP_ALWAYS); 4009 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); 4010 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); 4011 PRIVATE_SETTINGS.add(POINTER_SPEED); 4012 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); 4013 PRIVATE_SETTINGS.add(EGG_MODE); 4014 } 4015 4016 /** 4017 * These are all public system settings 4018 * 4019 * @hide 4020 */ 4021 public static final Map<String, Validator> VALIDATORS = new ArrayMap<>(); 4022 static { 4023 VALIDATORS.put(END_BUTTON_BEHAVIOR,END_BUTTON_BEHAVIOR_VALIDATOR); 4024 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); 4025 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY, BLUETOOTH_DISCOVERABILITY_VALIDATOR); 4026 VALIDATORS.put(BLUETOOTH_DISCOVERABILITY_TIMEOUT, 4027 BLUETOOTH_DISCOVERABILITY_TIMEOUT_VALIDATOR); 4028 VALIDATORS.put(NEXT_ALARM_FORMATTED, NEXT_ALARM_FORMATTED_VALIDATOR); 4029 VALIDATORS.put(FONT_SCALE, FONT_SCALE_VALIDATOR); 4030 VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR); 4031 VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR); 4032 VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR); 4033 VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR); 4034 VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR); 4035 VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR); 4036 VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR); 4037 VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR); 4038 VALIDATORS.put(RINGTONE, RINGTONE_VALIDATOR); 4039 VALIDATORS.put(NOTIFICATION_SOUND, NOTIFICATION_SOUND_VALIDATOR); 4040 VALIDATORS.put(ALARM_ALERT, ALARM_ALERT_VALIDATOR); 4041 VALIDATORS.put(TEXT_AUTO_REPLACE, TEXT_AUTO_REPLACE_VALIDATOR); 4042 VALIDATORS.put(TEXT_AUTO_CAPS, TEXT_AUTO_CAPS_VALIDATOR); 4043 VALIDATORS.put(TEXT_AUTO_PUNCTUATE, TEXT_AUTO_PUNCTUATE_VALIDATOR); 4044 VALIDATORS.put(TEXT_SHOW_PASSWORD, TEXT_SHOW_PASSWORD_VALIDATOR); 4045 VALIDATORS.put(SHOW_GTALK_SERVICE_STATUS, SHOW_GTALK_SERVICE_STATUS_VALIDATOR); 4046 VALIDATORS.put(WALLPAPER_ACTIVITY, WALLPAPER_ACTIVITY_VALIDATOR); 4047 VALIDATORS.put(TIME_12_24, TIME_12_24_VALIDATOR); 4048 VALIDATORS.put(DATE_FORMAT, DATE_FORMAT_VALIDATOR); 4049 VALIDATORS.put(SETUP_WIZARD_HAS_RUN, SETUP_WIZARD_HAS_RUN_VALIDATOR); 4050 VALIDATORS.put(ACCELEROMETER_ROTATION, ACCELEROMETER_ROTATION_VALIDATOR); 4051 VALIDATORS.put(USER_ROTATION, USER_ROTATION_VALIDATOR); 4052 VALIDATORS.put(DTMF_TONE_WHEN_DIALING, DTMF_TONE_WHEN_DIALING_VALIDATOR); 4053 VALIDATORS.put(SOUND_EFFECTS_ENABLED, SOUND_EFFECTS_ENABLED_VALIDATOR); 4054 VALIDATORS.put(HAPTIC_FEEDBACK_ENABLED, HAPTIC_FEEDBACK_ENABLED_VALIDATOR); 4055 VALIDATORS.put(SHOW_WEB_SUGGESTIONS, SHOW_WEB_SUGGESTIONS_VALIDATOR); 4056 VALIDATORS.put(WIFI_USE_STATIC_IP, WIFI_USE_STATIC_IP_VALIDATOR); 4057 VALIDATORS.put(END_BUTTON_BEHAVIOR, END_BUTTON_BEHAVIOR_VALIDATOR); 4058 VALIDATORS.put(ADVANCED_SETTINGS, ADVANCED_SETTINGS_VALIDATOR); 4059 VALIDATORS.put(SCREEN_AUTO_BRIGHTNESS_ADJ, SCREEN_AUTO_BRIGHTNESS_ADJ_VALIDATOR); 4060 VALIDATORS.put(VIBRATE_INPUT_DEVICES, VIBRATE_INPUT_DEVICES_VALIDATOR); 4061 VALIDATORS.put(MASTER_MONO, MASTER_MONO_VALIDATOR); 4062 VALIDATORS.put(NOTIFICATIONS_USE_RING_VOLUME, NOTIFICATIONS_USE_RING_VOLUME_VALIDATOR); 4063 VALIDATORS.put(VIBRATE_IN_SILENT, VIBRATE_IN_SILENT_VALIDATOR); 4064 VALIDATORS.put(MEDIA_BUTTON_RECEIVER, MEDIA_BUTTON_RECEIVER_VALIDATOR); 4065 VALIDATORS.put(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 4066 HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY_VALIDATOR); 4067 VALIDATORS.put(VIBRATE_WHEN_RINGING, VIBRATE_WHEN_RINGING_VALIDATOR); 4068 VALIDATORS.put(DTMF_TONE_TYPE_WHEN_DIALING, DTMF_TONE_TYPE_WHEN_DIALING_VALIDATOR); 4069 VALIDATORS.put(HEARING_AID, HEARING_AID_VALIDATOR); 4070 VALIDATORS.put(TTY_MODE, TTY_MODE_VALIDATOR); 4071 VALIDATORS.put(NOTIFICATION_LIGHT_PULSE, NOTIFICATION_LIGHT_PULSE_VALIDATOR); 4072 VALIDATORS.put(POINTER_LOCATION, POINTER_LOCATION_VALIDATOR); 4073 VALIDATORS.put(SHOW_TOUCHES, SHOW_TOUCHES_VALIDATOR); 4074 VALIDATORS.put(WINDOW_ORIENTATION_LISTENER_LOG, 4075 WINDOW_ORIENTATION_LISTENER_LOG_VALIDATOR); 4076 VALIDATORS.put(LOCKSCREEN_SOUNDS_ENABLED, LOCKSCREEN_SOUNDS_ENABLED_VALIDATOR); 4077 VALIDATORS.put(LOCKSCREEN_DISABLED, LOCKSCREEN_DISABLED_VALIDATOR); 4078 VALIDATORS.put(SIP_RECEIVE_CALLS, SIP_RECEIVE_CALLS_VALIDATOR); 4079 VALIDATORS.put(SIP_CALL_OPTIONS, SIP_CALL_OPTIONS_VALIDATOR); 4080 VALIDATORS.put(SIP_ALWAYS, SIP_ALWAYS_VALIDATOR); 4081 VALIDATORS.put(SIP_ADDRESS_ONLY, SIP_ADDRESS_ONLY_VALIDATOR); 4082 VALIDATORS.put(SIP_ASK_ME_EACH_TIME, SIP_ASK_ME_EACH_TIME_VALIDATOR); 4083 VALIDATORS.put(POINTER_SPEED, POINTER_SPEED_VALIDATOR); 4084 VALIDATORS.put(LOCK_TO_APP_ENABLED, LOCK_TO_APP_ENABLED_VALIDATOR); 4085 VALIDATORS.put(EGG_MODE, EGG_MODE_VALIDATOR); 4086 VALIDATORS.put(WIFI_STATIC_IP, WIFI_STATIC_IP_VALIDATOR); 4087 VALIDATORS.put(WIFI_STATIC_GATEWAY, WIFI_STATIC_GATEWAY_VALIDATOR); 4088 VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); 4089 VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); 4090 VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); 4091 } 4092 4093 /** 4094 * These entries are considered common between the personal and the managed profile, 4095 * since the managed profile doesn't get to change them. 4096 */ 4097 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 4098 static { 4099 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); 4100 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); 4101 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); 4102 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); 4103 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); 4104 } 4105 4106 /** @hide */ 4107 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 4108 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 4109 } 4110 4111 /** 4112 * These entries should be cloned from this profile's parent only if the dependency's 4113 * value is true ("1") 4114 * 4115 * Note: the dependencies must be Secure settings 4116 * 4117 * @hide 4118 */ 4119 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); 4120 static { 4121 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); 4122 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); 4123 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); 4124 } 4125 4126 /** @hide */ 4127 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { 4128 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); 4129 } 4130 4131 /** 4132 * System settings which can be accessed by instant apps. 4133 * @hide 4134 */ 4135 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 4136 static { 4137 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); 4138 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); 4139 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 4140 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); 4141 INSTANT_APP_SETTINGS.add(DATE_FORMAT); 4142 INSTANT_APP_SETTINGS.add(FONT_SCALE); 4143 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 4144 INSTANT_APP_SETTINGS.add(TIME_12_24); 4145 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); 4146 } 4147 4148 /** 4149 * When to use Wi-Fi calling 4150 * 4151 * @see android.telephony.TelephonyManager.WifiCallingChoices 4152 * @hide 4153 */ 4154 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 4155 4156 // Settings moved to Settings.Secure 4157 4158 /** 4159 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 4160 * instead 4161 */ 4162 @Deprecated 4163 public static final String ADB_ENABLED = Global.ADB_ENABLED; 4164 4165 /** 4166 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 4167 */ 4168 @Deprecated 4169 public static final String ANDROID_ID = Secure.ANDROID_ID; 4170 4171 /** 4172 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 4173 */ 4174 @Deprecated 4175 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 4176 4177 /** 4178 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 4179 */ 4180 @Deprecated 4181 public static final String DATA_ROAMING = Global.DATA_ROAMING; 4182 4183 /** 4184 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 4185 */ 4186 @Deprecated 4187 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 4188 4189 /** 4190 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 4191 */ 4192 @Deprecated 4193 public static final String HTTP_PROXY = Global.HTTP_PROXY; 4194 4195 /** 4196 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 4197 */ 4198 @Deprecated 4199 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 4200 4201 /** 4202 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 4203 * instead 4204 */ 4205 @Deprecated 4206 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 4207 4208 /** 4209 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 4210 */ 4211 @Deprecated 4212 public static final String LOGGING_ID = Secure.LOGGING_ID; 4213 4214 /** 4215 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 4216 */ 4217 @Deprecated 4218 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 4219 4220 /** 4221 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 4222 * instead 4223 */ 4224 @Deprecated 4225 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 4226 4227 /** 4228 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 4229 * instead 4230 */ 4231 @Deprecated 4232 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 4233 4234 /** 4235 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 4236 * instead 4237 */ 4238 @Deprecated 4239 public static final String PARENTAL_CONTROL_REDIRECT_URL = 4240 Secure.PARENTAL_CONTROL_REDIRECT_URL; 4241 4242 /** 4243 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 4244 */ 4245 @Deprecated 4246 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 4247 4248 /** 4249 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 4250 */ 4251 @Deprecated 4252 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 4253 4254 /** 4255 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 4256 */ 4257 @Deprecated 4258 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 4259 4260 /** 4261 * @deprecated Use 4262 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 4263 */ 4264 @Deprecated 4265 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 4266 4267 /** 4268 * @deprecated Use 4269 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 4270 */ 4271 @Deprecated 4272 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 4273 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 4274 4275 /** 4276 * @deprecated Use 4277 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 4278 */ 4279 @Deprecated 4280 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 4281 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 4282 4283 /** 4284 * @deprecated Use 4285 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 4286 */ 4287 @Deprecated 4288 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 4289 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 4290 4291 /** 4292 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 4293 * instead 4294 */ 4295 @Deprecated 4296 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 4297 4298 /** 4299 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 4300 */ 4301 @Deprecated 4302 public static final String WIFI_ON = Global.WIFI_ON; 4303 4304 /** 4305 * @deprecated Use 4306 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 4307 * instead 4308 */ 4309 @Deprecated 4310 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 4311 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 4312 4313 /** 4314 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 4315 */ 4316 @Deprecated 4317 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 4318 4319 /** 4320 * @deprecated Use 4321 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 4322 */ 4323 @Deprecated 4324 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 4325 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 4326 4327 /** 4328 * @deprecated Use 4329 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 4330 */ 4331 @Deprecated 4332 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 4333 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 4334 4335 /** 4336 * @deprecated Use 4337 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 4338 * instead 4339 */ 4340 @Deprecated 4341 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 4342 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 4343 4344 /** 4345 * @deprecated Use 4346 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 4347 */ 4348 @Deprecated 4349 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 4350 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 4351 4352 /** 4353 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 4354 * instead 4355 */ 4356 @Deprecated 4357 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 4358 4359 /** 4360 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 4361 */ 4362 @Deprecated 4363 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 4364 4365 /** 4366 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 4367 */ 4368 @Deprecated 4369 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 4370 4371 /** 4372 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 4373 * instead 4374 */ 4375 @Deprecated 4376 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 4377 4378 /** 4379 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 4380 * instead 4381 */ 4382 @Deprecated 4383 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 4384 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 4385 4386 /** 4387 * Checks if the specified app can modify system settings. As of API 4388 * level 23, an app cannot modify system settings unless it declares the 4389 * {@link android.Manifest.permission#WRITE_SETTINGS} 4390 * permission in its manifest, <em>and</em> the user specifically grants 4391 * the app this capability. To prompt the user to grant this approval, 4392 * the app must send an intent with the action {@link 4393 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes 4394 * the system to display a permission management screen. 4395 * 4396 * @param context App context. 4397 * @return true if the calling app can write to system settings, false otherwise 4398 */ 4399 public static boolean canWrite(Context context) { 4400 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), 4401 context.getOpPackageName(), false); 4402 } 4403 } 4404 4405 /** 4406 * Secure system settings, containing system preferences that applications 4407 * can read but are not allowed to write. These are for preferences that 4408 * the user must explicitly modify through the system UI or specialized 4409 * APIs for those values, not modified directly by applications. 4410 */ 4411 public static final class Secure extends NameValueTable { 4412 /** 4413 * The content:// style URL for this table 4414 */ 4415 public static final Uri CONTENT_URI = 4416 Uri.parse("content://" + AUTHORITY + "/secure"); 4417 4418 private static final ContentProviderHolder sProviderHolder = 4419 new ContentProviderHolder(CONTENT_URI); 4420 4421 // Populated lazily, guarded by class object: 4422 private static final NameValueCache sNameValueCache = new NameValueCache( 4423 CONTENT_URI, 4424 CALL_METHOD_GET_SECURE, 4425 CALL_METHOD_PUT_SECURE, 4426 sProviderHolder); 4427 4428 private static ILockSettings sLockSettings = null; 4429 4430 private static boolean sIsSystemProcess; 4431 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 4432 private static final HashSet<String> MOVED_TO_GLOBAL; 4433 static { 4434 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); 4435 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 4436 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 4437 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 4438 4439 MOVED_TO_GLOBAL = new HashSet<>(); 4440 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 4441 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 4442 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 4443 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 4444 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 4445 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 4446 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 4447 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 4448 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 4449 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 4450 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 4451 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 4452 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 4453 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 4454 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 4455 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 4456 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 4457 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 4458 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 4459 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 4460 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 4461 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 4462 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 4463 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 4464 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 4465 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 4466 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 4467 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 4468 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 4469 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 4470 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 4471 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 4472 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 4473 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 4474 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 4475 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 4476 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 4477 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 4478 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 4479 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 4480 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 4481 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 4482 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 4483 MOVED_TO_GLOBAL.add(Settings.Global.SAMPLING_PROFILER_MS); 4484 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 4485 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 4486 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 4487 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 4488 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 4489 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 4490 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 4491 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 4492 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 4493 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 4494 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 4495 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 4496 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 4497 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 4498 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 4499 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 4500 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 4501 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 4502 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 4503 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SAVED_STATE); 4504 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 4505 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUSPEND_OPTIMIZATIONS_ENABLED); 4506 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); 4507 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 4508 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 4509 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 4510 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 4511 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 4512 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_ENABLE); 4513 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 4514 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 4515 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 4516 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 4517 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 4518 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 4519 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 4520 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 4521 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 4522 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 4523 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 4524 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 4525 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 4526 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 4527 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 4528 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 4529 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 4530 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 4531 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 4532 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 4533 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 4534 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 4535 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 4536 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 4537 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 4538 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 4539 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 4540 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 4541 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 4542 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 4543 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 4544 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 4545 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 4546 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 4547 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 4548 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 4549 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 4550 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 4551 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 4552 } 4553 4554 /** @hide */ 4555 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 4556 outKeySet.addAll(MOVED_TO_GLOBAL); 4557 } 4558 4559 /** 4560 * Look up a name in the database. 4561 * @param resolver to access the database with 4562 * @param name to look up in the table 4563 * @return the corresponding value, or null if not present 4564 */ 4565 public static String getString(ContentResolver resolver, String name) { 4566 return getStringForUser(resolver, name, UserHandle.myUserId()); 4567 } 4568 4569 /** @hide */ 4570 public static String getStringForUser(ContentResolver resolver, String name, 4571 int userHandle) { 4572 if (MOVED_TO_GLOBAL.contains(name)) { 4573 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 4574 + " to android.provider.Settings.Global."); 4575 return Global.getStringForUser(resolver, name, userHandle); 4576 } 4577 4578 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 4579 synchronized (Secure.class) { 4580 if (sLockSettings == null) { 4581 sLockSettings = ILockSettings.Stub.asInterface( 4582 (IBinder) ServiceManager.getService("lock_settings")); 4583 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 4584 } 4585 } 4586 if (sLockSettings != null && !sIsSystemProcess) { 4587 // No context; use the ActivityThread's context as an approximation for 4588 // determining the target API level. 4589 Application application = ActivityThread.currentApplication(); 4590 4591 boolean isPreMnc = application != null 4592 && application.getApplicationInfo() != null 4593 && application.getApplicationInfo().targetSdkVersion 4594 <= VERSION_CODES.LOLLIPOP_MR1; 4595 if (isPreMnc) { 4596 try { 4597 return sLockSettings.getString(name, "0", userHandle); 4598 } catch (RemoteException re) { 4599 // Fall through 4600 } 4601 } else { 4602 throw new SecurityException("Settings.Secure." + name 4603 + " is deprecated and no longer accessible." 4604 + " See API documentation for potential replacements."); 4605 } 4606 } 4607 } 4608 4609 return sNameValueCache.getStringForUser(resolver, name, userHandle); 4610 } 4611 4612 /** 4613 * Store a name/value pair into the database. 4614 * @param resolver to access the database with 4615 * @param name to store 4616 * @param value to associate with the name 4617 * @return true if the value was set, false on database errors 4618 */ 4619 public static boolean putString(ContentResolver resolver, String name, String value) { 4620 return putStringForUser(resolver, name, value, UserHandle.myUserId()); 4621 } 4622 4623 /** @hide */ 4624 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 4625 int userHandle) { 4626 return putStringForUser(resolver, name, value, null, false, userHandle); 4627 } 4628 4629 /** @hide */ 4630 public static boolean putStringForUser(@NonNull ContentResolver resolver, 4631 @NonNull String name, @Nullable String value, @Nullable String tag, 4632 boolean makeDefault, @UserIdInt int userHandle) { 4633 if (LOCATION_MODE.equals(name)) { 4634 // Map LOCATION_MODE to underlying location provider storage API 4635 return setLocationModeForUser(resolver, Integer.parseInt(value), userHandle); 4636 } 4637 if (MOVED_TO_GLOBAL.contains(name)) { 4638 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 4639 + " to android.provider.Settings.Global"); 4640 return Global.putStringForUser(resolver, name, value, 4641 tag, makeDefault, userHandle); 4642 } 4643 return sNameValueCache.putStringForUser(resolver, name, value, tag, 4644 makeDefault, userHandle); 4645 } 4646 4647 /** 4648 * Store a name/value pair into the database. 4649 * <p> 4650 * The method takes an optional tag to associate with the setting 4651 * which can be used to clear only settings made by your package and 4652 * associated with this tag by passing the tag to {@link 4653 * #resetToDefaults(ContentResolver, String)}. Anyone can override 4654 * the current tag. Also if another package changes the setting 4655 * then the tag will be set to the one specified in the set call 4656 * which can be null. Also any of the settings setters that do not 4657 * take a tag as an argument effectively clears the tag. 4658 * </p><p> 4659 * For example, if you set settings A and B with tags T1 and T2 and 4660 * another app changes setting A (potentially to the same value), it 4661 * can assign to it a tag T3 (note that now the package that changed 4662 * the setting is not yours). Now if you reset your changes for T1 and 4663 * T2 only setting B will be reset and A not (as it was changed by 4664 * another package) but since A did not change you are in the desired 4665 * initial state. Now if the other app changes the value of A (assuming 4666 * you registered an observer in the beginning) you would detect that 4667 * the setting was changed by another app and handle this appropriately 4668 * (ignore, set back to some value, etc). 4669 * </p><p> 4670 * Also the method takes an argument whether to make the value the 4671 * default for this setting. If the system already specified a default 4672 * value, then the one passed in here will <strong>not</strong> 4673 * be set as the default. 4674 * </p> 4675 * 4676 * @param resolver to access the database with. 4677 * @param name to store. 4678 * @param value to associate with the name. 4679 * @param tag to associate with the setting. 4680 * @param makeDefault whether to make the value the default one. 4681 * @return true if the value was set, false on database errors. 4682 * 4683 * @see #resetToDefaults(ContentResolver, String) 4684 * 4685 * @hide 4686 */ 4687 @SystemApi 4688 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 4689 public static boolean putString(@NonNull ContentResolver resolver, 4690 @NonNull String name, @Nullable String value, @Nullable String tag, 4691 boolean makeDefault) { 4692 return putStringForUser(resolver, name, value, tag, makeDefault, 4693 UserHandle.myUserId()); 4694 } 4695 4696 /** 4697 * Reset the settings to their defaults. This would reset <strong>only</strong> 4698 * settings set by the caller's package. Think of it of a way to undo your own 4699 * changes to the global settings. Passing in the optional tag will reset only 4700 * settings changed by your package and associated with this tag. 4701 * 4702 * @param resolver Handle to the content resolver. 4703 * @param tag Optional tag which should be associated with the settings to reset. 4704 * 4705 * @see #putString(ContentResolver, String, String, String, boolean) 4706 * 4707 * @hide 4708 */ 4709 @SystemApi 4710 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 4711 public static void resetToDefaults(@NonNull ContentResolver resolver, 4712 @Nullable String tag) { 4713 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 4714 UserHandle.myUserId()); 4715 } 4716 4717 /** 4718 * 4719 * Reset the settings to their defaults for a given user with a specific mode. The 4720 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 4721 * allowing resetting the settings made by a package and associated with the tag. 4722 * 4723 * @param resolver Handle to the content resolver. 4724 * @param tag Optional tag which should be associated with the settings to reset. 4725 * @param mode The reset mode. 4726 * @param userHandle The user for which to reset to defaults. 4727 * 4728 * @see #RESET_MODE_PACKAGE_DEFAULTS 4729 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 4730 * @see #RESET_MODE_UNTRUSTED_CHANGES 4731 * @see #RESET_MODE_TRUSTED_DEFAULTS 4732 * 4733 * @hide 4734 */ 4735 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 4736 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 4737 try { 4738 Bundle arg = new Bundle(); 4739 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 4740 if (tag != null) { 4741 arg.putString(CALL_METHOD_TAG_KEY, tag); 4742 } 4743 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 4744 IContentProvider cp = sProviderHolder.getProvider(resolver); 4745 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_SECURE, null, arg); 4746 } catch (RemoteException e) { 4747 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 4748 } 4749 } 4750 4751 /** 4752 * Construct the content URI for a particular name/value pair, 4753 * useful for monitoring changes with a ContentObserver. 4754 * @param name to look up in the table 4755 * @return the corresponding content URI, or null if not present 4756 */ 4757 public static Uri getUriFor(String name) { 4758 if (MOVED_TO_GLOBAL.contains(name)) { 4759 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 4760 + " to android.provider.Settings.Global, returning global URI."); 4761 return Global.getUriFor(Global.CONTENT_URI, name); 4762 } 4763 return getUriFor(CONTENT_URI, name); 4764 } 4765 4766 /** 4767 * Convenience function for retrieving a single secure settings value 4768 * as an integer. Note that internally setting values are always 4769 * stored as strings; this function converts the string to an integer 4770 * for you. The default value will be returned if the setting is 4771 * not defined or not an integer. 4772 * 4773 * @param cr The ContentResolver to access. 4774 * @param name The name of the setting to retrieve. 4775 * @param def Value to return if the setting is not defined. 4776 * 4777 * @return The setting's current value, or 'def' if it is not defined 4778 * or not a valid integer. 4779 */ 4780 public static int getInt(ContentResolver cr, String name, int def) { 4781 return getIntForUser(cr, name, def, UserHandle.myUserId()); 4782 } 4783 4784 /** @hide */ 4785 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 4786 if (LOCATION_MODE.equals(name)) { 4787 // Map from to underlying location provider storage API to location mode 4788 return getLocationModeForUser(cr, userHandle); 4789 } 4790 String v = getStringForUser(cr, name, userHandle); 4791 try { 4792 return v != null ? Integer.parseInt(v) : def; 4793 } catch (NumberFormatException e) { 4794 return def; 4795 } 4796 } 4797 4798 /** 4799 * Convenience function for retrieving a single secure settings value 4800 * as an integer. Note that internally setting values are always 4801 * stored as strings; this function converts the string to an integer 4802 * for you. 4803 * <p> 4804 * This version does not take a default value. If the setting has not 4805 * been set, or the string value is not a number, 4806 * it throws {@link SettingNotFoundException}. 4807 * 4808 * @param cr The ContentResolver to access. 4809 * @param name The name of the setting to retrieve. 4810 * 4811 * @throws SettingNotFoundException Thrown if a setting by the given 4812 * name can't be found or the setting value is not an integer. 4813 * 4814 * @return The setting's current value. 4815 */ 4816 public static int getInt(ContentResolver cr, String name) 4817 throws SettingNotFoundException { 4818 return getIntForUser(cr, name, UserHandle.myUserId()); 4819 } 4820 4821 /** @hide */ 4822 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 4823 throws SettingNotFoundException { 4824 if (LOCATION_MODE.equals(name)) { 4825 // Map from to underlying location provider storage API to location mode 4826 return getLocationModeForUser(cr, userHandle); 4827 } 4828 String v = getStringForUser(cr, name, userHandle); 4829 try { 4830 return Integer.parseInt(v); 4831 } catch (NumberFormatException e) { 4832 throw new SettingNotFoundException(name); 4833 } 4834 } 4835 4836 /** 4837 * Convenience function for updating a single settings value as an 4838 * integer. This will either create a new entry in the table if the 4839 * given name does not exist, or modify the value of the existing row 4840 * with that name. Note that internally setting values are always 4841 * stored as strings, so this function converts the given value to a 4842 * string before storing it. 4843 * 4844 * @param cr The ContentResolver to access. 4845 * @param name The name of the setting to modify. 4846 * @param value The new value for the setting. 4847 * @return true if the value was set, false on database errors 4848 */ 4849 public static boolean putInt(ContentResolver cr, String name, int value) { 4850 return putIntForUser(cr, name, value, UserHandle.myUserId()); 4851 } 4852 4853 /** @hide */ 4854 public static boolean putIntForUser(ContentResolver cr, String name, int value, 4855 int userHandle) { 4856 return putStringForUser(cr, name, Integer.toString(value), userHandle); 4857 } 4858 4859 /** 4860 * Convenience function for retrieving a single secure settings value 4861 * as a {@code long}. Note that internally setting values are always 4862 * stored as strings; this function converts the string to a {@code long} 4863 * for you. The default value will be returned if the setting is 4864 * not defined or not a {@code long}. 4865 * 4866 * @param cr The ContentResolver to access. 4867 * @param name The name of the setting to retrieve. 4868 * @param def Value to return if the setting is not defined. 4869 * 4870 * @return The setting's current value, or 'def' if it is not defined 4871 * or not a valid {@code long}. 4872 */ 4873 public static long getLong(ContentResolver cr, String name, long def) { 4874 return getLongForUser(cr, name, def, UserHandle.myUserId()); 4875 } 4876 4877 /** @hide */ 4878 public static long getLongForUser(ContentResolver cr, String name, long def, 4879 int userHandle) { 4880 String valString = getStringForUser(cr, name, userHandle); 4881 long value; 4882 try { 4883 value = valString != null ? Long.parseLong(valString) : def; 4884 } catch (NumberFormatException e) { 4885 value = def; 4886 } 4887 return value; 4888 } 4889 4890 /** 4891 * Convenience function for retrieving a single secure settings value 4892 * as a {@code long}. Note that internally setting values are always 4893 * stored as strings; this function converts the string to a {@code long} 4894 * for you. 4895 * <p> 4896 * This version does not take a default value. If the setting has not 4897 * been set, or the string value is not a number, 4898 * it throws {@link SettingNotFoundException}. 4899 * 4900 * @param cr The ContentResolver to access. 4901 * @param name The name of the setting to retrieve. 4902 * 4903 * @return The setting's current value. 4904 * @throws SettingNotFoundException Thrown if a setting by the given 4905 * name can't be found or the setting value is not an integer. 4906 */ 4907 public static long getLong(ContentResolver cr, String name) 4908 throws SettingNotFoundException { 4909 return getLongForUser(cr, name, UserHandle.myUserId()); 4910 } 4911 4912 /** @hide */ 4913 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 4914 throws SettingNotFoundException { 4915 String valString = getStringForUser(cr, name, userHandle); 4916 try { 4917 return Long.parseLong(valString); 4918 } catch (NumberFormatException e) { 4919 throw new SettingNotFoundException(name); 4920 } 4921 } 4922 4923 /** 4924 * Convenience function for updating a secure settings value as a long 4925 * integer. This will either create a new entry in the table if the 4926 * given name does not exist, or modify the value of the existing row 4927 * with that name. Note that internally setting values are always 4928 * stored as strings, so this function converts the given value to a 4929 * string before storing it. 4930 * 4931 * @param cr The ContentResolver to access. 4932 * @param name The name of the setting to modify. 4933 * @param value The new value for the setting. 4934 * @return true if the value was set, false on database errors 4935 */ 4936 public static boolean putLong(ContentResolver cr, String name, long value) { 4937 return putLongForUser(cr, name, value, UserHandle.myUserId()); 4938 } 4939 4940 /** @hide */ 4941 public static boolean putLongForUser(ContentResolver cr, String name, long value, 4942 int userHandle) { 4943 return putStringForUser(cr, name, Long.toString(value), userHandle); 4944 } 4945 4946 /** 4947 * Convenience function for retrieving a single secure settings value 4948 * as a floating point number. Note that internally setting values are 4949 * always stored as strings; this function converts the string to an 4950 * float for you. The default value will be returned if the setting 4951 * is not defined or not a valid float. 4952 * 4953 * @param cr The ContentResolver to access. 4954 * @param name The name of the setting to retrieve. 4955 * @param def Value to return if the setting is not defined. 4956 * 4957 * @return The setting's current value, or 'def' if it is not defined 4958 * or not a valid float. 4959 */ 4960 public static float getFloat(ContentResolver cr, String name, float def) { 4961 return getFloatForUser(cr, name, def, UserHandle.myUserId()); 4962 } 4963 4964 /** @hide */ 4965 public static float getFloatForUser(ContentResolver cr, String name, float def, 4966 int userHandle) { 4967 String v = getStringForUser(cr, name, userHandle); 4968 try { 4969 return v != null ? Float.parseFloat(v) : def; 4970 } catch (NumberFormatException e) { 4971 return def; 4972 } 4973 } 4974 4975 /** 4976 * Convenience function for retrieving a single secure settings value 4977 * as a float. Note that internally setting values are always 4978 * stored as strings; this function converts the string to a float 4979 * for you. 4980 * <p> 4981 * This version does not take a default value. If the setting has not 4982 * been set, or the string value is not a number, 4983 * it throws {@link SettingNotFoundException}. 4984 * 4985 * @param cr The ContentResolver to access. 4986 * @param name The name of the setting to retrieve. 4987 * 4988 * @throws SettingNotFoundException Thrown if a setting by the given 4989 * name can't be found or the setting value is not a float. 4990 * 4991 * @return The setting's current value. 4992 */ 4993 public static float getFloat(ContentResolver cr, String name) 4994 throws SettingNotFoundException { 4995 return getFloatForUser(cr, name, UserHandle.myUserId()); 4996 } 4997 4998 /** @hide */ 4999 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 5000 throws SettingNotFoundException { 5001 String v = getStringForUser(cr, name, userHandle); 5002 if (v == null) { 5003 throw new SettingNotFoundException(name); 5004 } 5005 try { 5006 return Float.parseFloat(v); 5007 } catch (NumberFormatException e) { 5008 throw new SettingNotFoundException(name); 5009 } 5010 } 5011 5012 /** 5013 * Convenience function for updating a single settings value as a 5014 * floating point number. This will either create a new entry in the 5015 * table if the given name does not exist, or modify the value of the 5016 * existing row with that name. Note that internally setting values 5017 * are always stored as strings, so this function converts the given 5018 * value to a string before storing it. 5019 * 5020 * @param cr The ContentResolver to access. 5021 * @param name The name of the setting to modify. 5022 * @param value The new value for the setting. 5023 * @return true if the value was set, false on database errors 5024 */ 5025 public static boolean putFloat(ContentResolver cr, String name, float value) { 5026 return putFloatForUser(cr, name, value, UserHandle.myUserId()); 5027 } 5028 5029 /** @hide */ 5030 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 5031 int userHandle) { 5032 return putStringForUser(cr, name, Float.toString(value), userHandle); 5033 } 5034 5035 /** 5036 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 5037 * instead 5038 */ 5039 @Deprecated 5040 public static final String DEVELOPMENT_SETTINGS_ENABLED = 5041 Global.DEVELOPMENT_SETTINGS_ENABLED; 5042 5043 /** 5044 * When the user has enable the option to have a "bug report" command 5045 * in the power menu. 5046 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 5047 * @hide 5048 */ 5049 @Deprecated 5050 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 5051 5052 /** 5053 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 5054 */ 5055 @Deprecated 5056 public static final String ADB_ENABLED = Global.ADB_ENABLED; 5057 5058 /** 5059 * Setting to allow mock locations and location provider status to be injected into the 5060 * LocationManager service for testing purposes during application development. These 5061 * locations and status values override actual location and status information generated 5062 * by network, gps, or other location providers. 5063 * 5064 * @deprecated This settings is not used anymore. 5065 */ 5066 @Deprecated 5067 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 5068 5069 /** 5070 * A 64-bit number (as a hex string) that is randomly 5071 * generated when the user first sets up the device and should remain 5072 * constant for the lifetime of the user's device. The value may 5073 * change if a factory reset is performed on the device. 5074 * <p class="note"><strong>Note:</strong> When a device has <a 5075 * href="{@docRoot}about/versions/android-4.2.html#MultipleUsers">multiple users</a> 5076 * (available on certain devices running Android 4.2 or higher), each user appears as a 5077 * completely separate device, so the {@code ANDROID_ID} value is unique to each 5078 * user.</p> 5079 */ 5080 public static final String ANDROID_ID = "android_id"; 5081 5082 /** 5083 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 5084 */ 5085 @Deprecated 5086 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 5087 5088 /** 5089 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 5090 */ 5091 @Deprecated 5092 public static final String DATA_ROAMING = Global.DATA_ROAMING; 5093 5094 /** 5095 * Setting to record the input method used by default, holding the ID 5096 * of the desired method. 5097 */ 5098 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 5099 5100 /** 5101 * Setting to record the input method subtype used by default, holding the ID 5102 * of the desired method. 5103 */ 5104 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 5105 "selected_input_method_subtype"; 5106 5107 /** 5108 * Setting to record the history of input method subtype, holding the pair of ID of IME 5109 * and its last used subtype. 5110 * @hide 5111 */ 5112 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 5113 "input_methods_subtype_history"; 5114 5115 /** 5116 * Setting to record the visibility of input method selector 5117 */ 5118 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 5119 "input_method_selector_visibility"; 5120 5121 /** 5122 * The currently selected voice interaction service flattened ComponentName. 5123 * @hide 5124 */ 5125 @TestApi 5126 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 5127 5128 /** 5129 * The currently selected auto-fill service flattened ComponentName. 5130 * @hide 5131 */ 5132 @TestApi 5133 public static final String AUTO_FILL_SERVICE = "auto_fill_service"; 5134 5135 /** 5136 * bluetooth HCI snoop log configuration 5137 * @hide 5138 */ 5139 public static final String BLUETOOTH_HCI_LOG = 5140 "bluetooth_hci_log"; 5141 5142 /** 5143 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 5144 */ 5145 @Deprecated 5146 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 5147 5148 /** 5149 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 5150 * @hide 5151 */ 5152 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 5153 5154 /** 5155 * Prefix for category name that marks whether a suggested action from that category was 5156 * completed. 5157 * @hide 5158 */ 5159 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; 5160 5161 /** 5162 * List of input methods that are currently enabled. This is a string 5163 * containing the IDs of all enabled input methods, each ID separated 5164 * by ':'. 5165 */ 5166 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 5167 5168 /** 5169 * List of system input methods that are currently disabled. This is a string 5170 * containing the IDs of all disabled input methods, each ID separated 5171 * by ':'. 5172 * @hide 5173 */ 5174 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 5175 5176 /** 5177 * Whether to show the IME when a hard keyboard is connected. This is a boolean that 5178 * determines if the IME should be shown when a hard keyboard is attached. 5179 * @hide 5180 */ 5181 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; 5182 5183 /** 5184 * Host name and port for global http proxy. Uses ':' seperator for 5185 * between host and port. 5186 * 5187 * @deprecated Use {@link Global#HTTP_PROXY} 5188 */ 5189 @Deprecated 5190 public static final String HTTP_PROXY = Global.HTTP_PROXY; 5191 5192 /** 5193 * Package designated as always-on VPN provider. 5194 * 5195 * @hide 5196 */ 5197 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; 5198 5199 /** 5200 * Whether to block networking outside of VPN connections while always-on is set. 5201 * @see #ALWAYS_ON_VPN_APP 5202 * 5203 * @hide 5204 */ 5205 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; 5206 5207 /** 5208 * Whether applications can be installed for this user via the system's 5209 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 5210 * 5211 * <p>1 = permit app installation via the system package installer intent 5212 * <p>0 = do not allow use of the package installer 5213 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use 5214 * {@link PackageManager#canRequestPackageInstalls()} 5215 * @see PackageManager#canRequestPackageInstalls() 5216 */ 5217 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 5218 5219 /** 5220 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that 5221 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it 5222 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} 5223 * on behalf of the profile owner if needed to make the change transparent for profile 5224 * owners. 5225 * 5226 * @hide 5227 */ 5228 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = 5229 "unknown_sources_default_reversed"; 5230 5231 /** 5232 * Comma-separated list of location providers that activities may access. Do not rely on 5233 * this value being present in settings.db or on ContentObserver notifications on the 5234 * corresponding Uri. 5235 * 5236 * @deprecated use {@link #LOCATION_MODE} and 5237 * {@link LocationManager#MODE_CHANGED_ACTION} (or 5238 * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) 5239 */ 5240 @Deprecated 5241 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 5242 5243 /** 5244 * The degree of location access enabled by the user. 5245 * <p> 5246 * When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link 5247 * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link 5248 * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link 5249 * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location 5250 * modes that might be added in the future. 5251 * <p> 5252 * Note: do not rely on this value being present in settings.db or on ContentObserver 5253 * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} 5254 * to receive changes in this value. 5255 */ 5256 public static final String LOCATION_MODE = "location_mode"; 5257 /** 5258 * Stores the previous location mode when {@link #LOCATION_MODE} is set to 5259 * {@link #LOCATION_MODE_OFF} 5260 * @hide 5261 */ 5262 public static final String LOCATION_PREVIOUS_MODE = "location_previous_mode"; 5263 5264 /** 5265 * Sets all location providers to the previous states before location was turned off. 5266 * @hide 5267 */ 5268 public static final int LOCATION_MODE_PREVIOUS = -1; 5269 /** 5270 * Location access disabled. 5271 */ 5272 public static final int LOCATION_MODE_OFF = 0; 5273 /** 5274 * Network Location Provider disabled, but GPS and other sensors enabled. 5275 */ 5276 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 5277 /** 5278 * Reduced power usage, such as limiting the number of GPS updates per hour. Requests 5279 * with {@link android.location.Criteria#POWER_HIGH} may be downgraded to 5280 * {@link android.location.Criteria#POWER_MEDIUM}. 5281 */ 5282 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 5283 /** 5284 * Best-effort location computation allowed. 5285 */ 5286 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 5287 5288 /** 5289 * A flag containing settings used for biometric weak 5290 * @hide 5291 */ 5292 @Deprecated 5293 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 5294 "lock_biometric_weak_flags"; 5295 5296 /** 5297 * Whether lock-to-app will lock the keyguard when exiting. 5298 * @hide 5299 */ 5300 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 5301 5302 /** 5303 * Whether autolock is enabled (0 = false, 1 = true) 5304 * 5305 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security 5306 * level of the keyguard. Accessing this setting from an app that is targeting 5307 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5308 */ 5309 @Deprecated 5310 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 5311 5312 /** 5313 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 5314 * 5315 * @deprecated Accessing this setting from an app that is targeting 5316 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5317 */ 5318 @Deprecated 5319 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 5320 5321 /** 5322 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 5323 * true) 5324 * 5325 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 5326 * lockscreen uses 5327 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 5328 * Accessing this setting from an app that is targeting 5329 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 5330 */ 5331 @Deprecated 5332 public static final String 5333 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 5334 5335 /** 5336 * This preference allows the device to be locked given time after screen goes off, 5337 * subject to current DeviceAdmin policy limits. 5338 * @hide 5339 */ 5340 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 5341 5342 5343 /** 5344 * This preference contains the string that shows for owner info on LockScreen. 5345 * @hide 5346 * @deprecated 5347 */ 5348 @Deprecated 5349 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 5350 5351 /** 5352 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 5353 * @hide 5354 */ 5355 @Deprecated 5356 public static final String LOCK_SCREEN_APPWIDGET_IDS = 5357 "lock_screen_appwidget_ids"; 5358 5359 /** 5360 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 5361 * @hide 5362 */ 5363 @Deprecated 5364 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 5365 "lock_screen_fallback_appwidget_id"; 5366 5367 /** 5368 * Index of the lockscreen appwidget to restore, -1 if none. 5369 * @hide 5370 */ 5371 @Deprecated 5372 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 5373 "lock_screen_sticky_appwidget"; 5374 5375 /** 5376 * This preference enables showing the owner info on LockScreen. 5377 * @hide 5378 * @deprecated 5379 */ 5380 @Deprecated 5381 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 5382 "lock_screen_owner_info_enabled"; 5383 5384 /** 5385 * When set by a user, allows notifications to be shown atop a securely locked screen 5386 * in their full "private" form (same as when the device is unlocked). 5387 * @hide 5388 */ 5389 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 5390 "lock_screen_allow_private_notifications"; 5391 5392 /** 5393 * When set by a user, allows notification remote input atop a securely locked screen 5394 * without having to unlock 5395 * @hide 5396 */ 5397 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = 5398 "lock_screen_allow_remote_input"; 5399 5400 /** 5401 * Set by the system to track if the user needs to see the call to action for 5402 * the lockscreen notification policy. 5403 * @hide 5404 */ 5405 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = 5406 "show_note_about_notification_hiding"; 5407 5408 /** 5409 * Set to 1 by the system after trust agents have been initialized. 5410 * @hide 5411 */ 5412 public static final String TRUST_AGENTS_INITIALIZED = 5413 "trust_agents_initialized"; 5414 5415 /** 5416 * The Logging ID (a unique 64-bit value) as a hex string. 5417 * Used as a pseudonymous identifier for logging. 5418 * @deprecated This identifier is poorly initialized and has 5419 * many collisions. It should not be used. 5420 */ 5421 @Deprecated 5422 public static final String LOGGING_ID = "logging_id"; 5423 5424 /** 5425 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 5426 */ 5427 @Deprecated 5428 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 5429 5430 /** 5431 * No longer supported. 5432 */ 5433 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 5434 5435 /** 5436 * No longer supported. 5437 */ 5438 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 5439 5440 /** 5441 * No longer supported. 5442 */ 5443 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 5444 5445 /** 5446 * Settings classname to launch when Settings is clicked from All 5447 * Applications. Needed because of user testing between the old 5448 * and new Settings apps. 5449 */ 5450 // TODO: 881807 5451 public static final String SETTINGS_CLASSNAME = "settings_classname"; 5452 5453 /** 5454 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 5455 */ 5456 @Deprecated 5457 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 5458 5459 /** 5460 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 5461 */ 5462 @Deprecated 5463 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 5464 5465 /** 5466 * If accessibility is enabled. 5467 */ 5468 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 5469 5470 /** 5471 * Setting specifying if the accessibility shortcut dialog has been shown to this user. 5472 * @hide 5473 */ 5474 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = 5475 "accessibility_shortcut_dialog_shown"; 5476 5477 /** 5478 * Setting specifying the the accessibility service to be toggled via the accessibility 5479 * shortcut. Must be its flattened {@link ComponentName}. 5480 * @hide 5481 */ 5482 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 5483 "accessibility_shortcut_target_service"; 5484 5485 /** 5486 * If touch exploration is enabled. 5487 */ 5488 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 5489 5490 /** 5491 * List of the enabled accessibility providers. 5492 */ 5493 public static final String ENABLED_ACCESSIBILITY_SERVICES = 5494 "enabled_accessibility_services"; 5495 5496 /** 5497 * List of the accessibility services to which the user has granted 5498 * permission to put the device into touch exploration mode. 5499 * 5500 * @hide 5501 */ 5502 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 5503 "touch_exploration_granted_accessibility_services"; 5504 5505 /** 5506 * Whether to speak passwords while in accessibility mode. 5507 * 5508 * @deprecated The speaking of passwords is controlled by individual accessibility services. 5509 * Apps should ignore this setting and provide complete information to accessibility 5510 * at all times, which was the behavior when this value was {@code true}. 5511 */ 5512 @Deprecated 5513 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 5514 5515 /** 5516 * Whether to draw text with high contrast while in accessibility mode. 5517 * 5518 * @hide 5519 */ 5520 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 5521 "high_text_contrast_enabled"; 5522 5523 /** 5524 * If injection of accessibility enhancing JavaScript screen-reader 5525 * is enabled. 5526 * <p> 5527 * Note: The JavaScript based screen-reader is served by the 5528 * Google infrastructure and enable users with disabilities to 5529 * efficiently navigate in and explore web content. 5530 * </p> 5531 * <p> 5532 * This property represents a boolean value. 5533 * </p> 5534 * @hide 5535 */ 5536 public static final String ACCESSIBILITY_SCRIPT_INJECTION = 5537 "accessibility_script_injection"; 5538 5539 /** 5540 * The URL for the injected JavaScript based screen-reader used 5541 * for providing accessibility of content in WebView. 5542 * <p> 5543 * Note: The JavaScript based screen-reader is served by the 5544 * Google infrastructure and enable users with disabilities to 5545 * efficiently navigate in and explore web content. 5546 * </p> 5547 * <p> 5548 * This property represents a string value. 5549 * </p> 5550 * @hide 5551 */ 5552 public static final String ACCESSIBILITY_SCREEN_READER_URL = 5553 "accessibility_script_injection_url"; 5554 5555 /** 5556 * Key bindings for navigation in built-in accessibility support for web content. 5557 * <p> 5558 * Note: These key bindings are for the built-in accessibility navigation for 5559 * web content which is used as a fall back solution if JavaScript in a WebView 5560 * is not enabled or the user has not opted-in script injection from Google. 5561 * </p> 5562 * <p> 5563 * The bindings are separated by semi-colon. A binding is a mapping from 5564 * a key to a sequence of actions (for more details look at 5565 * android.webkit.AccessibilityInjector). A key is represented as the hexademical 5566 * string representation of an integer obtained from a meta state (optional) shifted 5567 * sixteen times left and bitwise ored with a key code. An action is represented 5568 * as a hexademical string representation of an integer where the first two digits 5569 * are navigation action index, the second, the third, and the fourth digit pairs 5570 * represent the action arguments. The separate actions in a binding are colon 5571 * separated. The key and the action sequence it maps to are separated by equals. 5572 * </p> 5573 * <p> 5574 * For example, the binding below maps the DPAD right button to traverse the 5575 * current navigation axis once without firing an accessibility event and to 5576 * perform the same traversal again but to fire an event: 5577 * <code> 5578 * 0x16=0x01000100:0x01000101; 5579 * </code> 5580 * </p> 5581 * <p> 5582 * The goal of this binding is to enable dynamic rebinding of keys to 5583 * navigation actions for web content without requiring a framework change. 5584 * </p> 5585 * <p> 5586 * This property represents a string value. 5587 * </p> 5588 * @hide 5589 */ 5590 public static final String ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS = 5591 "accessibility_web_content_key_bindings"; 5592 5593 /** 5594 * Setting that specifies whether the display magnification is enabled. 5595 * Display magnifications allows the user to zoom in the display content 5596 * and is targeted to low vision users. The current magnification scale 5597 * is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 5598 * 5599 * @hide 5600 */ 5601 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 5602 "accessibility_display_magnification_enabled"; 5603 5604 /** 5605 * Setting that specifies what the display magnification scale is. 5606 * Display magnifications allows the user to zoom in the display 5607 * content and is targeted to low vision users. Whether a display 5608 * magnification is performed is controlled by 5609 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} 5610 * 5611 * @hide 5612 */ 5613 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 5614 "accessibility_display_magnification_scale"; 5615 5616 /** 5617 * Unused mangnification setting 5618 * 5619 * @hide 5620 * @deprecated 5621 */ 5622 @Deprecated 5623 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 5624 "accessibility_display_magnification_auto_update"; 5625 5626 /** 5627 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be 5628 * modified from an AccessibilityService using the SoftKeyboardController. 5629 * 5630 * @hide 5631 */ 5632 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = 5633 "accessibility_soft_keyboard_mode"; 5634 5635 /** 5636 * Default soft keyboard behavior. 5637 * 5638 * @hide 5639 */ 5640 public static final int SHOW_MODE_AUTO = 0; 5641 5642 /** 5643 * Soft keyboard is never shown. 5644 * 5645 * @hide 5646 */ 5647 public static final int SHOW_MODE_HIDDEN = 1; 5648 5649 /** 5650 * Setting that specifies whether timed text (captions) should be 5651 * displayed in video content. Text display properties are controlled by 5652 * the following settings: 5653 * <ul> 5654 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 5655 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 5656 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 5657 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 5658 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 5659 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 5660 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 5661 * </ul> 5662 * 5663 * @hide 5664 */ 5665 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 5666 "accessibility_captioning_enabled"; 5667 5668 /** 5669 * Setting that specifies the language for captions as a locale string, 5670 * e.g. en_US. 5671 * 5672 * @see java.util.Locale#toString 5673 * @hide 5674 */ 5675 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 5676 "accessibility_captioning_locale"; 5677 5678 /** 5679 * Integer property that specifies the preset style for captions, one 5680 * of: 5681 * <ul> 5682 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 5683 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 5684 * </ul> 5685 * 5686 * @see java.util.Locale#toString 5687 * @hide 5688 */ 5689 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 5690 "accessibility_captioning_preset"; 5691 5692 /** 5693 * Integer property that specifes the background color for captions as a 5694 * packed 32-bit color. 5695 * 5696 * @see android.graphics.Color#argb 5697 * @hide 5698 */ 5699 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 5700 "accessibility_captioning_background_color"; 5701 5702 /** 5703 * Integer property that specifes the foreground color for captions as a 5704 * packed 32-bit color. 5705 * 5706 * @see android.graphics.Color#argb 5707 * @hide 5708 */ 5709 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 5710 "accessibility_captioning_foreground_color"; 5711 5712 /** 5713 * Integer property that specifes the edge type for captions, one of: 5714 * <ul> 5715 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 5716 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 5717 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 5718 * </ul> 5719 * 5720 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 5721 * @hide 5722 */ 5723 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 5724 "accessibility_captioning_edge_type"; 5725 5726 /** 5727 * Integer property that specifes the edge color for captions as a 5728 * packed 32-bit color. 5729 * 5730 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 5731 * @see android.graphics.Color#argb 5732 * @hide 5733 */ 5734 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 5735 "accessibility_captioning_edge_color"; 5736 5737 /** 5738 * Integer property that specifes the window color for captions as a 5739 * packed 32-bit color. 5740 * 5741 * @see android.graphics.Color#argb 5742 * @hide 5743 */ 5744 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 5745 "accessibility_captioning_window_color"; 5746 5747 /** 5748 * String property that specifies the typeface for captions, one of: 5749 * <ul> 5750 * <li>DEFAULT 5751 * <li>MONOSPACE 5752 * <li>SANS_SERIF 5753 * <li>SERIF 5754 * </ul> 5755 * 5756 * @see android.graphics.Typeface 5757 * @hide 5758 */ 5759 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 5760 "accessibility_captioning_typeface"; 5761 5762 /** 5763 * Floating point property that specifies font scaling for captions. 5764 * 5765 * @hide 5766 */ 5767 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 5768 "accessibility_captioning_font_scale"; 5769 5770 /** 5771 * Setting that specifies whether display color inversion is enabled. 5772 */ 5773 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 5774 "accessibility_display_inversion_enabled"; 5775 5776 /** 5777 * Setting that specifies whether display color space adjustment is 5778 * enabled. 5779 * 5780 * @hide 5781 */ 5782 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 5783 "accessibility_display_daltonizer_enabled"; 5784 5785 /** 5786 * Integer property that specifies the type of color space adjustment to 5787 * perform. Valid values are defined in AccessibilityManager. 5788 * 5789 * @hide 5790 */ 5791 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 5792 "accessibility_display_daltonizer"; 5793 5794 /** 5795 * Setting that specifies whether automatic click when the mouse pointer stops moving is 5796 * enabled. 5797 * 5798 * @hide 5799 */ 5800 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = 5801 "accessibility_autoclick_enabled"; 5802 5803 /** 5804 * Integer setting specifying amount of time in ms the mouse pointer has to stay still 5805 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. 5806 * 5807 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED 5808 * @hide 5809 */ 5810 public static final String ACCESSIBILITY_AUTOCLICK_DELAY = 5811 "accessibility_autoclick_delay"; 5812 5813 /** 5814 * Whether or not larger size icons are used for the pointer of mouse/trackpad for 5815 * accessibility. 5816 * (0 = false, 1 = true) 5817 * @hide 5818 */ 5819 public static final String ACCESSIBILITY_LARGE_POINTER_ICON = 5820 "accessibility_large_pointer_icon"; 5821 5822 /** 5823 * The timeout for considering a press to be a long press in milliseconds. 5824 * @hide 5825 */ 5826 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 5827 5828 /** 5829 * The duration in milliseconds between the first tap's up event and the second tap's 5830 * down event for an interaction to be considered part of the same multi-press. 5831 * @hide 5832 */ 5833 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; 5834 5835 /** 5836 * List of the enabled print services. 5837 * 5838 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade 5839 * from pre-N. 5840 * 5841 * @hide 5842 */ 5843 public static final String ENABLED_PRINT_SERVICES = 5844 "enabled_print_services"; 5845 5846 /** 5847 * List of the disabled print services. 5848 * 5849 * @hide 5850 */ 5851 public static final String DISABLED_PRINT_SERVICES = 5852 "disabled_print_services"; 5853 5854 /** 5855 * The saved value for WindowManagerService.setForcedDisplayDensity() 5856 * formatted as a single integer representing DPI. If unset, then use 5857 * the real display density. 5858 * 5859 * @hide 5860 */ 5861 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 5862 5863 /** 5864 * Setting to always use the default text-to-speech settings regardless 5865 * of the application settings. 5866 * 1 = override application settings, 5867 * 0 = use application settings (if specified). 5868 * 5869 * @deprecated The value of this setting is no longer respected by 5870 * the framework text to speech APIs as of the Ice Cream Sandwich release. 5871 */ 5872 @Deprecated 5873 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 5874 5875 /** 5876 * Default text-to-speech engine speech rate. 100 = 1x 5877 */ 5878 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 5879 5880 /** 5881 * Default text-to-speech engine pitch. 100 = 1x 5882 */ 5883 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 5884 5885 /** 5886 * Default text-to-speech engine. 5887 */ 5888 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 5889 5890 /** 5891 * Default text-to-speech language. 5892 * 5893 * @deprecated this setting is no longer in use, as of the Ice Cream 5894 * Sandwich release. Apps should never need to read this setting directly, 5895 * instead can query the TextToSpeech framework classes for the default 5896 * locale. {@link TextToSpeech#getLanguage()}. 5897 */ 5898 @Deprecated 5899 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 5900 5901 /** 5902 * Default text-to-speech country. 5903 * 5904 * @deprecated this setting is no longer in use, as of the Ice Cream 5905 * Sandwich release. Apps should never need to read this setting directly, 5906 * instead can query the TextToSpeech framework classes for the default 5907 * locale. {@link TextToSpeech#getLanguage()}. 5908 */ 5909 @Deprecated 5910 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 5911 5912 /** 5913 * Default text-to-speech locale variant. 5914 * 5915 * @deprecated this setting is no longer in use, as of the Ice Cream 5916 * Sandwich release. Apps should never need to read this setting directly, 5917 * instead can query the TextToSpeech framework classes for the 5918 * locale that is in use {@link TextToSpeech#getLanguage()}. 5919 */ 5920 @Deprecated 5921 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 5922 5923 /** 5924 * Stores the default tts locales on a per engine basis. Stored as 5925 * a comma seperated list of values, each value being of the form 5926 * {@code engine_name:locale} for example, 5927 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 5928 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 5929 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 5930 * setting directly, and can query the TextToSpeech framework classes 5931 * for the locale that is in use. 5932 * 5933 * @hide 5934 */ 5935 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 5936 5937 /** 5938 * Space delimited list of plugin packages that are enabled. 5939 */ 5940 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 5941 5942 /** 5943 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 5944 * instead. 5945 */ 5946 @Deprecated 5947 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5948 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 5949 5950 /** 5951 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 5952 * instead. 5953 */ 5954 @Deprecated 5955 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 5956 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 5957 5958 /** 5959 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 5960 * instead. 5961 */ 5962 @Deprecated 5963 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 5964 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 5965 5966 /** 5967 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 5968 * instead. 5969 */ 5970 @Deprecated 5971 public static final String WIFI_ON = Global.WIFI_ON; 5972 5973 /** 5974 * The acceptable packet loss percentage (range 0 - 100) before trying 5975 * another AP on the same network. 5976 * @deprecated This setting is not used. 5977 */ 5978 @Deprecated 5979 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 5980 "wifi_watchdog_acceptable_packet_loss_percentage"; 5981 5982 /** 5983 * The number of access points required for a network in order for the 5984 * watchdog to monitor it. 5985 * @deprecated This setting is not used. 5986 */ 5987 @Deprecated 5988 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 5989 5990 /** 5991 * The delay between background checks. 5992 * @deprecated This setting is not used. 5993 */ 5994 @Deprecated 5995 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 5996 "wifi_watchdog_background_check_delay_ms"; 5997 5998 /** 5999 * Whether the Wi-Fi watchdog is enabled for background checking even 6000 * after it thinks the user has connected to a good access point. 6001 * @deprecated This setting is not used. 6002 */ 6003 @Deprecated 6004 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 6005 "wifi_watchdog_background_check_enabled"; 6006 6007 /** 6008 * The timeout for a background ping 6009 * @deprecated This setting is not used. 6010 */ 6011 @Deprecated 6012 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 6013 "wifi_watchdog_background_check_timeout_ms"; 6014 6015 /** 6016 * The number of initial pings to perform that *may* be ignored if they 6017 * fail. Again, if these fail, they will *not* be used in packet loss 6018 * calculation. For example, one network always seemed to time out for 6019 * the first couple pings, so this is set to 3 by default. 6020 * @deprecated This setting is not used. 6021 */ 6022 @Deprecated 6023 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 6024 "wifi_watchdog_initial_ignored_ping_count"; 6025 6026 /** 6027 * The maximum number of access points (per network) to attempt to test. 6028 * If this number is reached, the watchdog will no longer monitor the 6029 * initial connection state for the network. This is a safeguard for 6030 * networks containing multiple APs whose DNS does not respond to pings. 6031 * @deprecated This setting is not used. 6032 */ 6033 @Deprecated 6034 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 6035 6036 /** 6037 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 6038 */ 6039 @Deprecated 6040 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 6041 6042 /** 6043 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 6044 * @deprecated This setting is not used. 6045 */ 6046 @Deprecated 6047 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 6048 6049 /** 6050 * The number of pings to test if an access point is a good connection. 6051 * @deprecated This setting is not used. 6052 */ 6053 @Deprecated 6054 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 6055 6056 /** 6057 * The delay between pings. 6058 * @deprecated This setting is not used. 6059 */ 6060 @Deprecated 6061 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 6062 6063 /** 6064 * The timeout per ping. 6065 * @deprecated This setting is not used. 6066 */ 6067 @Deprecated 6068 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 6069 6070 /** 6071 * @deprecated Use 6072 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 6073 */ 6074 @Deprecated 6075 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 6076 6077 /** 6078 * @deprecated Use 6079 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 6080 */ 6081 @Deprecated 6082 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 6083 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 6084 6085 /** 6086 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives 6087 * the receivers of the PendingIntent an opportunity to make a new network request before 6088 * the Network satisfying the request is potentially removed. 6089 * 6090 * @hide 6091 */ 6092 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = 6093 "connectivity_release_pending_intent_delay_ms"; 6094 6095 /** 6096 * Whether background data usage is allowed. 6097 * 6098 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 6099 * availability of background data depends on several 6100 * combined factors. When background data is unavailable, 6101 * {@link ConnectivityManager#getActiveNetworkInfo()} will 6102 * now appear disconnected. 6103 */ 6104 @Deprecated 6105 public static final String BACKGROUND_DATA = "background_data"; 6106 6107 /** 6108 * Origins for which browsers should allow geolocation by default. 6109 * The value is a space-separated list of origins. 6110 */ 6111 public static final String ALLOWED_GEOLOCATION_ORIGINS 6112 = "allowed_geolocation_origins"; 6113 6114 /** 6115 * The preferred TTY mode 0 = TTy Off, CDMA default 6116 * 1 = TTY Full 6117 * 2 = TTY HCO 6118 * 3 = TTY VCO 6119 * @hide 6120 */ 6121 public static final String PREFERRED_TTY_MODE = 6122 "preferred_tty_mode"; 6123 6124 /** 6125 * Whether the enhanced voice privacy mode is enabled. 6126 * 0 = normal voice privacy 6127 * 1 = enhanced voice privacy 6128 * @hide 6129 */ 6130 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 6131 6132 /** 6133 * Whether the TTY mode mode is enabled. 6134 * 0 = disabled 6135 * 1 = enabled 6136 * @hide 6137 */ 6138 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 6139 6140 /** 6141 * Controls whether settings backup is enabled. 6142 * Type: int ( 0 = disabled, 1 = enabled ) 6143 * @hide 6144 */ 6145 public static final String BACKUP_ENABLED = "backup_enabled"; 6146 6147 /** 6148 * Controls whether application data is automatically restored from backup 6149 * at install time. 6150 * Type: int ( 0 = disabled, 1 = enabled ) 6151 * @hide 6152 */ 6153 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 6154 6155 /** 6156 * Indicates whether settings backup has been fully provisioned. 6157 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 6158 * @hide 6159 */ 6160 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 6161 6162 /** 6163 * Component of the transport to use for backup/restore. 6164 * @hide 6165 */ 6166 public static final String BACKUP_TRANSPORT = "backup_transport"; 6167 6168 /** 6169 * Version for which the setup wizard was last shown. Bumped for 6170 * each release when there is new setup information to show. 6171 * @hide 6172 */ 6173 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 6174 6175 /** 6176 * The interval in milliseconds after which Wi-Fi is considered idle. 6177 * When idle, it is possible for the device to be switched from Wi-Fi to 6178 * the mobile data network. 6179 * @hide 6180 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 6181 * instead. 6182 */ 6183 @Deprecated 6184 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 6185 6186 /** 6187 * The global search provider chosen by the user (if multiple global 6188 * search providers are installed). This will be the provider returned 6189 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 6190 * installed. This setting is stored as a flattened component name as 6191 * per {@link ComponentName#flattenToString()}. 6192 * 6193 * @hide 6194 */ 6195 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 6196 "search_global_search_activity"; 6197 6198 /** 6199 * The number of promoted sources in GlobalSearch. 6200 * @hide 6201 */ 6202 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 6203 /** 6204 * The maximum number of suggestions returned by GlobalSearch. 6205 * @hide 6206 */ 6207 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 6208 /** 6209 * The number of suggestions GlobalSearch will ask each non-web search source for. 6210 * @hide 6211 */ 6212 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 6213 /** 6214 * The number of suggestions the GlobalSearch will ask the web search source for. 6215 * @hide 6216 */ 6217 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 6218 "search_web_results_override_limit"; 6219 /** 6220 * The number of milliseconds that GlobalSearch will wait for suggestions from 6221 * promoted sources before continuing with all other sources. 6222 * @hide 6223 */ 6224 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 6225 "search_promoted_source_deadline_millis"; 6226 /** 6227 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 6228 * @hide 6229 */ 6230 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 6231 /** 6232 * The maximum number of milliseconds that GlobalSearch shows the previous results 6233 * after receiving a new query. 6234 * @hide 6235 */ 6236 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 6237 /** 6238 * The maximum age of log data used for shortcuts in GlobalSearch. 6239 * @hide 6240 */ 6241 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 6242 /** 6243 * The maximum age of log data used for source ranking in GlobalSearch. 6244 * @hide 6245 */ 6246 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 6247 "search_max_source_event_age_millis"; 6248 /** 6249 * The minimum number of impressions needed to rank a source in GlobalSearch. 6250 * @hide 6251 */ 6252 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 6253 "search_min_impressions_for_source_ranking"; 6254 /** 6255 * The minimum number of clicks needed to rank a source in GlobalSearch. 6256 * @hide 6257 */ 6258 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 6259 "search_min_clicks_for_source_ranking"; 6260 /** 6261 * The maximum number of shortcuts shown by GlobalSearch. 6262 * @hide 6263 */ 6264 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 6265 /** 6266 * The size of the core thread pool for suggestion queries in GlobalSearch. 6267 * @hide 6268 */ 6269 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 6270 "search_query_thread_core_pool_size"; 6271 /** 6272 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 6273 * @hide 6274 */ 6275 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 6276 "search_query_thread_max_pool_size"; 6277 /** 6278 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 6279 * @hide 6280 */ 6281 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 6282 "search_shortcut_refresh_core_pool_size"; 6283 /** 6284 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 6285 * @hide 6286 */ 6287 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 6288 "search_shortcut_refresh_max_pool_size"; 6289 /** 6290 * The maximun time that excess threads in the GlobalSeach thread pools will 6291 * wait before terminating. 6292 * @hide 6293 */ 6294 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 6295 "search_thread_keepalive_seconds"; 6296 /** 6297 * The maximum number of concurrent suggestion queries to each source. 6298 * @hide 6299 */ 6300 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 6301 "search_per_source_concurrent_query_limit"; 6302 6303 /** 6304 * Whether or not alert sounds are played on StorageManagerService events. 6305 * (0 = false, 1 = true) 6306 * @hide 6307 */ 6308 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 6309 6310 /** 6311 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 6312 * @hide 6313 */ 6314 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 6315 6316 /** 6317 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 6318 * @hide 6319 */ 6320 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 6321 6322 /** 6323 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 6324 * @hide 6325 */ 6326 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 6327 6328 /** 6329 * If nonzero, ANRs in invisible background processes bring up a dialog. 6330 * Otherwise, the process will be silently killed. 6331 * 6332 * Also prevents ANRs and crash dialogs from being suppressed. 6333 * @hide 6334 */ 6335 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 6336 6337 /** 6338 * The {@link ComponentName} string of the service to be used as the voice recognition 6339 * service. 6340 * 6341 * @hide 6342 */ 6343 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 6344 6345 /** 6346 * Stores whether an user has consented to have apps verified through PAM. 6347 * The value is boolean (1 or 0). 6348 * 6349 * @hide 6350 */ 6351 public static final String PACKAGE_VERIFIER_USER_CONSENT = 6352 "package_verifier_user_consent"; 6353 6354 /** 6355 * The {@link ComponentName} string of the selected spell checker service which is 6356 * one of the services managed by the text service manager. 6357 * 6358 * @hide 6359 */ 6360 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 6361 6362 /** 6363 * The {@link ComponentName} string of the selected subtype of the selected spell checker 6364 * service which is one of the services managed by the text service manager. 6365 * 6366 * @hide 6367 */ 6368 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 6369 "selected_spell_checker_subtype"; 6370 6371 /** 6372 * The {@link ComponentName} string whether spell checker is enabled or not. 6373 * 6374 * @hide 6375 */ 6376 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 6377 6378 /** 6379 * What happens when the user presses the Power button while in-call 6380 * and the screen is on.<br/> 6381 * <b>Values:</b><br/> 6382 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 6383 * 2 - The Power button hangs up the current call.<br/> 6384 * 6385 * @hide 6386 */ 6387 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 6388 6389 /** 6390 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 6391 * @hide 6392 */ 6393 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 6394 6395 /** 6396 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 6397 * @hide 6398 */ 6399 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 6400 6401 /** 6402 * INCALL_POWER_BUTTON_BEHAVIOR default value. 6403 * @hide 6404 */ 6405 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 6406 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 6407 6408 /** 6409 * What happens when the user presses the Back button while in-call 6410 * and the screen is on.<br/> 6411 * <b>Values:</b><br/> 6412 * 0 - The Back buttons does nothing different.<br/> 6413 * 1 - The Back button hangs up the current call.<br/> 6414 * 6415 * @hide 6416 */ 6417 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; 6418 6419 /** 6420 * INCALL_BACK_BUTTON_BEHAVIOR value for no action. 6421 * @hide 6422 */ 6423 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; 6424 6425 /** 6426 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". 6427 * @hide 6428 */ 6429 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; 6430 6431 /** 6432 * INCALL_POWER_BUTTON_BEHAVIOR default value. 6433 * @hide 6434 */ 6435 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = 6436 INCALL_BACK_BUTTON_BEHAVIOR_NONE; 6437 6438 /** 6439 * Whether the device should wake when the wake gesture sensor detects motion. 6440 * @hide 6441 */ 6442 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 6443 6444 /** 6445 * Whether the device should doze if configured. 6446 * @hide 6447 */ 6448 public static final String DOZE_ENABLED = "doze_enabled"; 6449 6450 /** 6451 * Whether doze should be always on. 6452 * @hide 6453 */ 6454 public static final String DOZE_ALWAYS_ON = "doze_always_on"; 6455 6456 /** 6457 * Whether the device should pulse on pick up gesture. 6458 * @hide 6459 */ 6460 public static final String DOZE_PULSE_ON_PICK_UP = "doze_pulse_on_pick_up"; 6461 6462 /** 6463 * Whether the device should pulse on double tap gesture. 6464 * @hide 6465 */ 6466 public static final String DOZE_PULSE_ON_DOUBLE_TAP = "doze_pulse_on_double_tap"; 6467 6468 /** 6469 * The current night mode that has been selected by the user. Owned 6470 * and controlled by UiModeManagerService. Constants are as per 6471 * UiModeManager. 6472 * @hide 6473 */ 6474 public static final String UI_NIGHT_MODE = "ui_night_mode"; 6475 6476 /** 6477 * Whether screensavers are enabled. 6478 * @hide 6479 */ 6480 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 6481 6482 /** 6483 * The user's chosen screensaver components. 6484 * 6485 * These will be launched by the PhoneWindowManager after a timeout when not on 6486 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 6487 * @hide 6488 */ 6489 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 6490 6491 /** 6492 * If screensavers are enabled, whether the screensaver should be automatically launched 6493 * when the device is inserted into a (desk) dock. 6494 * @hide 6495 */ 6496 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 6497 6498 /** 6499 * If screensavers are enabled, whether the screensaver should be automatically launched 6500 * when the screen times out when not on battery. 6501 * @hide 6502 */ 6503 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 6504 6505 /** 6506 * If screensavers are enabled, the default screensaver component. 6507 * @hide 6508 */ 6509 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 6510 6511 /** 6512 * The default NFC payment component 6513 * @hide 6514 */ 6515 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 6516 6517 /** 6518 * Whether NFC payment is handled by the foreground application or a default. 6519 * @hide 6520 */ 6521 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 6522 6523 /** 6524 * Specifies the package name currently configured to be the primary sms application 6525 * @hide 6526 */ 6527 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 6528 6529 /** 6530 * Specifies the package name currently configured to be the default dialer application 6531 * @hide 6532 */ 6533 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; 6534 6535 /** 6536 * Specifies the package name currently configured to be the emergency assistance application 6537 * 6538 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE 6539 * 6540 * @hide 6541 */ 6542 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; 6543 6544 /** 6545 * Specifies whether the current app context on scren (assist data) will be sent to the 6546 * assist application (active voice interaction service). 6547 * 6548 * @hide 6549 */ 6550 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; 6551 6552 /** 6553 * Specifies whether a screenshot of the screen contents will be sent to the assist 6554 * application (active voice interaction service). 6555 * 6556 * @hide 6557 */ 6558 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; 6559 6560 /** 6561 * Specifies whether the screen will show an animation if screen contents are sent to the 6562 * assist application (active voice interaction service). 6563 * 6564 * Note that the disclosure will be forced for third-party assistants or if the device 6565 * does not support disabling it. 6566 * 6567 * @hide 6568 */ 6569 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; 6570 6571 /** 6572 * Name of the service components that the current user has explicitly allowed to 6573 * see and assist with all of the user's notifications. 6574 * 6575 * @hide 6576 */ 6577 public static final String ENABLED_NOTIFICATION_ASSISTANT = 6578 "enabled_notification_assistant"; 6579 6580 /** 6581 * Names of the service components that the current user has explicitly allowed to 6582 * see all of the user's notifications, separated by ':'. 6583 * 6584 * @hide 6585 */ 6586 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 6587 6588 /** 6589 * Names of the packages that the current user has explicitly allowed to 6590 * manage notification policy configuration, separated by ':'. 6591 * 6592 * @hide 6593 */ 6594 @TestApi 6595 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = 6596 "enabled_notification_policy_access_packages"; 6597 6598 /** 6599 * Defines whether managed profile ringtones should be synced from it's parent profile 6600 * <p> 6601 * 0 = ringtones are not synced 6602 * 1 = ringtones are synced from the profile's parent (default) 6603 * <p> 6604 * This value is only used for managed profiles. 6605 * @hide 6606 */ 6607 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; 6608 6609 /** @hide */ 6610 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 6611 6612 /** 6613 * This is the query URI for finding a print service to install. 6614 * 6615 * @hide 6616 */ 6617 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 6618 6619 /** 6620 * This is the query URI for finding a NFC payment service to install. 6621 * 6622 * @hide 6623 */ 6624 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 6625 6626 /** 6627 * If enabled, apps should try to skip any introductory hints on first launch. This might 6628 * apply to users that are already familiar with the environment or temporary users. 6629 * <p> 6630 * Type : int (0 to show hints, 1 to skip showing hints) 6631 */ 6632 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 6633 6634 /** 6635 * Persisted playback time after a user confirmation of an unsafe volume level. 6636 * 6637 * @hide 6638 */ 6639 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; 6640 6641 /** 6642 * This preference enables notification display on the lockscreen. 6643 * @hide 6644 */ 6645 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 6646 "lock_screen_show_notifications"; 6647 6648 /** 6649 * This preference stores the last stack active task time for each user, which affects what 6650 * tasks will be visible in Overview. 6651 * @hide 6652 */ 6653 public static final String OVERVIEW_LAST_STACK_ACTIVE_TIME = 6654 "overview_last_stack_active_time"; 6655 6656 /** 6657 * List of TV inputs that are currently hidden. This is a string 6658 * containing the IDs of all hidden TV inputs. Each ID is encoded by 6659 * {@link android.net.Uri#encode(String)} and separated by ':'. 6660 * @hide 6661 */ 6662 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; 6663 6664 /** 6665 * List of custom TV input labels. This is a string containing <TV input id, custom name> 6666 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} 6667 * and separated by ','. Each pair is separated by ':'. 6668 * @hide 6669 */ 6670 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; 6671 6672 /** 6673 * Whether automatic routing of system audio to USB audio peripheral is disabled. 6674 * The value is boolean (1 or 0), where 1 means automatic routing is disabled, 6675 * and 0 means automatic routing is enabled. 6676 * 6677 * @hide 6678 */ 6679 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 6680 "usb_audio_automatic_routing_disabled"; 6681 6682 /** 6683 * The timeout in milliseconds before the device fully goes to sleep after 6684 * a period of inactivity. This value sets an upper bound on how long the device 6685 * will stay awake or dreaming without user activity. It should generally 6686 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device 6687 * will sleep before it ever has a chance to dream. 6688 * <p> 6689 * Use -1 to disable this timeout. 6690 * </p> 6691 * 6692 * @hide 6693 */ 6694 public static final String SLEEP_TIMEOUT = "sleep_timeout"; 6695 6696 /** 6697 * Controls whether double tap to wake is enabled. 6698 * @hide 6699 */ 6700 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; 6701 6702 /** 6703 * The current assistant component. It could be a voice interaction service, 6704 * or an activity that handles ACTION_ASSIST, or empty which means using the default 6705 * handling. 6706 * 6707 * @hide 6708 */ 6709 public static final String ASSISTANT = "assistant"; 6710 6711 /** 6712 * Whether the camera launch gesture should be disabled. 6713 * 6714 * @hide 6715 */ 6716 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; 6717 6718 /** 6719 * Whether the camera launch gesture to double tap the power button when the screen is off 6720 * should be disabled. 6721 * 6722 * @hide 6723 */ 6724 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = 6725 "camera_double_tap_power_gesture_disabled"; 6726 6727 /** 6728 * Whether the camera double twist gesture to flip between front and back mode should be 6729 * enabled. 6730 * 6731 * @hide 6732 */ 6733 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = 6734 "camera_double_twist_to_flip_enabled"; 6735 6736 /** 6737 * Whether the assist gesture should be enabled. 6738 * 6739 * @hide 6740 */ 6741 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; 6742 6743 /** 6744 * Control whether Night display is currently activated. 6745 * @hide 6746 */ 6747 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; 6748 6749 /** 6750 * Control whether Night display will automatically activate/deactivate. 6751 * @hide 6752 */ 6753 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; 6754 6755 /** 6756 * Custom time when Night display is scheduled to activate. 6757 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6758 * @hide 6759 */ 6760 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = "night_display_custom_start_time"; 6761 6762 /** 6763 * Custom time when Night display is scheduled to deactivate. 6764 * Represented as milliseconds from midnight (e.g. 21600000 == 6am). 6765 * @hide 6766 */ 6767 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; 6768 6769 /** 6770 * Names of the service components that the current user has explicitly allowed to 6771 * be a VR mode listener, separated by ':'. 6772 * 6773 * @hide 6774 */ 6775 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; 6776 6777 /** 6778 * Behavior of the display while in VR mode. 6779 * 6780 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. 6781 * 6782 * @hide 6783 */ 6784 public static final String VR_DISPLAY_MODE = "vr_display_mode"; 6785 6786 /** 6787 * Lower the display persistence while the system is in VR mode. 6788 * 6789 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 6790 * 6791 * @hide. 6792 */ 6793 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; 6794 6795 /** 6796 * Do not alter the display persistence while the system is in VR mode. 6797 * 6798 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 6799 * 6800 * @hide. 6801 */ 6802 public static final int VR_DISPLAY_MODE_OFF = 1; 6803 6804 /** 6805 * Whether CarrierAppUtils#disableCarrierAppsUntilPrivileged has been executed at least 6806 * once. 6807 * 6808 * <p>This is used to ensure that we only take one pass which will disable apps that are not 6809 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is 6810 * inserted), to avoid disabling an app that the user might actively be using. 6811 * 6812 * <p>Will be set to 1 once executed. 6813 * 6814 * @hide 6815 */ 6816 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; 6817 6818 /** 6819 * Whether parent user can access remote contact in managed profile. 6820 * 6821 * @hide 6822 */ 6823 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = 6824 "managed_profile_contact_remote_search"; 6825 6826 /** 6827 * Whether or not the automatic storage manager is enabled and should run on the device. 6828 * 6829 * @hide 6830 */ 6831 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = 6832 "automatic_storage_manager_enabled"; 6833 6834 /** 6835 * How many days of information for the automatic storage manager to retain on the device. 6836 * 6837 * @hide 6838 */ 6839 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = 6840 "automatic_storage_manager_days_to_retain"; 6841 6842 /** 6843 * Default number of days of information for the automatic storage manager to retain. 6844 * 6845 * @hide 6846 */ 6847 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; 6848 6849 /** 6850 * How many bytes the automatic storage manager has cleared out. 6851 * 6852 * @hide 6853 */ 6854 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = 6855 "automatic_storage_manager_bytes_cleared"; 6856 6857 6858 /** 6859 * Last run time for the automatic storage manager. 6860 * 6861 * @hide 6862 */ 6863 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = 6864 "automatic_storage_manager_last_run"; 6865 6866 /** 6867 * Whether SystemUI navigation keys is enabled. 6868 * @hide 6869 */ 6870 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = 6871 "system_navigation_keys_enabled"; 6872 6873 /** 6874 * Holds comma separated list of ordering of QS tiles. 6875 * @hide 6876 */ 6877 public static final String QS_TILES = "sysui_qs_tiles"; 6878 6879 /** 6880 * Whether preloaded APKs have been installed for the user. 6881 * @hide 6882 */ 6883 public static final String DEMO_USER_SETUP_COMPLETE 6884 = "demo_user_setup_complete"; 6885 6886 /** 6887 * Specifies whether the web action API is enabled. 6888 * 6889 * @hide 6890 */ 6891 public static final String WEB_ACTION_ENABLED = "web_action_enabled"; 6892 6893 /** 6894 * Has this pairable device been paired or upgraded from a previously paired system. 6895 * @hide 6896 */ 6897 public static final String DEVICE_PAIRED = "device_paired"; 6898 6899 /** 6900 * Integer state indicating whether package verifier is enabled. 6901 * TODO(b/34259924): Remove this setting. 6902 * 6903 * @hide 6904 */ 6905 public static final String PACKAGE_VERIFIER_STATE = "package_verifier_state"; 6906 6907 /** 6908 * This are the settings to be backed up. 6909 * 6910 * NOTE: Settings are backed up and restored in the order they appear 6911 * in this array. If you have one setting depending on another, 6912 * make sure that they are ordered appropriately. 6913 * 6914 * @hide 6915 */ 6916 public static final String[] SETTINGS_TO_BACKUP = { 6917 BUGREPORT_IN_POWER_MENU, // moved to global 6918 ALLOW_MOCK_LOCATION, 6919 PARENTAL_CONTROL_ENABLED, 6920 PARENTAL_CONTROL_REDIRECT_URL, 6921 USB_MASS_STORAGE_ENABLED, // moved to global 6922 ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 6923 ACCESSIBILITY_DISPLAY_DALTONIZER, 6924 ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 6925 ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 6926 ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, 6927 ACCESSIBILITY_SCRIPT_INJECTION, 6928 ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS, 6929 ENABLED_ACCESSIBILITY_SERVICES, 6930 ENABLED_NOTIFICATION_LISTENERS, 6931 ENABLED_VR_LISTENERS, 6932 ENABLED_INPUT_METHODS, 6933 TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES, 6934 TOUCH_EXPLORATION_ENABLED, 6935 ACCESSIBILITY_ENABLED, 6936 ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, 6937 ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN, 6938 ACCESSIBILITY_SPEAK_PASSWORD, 6939 ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, 6940 ACCESSIBILITY_CAPTIONING_PRESET, 6941 ACCESSIBILITY_CAPTIONING_ENABLED, 6942 ACCESSIBILITY_CAPTIONING_LOCALE, 6943 ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, 6944 ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR, 6945 ACCESSIBILITY_CAPTIONING_EDGE_TYPE, 6946 ACCESSIBILITY_CAPTIONING_EDGE_COLOR, 6947 ACCESSIBILITY_CAPTIONING_TYPEFACE, 6948 ACCESSIBILITY_CAPTIONING_FONT_SCALE, 6949 ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, 6950 TTS_USE_DEFAULTS, 6951 TTS_DEFAULT_RATE, 6952 TTS_DEFAULT_PITCH, 6953 TTS_DEFAULT_SYNTH, 6954 TTS_DEFAULT_LANG, 6955 TTS_DEFAULT_COUNTRY, 6956 TTS_ENABLED_PLUGINS, 6957 TTS_DEFAULT_LOCALE, 6958 SHOW_IME_WITH_HARD_KEYBOARD, 6959 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global 6960 WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global 6961 WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global 6962 SELECTED_SPELL_CHECKER, 6963 SELECTED_SPELL_CHECKER_SUBTYPE, 6964 SPELL_CHECKER_ENABLED, 6965 MOUNT_PLAY_NOTIFICATION_SND, 6966 MOUNT_UMS_AUTOSTART, 6967 MOUNT_UMS_PROMPT, 6968 MOUNT_UMS_NOTIFY_ENABLED, 6969 SLEEP_TIMEOUT, 6970 DOUBLE_TAP_TO_WAKE, 6971 WAKE_GESTURE_ENABLED, 6972 LONG_PRESS_TIMEOUT, 6973 CAMERA_GESTURE_DISABLED, 6974 ACCESSIBILITY_AUTOCLICK_ENABLED, 6975 ACCESSIBILITY_AUTOCLICK_DELAY, 6976 ACCESSIBILITY_LARGE_POINTER_ICON, 6977 PREFERRED_TTY_MODE, 6978 ENHANCED_VOICE_PRIVACY_ENABLED, 6979 TTY_MODE_ENABLED, 6980 INCALL_POWER_BUTTON_BEHAVIOR, 6981 NIGHT_DISPLAY_CUSTOM_START_TIME, 6982 NIGHT_DISPLAY_CUSTOM_END_TIME, 6983 NIGHT_DISPLAY_AUTO_MODE, 6984 NIGHT_DISPLAY_ACTIVATED, 6985 SYNC_PARENT_SOUNDS, 6986 CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED, 6987 CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 6988 SYSTEM_NAVIGATION_KEYS_ENABLED, 6989 QS_TILES, 6990 DOZE_ENABLED, 6991 DOZE_PULSE_ON_PICK_UP, 6992 DOZE_PULSE_ON_DOUBLE_TAP, 6993 NFC_PAYMENT_DEFAULT_COMPONENT, 6994 AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN, 6995 ASSIST_GESTURE_ENABLED 6996 }; 6997 6998 /** 6999 * These entries are considered common between the personal and the managed profile, 7000 * since the managed profile doesn't get to change them. 7001 */ 7002 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 7003 7004 static { 7005 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); 7006 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); 7007 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); 7008 CLONE_TO_MANAGED_PROFILE.add(DEFAULT_INPUT_METHOD); 7009 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); 7010 CLONE_TO_MANAGED_PROFILE.add(ENABLED_INPUT_METHODS); 7011 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); 7012 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PREVIOUS_MODE); 7013 CLONE_TO_MANAGED_PROFILE.add(LOCATION_PROVIDERS_ALLOWED); 7014 CLONE_TO_MANAGED_PROFILE.add(SELECTED_INPUT_METHOD_SUBTYPE); 7015 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER); 7016 CLONE_TO_MANAGED_PROFILE.add(SELECTED_SPELL_CHECKER_SUBTYPE); 7017 } 7018 7019 /** @hide */ 7020 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 7021 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 7022 } 7023 7024 /** 7025 * Secure settings which can be accessed by instant apps. 7026 * @hide 7027 */ 7028 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 7029 static { 7030 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); 7031 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); 7032 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); 7033 7034 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); 7035 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); 7036 } 7037 7038 /** 7039 * Helper method for determining if a location provider is enabled. 7040 * 7041 * @param cr the content resolver to use 7042 * @param provider the location provider to query 7043 * @return true if the provider is enabled 7044 * 7045 * @deprecated use {@link #LOCATION_MODE} or 7046 * {@link LocationManager#isProviderEnabled(String)} 7047 */ 7048 @Deprecated 7049 public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 7050 return isLocationProviderEnabledForUser(cr, provider, UserHandle.myUserId()); 7051 } 7052 7053 /** 7054 * Helper method for determining if a location provider is enabled. 7055 * @param cr the content resolver to use 7056 * @param provider the location provider to query 7057 * @param userId the userId to query 7058 * @return true if the provider is enabled 7059 * @deprecated use {@link #LOCATION_MODE} or 7060 * {@link LocationManager#isProviderEnabled(String)} 7061 * @hide 7062 */ 7063 @Deprecated 7064 public static final boolean isLocationProviderEnabledForUser(ContentResolver cr, String provider, int userId) { 7065 String allowedProviders = Settings.Secure.getStringForUser(cr, 7066 LOCATION_PROVIDERS_ALLOWED, userId); 7067 return TextUtils.delimitedStringContains(allowedProviders, ',', provider); 7068 } 7069 7070 /** 7071 * Thread-safe method for enabling or disabling a single location provider. 7072 * @param cr the content resolver to use 7073 * @param provider the location provider to enable or disable 7074 * @param enabled true if the provider should be enabled 7075 * @deprecated use {@link #putInt(ContentResolver, String, int)} and {@link #LOCATION_MODE} 7076 */ 7077 @Deprecated 7078 public static final void setLocationProviderEnabled(ContentResolver cr, 7079 String provider, boolean enabled) { 7080 setLocationProviderEnabledForUser(cr, provider, enabled, UserHandle.myUserId()); 7081 } 7082 7083 /** 7084 * Thread-safe method for enabling or disabling a single location provider. 7085 * 7086 * @param cr the content resolver to use 7087 * @param provider the location provider to enable or disable 7088 * @param enabled true if the provider should be enabled 7089 * @param userId the userId for which to enable/disable providers 7090 * @return true if the value was set, false on database errors 7091 * @deprecated use {@link #putIntForUser(ContentResolver, String, int, int)} and 7092 * {@link #LOCATION_MODE} 7093 * @hide 7094 */ 7095 @Deprecated 7096 public static final boolean setLocationProviderEnabledForUser(ContentResolver cr, 7097 String provider, boolean enabled, int userId) { 7098 synchronized (mLocationSettingsLock) { 7099 // to ensure thread safety, we write the provider name with a '+' or '-' 7100 // and let the SettingsProvider handle it rather than reading and modifying 7101 // the list of enabled providers. 7102 if (enabled) { 7103 provider = "+" + provider; 7104 } else { 7105 provider = "-" + provider; 7106 } 7107 return putStringForUser(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider, 7108 userId); 7109 } 7110 } 7111 7112 /** 7113 * Saves the current location mode into {@link #LOCATION_PREVIOUS_MODE}. 7114 */ 7115 private static final boolean saveLocationModeForUser(ContentResolver cr, int userId) { 7116 final int mode = getLocationModeForUser(cr, userId); 7117 return putIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, mode, userId); 7118 } 7119 7120 /** 7121 * Restores the current location mode from {@link #LOCATION_PREVIOUS_MODE}. 7122 */ 7123 private static final boolean restoreLocationModeForUser(ContentResolver cr, int userId) { 7124 int mode = getIntForUser(cr, Settings.Secure.LOCATION_PREVIOUS_MODE, 7125 LOCATION_MODE_HIGH_ACCURACY, userId); 7126 // Make sure that the previous mode is never "off". Otherwise the user won't be able to 7127 // turn on location any longer. 7128 if (mode == LOCATION_MODE_OFF) { 7129 mode = LOCATION_MODE_HIGH_ACCURACY; 7130 } 7131 return setLocationModeForUser(cr, mode, userId); 7132 } 7133 7134 /** 7135 * Thread-safe method for setting the location mode to one of 7136 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 7137 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. 7138 * Necessary because the mode is a composite of the underlying location provider 7139 * settings. 7140 * 7141 * @param cr the content resolver to use 7142 * @param mode such as {@link #LOCATION_MODE_HIGH_ACCURACY} 7143 * @param userId the userId for which to change mode 7144 * @return true if the value was set, false on database errors 7145 * 7146 * @throws IllegalArgumentException if mode is not one of the supported values 7147 */ 7148 private static final boolean setLocationModeForUser(ContentResolver cr, int mode, 7149 int userId) { 7150 synchronized (mLocationSettingsLock) { 7151 boolean gps = false; 7152 boolean network = false; 7153 switch (mode) { 7154 case LOCATION_MODE_PREVIOUS: 7155 // Retrieve the actual mode and set to that mode. 7156 return restoreLocationModeForUser(cr, userId); 7157 case LOCATION_MODE_OFF: 7158 saveLocationModeForUser(cr, userId); 7159 break; 7160 case LOCATION_MODE_SENSORS_ONLY: 7161 gps = true; 7162 break; 7163 case LOCATION_MODE_BATTERY_SAVING: 7164 network = true; 7165 break; 7166 case LOCATION_MODE_HIGH_ACCURACY: 7167 gps = true; 7168 network = true; 7169 break; 7170 default: 7171 throw new IllegalArgumentException("Invalid location mode: " + mode); 7172 } 7173 // Note it's important that we set the NLP mode first. The Google implementation 7174 // of NLP clears its NLP consent setting any time it receives a 7175 // LocationManager.PROVIDERS_CHANGED_ACTION broadcast and NLP is disabled. Also, 7176 // it shows an NLP consent dialog any time it receives the broadcast, NLP is 7177 // enabled, and the NLP consent is not set. If 1) we were to enable GPS first, 7178 // 2) a setup wizard has its own NLP consent UI that sets the NLP consent setting, 7179 // and 3) the receiver happened to complete before we enabled NLP, then the Google 7180 // NLP would detect the attempt to enable NLP and show a redundant NLP consent 7181 // dialog. Then the people who wrote the setup wizard would be sad. 7182 boolean nlpSuccess = Settings.Secure.setLocationProviderEnabledForUser( 7183 cr, LocationManager.NETWORK_PROVIDER, network, userId); 7184 boolean gpsSuccess = Settings.Secure.setLocationProviderEnabledForUser( 7185 cr, LocationManager.GPS_PROVIDER, gps, userId); 7186 return gpsSuccess && nlpSuccess; 7187 } 7188 } 7189 7190 /** 7191 * Thread-safe method for reading the location mode, returns one of 7192 * {@link #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, 7193 * {@link #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. Necessary 7194 * because the mode is a composite of the underlying location provider settings. 7195 * 7196 * @param cr the content resolver to use 7197 * @param userId the userId for which to read the mode 7198 * @return the location mode 7199 */ 7200 private static final int getLocationModeForUser(ContentResolver cr, int userId) { 7201 synchronized (mLocationSettingsLock) { 7202 boolean gpsEnabled = Settings.Secure.isLocationProviderEnabledForUser( 7203 cr, LocationManager.GPS_PROVIDER, userId); 7204 boolean networkEnabled = Settings.Secure.isLocationProviderEnabledForUser( 7205 cr, LocationManager.NETWORK_PROVIDER, userId); 7206 if (gpsEnabled && networkEnabled) { 7207 return LOCATION_MODE_HIGH_ACCURACY; 7208 } else if (gpsEnabled) { 7209 return LOCATION_MODE_SENSORS_ONLY; 7210 } else if (networkEnabled) { 7211 return LOCATION_MODE_BATTERY_SAVING; 7212 } else { 7213 return LOCATION_MODE_OFF; 7214 } 7215 } 7216 } 7217 } 7218 7219 /** 7220 * Global system settings, containing preferences that always apply identically 7221 * to all defined users. Applications can read these but are not allowed to write; 7222 * like the "Secure" settings, these are for preferences that the user must 7223 * explicitly modify through the system UI or specialized APIs for those values. 7224 */ 7225 public static final class Global extends NameValueTable { 7226 /** 7227 * The content:// style URL for global secure settings items. Not public. 7228 */ 7229 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 7230 7231 /** 7232 * Whether users are allowed to add more users or guest from lockscreen. 7233 * <p> 7234 * Type: int 7235 * @hide 7236 */ 7237 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; 7238 7239 /** 7240 * Setting whether the global gesture for enabling accessibility is enabled. 7241 * If this gesture is enabled the user will be able to perfrom it to enable 7242 * the accessibility state without visiting the settings app. 7243 * 7244 * @hide 7245 * No longer used. Should be removed once all dependencies have been updated. 7246 */ 7247 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 7248 "enable_accessibility_global_gesture_enabled"; 7249 7250 /** 7251 * Whether Airplane Mode is on. 7252 */ 7253 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 7254 7255 /** 7256 * Whether Theater Mode is on. 7257 * {@hide} 7258 */ 7259 @SystemApi 7260 public static final String THEATER_MODE_ON = "theater_mode_on"; 7261 7262 /** 7263 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 7264 */ 7265 public static final String RADIO_BLUETOOTH = "bluetooth"; 7266 7267 /** 7268 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 7269 */ 7270 public static final String RADIO_WIFI = "wifi"; 7271 7272 /** 7273 * {@hide} 7274 */ 7275 public static final String RADIO_WIMAX = "wimax"; 7276 /** 7277 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 7278 */ 7279 public static final String RADIO_CELL = "cell"; 7280 7281 /** 7282 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 7283 */ 7284 public static final String RADIO_NFC = "nfc"; 7285 7286 /** 7287 * A comma separated list of radios that need to be disabled when airplane mode 7288 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 7289 * included in the comma separated list. 7290 */ 7291 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 7292 7293 /** 7294 * A comma separated list of radios that should to be disabled when airplane mode 7295 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 7296 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 7297 * will be turned off when entering airplane mode, but the user will be able to reenable 7298 * Wifi in the Settings app. 7299 * 7300 * {@hide} 7301 */ 7302 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 7303 7304 /** 7305 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. 7306 * See {@link android.bluetooth.BluetoothProfile}. 7307 * {@hide} 7308 */ 7309 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; 7310 7311 /** 7312 * A semi-colon separated list of Bluetooth interoperability workarounds. 7313 * Each entry is a partial Bluetooth device address string and an integer representing 7314 * the feature to be disabled, separated by a comma. The integer must correspond 7315 * to a interoperability feature as defined in "interop.h" in /system/bt. 7316 * <p> 7317 * Example: <br/> 7318 * "00:11:22,0;01:02:03:04,2" 7319 * @hide 7320 */ 7321 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; 7322 7323 /** 7324 * The policy for deciding when Wi-Fi should go to sleep (which will in 7325 * turn switch to using the mobile data as an Internet connection). 7326 * <p> 7327 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 7328 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 7329 * {@link #WIFI_SLEEP_POLICY_NEVER}. 7330 */ 7331 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 7332 7333 /** 7334 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 7335 * policy, which is to sleep shortly after the turning off 7336 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 7337 */ 7338 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 7339 7340 /** 7341 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 7342 * the device is on battery, and never go to sleep when the device is 7343 * plugged in. 7344 */ 7345 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 7346 7347 /** 7348 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 7349 */ 7350 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 7351 7352 /** 7353 * Value to specify if the user prefers the date, time and time zone 7354 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 7355 */ 7356 public static final String AUTO_TIME = "auto_time"; 7357 7358 /** 7359 * Value to specify if the user prefers the time zone 7360 * to be automatically fetched from the network (NITZ). 1=yes, 0=no 7361 */ 7362 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 7363 7364 /** 7365 * URI for the car dock "in" event sound. 7366 * @hide 7367 */ 7368 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 7369 7370 /** 7371 * URI for the car dock "out" event sound. 7372 * @hide 7373 */ 7374 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 7375 7376 /** 7377 * URI for the desk dock "in" event sound. 7378 * @hide 7379 */ 7380 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 7381 7382 /** 7383 * URI for the desk dock "out" event sound. 7384 * @hide 7385 */ 7386 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 7387 7388 /** 7389 * Whether to play a sound for dock events. 7390 * @hide 7391 */ 7392 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 7393 7394 /** 7395 * Whether to play a sound for dock events, only when an accessibility service is on. 7396 * @hide 7397 */ 7398 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; 7399 7400 /** 7401 * URI for the "device locked" (keyguard shown) sound. 7402 * @hide 7403 */ 7404 public static final String LOCK_SOUND = "lock_sound"; 7405 7406 /** 7407 * URI for the "device unlocked" sound. 7408 * @hide 7409 */ 7410 public static final String UNLOCK_SOUND = "unlock_sound"; 7411 7412 /** 7413 * URI for the "device is trusted" sound, which is played when the device enters the trusted 7414 * state without unlocking. 7415 * @hide 7416 */ 7417 public static final String TRUSTED_SOUND = "trusted_sound"; 7418 7419 /** 7420 * URI for the low battery sound file. 7421 * @hide 7422 */ 7423 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 7424 7425 /** 7426 * Whether to play a sound for low-battery alerts. 7427 * @hide 7428 */ 7429 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 7430 7431 /** 7432 * URI for the "wireless charging started" sound. 7433 * @hide 7434 */ 7435 public static final String WIRELESS_CHARGING_STARTED_SOUND = 7436 "wireless_charging_started_sound"; 7437 7438 /** 7439 * Whether to play a sound for charging events. 7440 * @hide 7441 */ 7442 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 7443 7444 /** 7445 * Whether we keep the device on while the device is plugged in. 7446 * Supported values are: 7447 * <ul> 7448 * <li>{@code 0} to never stay on while plugged in</li> 7449 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 7450 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 7451 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 7452 * </ul> 7453 * These values can be OR-ed together. 7454 */ 7455 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 7456 7457 /** 7458 * When the user has enable the option to have a "bug report" command 7459 * in the power menu. 7460 * @hide 7461 */ 7462 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 7463 7464 /** 7465 * Whether ADB is enabled. 7466 */ 7467 public static final String ADB_ENABLED = "adb_enabled"; 7468 7469 /** 7470 * Whether Views are allowed to save their attribute data. 7471 * @hide 7472 */ 7473 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 7474 7475 /** 7476 * Whether assisted GPS should be enabled or not. 7477 * @hide 7478 */ 7479 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 7480 7481 /** 7482 * Whether bluetooth is enabled/disabled 7483 * 0=disabled. 1=enabled. 7484 */ 7485 public static final String BLUETOOTH_ON = "bluetooth_on"; 7486 7487 /** 7488 * CDMA Cell Broadcast SMS 7489 * 0 = CDMA Cell Broadcast SMS disabled 7490 * 1 = CDMA Cell Broadcast SMS enabled 7491 * @hide 7492 */ 7493 public static final String CDMA_CELL_BROADCAST_SMS = 7494 "cdma_cell_broadcast_sms"; 7495 7496 /** 7497 * The CDMA roaming mode 0 = Home Networks, CDMA default 7498 * 1 = Roaming on Affiliated networks 7499 * 2 = Roaming on any networks 7500 * @hide 7501 */ 7502 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 7503 7504 /** 7505 * The CDMA subscription mode 0 = RUIM/SIM (default) 7506 * 1 = NV 7507 * @hide 7508 */ 7509 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 7510 7511 /** Inactivity timeout to track mobile data activity. 7512 * 7513 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 7514 * infer the data activity of mobile network. After a period of no activity on mobile 7515 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 7516 * intent is fired to indicate a transition of network status from "active" to "idle". Any 7517 * subsequent activity on mobile networks triggers the firing of {@code 7518 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 7519 * 7520 * Network activity refers to transmitting or receiving data on the network interfaces. 7521 * 7522 * Tracking is disabled if set to zero or negative value. 7523 * 7524 * @hide 7525 */ 7526 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 7527 7528 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 7529 * but for Wifi network. 7530 * @hide 7531 */ 7532 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 7533 7534 /** 7535 * Whether or not data roaming is enabled. (0 = false, 1 = true) 7536 */ 7537 public static final String DATA_ROAMING = "data_roaming"; 7538 7539 /** 7540 * The value passed to a Mobile DataConnection via bringUp which defines the 7541 * number of retries to preform when setting up the initial connection. The default 7542 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 7543 * @hide 7544 */ 7545 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 7546 7547 /** 7548 * Whether any package can be on external storage. When this is true, any 7549 * package, regardless of manifest values, is a candidate for installing 7550 * or moving onto external storage. (0 = false, 1 = true) 7551 * @hide 7552 */ 7553 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 7554 7555 /** 7556 * Whether any activity can be resized. When this is true, any 7557 * activity, regardless of manifest values, can be resized for multi-window. 7558 * (0 = false, 1 = true) 7559 * @hide 7560 */ 7561 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES 7562 = "force_resizable_activities"; 7563 7564 /** 7565 * Whether to enable experimental freeform support for windows. 7566 * @hide 7567 */ 7568 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT 7569 = "enable_freeform_support"; 7570 7571 /** 7572 * Whether user has enabled development settings. 7573 */ 7574 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 7575 7576 /** 7577 * Whether the device has been provisioned (0 = false, 1 = true). 7578 * <p>On a multiuser device with a separate system user, the screen may be locked 7579 * as soon as this is set to true and further activities cannot be launched on the 7580 * system user unless they are marked to show over keyguard. 7581 */ 7582 public static final String DEVICE_PROVISIONED = "device_provisioned"; 7583 7584 /** 7585 * Whether mobile data should be allowed while the device is being provisioned. 7586 * This allows the provisioning process to turn off mobile data before the user 7587 * has an opportunity to set things up, preventing other processes from burning 7588 * precious bytes before wifi is setup. 7589 * (0 = false, 1 = true) 7590 * @hide 7591 */ 7592 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = 7593 "device_provisioning_mobile_data"; 7594 7595 /** 7596 * The saved value for WindowManagerService.setForcedDisplaySize(). 7597 * Two integers separated by a comma. If unset, then use the real display size. 7598 * @hide 7599 */ 7600 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 7601 7602 /** 7603 * The saved value for WindowManagerService.setForcedDisplayScalingMode(). 7604 * 0 or unset if scaling is automatic, 1 if scaling is disabled. 7605 * @hide 7606 */ 7607 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; 7608 7609 /** 7610 * The maximum size, in bytes, of a download that the download manager will transfer over 7611 * a non-wifi connection. 7612 * @hide 7613 */ 7614 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 7615 "download_manager_max_bytes_over_mobile"; 7616 7617 /** 7618 * The recommended maximum size, in bytes, of a download that the download manager should 7619 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 7620 * have the option to start the download over the mobile connection anyway. 7621 * @hide 7622 */ 7623 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 7624 "download_manager_recommended_max_bytes_over_mobile"; 7625 7626 /** 7627 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 7628 */ 7629 @Deprecated 7630 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 7631 7632 /** 7633 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 7634 * sent or processed. (0 = false, 1 = true) 7635 * @hide 7636 */ 7637 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 7638 7639 /** 7640 * Whether HDMI system audio is enabled. If enabled, TV internal speaker is muted, 7641 * and the output is redirected to AV Receiver connected via 7642 * {@Global#HDMI_SYSTEM_AUDIO_OUTPUT}. 7643 * @hide 7644 */ 7645 public static final String HDMI_SYSTEM_AUDIO_ENABLED = "hdmi_system_audio_enabled"; 7646 7647 /** 7648 * Whether TV will automatically turn on upon reception of the CEC command 7649 * <Text View On> or <Image View On>. (0 = false, 1 = true) 7650 * @hide 7651 */ 7652 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 7653 "hdmi_control_auto_wakeup_enabled"; 7654 7655 /** 7656 * Whether TV will also turn off other CEC devices when it goes to standby mode. 7657 * (0 = false, 1 = true) 7658 * @hide 7659 */ 7660 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 7661 "hdmi_control_auto_device_off_enabled"; 7662 7663 /** 7664 * The interval in milliseconds at which location requests will be throttled when they are 7665 * coming from the background. 7666 * @hide 7667 */ 7668 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = 7669 "location_background_throttle_interval_ms"; 7670 7671 /** 7672 * Packages that are whitelisted for background throttling (throttling will not be applied). 7673 * @hide 7674 */ 7675 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = 7676 "location_background_throttle_package_whitelist"; 7677 7678 /** 7679 * Whether TV will switch to MHL port when a mobile device is plugged in. 7680 * (0 = false, 1 = true) 7681 * @hide 7682 */ 7683 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 7684 7685 /** 7686 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 7687 * @hide 7688 */ 7689 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 7690 7691 /** 7692 * Whether mobile data connections are allowed by the user. See 7693 * ConnectivityManager for more info. 7694 * @hide 7695 */ 7696 public static final String MOBILE_DATA = "mobile_data"; 7697 7698 /** 7699 * Whether the mobile data connection should remain active even when higher 7700 * priority networks like WiFi are active, to help make network switching faster. 7701 * 7702 * See ConnectivityService for more info. 7703 * 7704 * (0 = disabled, 1 = enabled) 7705 * @hide 7706 */ 7707 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 7708 7709 /** 7710 * Size of the event buffer for IP connectivity metrics. 7711 * @hide 7712 */ 7713 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = 7714 "connectivity_metrics_buffer_size"; 7715 7716 /** {@hide} */ 7717 public static final String NETSTATS_ENABLED = "netstats_enabled"; 7718 /** {@hide} */ 7719 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 7720 /** {@hide} */ 7721 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 7722 /** {@hide} */ 7723 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 7724 /** {@hide} */ 7725 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 7726 7727 /** {@hide} */ 7728 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 7729 /** {@hide} */ 7730 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 7731 /** {@hide} */ 7732 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 7733 /** {@hide} */ 7734 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 7735 7736 /** {@hide} */ 7737 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 7738 /** {@hide} */ 7739 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 7740 /** {@hide} */ 7741 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 7742 /** {@hide} */ 7743 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 7744 7745 /** {@hide} */ 7746 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = "netstats_uid_tag_bucket_duration"; 7747 /** {@hide} */ 7748 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = "netstats_uid_tag_persist_bytes"; 7749 /** {@hide} */ 7750 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 7751 /** {@hide} */ 7752 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 7753 7754 /** 7755 * User preference for which network(s) should be used. Only the 7756 * connectivity service should touch this. 7757 */ 7758 public static final String NETWORK_PREFERENCE = "network_preference"; 7759 7760 /** 7761 * Which package name to use for network scoring. If null, or if the package is not a valid 7762 * scorer app, external network scores will neither be requested nor accepted. 7763 * @hide 7764 */ 7765 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 7766 7767 /** 7768 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 7769 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 7770 * exceeded. 7771 * @hide 7772 */ 7773 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 7774 7775 /** 7776 * The length of time in milli-seconds that automatic small adjustments to 7777 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 7778 * @hide 7779 */ 7780 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 7781 7782 /** Preferred NTP server. {@hide} */ 7783 public static final String NTP_SERVER = "ntp_server"; 7784 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 7785 public static final String NTP_TIMEOUT = "ntp_timeout"; 7786 7787 /** {@hide} */ 7788 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; 7789 7790 /** 7791 * Sample validity in seconds to configure for the system DNS resolver. 7792 * {@hide} 7793 */ 7794 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = 7795 "dns_resolver_sample_validity_seconds"; 7796 7797 /** 7798 * Success threshold in percent for use with the system DNS resolver. 7799 * {@hide} 7800 */ 7801 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = 7802 "dns_resolver_success_threshold_percent"; 7803 7804 /** 7805 * Minimum number of samples needed for statistics to be considered meaningful in the 7806 * system DNS resolver. 7807 * {@hide} 7808 */ 7809 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; 7810 7811 /** 7812 * Maximum number taken into account for statistics purposes in the system DNS resolver. 7813 * {@hide} 7814 */ 7815 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; 7816 7817 /** 7818 * Whether to disable the automatic scheduling of system updates. 7819 * 1 = system updates won't be automatically scheduled (will always 7820 * present notification instead). 7821 * 0 = system updates will be automatically scheduled. (default) 7822 * @hide 7823 */ 7824 @SystemApi 7825 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; 7826 7827 /** 7828 * Whether the package manager should send package verification broadcasts for verifiers to 7829 * review apps prior to installation. 7830 * 1 = request apps to be verified prior to installation, if a verifier exists. 7831 * 0 = do not verify apps before installation 7832 * @hide 7833 */ 7834 public static final String PACKAGE_VERIFIER_ENABLE = "package_verifier_enable"; 7835 7836 /** Timeout for package verification. 7837 * @hide */ 7838 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 7839 7840 /** Default response code for package verification. 7841 * @hide */ 7842 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 7843 7844 /** 7845 * Show package verification setting in the Settings app. 7846 * 1 = show (default) 7847 * 0 = hide 7848 * @hide 7849 */ 7850 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 7851 7852 /** 7853 * Run package verification on apps installed through ADB/ADT/USB 7854 * 1 = perform package verification on ADB installs (default) 7855 * 0 = bypass package verification on ADB installs 7856 * @hide 7857 */ 7858 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 7859 7860 /** 7861 * Time since last fstrim (milliseconds) after which we force one to happen 7862 * during device startup. If unset, the default is 3 days. 7863 * @hide 7864 */ 7865 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; 7866 7867 /** 7868 * The interval in milliseconds at which to check packet counts on the 7869 * mobile data interface when screen is on, to detect possible data 7870 * connection problems. 7871 * @hide 7872 */ 7873 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 7874 "pdp_watchdog_poll_interval_ms"; 7875 7876 /** 7877 * The interval in milliseconds at which to check packet counts on the 7878 * mobile data interface when screen is off, to detect possible data 7879 * connection problems. 7880 * @hide 7881 */ 7882 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 7883 "pdp_watchdog_long_poll_interval_ms"; 7884 7885 /** 7886 * The interval in milliseconds at which to check packet counts on the 7887 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 7888 * outgoing packets has been reached without incoming packets. 7889 * @hide 7890 */ 7891 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 7892 "pdp_watchdog_error_poll_interval_ms"; 7893 7894 /** 7895 * The number of outgoing packets sent without seeing an incoming packet 7896 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 7897 * device is logged to the event log 7898 * @hide 7899 */ 7900 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 7901 "pdp_watchdog_trigger_packet_count"; 7902 7903 /** 7904 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 7905 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 7906 * attempting data connection recovery. 7907 * @hide 7908 */ 7909 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 7910 "pdp_watchdog_error_poll_count"; 7911 7912 /** 7913 * The number of failed PDP reset attempts before moving to something more 7914 * drastic: re-registering to the network. 7915 * @hide 7916 */ 7917 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 7918 "pdp_watchdog_max_pdp_reset_fail_count"; 7919 7920 /** 7921 * A positive value indicates how often the SamplingProfiler 7922 * should take snapshots. Zero value means SamplingProfiler 7923 * is disabled. 7924 * 7925 * @hide 7926 */ 7927 public static final String SAMPLING_PROFILER_MS = "sampling_profiler_ms"; 7928 7929 /** 7930 * URL to open browser on to allow user to manage a prepay account 7931 * @hide 7932 */ 7933 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 7934 "setup_prepaid_data_service_url"; 7935 7936 /** 7937 * URL to attempt a GET on to see if this is a prepay device 7938 * @hide 7939 */ 7940 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 7941 "setup_prepaid_detection_target_url"; 7942 7943 /** 7944 * Host to check for a redirect to after an attempt to GET 7945 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 7946 * this is a prepaid device with zero balance.) 7947 * @hide 7948 */ 7949 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 7950 "setup_prepaid_detection_redir_host"; 7951 7952 /** 7953 * The interval in milliseconds at which to check the number of SMS sent out without asking 7954 * for use permit, to limit the un-authorized SMS usage. 7955 * 7956 * @hide 7957 */ 7958 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 7959 "sms_outgoing_check_interval_ms"; 7960 7961 /** 7962 * The number of outgoing SMS sent without asking for user permit (of {@link 7963 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 7964 * 7965 * @hide 7966 */ 7967 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 7968 "sms_outgoing_check_max_count"; 7969 7970 /** 7971 * Used to disable SMS short code confirmation - defaults to true. 7972 * True indcates we will do the check, etc. Set to false to disable. 7973 * @see com.android.internal.telephony.SmsUsageMonitor 7974 * @hide 7975 */ 7976 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 7977 7978 /** 7979 * Used to select which country we use to determine premium sms codes. 7980 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 7981 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 7982 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 7983 * @hide 7984 */ 7985 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 7986 7987 /** 7988 * Used to select TCP's default initial receiver window size in segments - defaults to a build config value 7989 * @hide 7990 */ 7991 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 7992 7993 /** 7994 * Used to disable Tethering on a device - defaults to true 7995 * @hide 7996 */ 7997 public static final String TETHER_SUPPORTED = "tether_supported"; 7998 7999 /** 8000 * Used to require DUN APN on the device or not - defaults to a build config value 8001 * which defaults to false 8002 * @hide 8003 */ 8004 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 8005 8006 /** 8007 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 8008 * corresponding build config values are set it will override the APN DB 8009 * values. 8010 * Consists of a comma seperated list of strings: 8011 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 8012 * note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" 8013 * @hide 8014 */ 8015 public static final String TETHER_DUN_APN = "tether_dun_apn"; 8016 8017 /** 8018 * List of carrier apps which are whitelisted to prompt the user for install when 8019 * a sim card with matching uicc carrier privilege rules is inserted. 8020 * 8021 * The value is "package1;package2;..." 8022 * @hide 8023 */ 8024 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; 8025 8026 /** 8027 * USB Mass Storage Enabled 8028 */ 8029 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 8030 8031 /** 8032 * If this setting is set (to anything), then all references 8033 * to Gmail on the device must change to Google Mail. 8034 */ 8035 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 8036 8037 /** 8038 * Webview Data reduction proxy key. 8039 * @hide 8040 */ 8041 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 8042 "webview_data_reduction_proxy_key"; 8043 8044 /** 8045 * Whether or not the WebView fallback mechanism should be enabled. 8046 * 0=disabled, 1=enabled. 8047 * @hide 8048 */ 8049 public static final String WEBVIEW_FALLBACK_LOGIC_ENABLED = 8050 "webview_fallback_logic_enabled"; 8051 8052 /** 8053 * Name of the package used as WebView provider (if unset the provider is instead determined 8054 * by the system). 8055 * @hide 8056 */ 8057 public static final String WEBVIEW_PROVIDER = "webview_provider"; 8058 8059 /** 8060 * Developer setting to enable WebView multiprocess rendering. 8061 * @hide 8062 */ 8063 @SystemApi 8064 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; 8065 8066 /** 8067 * The maximum number of notifications shown in 24 hours when switching networks. 8068 * @hide 8069 */ 8070 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = 8071 "network_switch_notification_daily_limit"; 8072 8073 /** 8074 * The minimum time in milliseconds between notifications when switching networks. 8075 * @hide 8076 */ 8077 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = 8078 "network_switch_notification_rate_limit_millis"; 8079 8080 /** 8081 * Whether to automatically switch away from wifi networks that lose Internet access. 8082 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always 8083 * avoids such networks. Valid values are: 8084 * 8085 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. 8086 * null: Ask the user whether to switch away from bad wifi. 8087 * 1: Avoid bad wifi. 8088 * 8089 * @hide 8090 */ 8091 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; 8092 8093 /** 8094 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be 8095 * overridden by the system based on device or application state. If null, the value 8096 * specified by config_networkMeteredMultipathPreference is used. 8097 * 8098 * @hide 8099 */ 8100 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = 8101 "network_metered_multipath_preference"; 8102 8103 /** 8104 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of 8105 * colon-delimited key-value pairs. The key is the badging enum value defined in 8106 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in 8107 * kbps required for the badge. For example: "10:3000,20:5000,30:25000" 8108 * 8109 * @hide 8110 */ 8111 @SystemApi 8112 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; 8113 8114 /** 8115 * Whether Wifi display is enabled/disabled 8116 * 0=disabled. 1=enabled. 8117 * @hide 8118 */ 8119 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 8120 8121 /** 8122 * Whether Wifi display certification mode is enabled/disabled 8123 * 0=disabled. 1=enabled. 8124 * @hide 8125 */ 8126 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 8127 "wifi_display_certification_on"; 8128 8129 /** 8130 * WPS Configuration method used by Wifi display, this setting only 8131 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 8132 * 8133 * Possible values are: 8134 * 8135 * WpsInfo.INVALID: use default WPS method chosen by framework 8136 * WpsInfo.PBC : use Push button 8137 * WpsInfo.KEYPAD : use Keypad 8138 * WpsInfo.DISPLAY: use Display 8139 * @hide 8140 */ 8141 public static final String WIFI_DISPLAY_WPS_CONFIG = 8142 "wifi_display_wps_config"; 8143 8144 /** 8145 * Whether to notify the user of open networks. 8146 * <p> 8147 * If not connected and the scan results have an open network, we will 8148 * put this notification up. If we attempt to connect to a network or 8149 * the open network(s) disappear, we remove the notification. When we 8150 * show the notification, we will not show it again for 8151 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 8152 */ 8153 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 8154 "wifi_networks_available_notification_on"; 8155 /** 8156 * {@hide} 8157 */ 8158 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 8159 "wimax_networks_available_notification_on"; 8160 8161 /** 8162 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 8163 * Connecting to a network will reset the timer. 8164 */ 8165 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 8166 "wifi_networks_available_repeat_delay"; 8167 8168 /** 8169 * 802.11 country code in ISO 3166 format 8170 * @hide 8171 */ 8172 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 8173 8174 /** 8175 * The interval in milliseconds to issue wake up scans when wifi needs 8176 * to connect. This is necessary to connect to an access point when 8177 * device is on the move and the screen is off. 8178 * @hide 8179 */ 8180 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 8181 "wifi_framework_scan_interval_ms"; 8182 8183 /** 8184 * The interval in milliseconds after which Wi-Fi is considered idle. 8185 * When idle, it is possible for the device to be switched from Wi-Fi to 8186 * the mobile data network. 8187 * @hide 8188 */ 8189 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 8190 8191 /** 8192 * When the number of open networks exceeds this number, the 8193 * least-recently-used excess networks will be removed. 8194 */ 8195 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 8196 8197 /** 8198 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 8199 */ 8200 public static final String WIFI_ON = "wifi_on"; 8201 8202 /** 8203 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 8204 * @hide 8205 */ 8206 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 8207 "wifi_scan_always_enabled"; 8208 8209 /** 8210 * Value to specify if Wi-Fi Wakeup feature is enabled. 8211 * 8212 * Type: int (0 for false, 1 for true) 8213 * @hide 8214 */ 8215 @SystemApi 8216 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; 8217 8218 /** 8219 * Value to specify whether network quality scores and badging should be shown in the UI. 8220 * 8221 * Type: int (0 for false, 1 for true) 8222 * @hide 8223 */ 8224 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; 8225 8226 /** 8227 * Value to specify if network recommendations from 8228 * {@link com.android.server.NetworkScoreService} are enabled. 8229 * 8230 * Type: int (0 for false, 1 for true) 8231 * @hide 8232 */ 8233 @SystemApi 8234 public static final String NETWORK_RECOMMENDATIONS_ENABLED = 8235 "network_recommendations_enabled"; 8236 8237 /** 8238 * Which package name to use for network recommendations. If null, network recommendations 8239 * will neither be requested nor accepted. 8240 * 8241 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and 8242 * {@link NetworkScoreManager#setActiveScorer(String)} to write it. 8243 * 8244 * Type: string - package name 8245 * @hide 8246 */ 8247 public static final String NETWORK_RECOMMENDATIONS_PACKAGE = 8248 "network_recommendations_package"; 8249 8250 /** 8251 * Value to specify if the Wi-Fi Framework should defer to 8252 * {@link com.android.server.NetworkScoreService} for evaluating saved open networks. 8253 * 8254 * Type: int (0 for false, 1 for true) 8255 * @hide 8256 */ 8257 @SystemApi 8258 public static final String CURATE_SAVED_OPEN_NETWORKS = "curate_saved_open_networks"; 8259 8260 /** 8261 * The package name of the application that connect and secures high quality open wifi 8262 * networks automatically. 8263 * 8264 * Type: string package name or null if the feature is either not provided or disabled. 8265 * @hide 8266 */ 8267 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; 8268 8269 /** 8270 * The number of milliseconds the {@link com.android.server.NetworkScoreService} 8271 * will give a recommendation request to complete before returning a default response. 8272 * 8273 * Type: long 8274 * @hide 8275 */ 8276 public static final String NETWORK_RECOMMENDATION_REQUEST_TIMEOUT_MS = 8277 "network_recommendation_request_timeout_ms"; 8278 8279 /** 8280 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for 8281 * connectivity. 8282 * @hide 8283 */ 8284 public static final String BLE_SCAN_ALWAYS_AVAILABLE = 8285 "ble_scan_always_enabled"; 8286 8287 /** 8288 * Used to save the Wifi_ON state prior to tethering. 8289 * This state will be checked to restore Wifi after 8290 * the user turns off tethering. 8291 * 8292 * @hide 8293 */ 8294 public static final String WIFI_SAVED_STATE = "wifi_saved_state"; 8295 8296 /** 8297 * The interval in milliseconds to scan as used by the wifi supplicant 8298 * @hide 8299 */ 8300 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 8301 "wifi_supplicant_scan_interval_ms"; 8302 8303 /** 8304 * whether frameworks handles wifi auto-join 8305 * @hide 8306 */ 8307 public static final String WIFI_ENHANCED_AUTO_JOIN = 8308 "wifi_enhanced_auto_join"; 8309 8310 /** 8311 * whether settings show RSSI 8312 * @hide 8313 */ 8314 public static final String WIFI_NETWORK_SHOW_RSSI = 8315 "wifi_network_show_rssi"; 8316 8317 /** 8318 * The interval in milliseconds to scan at supplicant when p2p is connected 8319 * @hide 8320 */ 8321 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 8322 "wifi_scan_interval_p2p_connected_ms"; 8323 8324 /** 8325 * Whether the Wi-Fi watchdog is enabled. 8326 */ 8327 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 8328 8329 /** 8330 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 8331 * the setting needs to be set to 0 to disable it. 8332 * @hide 8333 */ 8334 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 8335 "wifi_watchdog_poor_network_test_enabled"; 8336 8337 /** 8338 * Setting to turn on suspend optimizations at screen off on Wi-Fi. Enabled by default and 8339 * needs to be set to 0 to disable it. 8340 * @hide 8341 */ 8342 public static final String WIFI_SUSPEND_OPTIMIZATIONS_ENABLED = 8343 "wifi_suspend_optimizations_enabled"; 8344 8345 /** 8346 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 8347 * will enable it. In the future, additional values may be supported. 8348 * @hide 8349 */ 8350 public static final String WIFI_VERBOSE_LOGGING_ENABLED = 8351 "wifi_verbose_logging_enabled"; 8352 8353 /** 8354 * The maximum number of times we will retry a connection to an access 8355 * point for which we have failed in acquiring an IP address from DHCP. 8356 * A value of N means that we will make N+1 connection attempts in all. 8357 */ 8358 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 8359 8360 /** 8361 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 8362 * data connectivity to be established after a disconnect from Wi-Fi. 8363 */ 8364 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 8365 "wifi_mobile_data_transition_wakelock_timeout_ms"; 8366 8367 /** 8368 * This setting controls whether WiFi configurations created by a Device Owner app 8369 * should be locked down (that is, be editable or removable only by the Device Owner App, 8370 * not even by Settings app). 8371 * This setting takes integer values. Non-zero values mean DO created configurations 8372 * are locked down. Value of zero means they are not. Default value in the absence of 8373 * actual value to this setting is 0. 8374 */ 8375 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = 8376 "wifi_device_owner_configs_lockdown"; 8377 8378 /** 8379 * The operational wifi frequency band 8380 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 8381 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 8382 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 8383 * 8384 * @hide 8385 */ 8386 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 8387 8388 /** 8389 * The Wi-Fi peer-to-peer device name 8390 * @hide 8391 */ 8392 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 8393 8394 /** 8395 * The min time between wifi disable and wifi enable 8396 * @hide 8397 */ 8398 public static final String WIFI_REENABLE_DELAY_MS = "wifi_reenable_delay"; 8399 8400 /** 8401 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect 8402 * from an ephemeral network if there is no BSSID for that network with a non-null score that 8403 * has been seen in this time period. 8404 * 8405 * If this is less than or equal to zero, we use a more conservative behavior and only check 8406 * for a non-null score from the currently connected or target BSSID. 8407 * @hide 8408 */ 8409 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = 8410 "wifi_ephemeral_out_of_range_timeout_ms"; 8411 8412 /** 8413 * The number of milliseconds to delay when checking for data stalls during 8414 * non-aggressive detection. (screen is turned off.) 8415 * @hide 8416 */ 8417 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 8418 "data_stall_alarm_non_aggressive_delay_in_ms"; 8419 8420 /** 8421 * The number of milliseconds to delay when checking for data stalls during 8422 * aggressive detection. (screen on or suspected data stall) 8423 * @hide 8424 */ 8425 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 8426 "data_stall_alarm_aggressive_delay_in_ms"; 8427 8428 /** 8429 * The number of milliseconds to allow the provisioning apn to remain active 8430 * @hide 8431 */ 8432 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 8433 "provisioning_apn_alarm_delay_in_ms"; 8434 8435 /** 8436 * The interval in milliseconds at which to check gprs registration 8437 * after the first registration mismatch of gprs and voice service, 8438 * to detect possible data network registration problems. 8439 * 8440 * @hide 8441 */ 8442 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 8443 "gprs_register_check_period_ms"; 8444 8445 /** 8446 * Nonzero causes Log.wtf() to crash. 8447 * @hide 8448 */ 8449 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 8450 8451 /** 8452 * Ringer mode. This is used internally, changing this value will not 8453 * change the ringer mode. See AudioManager. 8454 */ 8455 public static final String MODE_RINGER = "mode_ringer"; 8456 8457 /** 8458 * Overlay display devices setting. 8459 * The associated value is a specially formatted string that describes the 8460 * size and density of simulated secondary display devices. 8461 * <p> 8462 * Format: {width}x{height}/{dpi};... 8463 * </p><p> 8464 * Example: 8465 * <ul> 8466 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 8467 * <li><code>1920x1080/320;1280x720/213</code>: make two overlays, the first 8468 * at 1080p and the second at 720p.</li> 8469 * <li>If the value is empty, then no overlay display devices are created.</li> 8470 * </ul></p> 8471 * 8472 * @hide 8473 */ 8474 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 8475 8476 /** 8477 * Threshold values for the duration and level of a discharge cycle, 8478 * under which we log discharge cycle info. 8479 * 8480 * @hide 8481 */ 8482 public static final String 8483 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 8484 8485 /** @hide */ 8486 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 8487 8488 /** 8489 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 8490 * intents on application crashes and ANRs. If this is disabled, the 8491 * crash/ANR dialog will never display the "Report" button. 8492 * <p> 8493 * Type: int (0 = disallow, 1 = allow) 8494 * 8495 * @hide 8496 */ 8497 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 8498 8499 /** 8500 * Maximum age of entries kept by {@link DropBoxManager}. 8501 * 8502 * @hide 8503 */ 8504 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 8505 8506 /** 8507 * Maximum number of entry files which {@link DropBoxManager} will keep 8508 * around. 8509 * 8510 * @hide 8511 */ 8512 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 8513 8514 /** 8515 * Maximum amount of disk space used by {@link DropBoxManager} no matter 8516 * what. 8517 * 8518 * @hide 8519 */ 8520 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 8521 8522 /** 8523 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 8524 * will use. 8525 * 8526 * @hide 8527 */ 8528 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 8529 8530 /** 8531 * Percent of total disk which {@link DropBoxManager} will never dip 8532 * into. 8533 * 8534 * @hide 8535 */ 8536 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 8537 8538 /** 8539 * Prefix for per-tag dropbox disable/enable settings. 8540 * 8541 * @hide 8542 */ 8543 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 8544 8545 /** 8546 * Lines of logcat to include with system crash/ANR/etc. reports, as a 8547 * prefix of the dropbox tag of the report type. For example, 8548 * "logcat_for_system_server_anr" controls the lines of logcat captured 8549 * with system server ANR reports. 0 to disable. 8550 * 8551 * @hide 8552 */ 8553 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 8554 8555 /** 8556 * The interval in minutes after which the amount of free storage left 8557 * on the device is logged to the event log 8558 * 8559 * @hide 8560 */ 8561 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 8562 8563 /** 8564 * Threshold for the amount of change in disk free space required to 8565 * report the amount of free space. Used to prevent spamming the logs 8566 * when the disk free space isn't changing frequently. 8567 * 8568 * @hide 8569 */ 8570 public static final String 8571 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 8572 8573 /** 8574 * Minimum percentage of free storage on the device that is used to 8575 * determine if the device is running low on storage. The default is 10. 8576 * <p> 8577 * Say this value is set to 10, the device is considered running low on 8578 * storage if 90% or more of the device storage is filled up. 8579 * 8580 * @hide 8581 */ 8582 public static final String 8583 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 8584 8585 /** 8586 * Maximum byte size of the low storage threshold. This is to ensure 8587 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 8588 * overly large threshold for large storage devices. Currently this must 8589 * be less than 2GB. This default is 500MB. 8590 * 8591 * @hide 8592 */ 8593 public static final String 8594 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 8595 8596 /** 8597 * Minimum bytes of free storage on the device before the data partition 8598 * is considered full. By default, 1 MB is reserved to avoid system-wide 8599 * SQLite disk full exceptions. 8600 * 8601 * @hide 8602 */ 8603 public static final String 8604 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 8605 8606 /** 8607 * Minimum percentage of storage on the device that is reserved for 8608 * cached data. 8609 * 8610 * @hide 8611 */ 8612 public static final String 8613 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; 8614 8615 /** 8616 * Maximum bytes of storage on the device that is reserved for cached 8617 * data. 8618 * 8619 * @hide 8620 */ 8621 public static final String 8622 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; 8623 8624 /** 8625 * The maximum reconnect delay for short network outages or when the 8626 * network is suspended due to phone use. 8627 * 8628 * @hide 8629 */ 8630 public static final String 8631 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 8632 8633 /** 8634 * The number of milliseconds to delay before sending out 8635 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. 8636 * 8637 * @hide 8638 */ 8639 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 8640 8641 8642 /** 8643 * Network sampling interval, in seconds. We'll generate link information 8644 * about bytes/packets sent and error rates based on data sampled in this interval 8645 * 8646 * @hide 8647 */ 8648 8649 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 8650 "connectivity_sampling_interval_in_seconds"; 8651 8652 /** 8653 * The series of successively longer delays used in retrying to download PAC file. 8654 * Last delay is used between successful PAC downloads. 8655 * 8656 * @hide 8657 */ 8658 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 8659 8660 /** 8661 * Don't attempt to detect captive portals. 8662 * 8663 * @hide 8664 */ 8665 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; 8666 8667 /** 8668 * When detecting a captive portal, display a notification that 8669 * prompts the user to sign in. 8670 * 8671 * @hide 8672 */ 8673 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; 8674 8675 /** 8676 * When detecting a captive portal, immediately disconnect from the 8677 * network and do not reconnect to that network in the future. 8678 * 8679 * @hide 8680 */ 8681 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; 8682 8683 /** 8684 * What to do when connecting a network that presents a captive portal. 8685 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. 8686 * 8687 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. 8688 * @hide 8689 */ 8690 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; 8691 8692 /** 8693 * Setting to turn off captive portal detection. Feature is enabled by 8694 * default and the setting needs to be set to 0 to disable it. 8695 * 8696 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection 8697 * @hide 8698 */ 8699 @Deprecated 8700 public static final String 8701 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 8702 8703 /** 8704 * The server used for captive portal detection upon a new conection. A 8705 * 204 response code from the server is used for validation. 8706 * TODO: remove this deprecated symbol. 8707 * 8708 * @hide 8709 */ 8710 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 8711 8712 /** 8713 * The URL used for HTTPS captive portal detection upon a new connection. 8714 * A 204 response code from the server is used for validation. 8715 * 8716 * @hide 8717 */ 8718 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; 8719 8720 /** 8721 * The URL used for HTTP captive portal detection upon a new connection. 8722 * A 204 response code from the server is used for validation. 8723 * 8724 * @hide 8725 */ 8726 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; 8727 8728 /** 8729 * The URL used for fallback HTTP captive portal detection when previous HTTP 8730 * and HTTPS captive portal detection attemps did not return a conclusive answer. 8731 * 8732 * @hide 8733 */ 8734 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; 8735 8736 /** 8737 * Whether to use HTTPS for network validation. This is enabled by default and the setting 8738 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals 8739 * don't actually use HTTPS, but it's consistent with the other settings. 8740 * 8741 * @hide 8742 */ 8743 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; 8744 8745 /** 8746 * Which User-Agent string to use in the header of the captive portal detection probes. 8747 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). 8748 * 8749 * @hide 8750 */ 8751 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; 8752 8753 /** 8754 * Whether network service discovery is enabled. 8755 * 8756 * @hide 8757 */ 8758 public static final String NSD_ON = "nsd_on"; 8759 8760 /** 8761 * Let user pick default install location. 8762 * 8763 * @hide 8764 */ 8765 public static final String SET_INSTALL_LOCATION = "set_install_location"; 8766 8767 /** 8768 * Default install location value. 8769 * 0 = auto, let system decide 8770 * 1 = internal 8771 * 2 = sdcard 8772 * @hide 8773 */ 8774 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 8775 8776 /** 8777 * ms during which to consume extra events related to Inet connection 8778 * condition after a transtion to fully-connected 8779 * 8780 * @hide 8781 */ 8782 public static final String 8783 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 8784 8785 /** 8786 * ms during which to consume extra events related to Inet connection 8787 * condtion after a transtion to partly-connected 8788 * 8789 * @hide 8790 */ 8791 public static final String 8792 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 8793 8794 /** {@hide} */ 8795 public static final String 8796 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 8797 8798 /** 8799 * Host name and port for global http proxy. Uses ':' seperator for 8800 * between host and port. 8801 */ 8802 public static final String HTTP_PROXY = "http_proxy"; 8803 8804 /** 8805 * Host name for global http proxy. Set via ConnectivityManager. 8806 * 8807 * @hide 8808 */ 8809 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 8810 8811 /** 8812 * Integer host port for global http proxy. Set via ConnectivityManager. 8813 * 8814 * @hide 8815 */ 8816 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 8817 8818 /** 8819 * Exclusion list for global proxy. This string contains a list of 8820 * comma-separated domains where the global proxy does not apply. 8821 * Domains should be listed in a comma- separated list. Example of 8822 * acceptable formats: ".domain1.com,my.domain2.com" Use 8823 * ConnectivityManager to set/get. 8824 * 8825 * @hide 8826 */ 8827 public static final String 8828 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 8829 8830 /** 8831 * The location PAC File for the proxy. 8832 * @hide 8833 */ 8834 public static final String 8835 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 8836 8837 /** 8838 * Enables the UI setting to allow the user to specify the global HTTP 8839 * proxy and associated exclusion list. 8840 * 8841 * @hide 8842 */ 8843 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 8844 8845 /** 8846 * Setting for default DNS in case nobody suggests one 8847 * 8848 * @hide 8849 */ 8850 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 8851 8852 /** {@hide} */ 8853 public static final String 8854 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 8855 /** {@hide} */ 8856 public static final String 8857 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 8858 /** {@hide} */ 8859 public static final String 8860 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; 8861 /** {@hide} */ 8862 public static final String 8863 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 8864 /** {@hide} */ 8865 public static final String 8866 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 8867 /** {@hide} */ 8868 public static final String 8869 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; 8870 /** {@hide} */ 8871 public static final String 8872 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; 8873 /** {@hide} */ 8874 public static final String 8875 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; 8876 /** {@hide} */ 8877 public static final String 8878 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; 8879 8880 /** 8881 * Activity manager specific settings. 8882 * This is encoded as a key=value list, separated by commas. Ex: 8883 * 8884 * "enforce_bg_check=true,max_cached_processes=24" 8885 * 8886 * The following keys are supported: 8887 * 8888 * <pre> 8889 * enforce_bg_check (boolean) 8890 * max_cached_processes (int) 8891 * </pre> 8892 * 8893 * <p> 8894 * Type: string 8895 * @hide 8896 * @see com.android.server.am.ActivityManagerConstants 8897 */ 8898 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; 8899 8900 /** 8901 * Device Idle (Doze) specific settings. 8902 * This is encoded as a key=value list, separated by commas. Ex: 8903 * 8904 * "inactive_to=60000,sensing_to=400000" 8905 * 8906 * The following keys are supported: 8907 * 8908 * <pre> 8909 * inactive_to (long) 8910 * sensing_to (long) 8911 * motion_inactive_to (long) 8912 * idle_after_inactive_to (long) 8913 * idle_pending_to (long) 8914 * max_idle_pending_to (long) 8915 * idle_pending_factor (float) 8916 * idle_to (long) 8917 * max_idle_to (long) 8918 * idle_factor (float) 8919 * min_time_to_alarm (long) 8920 * max_temp_app_whitelist_duration (long) 8921 * notification_whitelist_duration (long) 8922 * </pre> 8923 * 8924 * <p> 8925 * Type: string 8926 * @hide 8927 * @see com.android.server.DeviceIdleController.Constants 8928 */ 8929 public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants"; 8930 8931 /** 8932 * Device Idle (Doze) specific settings for watches. See {@code #DEVICE_IDLE_CONSTANTS} 8933 * 8934 * <p> 8935 * Type: string 8936 * @hide 8937 * @see com.android.server.DeviceIdleController.Constants 8938 */ 8939 public static final String DEVICE_IDLE_CONSTANTS_WATCH = "device_idle_constants_watch"; 8940 8941 /** 8942 * App standby (app idle) specific settings. 8943 * This is encoded as a key=value list, separated by commas. Ex: 8944 * 8945 * "idle_duration=5000,parole_interval=4500" 8946 * 8947 * The following keys are supported: 8948 * 8949 * <pre> 8950 * idle_duration2 (long) 8951 * wallclock_threshold (long) 8952 * parole_interval (long) 8953 * parole_duration (long) 8954 * 8955 * idle_duration (long) // This is deprecated and used to circumvent b/26355386. 8956 * </pre> 8957 * 8958 * <p> 8959 * Type: string 8960 * @hide 8961 * @see com.android.server.usage.UsageStatsService.SettingsObserver 8962 */ 8963 public static final String APP_IDLE_CONSTANTS = "app_idle_constants"; 8964 8965 /** 8966 * Power manager specific settings. 8967 * This is encoded as a key=value list, separated by commas. Ex: 8968 * 8969 * "no_cached_wake_locks=1" 8970 * 8971 * The following keys are supported: 8972 * 8973 * <pre> 8974 * no_cached_wake_locks (boolean) 8975 * </pre> 8976 * 8977 * <p> 8978 * Type: string 8979 * @hide 8980 * @see com.android.server.power.PowerManagerConstants 8981 */ 8982 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; 8983 8984 /** 8985 * Alarm manager specific settings. 8986 * This is encoded as a key=value list, separated by commas. Ex: 8987 * 8988 * "min_futurity=5000,allow_while_idle_short_time=4500" 8989 * 8990 * The following keys are supported: 8991 * 8992 * <pre> 8993 * min_futurity (long) 8994 * min_interval (long) 8995 * allow_while_idle_short_time (long) 8996 * allow_while_idle_long_time (long) 8997 * allow_while_idle_whitelist_duration (long) 8998 * </pre> 8999 * 9000 * <p> 9001 * Type: string 9002 * @hide 9003 * @see com.android.server.AlarmManagerService.Constants 9004 */ 9005 public static final String ALARM_MANAGER_CONSTANTS = "alarm_manager_constants"; 9006 9007 /** 9008 * Job scheduler specific settings. 9009 * This is encoded as a key=value list, separated by commas. Ex: 9010 * 9011 * "min_ready_jobs_count=2,moderate_use_factor=.5" 9012 * 9013 * The following keys are supported: 9014 * 9015 * <pre> 9016 * min_idle_count (int) 9017 * min_charging_count (int) 9018 * min_connectivity_count (int) 9019 * min_content_count (int) 9020 * min_ready_jobs_count (int) 9021 * heavy_use_factor (float) 9022 * moderate_use_factor (float) 9023 * fg_job_count (int) 9024 * bg_normal_job_count (int) 9025 * bg_moderate_job_count (int) 9026 * bg_low_job_count (int) 9027 * bg_critical_job_count (int) 9028 * </pre> 9029 * 9030 * <p> 9031 * Type: string 9032 * @hide 9033 * @see com.android.server.job.JobSchedulerService.Constants 9034 */ 9035 public static final String JOB_SCHEDULER_CONSTANTS = "job_scheduler_constants"; 9036 9037 /** 9038 * ShortcutManager specific settings. 9039 * This is encoded as a key=value list, separated by commas. Ex: 9040 * 9041 * "reset_interval_sec=86400,max_updates_per_interval=1" 9042 * 9043 * The following keys are supported: 9044 * 9045 * <pre> 9046 * reset_interval_sec (long) 9047 * max_updates_per_interval (int) 9048 * max_icon_dimension_dp (int, DP) 9049 * max_icon_dimension_dp_lowram (int, DP) 9050 * max_shortcuts (int) 9051 * icon_quality (int, 0-100) 9052 * icon_format (String) 9053 * </pre> 9054 * 9055 * <p> 9056 * Type: string 9057 * @hide 9058 * @see com.android.server.pm.ShortcutService.ConfigConstants 9059 */ 9060 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; 9061 9062 /** 9063 * Get the key that retrieves a bluetooth headset's priority. 9064 * @hide 9065 */ 9066 public static final String getBluetoothHeadsetPriorityKey(String address) { 9067 return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9068 } 9069 9070 /** 9071 * Get the key that retrieves a bluetooth a2dp sink's priority. 9072 * @hide 9073 */ 9074 public static final String getBluetoothA2dpSinkPriorityKey(String address) { 9075 return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9076 } 9077 9078 /** 9079 * Get the key that retrieves a bluetooth a2dp src's priority. 9080 * @hide 9081 */ 9082 public static final String getBluetoothA2dpSrcPriorityKey(String address) { 9083 return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9084 } 9085 9086 /** 9087 * Get the key that retrieves a bluetooth Input Device's priority. 9088 * @hide 9089 */ 9090 public static final String getBluetoothInputDevicePriorityKey(String address) { 9091 return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9092 } 9093 9094 /** 9095 * Get the key that retrieves a bluetooth pan client priority. 9096 * @hide 9097 */ 9098 public static final String getBluetoothPanPriorityKey(String address) { 9099 return BLUETOOTH_PAN_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9100 } 9101 9102 /** 9103 * Get the key that retrieves a bluetooth map priority. 9104 * @hide 9105 */ 9106 public static final String getBluetoothMapPriorityKey(String address) { 9107 return BLUETOOTH_MAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9108 } 9109 9110 /** 9111 * Get the key that retrieves a bluetooth map client priority. 9112 * @hide 9113 */ 9114 public static final String getBluetoothMapClientPriorityKey(String address) { 9115 return BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9116 } 9117 9118 /** 9119 * Get the key that retrieves a bluetooth pbap client priority. 9120 * @hide 9121 */ 9122 public static final String getBluetoothPbapClientPriorityKey(String address) { 9123 return BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9124 } 9125 9126 /** 9127 * Get the key that retrieves a bluetooth sap priority. 9128 * @hide 9129 */ 9130 public static final String getBluetoothSapPriorityKey(String address) { 9131 return BLUETOOTH_SAP_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); 9132 } 9133 9134 /** 9135 * Scaling factor for normal window animations. Setting to 0 will 9136 * disable window animations. 9137 */ 9138 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 9139 9140 /** 9141 * Scaling factor for activity transition animations. Setting to 0 will 9142 * disable window animations. 9143 */ 9144 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 9145 9146 /** 9147 * Scaling factor for Animator-based animations. This affects both the 9148 * start delay and duration of all such animations. Setting to 0 will 9149 * cause animations to end immediately. The default value is 1. 9150 */ 9151 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 9152 9153 /** 9154 * Scaling factor for normal window animations. Setting to 0 will 9155 * disable window animations. 9156 * 9157 * @hide 9158 */ 9159 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 9160 9161 /** 9162 * If 0, the compatibility mode is off for all applications. 9163 * If 1, older applications run under compatibility mode. 9164 * TODO: remove this settings before code freeze (bug/1907571) 9165 * @hide 9166 */ 9167 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 9168 9169 /** 9170 * CDMA only settings 9171 * Emergency Tone 0 = Off 9172 * 1 = Alert 9173 * 2 = Vibrate 9174 * @hide 9175 */ 9176 public static final String EMERGENCY_TONE = "emergency_tone"; 9177 9178 /** 9179 * CDMA only settings 9180 * Whether the auto retry is enabled. The value is 9181 * boolean (1 or 0). 9182 * @hide 9183 */ 9184 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 9185 9186 /** 9187 * A setting that can be read whether the emergency affordance is currently needed. 9188 * The value is a boolean (1 or 0). 9189 * @hide 9190 */ 9191 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; 9192 9193 /** 9194 * See RIL_PreferredNetworkType in ril.h 9195 * @hide 9196 */ 9197 public static final String PREFERRED_NETWORK_MODE = 9198 "preferred_network_mode"; 9199 9200 /** 9201 * Name of an application package to be debugged. 9202 */ 9203 public static final String DEBUG_APP = "debug_app"; 9204 9205 /** 9206 * If 1, when launching DEBUG_APP it will wait for the debugger before 9207 * starting user code. If 0, it will run normally. 9208 */ 9209 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 9210 9211 /** 9212 * Control whether the process CPU usage meter should be shown. 9213 * 9214 * @deprecated This functionality is no longer available as of 9215 * {@link android.os.Build.VERSION_CODES#N_MR1}. 9216 */ 9217 @Deprecated 9218 public static final String SHOW_PROCESSES = "show_processes"; 9219 9220 /** 9221 * If 1 low power mode is enabled. 9222 * @hide 9223 */ 9224 public static final String LOW_POWER_MODE = "low_power"; 9225 9226 /** 9227 * Battery level [1-99] at which low power mode automatically turns on. 9228 * If 0, it will not automatically turn on. 9229 * @hide 9230 */ 9231 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 9232 9233 /** 9234 * If not 0, the activity manager will aggressively finish activities and 9235 * processes as soon as they are no longer needed. If 0, the normal 9236 * extended lifetime is used. 9237 */ 9238 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; 9239 9240 /** 9241 * Use Dock audio output for media: 9242 * 0 = disabled 9243 * 1 = enabled 9244 * @hide 9245 */ 9246 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 9247 9248 /** 9249 * The surround sound formats AC3, DTS or IEC61937 are 9250 * available for use if they are detected. 9251 * This is the default mode. 9252 * 9253 * Note that AUTO is equivalent to ALWAYS for Android TVs and other 9254 * devices that have an S/PDIF output. This is because S/PDIF 9255 * is unidirectional and the TV cannot know if a decoder is 9256 * connected. So it assumes they are always available. 9257 * @hide 9258 */ 9259 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; 9260 9261 /** 9262 * AC3, DTS or IEC61937 are NEVER available, even if they 9263 * are detected by the hardware. Those formats will not be 9264 * reported. 9265 * 9266 * An example use case would be an AVR reports that it is capable of 9267 * surround sound decoding but is broken. If NEVER is chosen 9268 * then apps must use PCM output instead of encoded output. 9269 * @hide 9270 */ 9271 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; 9272 9273 /** 9274 * AC3, DTS or IEC61937 are ALWAYS available, even if they 9275 * are not detected by the hardware. Those formats will be 9276 * reported as part of the HDMI output capability. Applications 9277 * are then free to use either PCM or encoded output. 9278 * 9279 * An example use case would be a when TV was connected over 9280 * TOS-link to an AVR. But the TV could not see it because TOS-link 9281 * is unidirectional. 9282 * @hide 9283 */ 9284 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; 9285 9286 /** 9287 * Set to ENCODED_SURROUND_OUTPUT_AUTO, 9288 * ENCODED_SURROUND_OUTPUT_NEVER or 9289 * ENCODED_SURROUND_OUTPUT_ALWAYS 9290 * @hide 9291 */ 9292 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; 9293 9294 /** 9295 * Persisted safe headphone volume management state by AudioService 9296 * @hide 9297 */ 9298 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 9299 9300 /** 9301 * URL for tzinfo (time zone) updates 9302 * @hide 9303 */ 9304 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 9305 9306 /** 9307 * URL for tzinfo (time zone) update metadata 9308 * @hide 9309 */ 9310 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 9311 9312 /** 9313 * URL for selinux (mandatory access control) updates 9314 * @hide 9315 */ 9316 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 9317 9318 /** 9319 * URL for selinux (mandatory access control) update metadata 9320 * @hide 9321 */ 9322 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 9323 9324 /** 9325 * URL for sms short code updates 9326 * @hide 9327 */ 9328 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 9329 "sms_short_codes_content_url"; 9330 9331 /** 9332 * URL for sms short code update metadata 9333 * @hide 9334 */ 9335 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 9336 "sms_short_codes_metadata_url"; 9337 9338 /** 9339 * URL for apn_db updates 9340 * @hide 9341 */ 9342 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; 9343 9344 /** 9345 * URL for apn_db update metadata 9346 * @hide 9347 */ 9348 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; 9349 9350 /** 9351 * URL for cert pinlist updates 9352 * @hide 9353 */ 9354 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 9355 9356 /** 9357 * URL for cert pinlist updates 9358 * @hide 9359 */ 9360 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 9361 9362 /** 9363 * URL for intent firewall updates 9364 * @hide 9365 */ 9366 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 9367 "intent_firewall_content_url"; 9368 9369 /** 9370 * URL for intent firewall update metadata 9371 * @hide 9372 */ 9373 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 9374 "intent_firewall_metadata_url"; 9375 9376 /** 9377 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 9378 * @hide 9379 */ 9380 public static final String SELINUX_STATUS = "selinux_status"; 9381 9382 /** 9383 * Developer setting to force RTL layout. 9384 * @hide 9385 */ 9386 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 9387 9388 /** 9389 * Milliseconds after screen-off after which low battery sounds will be silenced. 9390 * 9391 * If zero, battery sounds will always play. 9392 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 9393 * 9394 * @hide 9395 */ 9396 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 9397 9398 /** 9399 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 9400 * the caller is done with this, they should call {@link ContentResolver#delete} to 9401 * clean up any value that they may have written. 9402 * 9403 * @hide 9404 */ 9405 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 9406 9407 /** 9408 * Defines global runtime overrides to window policy. 9409 * 9410 * See {@link com.android.server.policy.PolicyControl} for value format. 9411 * 9412 * @hide 9413 */ 9414 public static final String POLICY_CONTROL = "policy_control"; 9415 9416 /** 9417 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 9418 * or ZEN_MODE_NO_INTERRUPTIONS. 9419 * 9420 * @hide 9421 */ 9422 public static final String ZEN_MODE = "zen_mode"; 9423 9424 /** @hide */ public static final int ZEN_MODE_OFF = 0; 9425 /** @hide */ public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 9426 /** @hide */ public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 9427 /** @hide */ public static final int ZEN_MODE_ALARMS = 3; 9428 9429 /** @hide */ public static String zenModeToString(int mode) { 9430 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 9431 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; 9432 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 9433 return "ZEN_MODE_OFF"; 9434 } 9435 9436 /** @hide */ public static boolean isValidZenMode(int value) { 9437 switch (value) { 9438 case Global.ZEN_MODE_OFF: 9439 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: 9440 case Global.ZEN_MODE_ALARMS: 9441 case Global.ZEN_MODE_NO_INTERRUPTIONS: 9442 return true; 9443 default: 9444 return false; 9445 } 9446 } 9447 9448 /** 9449 * Value of the ringer before entering zen mode. 9450 * 9451 * @hide 9452 */ 9453 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; 9454 9455 /** 9456 * Opaque value, changes when persisted zen mode configuration changes. 9457 * 9458 * @hide 9459 */ 9460 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 9461 9462 /** 9463 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 9464 * 9465 * @hide 9466 */ 9467 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 9468 "heads_up_notifications_enabled"; 9469 9470 /** @hide */ public static final int HEADS_UP_OFF = 0; 9471 /** @hide */ public static final int HEADS_UP_ON = 1; 9472 9473 /** 9474 * The name of the device 9475 */ 9476 public static final String DEVICE_NAME = "device_name"; 9477 9478 /** 9479 * Whether the NetworkScoringService has been first initialized. 9480 * <p> 9481 * Type: int (0 for false, 1 for true) 9482 * @hide 9483 */ 9484 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; 9485 9486 /** 9487 * Whether the user wants to be prompted for password to decrypt the device on boot. 9488 * This only matters if the storage is encrypted. 9489 * <p> 9490 * Type: int (0 for false, 1 for true) 9491 * @hide 9492 */ 9493 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; 9494 9495 /** 9496 * Whether the Volte is enabled 9497 * <p> 9498 * Type: int (0 for false, 1 for true) 9499 * @hide 9500 */ 9501 public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled"; 9502 9503 /** 9504 * Whether VT (Video Telephony over IMS) is enabled 9505 * <p> 9506 * Type: int (0 for false, 1 for true) 9507 * 9508 * @hide 9509 */ 9510 public static final String VT_IMS_ENABLED = "vt_ims_enabled"; 9511 9512 /** 9513 * Whether WFC is enabled 9514 * <p> 9515 * Type: int (0 for false, 1 for true) 9516 * 9517 * @hide 9518 */ 9519 public static final String WFC_IMS_ENABLED = "wfc_ims_enabled"; 9520 9521 /** 9522 * WFC mode on home/non-roaming network. 9523 * <p> 9524 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only 9525 * 9526 * @hide 9527 */ 9528 public static final String WFC_IMS_MODE = "wfc_ims_mode"; 9529 9530 /** 9531 * WFC mode on roaming network. 9532 * <p> 9533 * Type: int - see {@link #WFC_IMS_MODE} for values 9534 * 9535 * @hide 9536 */ 9537 public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode"; 9538 9539 /** 9540 * Whether WFC roaming is enabled 9541 * <p> 9542 * Type: int (0 for false, 1 for true) 9543 * 9544 * @hide 9545 */ 9546 public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; 9547 9548 /** 9549 * Whether user can enable/disable LTE as a preferred network. A carrier might control 9550 * this via gservices, OMA-DM, carrier app, etc. 9551 * <p> 9552 * Type: int (0 for false, 1 for true) 9553 * @hide 9554 */ 9555 public static final String LTE_SERVICE_FORCED = "lte_service_forced"; 9556 9557 /** 9558 * Ephemeral app cookie max size in bytes. 9559 * <p> 9560 * Type: int 9561 * @hide 9562 */ 9563 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 9564 "ephemeral_cookie_max_size_bytes"; 9565 9566 /** 9567 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is 9568 * enabled. Set to zero to disable. 9569 * <p> 9570 * Type: int (0 for false, 1 for true) 9571 * 9572 * @hide 9573 */ 9574 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; 9575 9576 /** 9577 * The duration for caching uninstalled instant apps. 9578 * <p> 9579 * Type: long 9580 * @hide 9581 */ 9582 public static final String UNINSTALLED_INSTANT_APP_CACHE_DURATION_MILLIS = 9583 "uninstalled_instant_app_cache_duration_millis"; 9584 9585 /** 9586 * Allows switching users when system user is locked. 9587 * <p> 9588 * Type: int 9589 * @hide 9590 */ 9591 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = 9592 "allow_user_switching_when_system_user_locked"; 9593 9594 /** 9595 * Boot count since the device starts running APK level 24. 9596 * <p> 9597 * Type: int 9598 */ 9599 public static final String BOOT_COUNT = "boot_count"; 9600 9601 /** 9602 * Whether the safe boot is disallowed. 9603 * 9604 * <p>This setting should have the identical value as the corresponding user restriction. 9605 * The purpose of the setting is to make the restriction available in early boot stages 9606 * before the user restrictions are loaded. 9607 * @hide 9608 */ 9609 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; 9610 9611 /** 9612 * Whether this device is currently in retail demo mode. If true, device 9613 * usage is severely limited. 9614 * <p> 9615 * Type: int (0 for false, 1 for true) 9616 * @hide 9617 */ 9618 public static final String DEVICE_DEMO_MODE = "device_demo_mode"; 9619 9620 /** 9621 * Retail mode specific settings. This is encoded as a key=value list, separated by commas. 9622 * Ex: "user_inactivity_timeout_ms=30000,warning_dialog_timeout_ms=10000". The following 9623 * keys are supported: 9624 * 9625 * <pre> 9626 * user_inactivity_timeout_ms (long) 9627 * warning_dialog_timeout_ms (long) 9628 * </pre> 9629 * <p> 9630 * Type: string 9631 * 9632 * @hide 9633 */ 9634 public static final String RETAIL_DEMO_MODE_CONSTANTS = "retail_demo_mode_constants"; 9635 9636 /** 9637 * The reason for the settings database being downgraded. This is only for 9638 * troubleshooting purposes and its value should not be interpreted in any way. 9639 * 9640 * Type: string 9641 * 9642 * @hide 9643 */ 9644 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; 9645 9646 /** 9647 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by 9648 * default. Set to 0 to disable. 9649 * 9650 * @hide 9651 */ 9652 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; 9653 9654 /** 9655 * Flag to enable the link to location permissions in location setting. Set to 0 to disable. 9656 * 9657 * @hide 9658 */ 9659 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = 9660 "location_settings_link_to_permissions_enabled"; 9661 9662 /** 9663 * Settings to backup. This is here so that it's in the same place as the settings 9664 * keys and easy to update. 9665 * 9666 * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System 9667 * and Secure as well. This is because those tables drive both backup and 9668 * restore, and restore needs to properly whitelist keys that used to live 9669 * in those namespaces. The keys will only actually be backed up / restored 9670 * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP). 9671 * 9672 * NOTE: Settings are backed up and restored in the order they appear 9673 * in this array. If you have one setting depending on another, 9674 * make sure that they are ordered appropriately. 9675 * 9676 * @hide 9677 */ 9678 public static final String[] SETTINGS_TO_BACKUP = { 9679 BUGREPORT_IN_POWER_MENU, 9680 STAY_ON_WHILE_PLUGGED_IN, 9681 AUTO_TIME, 9682 AUTO_TIME_ZONE, 9683 POWER_SOUNDS_ENABLED, 9684 DOCK_SOUNDS_ENABLED, 9685 CHARGING_SOUNDS_ENABLED, 9686 USB_MASS_STORAGE_ENABLED, 9687 NETWORK_RECOMMENDATIONS_ENABLED, 9688 CURATE_SAVED_OPEN_NETWORKS, 9689 WIFI_WAKEUP_ENABLED, 9690 WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 9691 USE_OPEN_WIFI_PACKAGE, 9692 WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED, 9693 EMERGENCY_TONE, 9694 CALL_AUTO_RETRY, 9695 DOCK_AUDIO_MEDIA_ENABLED, 9696 ENCODED_SURROUND_OUTPUT, 9697 LOW_POWER_MODE_TRIGGER_LEVEL 9698 }; 9699 9700 private static final ContentProviderHolder sProviderHolder = 9701 new ContentProviderHolder(CONTENT_URI); 9702 9703 // Populated lazily, guarded by class object: 9704 private static final NameValueCache sNameValueCache = new NameValueCache( 9705 CONTENT_URI, 9706 CALL_METHOD_GET_GLOBAL, 9707 CALL_METHOD_PUT_GLOBAL, 9708 sProviderHolder); 9709 9710 // Certain settings have been moved from global to the per-user secure namespace 9711 private static final HashSet<String> MOVED_TO_SECURE; 9712 static { 9713 MOVED_TO_SECURE = new HashSet<>(1); 9714 MOVED_TO_SECURE.add(Settings.Global.INSTALL_NON_MARKET_APPS); 9715 } 9716 9717 /** @hide */ 9718 public static void getMovedToSecureSettings(Set<String> outKeySet) { 9719 outKeySet.addAll(MOVED_TO_SECURE); 9720 } 9721 9722 /** 9723 * Look up a name in the database. 9724 * @param resolver to access the database with 9725 * @param name to look up in the table 9726 * @return the corresponding value, or null if not present 9727 */ 9728 public static String getString(ContentResolver resolver, String name) { 9729 return getStringForUser(resolver, name, UserHandle.myUserId()); 9730 } 9731 9732 /** @hide */ 9733 public static String getStringForUser(ContentResolver resolver, String name, 9734 int userHandle) { 9735 if (MOVED_TO_SECURE.contains(name)) { 9736 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 9737 + " to android.provider.Settings.Secure, returning read-only value."); 9738 return Secure.getStringForUser(resolver, name, userHandle); 9739 } 9740 return sNameValueCache.getStringForUser(resolver, name, userHandle); 9741 } 9742 9743 /** 9744 * Store a name/value pair into the database. 9745 * @param resolver to access the database with 9746 * @param name to store 9747 * @param value to associate with the name 9748 * @return true if the value was set, false on database errors 9749 */ 9750 public static boolean putString(ContentResolver resolver, 9751 String name, String value) { 9752 return putStringForUser(resolver, name, value, null, false, UserHandle.myUserId()); 9753 } 9754 9755 /** 9756 * Store a name/value pair into the database. 9757 * <p> 9758 * The method takes an optional tag to associate with the setting 9759 * which can be used to clear only settings made by your package and 9760 * associated with this tag by passing the tag to {@link 9761 * #resetToDefaults(ContentResolver, String)}. Anyone can override 9762 * the current tag. Also if another package changes the setting 9763 * then the tag will be set to the one specified in the set call 9764 * which can be null. Also any of the settings setters that do not 9765 * take a tag as an argument effectively clears the tag. 9766 * </p><p> 9767 * For example, if you set settings A and B with tags T1 and T2 and 9768 * another app changes setting A (potentially to the same value), it 9769 * can assign to it a tag T3 (note that now the package that changed 9770 * the setting is not yours). Now if you reset your changes for T1 and 9771 * T2 only setting B will be reset and A not (as it was changed by 9772 * another package) but since A did not change you are in the desired 9773 * initial state. Now if the other app changes the value of A (assuming 9774 * you registered an observer in the beginning) you would detect that 9775 * the setting was changed by another app and handle this appropriately 9776 * (ignore, set back to some value, etc). 9777 * </p><p> 9778 * Also the method takes an argument whether to make the value the 9779 * default for this setting. If the system already specified a default 9780 * value, then the one passed in here will <strong>not</strong> 9781 * be set as the default. 9782 * </p> 9783 * 9784 * @param resolver to access the database with. 9785 * @param name to store. 9786 * @param value to associate with the name. 9787 * @param tag to associated with the setting. 9788 * @param makeDefault whether to make the value the default one. 9789 * @return true if the value was set, false on database errors. 9790 * 9791 * @see #resetToDefaults(ContentResolver, String) 9792 * 9793 * @hide 9794 */ 9795 @SystemApi 9796 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 9797 public static boolean putString(@NonNull ContentResolver resolver, 9798 @NonNull String name, @Nullable String value, @Nullable String tag, 9799 boolean makeDefault) { 9800 return putStringForUser(resolver, name, value, tag, makeDefault, 9801 UserHandle.myUserId()); 9802 } 9803 9804 /** 9805 * Reset the settings to their defaults. This would reset <strong>only</strong> 9806 * settings set by the caller's package. Think of it of a way to undo your own 9807 * changes to the secure settings. Passing in the optional tag will reset only 9808 * settings changed by your package and associated with this tag. 9809 * 9810 * @param resolver Handle to the content resolver. 9811 * @param tag Optional tag which should be associated with the settings to reset. 9812 * 9813 * @see #putString(ContentResolver, String, String, String, boolean) 9814 * 9815 * @hide 9816 */ 9817 @SystemApi 9818 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 9819 public static void resetToDefaults(@NonNull ContentResolver resolver, 9820 @Nullable String tag) { 9821 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 9822 UserHandle.myUserId()); 9823 } 9824 9825 /** 9826 * Reset the settings to their defaults for a given user with a specific mode. The 9827 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 9828 * allowing resetting the settings made by a package and associated with the tag. 9829 * 9830 * @param resolver Handle to the content resolver. 9831 * @param tag Optional tag which should be associated with the settings to reset. 9832 * @param mode The reset mode. 9833 * @param userHandle The user for which to reset to defaults. 9834 * 9835 * @see #RESET_MODE_PACKAGE_DEFAULTS 9836 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 9837 * @see #RESET_MODE_UNTRUSTED_CHANGES 9838 * @see #RESET_MODE_TRUSTED_DEFAULTS 9839 * 9840 * @hide 9841 */ 9842 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 9843 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 9844 try { 9845 Bundle arg = new Bundle(); 9846 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 9847 if (tag != null) { 9848 arg.putString(CALL_METHOD_TAG_KEY, tag); 9849 } 9850 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 9851 IContentProvider cp = sProviderHolder.getProvider(resolver); 9852 cp.call(resolver.getPackageName(), CALL_METHOD_RESET_GLOBAL, null, arg); 9853 } catch (RemoteException e) { 9854 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 9855 } 9856 } 9857 9858 /** @hide */ 9859 public static boolean putStringForUser(ContentResolver resolver, 9860 String name, String value, int userHandle) { 9861 return putStringForUser(resolver, name, value, null, false, userHandle); 9862 } 9863 9864 /** @hide */ 9865 public static boolean putStringForUser(@NonNull ContentResolver resolver, 9866 @NonNull String name, @Nullable String value, @Nullable String tag, 9867 boolean makeDefault, @UserIdInt int userHandle) { 9868 if (LOCAL_LOGV) { 9869 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 9870 + " for " + userHandle); 9871 } 9872 // Global and Secure have the same access policy so we can forward writes 9873 if (MOVED_TO_SECURE.contains(name)) { 9874 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 9875 + " to android.provider.Settings.Secure, value is unchanged."); 9876 return Secure.putStringForUser(resolver, name, value, tag, 9877 makeDefault, userHandle); 9878 } 9879 return sNameValueCache.putStringForUser(resolver, name, value, tag, 9880 makeDefault, userHandle); 9881 } 9882 9883 /** 9884 * Construct the content URI for a particular name/value pair, 9885 * useful for monitoring changes with a ContentObserver. 9886 * @param name to look up in the table 9887 * @return the corresponding content URI, or null if not present 9888 */ 9889 public static Uri getUriFor(String name) { 9890 return getUriFor(CONTENT_URI, name); 9891 } 9892 9893 /** 9894 * Convenience function for retrieving a single secure settings value 9895 * as an integer. Note that internally setting values are always 9896 * stored as strings; this function converts the string to an integer 9897 * for you. The default value will be returned if the setting is 9898 * not defined or not an integer. 9899 * 9900 * @param cr The ContentResolver to access. 9901 * @param name The name of the setting to retrieve. 9902 * @param def Value to return if the setting is not defined. 9903 * 9904 * @return The setting's current value, or 'def' if it is not defined 9905 * or not a valid integer. 9906 */ 9907 public static int getInt(ContentResolver cr, String name, int def) { 9908 String v = getString(cr, name); 9909 try { 9910 return v != null ? Integer.parseInt(v) : def; 9911 } catch (NumberFormatException e) { 9912 return def; 9913 } 9914 } 9915 9916 /** 9917 * Convenience function for retrieving a single secure settings value 9918 * as an integer. Note that internally setting values are always 9919 * stored as strings; this function converts the string to an integer 9920 * for you. 9921 * <p> 9922 * This version does not take a default value. If the setting has not 9923 * been set, or the string value is not a number, 9924 * it throws {@link SettingNotFoundException}. 9925 * 9926 * @param cr The ContentResolver to access. 9927 * @param name The name of the setting to retrieve. 9928 * 9929 * @throws SettingNotFoundException Thrown if a setting by the given 9930 * name can't be found or the setting value is not an integer. 9931 * 9932 * @return The setting's current value. 9933 */ 9934 public static int getInt(ContentResolver cr, String name) 9935 throws SettingNotFoundException { 9936 String v = getString(cr, name); 9937 try { 9938 return Integer.parseInt(v); 9939 } catch (NumberFormatException e) { 9940 throw new SettingNotFoundException(name); 9941 } 9942 } 9943 9944 /** 9945 * Convenience function for updating a single settings value as an 9946 * integer. This will either create a new entry in the table if the 9947 * given name does not exist, or modify the value of the existing row 9948 * with that name. Note that internally setting values are always 9949 * stored as strings, so this function converts the given value to a 9950 * string before storing it. 9951 * 9952 * @param cr The ContentResolver to access. 9953 * @param name The name of the setting to modify. 9954 * @param value The new value for the setting. 9955 * @return true if the value was set, false on database errors 9956 */ 9957 public static boolean putInt(ContentResolver cr, String name, int value) { 9958 return putString(cr, name, Integer.toString(value)); 9959 } 9960 9961 /** 9962 * Convenience function for retrieving a single secure settings value 9963 * as a {@code long}. Note that internally setting values are always 9964 * stored as strings; this function converts the string to a {@code long} 9965 * for you. The default value will be returned if the setting is 9966 * not defined or not a {@code long}. 9967 * 9968 * @param cr The ContentResolver to access. 9969 * @param name The name of the setting to retrieve. 9970 * @param def Value to return if the setting is not defined. 9971 * 9972 * @return The setting's current value, or 'def' if it is not defined 9973 * or not a valid {@code long}. 9974 */ 9975 public static long getLong(ContentResolver cr, String name, long def) { 9976 String valString = getString(cr, name); 9977 long value; 9978 try { 9979 value = valString != null ? Long.parseLong(valString) : def; 9980 } catch (NumberFormatException e) { 9981 value = def; 9982 } 9983 return value; 9984 } 9985 9986 /** 9987 * Convenience function for retrieving a single secure settings value 9988 * as a {@code long}. Note that internally setting values are always 9989 * stored as strings; this function converts the string to a {@code long} 9990 * for you. 9991 * <p> 9992 * This version does not take a default value. If the setting has not 9993 * been set, or the string value is not a number, 9994 * it throws {@link SettingNotFoundException}. 9995 * 9996 * @param cr The ContentResolver to access. 9997 * @param name The name of the setting to retrieve. 9998 * 9999 * @return The setting's current value. 10000 * @throws SettingNotFoundException Thrown if a setting by the given 10001 * name can't be found or the setting value is not an integer. 10002 */ 10003 public static long getLong(ContentResolver cr, String name) 10004 throws SettingNotFoundException { 10005 String valString = getString(cr, name); 10006 try { 10007 return Long.parseLong(valString); 10008 } catch (NumberFormatException e) { 10009 throw new SettingNotFoundException(name); 10010 } 10011 } 10012 10013 /** 10014 * Convenience function for updating a secure settings value as a long 10015 * integer. This will either create a new entry in the table if the 10016 * given name does not exist, or modify the value of the existing row 10017 * with that name. Note that internally setting values are always 10018 * stored as strings, so this function converts the given value to a 10019 * string before storing it. 10020 * 10021 * @param cr The ContentResolver to access. 10022 * @param name The name of the setting to modify. 10023 * @param value The new value for the setting. 10024 * @return true if the value was set, false on database errors 10025 */ 10026 public static boolean putLong(ContentResolver cr, String name, long value) { 10027 return putString(cr, name, Long.toString(value)); 10028 } 10029 10030 /** 10031 * Convenience function for retrieving a single secure settings value 10032 * as a floating point number. Note that internally setting values are 10033 * always stored as strings; this function converts the string to an 10034 * float for you. The default value will be returned if the setting 10035 * is not defined or not a valid float. 10036 * 10037 * @param cr The ContentResolver to access. 10038 * @param name The name of the setting to retrieve. 10039 * @param def Value to return if the setting is not defined. 10040 * 10041 * @return The setting's current value, or 'def' if it is not defined 10042 * or not a valid float. 10043 */ 10044 public static float getFloat(ContentResolver cr, String name, float def) { 10045 String v = getString(cr, name); 10046 try { 10047 return v != null ? Float.parseFloat(v) : def; 10048 } catch (NumberFormatException e) { 10049 return def; 10050 } 10051 } 10052 10053 /** 10054 * Convenience function for retrieving a single secure settings value 10055 * as a float. Note that internally setting values are always 10056 * stored as strings; this function converts the string to a float 10057 * for you. 10058 * <p> 10059 * This version does not take a default value. If the setting has not 10060 * been set, or the string value is not a number, 10061 * it throws {@link SettingNotFoundException}. 10062 * 10063 * @param cr The ContentResolver to access. 10064 * @param name The name of the setting to retrieve. 10065 * 10066 * @throws SettingNotFoundException Thrown if a setting by the given 10067 * name can't be found or the setting value is not a float. 10068 * 10069 * @return The setting's current value. 10070 */ 10071 public static float getFloat(ContentResolver cr, String name) 10072 throws SettingNotFoundException { 10073 String v = getString(cr, name); 10074 if (v == null) { 10075 throw new SettingNotFoundException(name); 10076 } 10077 try { 10078 return Float.parseFloat(v); 10079 } catch (NumberFormatException e) { 10080 throw new SettingNotFoundException(name); 10081 } 10082 } 10083 10084 /** 10085 * Convenience function for updating a single settings value as a 10086 * floating point number. This will either create a new entry in the 10087 * table if the given name does not exist, or modify the value of the 10088 * existing row with that name. Note that internally setting values 10089 * are always stored as strings, so this function converts the given 10090 * value to a string before storing it. 10091 * 10092 * @param cr The ContentResolver to access. 10093 * @param name The name of the setting to modify. 10094 * @param value The new value for the setting. 10095 * @return true if the value was set, false on database errors 10096 */ 10097 public static boolean putFloat(ContentResolver cr, String name, float value) { 10098 return putString(cr, name, Float.toString(value)); 10099 } 10100 10101 /** 10102 * Subscription to be used for voice call on a multi sim device. The supported values 10103 * are 0 = SUB1, 1 = SUB2 and etc. 10104 * @hide 10105 */ 10106 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 10107 10108 /** 10109 * Used to provide option to user to select subscription during dial. 10110 * The supported values are 0 = disable or 1 = enable prompt. 10111 * @hide 10112 */ 10113 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 10114 10115 /** 10116 * Subscription to be used for data call on a multi sim device. The supported values 10117 * are 0 = SUB1, 1 = SUB2 and etc. 10118 * @hide 10119 */ 10120 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 10121 10122 /** 10123 * Subscription to be used for SMS on a multi sim device. The supported values 10124 * are 0 = SUB1, 1 = SUB2 and etc. 10125 * @hide 10126 */ 10127 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 10128 10129 /** 10130 * Used to provide option to user to select subscription during send SMS. 10131 * The value 1 - enable, 0 - disable 10132 * @hide 10133 */ 10134 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 10135 10136 10137 10138 /** User preferred subscriptions setting. 10139 * This holds the details of the user selected subscription from the card and 10140 * the activation status. Each settings string have the coma separated values 10141 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 10142 * @hide 10143 */ 10144 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 10145 "user_preferred_sub2","user_preferred_sub3"}; 10146 10147 /** 10148 * Whether to enable new contacts aggregator or not. 10149 * The value 1 - enable, 0 - disable 10150 * @hide 10151 */ 10152 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; 10153 10154 /** 10155 * Whether to enable contacts metadata syncing or not 10156 * The value 1 - enable, 0 - disable 10157 * 10158 * @removed 10159 */ 10160 @Deprecated 10161 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; 10162 10163 /** 10164 * Whether to enable contacts metadata syncing or not 10165 * The value 1 - enable, 0 - disable 10166 */ 10167 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; 10168 10169 /** 10170 * Whether to enable cellular on boot. 10171 * The value 1 - enable, 0 - disable 10172 * @hide 10173 */ 10174 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; 10175 10176 /** 10177 * The maximum allowed notification enqueue rate in Hertz. 10178 * 10179 * Should be a float, and includes both posts and updates. 10180 * @hide 10181 */ 10182 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; 10183 10184 /** 10185 * Whether cell is enabled/disabled 10186 * @hide 10187 */ 10188 public static final String CELL_ON = "cell_on"; 10189 10190 /** 10191 * Global settings which can be accessed by instant apps. 10192 * @hide 10193 */ 10194 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 10195 static { 10196 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); 10197 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); 10198 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); 10199 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); 10200 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); 10201 } 10202 10203 /** 10204 * Whether to show the high temperature warning notification. 10205 * @hide 10206 */ 10207 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; 10208 10209 /** 10210 * Temperature at which the high temperature warning notification should be shown. 10211 * @hide 10212 */ 10213 public static final String WARNING_TEMPERATURE = "warning_temperature"; 10214 10215 /** 10216 * Whether the diskstats logging task is enabled/disabled. 10217 * @hide 10218 */ 10219 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; 10220 10221 /** 10222 * Whether the cache quota calculation task is enabled/disabled. 10223 * @hide 10224 */ 10225 public static final String ENABLE_CACHE_QUOTA_CALCULATION = 10226 "enable_cache_quota_calculation"; 10227 } 10228 10229 /** 10230 * User-defined bookmarks and shortcuts. The target of each bookmark is an 10231 * Intent URL, allowing it to be either a web page or a particular 10232 * application activity. 10233 * 10234 * @hide 10235 */ 10236 public static final class Bookmarks implements BaseColumns 10237 { 10238 private static final String TAG = "Bookmarks"; 10239 10240 /** 10241 * The content:// style URL for this table 10242 */ 10243 public static final Uri CONTENT_URI = 10244 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 10245 10246 /** 10247 * The row ID. 10248 * <p>Type: INTEGER</p> 10249 */ 10250 public static final String ID = "_id"; 10251 10252 /** 10253 * Descriptive name of the bookmark that can be displayed to the user. 10254 * If this is empty, the title should be resolved at display time (use 10255 * {@link #getTitle(Context, Cursor)} any time you want to display the 10256 * title of a bookmark.) 10257 * <P> 10258 * Type: TEXT 10259 * </P> 10260 */ 10261 public static final String TITLE = "title"; 10262 10263 /** 10264 * Arbitrary string (displayed to the user) that allows bookmarks to be 10265 * organized into categories. There are some special names for 10266 * standard folders, which all start with '@'. The label displayed for 10267 * the folder changes with the locale (via {@link #getLabelForFolder}) but 10268 * the folder name does not change so you can consistently query for 10269 * the folder regardless of the current locale. 10270 * 10271 * <P>Type: TEXT</P> 10272 * 10273 */ 10274 public static final String FOLDER = "folder"; 10275 10276 /** 10277 * The Intent URL of the bookmark, describing what it points to. This 10278 * value is given to {@link android.content.Intent#getIntent} to create 10279 * an Intent that can be launched. 10280 * <P>Type: TEXT</P> 10281 */ 10282 public static final String INTENT = "intent"; 10283 10284 /** 10285 * Optional shortcut character associated with this bookmark. 10286 * <P>Type: INTEGER</P> 10287 */ 10288 public static final String SHORTCUT = "shortcut"; 10289 10290 /** 10291 * The order in which the bookmark should be displayed 10292 * <P>Type: INTEGER</P> 10293 */ 10294 public static final String ORDERING = "ordering"; 10295 10296 private static final String[] sIntentProjection = { INTENT }; 10297 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 10298 private static final String sShortcutSelection = SHORTCUT + "=?"; 10299 10300 /** 10301 * Convenience function to retrieve the bookmarked Intent for a 10302 * particular shortcut key. 10303 * 10304 * @param cr The ContentResolver to query. 10305 * @param shortcut The shortcut key. 10306 * 10307 * @return Intent The bookmarked URL, or null if there is no bookmark 10308 * matching the given shortcut. 10309 */ 10310 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 10311 { 10312 Intent intent = null; 10313 10314 Cursor c = cr.query(CONTENT_URI, 10315 sIntentProjection, sShortcutSelection, 10316 new String[] { String.valueOf((int) shortcut) }, ORDERING); 10317 // Keep trying until we find a valid shortcut 10318 try { 10319 while (intent == null && c.moveToNext()) { 10320 try { 10321 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 10322 intent = Intent.parseUri(intentURI, 0); 10323 } catch (java.net.URISyntaxException e) { 10324 // The stored URL is bad... ignore it. 10325 } catch (IllegalArgumentException e) { 10326 // Column not found 10327 Log.w(TAG, "Intent column not found", e); 10328 } 10329 } 10330 } finally { 10331 if (c != null) c.close(); 10332 } 10333 10334 return intent; 10335 } 10336 10337 /** 10338 * Add a new bookmark to the system. 10339 * 10340 * @param cr The ContentResolver to query. 10341 * @param intent The desired target of the bookmark. 10342 * @param title Bookmark title that is shown to the user; null if none 10343 * or it should be resolved to the intent's title. 10344 * @param folder Folder in which to place the bookmark; null if none. 10345 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 10346 * this is non-zero and there is an existing bookmark entry 10347 * with this same shortcut, then that existing shortcut is 10348 * cleared (the bookmark is not removed). 10349 * @return The unique content URL for the new bookmark entry. 10350 */ 10351 public static Uri add(ContentResolver cr, 10352 Intent intent, 10353 String title, 10354 String folder, 10355 char shortcut, 10356 int ordering) 10357 { 10358 // If a shortcut is supplied, and it is already defined for 10359 // another bookmark, then remove the old definition. 10360 if (shortcut != 0) { 10361 cr.delete(CONTENT_URI, sShortcutSelection, 10362 new String[] { String.valueOf((int) shortcut) }); 10363 } 10364 10365 ContentValues values = new ContentValues(); 10366 if (title != null) values.put(TITLE, title); 10367 if (folder != null) values.put(FOLDER, folder); 10368 values.put(INTENT, intent.toUri(0)); 10369 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 10370 values.put(ORDERING, ordering); 10371 return cr.insert(CONTENT_URI, values); 10372 } 10373 10374 /** 10375 * Return the folder name as it should be displayed to the user. This 10376 * takes care of localizing special folders. 10377 * 10378 * @param r Resources object for current locale; only need access to 10379 * system resources. 10380 * @param folder The value found in the {@link #FOLDER} column. 10381 * 10382 * @return CharSequence The label for this folder that should be shown 10383 * to the user. 10384 */ 10385 public static CharSequence getLabelForFolder(Resources r, String folder) { 10386 return folder; 10387 } 10388 10389 /** 10390 * Return the title as it should be displayed to the user. This takes 10391 * care of localizing bookmarks that point to activities. 10392 * 10393 * @param context A context. 10394 * @param cursor A cursor pointing to the row whose title should be 10395 * returned. The cursor must contain at least the {@link #TITLE} 10396 * and {@link #INTENT} columns. 10397 * @return A title that is localized and can be displayed to the user, 10398 * or the empty string if one could not be found. 10399 */ 10400 public static CharSequence getTitle(Context context, Cursor cursor) { 10401 int titleColumn = cursor.getColumnIndex(TITLE); 10402 int intentColumn = cursor.getColumnIndex(INTENT); 10403 if (titleColumn == -1 || intentColumn == -1) { 10404 throw new IllegalArgumentException( 10405 "The cursor must contain the TITLE and INTENT columns."); 10406 } 10407 10408 String title = cursor.getString(titleColumn); 10409 if (!TextUtils.isEmpty(title)) { 10410 return title; 10411 } 10412 10413 String intentUri = cursor.getString(intentColumn); 10414 if (TextUtils.isEmpty(intentUri)) { 10415 return ""; 10416 } 10417 10418 Intent intent; 10419 try { 10420 intent = Intent.parseUri(intentUri, 0); 10421 } catch (URISyntaxException e) { 10422 return ""; 10423 } 10424 10425 PackageManager packageManager = context.getPackageManager(); 10426 ResolveInfo info = packageManager.resolveActivity(intent, 0); 10427 return info != null ? info.loadLabel(packageManager) : ""; 10428 } 10429 } 10430 10431 /** 10432 * Returns the device ID that we should use when connecting to the mobile gtalk server. 10433 * This is a string like "android-0x1242", where the hex string is the Android ID obtained 10434 * from the GoogleLoginService. 10435 * 10436 * @param androidId The Android ID for this device. 10437 * @return The device ID that should be used when connecting to the mobile gtalk server. 10438 * @hide 10439 */ 10440 public static String getGTalkDeviceId(long androidId) { 10441 return "android-" + Long.toHexString(androidId); 10442 } 10443 10444 private static final String[] PM_WRITE_SETTINGS = { 10445 android.Manifest.permission.WRITE_SETTINGS 10446 }; 10447 private static final String[] PM_CHANGE_NETWORK_STATE = { 10448 android.Manifest.permission.CHANGE_NETWORK_STATE, 10449 android.Manifest.permission.WRITE_SETTINGS 10450 }; 10451 private static final String[] PM_SYSTEM_ALERT_WINDOW = { 10452 android.Manifest.permission.SYSTEM_ALERT_WINDOW 10453 }; 10454 10455 /** 10456 * Performs a strict and comprehensive check of whether a calling package is allowed to 10457 * write/modify system settings, as the condition differs for pre-M, M+, and 10458 * privileged/preinstalled apps. If the provided uid does not match the 10459 * callingPackage, a negative result will be returned. 10460 * @hide 10461 */ 10462 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, 10463 String callingPackage, boolean throwException) { 10464 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 10465 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 10466 PM_WRITE_SETTINGS, false); 10467 } 10468 10469 /** 10470 * Performs a strict and comprehensive check of whether a calling package is allowed to 10471 * write/modify system settings, as the condition differs for pre-M, M+, and 10472 * privileged/preinstalled apps. If the provided uid does not match the 10473 * callingPackage, a negative result will be returned. The caller is expected to have 10474 * the WRITE_SETTINGS permission declared. 10475 * 10476 * Note: if the check is successful, the operation of this app will be updated to the 10477 * current time. 10478 * @hide 10479 */ 10480 public static boolean checkAndNoteWriteSettingsOperation(Context context, int uid, 10481 String callingPackage, boolean throwException) { 10482 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 10483 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 10484 PM_WRITE_SETTINGS, true); 10485 } 10486 10487 /** 10488 * Performs a strict and comprehensive check of whether a calling package is allowed to 10489 * change the state of network, as the condition differs for pre-M, M+, and 10490 * privileged/preinstalled apps. The caller is expected to have either the 10491 * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these 10492 * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and 10493 * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal 10494 * permission and cannot be revoked. See http://b/23597341 10495 * 10496 * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation 10497 * of this app will be updated to the current time. 10498 * @hide 10499 */ 10500 public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid, 10501 String callingPackage, boolean throwException) { 10502 if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) 10503 == PackageManager.PERMISSION_GRANTED) { 10504 return true; 10505 } 10506 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 10507 callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS, 10508 PM_CHANGE_NETWORK_STATE, true); 10509 } 10510 10511 /** 10512 * Performs a strict and comprehensive check of whether a calling package is allowed to 10513 * draw on top of other apps, as the conditions differs for pre-M, M+, and 10514 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 10515 * a negative result will be returned. 10516 * @hide 10517 */ 10518 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, 10519 String callingPackage, boolean throwException) { 10520 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 10521 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 10522 PM_SYSTEM_ALERT_WINDOW, false); 10523 } 10524 10525 /** 10526 * Performs a strict and comprehensive check of whether a calling package is allowed to 10527 * draw on top of other apps, as the conditions differs for pre-M, M+, and 10528 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 10529 * a negative result will be returned. 10530 * 10531 * Note: if the check is successful, the operation of this app will be updated to the 10532 * current time. 10533 * @hide 10534 */ 10535 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, String 10536 callingPackage, boolean throwException) { 10537 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 10538 callingPackage, throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, 10539 PM_SYSTEM_ALERT_WINDOW, true); 10540 } 10541 10542 /** 10543 * Helper method to perform a general and comprehensive check of whether an operation that is 10544 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and 10545 * OP_WRITE_SETTINGS 10546 * @hide 10547 */ 10548 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 10549 int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] 10550 permissions, boolean makeNote) { 10551 if (callingPackage == null) { 10552 return false; 10553 } 10554 10555 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); 10556 int mode = AppOpsManager.MODE_DEFAULT; 10557 if (makeNote) { 10558 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage); 10559 } else { 10560 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); 10561 } 10562 10563 switch (mode) { 10564 case AppOpsManager.MODE_ALLOWED: 10565 return true; 10566 10567 case AppOpsManager.MODE_DEFAULT: 10568 // this is the default operating mode after an app's installation 10569 // In this case we will check all associated static permission to see 10570 // if it is granted during install time. 10571 for (String permission : permissions) { 10572 if (context.checkCallingOrSelfPermission(permission) == PackageManager 10573 .PERMISSION_GRANTED) { 10574 // if either of the permissions are granted, we will allow it 10575 return true; 10576 } 10577 } 10578 10579 default: 10580 // this is for all other cases trickled down here... 10581 if (!throwException) { 10582 return false; 10583 } 10584 } 10585 10586 // prepare string to throw SecurityException 10587 StringBuilder exceptionMessage = new StringBuilder(); 10588 exceptionMessage.append(callingPackage); 10589 exceptionMessage.append(" was not granted "); 10590 if (permissions.length > 1) { 10591 exceptionMessage.append(" either of these permissions: "); 10592 } else { 10593 exceptionMessage.append(" this permission: "); 10594 } 10595 for (int i = 0; i < permissions.length; i++) { 10596 exceptionMessage.append(permissions[i]); 10597 exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); 10598 } 10599 10600 throw new SecurityException(exceptionMessage.toString()); 10601 } 10602 10603 /** 10604 * Retrieves a correponding package name for a given uid. It will query all 10605 * packages that are associated with the given uid, but it will return only 10606 * the zeroth result. 10607 * Note: If package could not be found, a null is returned. 10608 * @hide 10609 */ 10610 public static String getPackageNameForUid(Context context, int uid) { 10611 String[] packages = context.getPackageManager().getPackagesForUid(uid); 10612 if (packages == null) { 10613 return null; 10614 } 10615 return packages[0]; 10616 } 10617} 10618