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 17 package android.provider; 18 19 import android.Manifest; 20 import android.annotation.IntDef; 21 import android.annotation.IntRange; 22 import android.annotation.NonNull; 23 import android.annotation.Nullable; 24 import android.annotation.RequiresPermission; 25 import android.annotation.SdkConstant; 26 import android.annotation.SdkConstant.SdkConstantType; 27 import android.annotation.SuppressLint; 28 import android.annotation.SystemApi; 29 import android.annotation.TestApi; 30 import android.annotation.UserIdInt; 31 import android.app.Activity; 32 import android.app.ActivityThread; 33 import android.app.AppOpsManager; 34 import android.app.Application; 35 import android.app.AutomaticZenRule; 36 import android.app.NotificationChannel; 37 import android.app.NotificationManager; 38 import android.app.SearchManager; 39 import android.app.WallpaperManager; 40 import android.compat.annotation.UnsupportedAppUsage; 41 import android.content.ComponentName; 42 import android.content.ContentResolver; 43 import android.content.ContentValues; 44 import android.content.Context; 45 import android.content.IContentProvider; 46 import android.content.Intent; 47 import android.content.pm.ActivityInfo; 48 import android.content.pm.ApplicationInfo; 49 import android.content.pm.PackageManager; 50 import android.content.pm.ResolveInfo; 51 import android.content.res.Configuration; 52 import android.content.res.Resources; 53 import android.database.Cursor; 54 import android.database.SQLException; 55 import android.location.ILocationManager; 56 import android.location.LocationManager; 57 import android.net.ConnectivityManager; 58 import android.net.NetworkScoreManager; 59 import android.net.Uri; 60 import android.net.wifi.SoftApConfiguration; 61 import android.net.wifi.WifiManager; 62 import android.net.wifi.p2p.WifiP2pManager; 63 import android.os.BatteryManager; 64 import android.os.Binder; 65 import android.os.Build; 66 import android.os.Build.VERSION_CODES; 67 import android.os.Bundle; 68 import android.os.DropBoxManager; 69 import android.os.IBinder; 70 import android.os.LocaleList; 71 import android.os.PowerManager; 72 import android.os.PowerManager.AutoPowerSaveModeTriggers; 73 import android.os.Process; 74 import android.os.RemoteCallback; 75 import android.os.RemoteException; 76 import android.os.ResultReceiver; 77 import android.os.ServiceManager; 78 import android.os.UserHandle; 79 import android.speech.tts.TextToSpeech; 80 import android.text.TextUtils; 81 import android.util.AndroidException; 82 import android.util.ArrayMap; 83 import android.util.ArraySet; 84 import android.util.Log; 85 import android.util.MemoryIntArray; 86 import android.view.Display; 87 import android.view.Window; 88 import android.view.WindowManager.LayoutParams; 89 90 import com.android.internal.annotations.GuardedBy; 91 import com.android.internal.util.Preconditions; 92 import com.android.internal.widget.ILockSettings; 93 94 import java.io.IOException; 95 import java.lang.annotation.ElementType; 96 import java.lang.annotation.Retention; 97 import java.lang.annotation.RetentionPolicy; 98 import java.lang.annotation.Target; 99 import java.lang.reflect.Field; 100 import java.net.URISyntaxException; 101 import java.util.ArrayList; 102 import java.util.HashMap; 103 import java.util.HashSet; 104 import java.util.List; 105 import java.util.Map; 106 import java.util.Objects; 107 import java.util.Set; 108 /** 109 * The Settings provider contains global system-level device preferences. 110 */ 111 public final class Settings { 112 /** @hide */ 113 public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false; 114 115 // Intent actions for Settings 116 117 /** 118 * Activity Action: Show system settings. 119 * <p> 120 * Input: Nothing. 121 * <p> 122 * Output: Nothing. 123 */ 124 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 125 public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; 126 127 /** 128 * Activity Action: Show settings to allow configuration of APNs. 129 * <p> 130 * Input: Nothing. 131 * <p> 132 * Output: Nothing. 133 * 134 * <p class="note"> 135 * In some cases, a matching Activity may not exist, so ensure you 136 * safeguard against this. 137 */ 138 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 139 public static final String ACTION_APN_SETTINGS = "android.settings.APN_SETTINGS"; 140 141 /** 142 * Activity Action: Show settings to allow configuration of current location 143 * sources. 144 * <p> 145 * In some cases, a matching Activity may not exist, so ensure you 146 * safeguard against this. 147 * <p> 148 * Input: Nothing. 149 * <p> 150 * Output: Nothing. 151 */ 152 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 153 public static final String ACTION_LOCATION_SOURCE_SETTINGS = 154 "android.settings.LOCATION_SOURCE_SETTINGS"; 155 156 /** 157 * Activity Action: Show settings to allow configuration of location controller extra package. 158 * <p> 159 * In some cases, a matching Activity may not exist, so ensure you 160 * safeguard against this. 161 * <p> 162 * Input: Nothing. 163 * <p> 164 * Output: Nothing. 165 * 166 * @hide 167 */ 168 @SystemApi 169 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 170 public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = 171 "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS"; 172 173 /** 174 * Activity Action: Show scanning settings to allow configuration of Wi-Fi 175 * and Bluetooth scanning settings. 176 * <p> 177 * In some cases, a matching Activity may not exist, so ensure you 178 * safeguard against this. 179 * <p> 180 * Input: Nothing. 181 * <p> 182 * Output: Nothing. 183 * @hide 184 */ 185 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 186 public static final String ACTION_LOCATION_SCANNING_SETTINGS = 187 "android.settings.LOCATION_SCANNING_SETTINGS"; 188 189 /** 190 * Activity Action: Show settings to allow configuration of users. 191 * <p> 192 * In some cases, a matching Activity may not exist, so ensure you 193 * safeguard against this. 194 * <p> 195 * Input: Nothing. 196 * <p> 197 * Output: Nothing. 198 * @hide 199 */ 200 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 201 public static final String ACTION_USER_SETTINGS = 202 "android.settings.USER_SETTINGS"; 203 204 /** 205 * Activity Action: Show settings to allow configuration of wireless controls 206 * such as Wi-Fi, Bluetooth and Mobile networks. 207 * <p> 208 * In some cases, a matching Activity may not exist, so ensure you 209 * safeguard against this. 210 * <p> 211 * Input: Nothing. 212 * <p> 213 * Output: Nothing. 214 */ 215 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 216 public static final String ACTION_WIRELESS_SETTINGS = 217 "android.settings.WIRELESS_SETTINGS"; 218 219 /** 220 * Activity Action: Show tether provisioning activity. 221 * 222 * <p> 223 * In some cases, a matching Activity may not exist, so ensure you 224 * safeguard against this. 225 * <p> 226 * Input: {@link ConnectivityManager#EXTRA_TETHER_TYPE} should be included to specify which type 227 * of tethering should be checked. {@link ConnectivityManager#EXTRA_PROVISION_CALLBACK} should 228 * contain a {@link ResultReceiver} which will be called back with a tether result code. 229 * <p> 230 * Output: The result of the provisioning check. 231 * {@link ConnectivityManager#TETHER_ERROR_NO_ERROR} if successful, 232 * {@link ConnectivityManager#TETHER_ERROR_PROVISION_FAILED} for failure. 233 * 234 * @hide 235 */ 236 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 237 @SystemApi 238 public static final String ACTION_TETHER_PROVISIONING_UI = 239 "android.settings.TETHER_PROVISIONING_UI"; 240 241 /** 242 * Activity Action: Show settings to allow entering/exiting airplane mode. 243 * <p> 244 * In some cases, a matching Activity may not exist, so ensure you 245 * safeguard against this. 246 * <p> 247 * Input: Nothing. 248 * <p> 249 * Output: Nothing. 250 */ 251 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 252 public static final String ACTION_AIRPLANE_MODE_SETTINGS = 253 "android.settings.AIRPLANE_MODE_SETTINGS"; 254 255 /** 256 * Activity Action: Show mobile data usage list. 257 * <p> 258 * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify 259 * how and what mobile data statistics should be collected. 260 * <p> 261 * Output: Nothing 262 * @hide 263 */ 264 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 265 public static final String ACTION_MOBILE_DATA_USAGE = 266 "android.settings.MOBILE_DATA_USAGE"; 267 268 /** @hide */ 269 public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; 270 271 /** 272 * The return values for {@link Settings.Config#set} 273 * @hide 274 */ 275 @IntDef(prefix = "SET_ALL_RESULT_", 276 value = { SET_ALL_RESULT_FAILURE, SET_ALL_RESULT_SUCCESS, SET_ALL_RESULT_DISABLED }) 277 @Retention(RetentionPolicy.SOURCE) 278 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE}) 279 public @interface SetAllResult {} 280 281 /** 282 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates failure. 283 * @hide 284 */ 285 public static final int SET_ALL_RESULT_FAILURE = 0; 286 287 /** 288 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates success. 289 * @hide 290 */ 291 public static final int SET_ALL_RESULT_SUCCESS = 1; 292 293 /** 294 * A return value for {@link #KEY_CONFIG_SET_ALL_RETURN}, indicates a set all is disabled. 295 * @hide 296 */ 297 public static final int SET_ALL_RESULT_DISABLED = 2; 298 299 /** @hide */ 300 public static final String KEY_CONFIG_SET_ALL_RETURN = "config_set_all_return"; 301 302 /** @hide */ 303 public static final String KEY_CONFIG_IS_SYNC_DISABLED_RETURN = 304 "config_is_sync_disabled_return"; 305 306 /** 307 * An int extra specifying a subscription ID. 308 * 309 * @see android.telephony.SubscriptionInfo#getSubscriptionId 310 */ 311 public static final String EXTRA_SUB_ID = "android.provider.extra.SUB_ID"; 312 313 /** 314 * Activity Action: Modify Airplane mode settings using a voice command. 315 * <p> 316 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 317 * <p> 318 * This intent MUST be started using 319 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 320 * startVoiceActivity}. 321 * <p> 322 * Note: The activity implementing this intent MUST verify that 323 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 324 * modifying the setting. 325 * <p> 326 * Input: To tell which state airplane mode should be set to, add the 327 * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified. 328 * If the extra is not included, no changes will be made. 329 * <p> 330 * Output: Nothing. 331 */ 332 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 333 public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE = 334 "android.settings.VOICE_CONTROL_AIRPLANE_MODE"; 335 336 /** 337 * Activity Action: Show settings for accessibility modules. 338 * <p> 339 * In some cases, a matching Activity may not exist, so ensure you 340 * safeguard against this. 341 * <p> 342 * Input: Nothing. 343 * <p> 344 * Output: Nothing. 345 */ 346 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 347 public static final String ACTION_ACCESSIBILITY_SETTINGS = 348 "android.settings.ACCESSIBILITY_SETTINGS"; 349 350 /** 351 * Activity Action: Show detail settings of a particular accessibility service. 352 * <p> 353 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 354 * <p> 355 * Input: {@link Intent#EXTRA_COMPONENT_NAME} must specify the accessibility service component 356 * name to be shown. 357 * <p> 358 * Output: Nothing. 359 * @hide 360 **/ 361 @SystemApi 362 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 363 public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = 364 "android.settings.ACCESSIBILITY_DETAILS_SETTINGS"; 365 366 /** 367 * Activity Action: Show settings to allow configuration of Reduce Bright Colors. 368 * <p> 369 * In some cases, a matching Activity may not exist, so ensure you 370 * safeguard against this. 371 * <p> 372 * Input: Nothing. 373 * <p> 374 * Output: Nothing. 375 * @hide 376 */ 377 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 378 public static final String ACTION_REDUCE_BRIGHT_COLORS_SETTINGS = 379 "android.settings.REDUCE_BRIGHT_COLORS_SETTINGS"; 380 381 /** 382 * Activity Action: Show settings to allow configuration of Color inversion. 383 * <p> 384 * In some cases, a matching Activity may not exist, so ensure you 385 * safeguard against this. 386 * <p> 387 * Input: Nothing. 388 * <p> 389 * Output: Nothing. 390 * @hide 391 */ 392 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 393 public static final String ACTION_COLOR_INVERSION_SETTINGS = 394 "android.settings.COLOR_INVERSION_SETTINGS"; 395 396 /** 397 * Activity Action: Show settings to control access to usage information. 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 */ 406 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 407 public static final String ACTION_USAGE_ACCESS_SETTINGS = 408 "android.settings.USAGE_ACCESS_SETTINGS"; 409 410 /** 411 * Activity Category: Show application settings related to usage access. 412 * <p> 413 * An activity that provides a user interface for adjusting usage access related 414 * preferences for its containing application. Optional but recommended for apps that 415 * use {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. 416 * <p> 417 * The activity may define meta-data to describe what usage access is 418 * used for within their app with {@link #METADATA_USAGE_ACCESS_REASON}, which 419 * will be displayed in Settings. 420 * <p> 421 * Input: Nothing. 422 * <p> 423 * Output: Nothing. 424 */ 425 @SdkConstant(SdkConstantType.INTENT_CATEGORY) 426 public static final String INTENT_CATEGORY_USAGE_ACCESS_CONFIG = 427 "android.intent.category.USAGE_ACCESS_CONFIG"; 428 429 /** 430 * Metadata key: Reason for needing usage access. 431 * <p> 432 * A key for metadata attached to an activity that receives action 433 * {@link #INTENT_CATEGORY_USAGE_ACCESS_CONFIG}, shown to the 434 * user as description of how the app uses usage access. 435 * <p> 436 */ 437 public static final String METADATA_USAGE_ACCESS_REASON = 438 "android.settings.metadata.USAGE_ACCESS_REASON"; 439 440 /** 441 * Activity Action: Show settings to allow configuration of security and 442 * location privacy. 443 * <p> 444 * In some cases, a matching Activity may not exist, so ensure you 445 * safeguard against this. 446 * <p> 447 * Input: Nothing. 448 * <p> 449 * Output: Nothing. 450 */ 451 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 452 public static final String ACTION_SECURITY_SETTINGS = 453 "android.settings.SECURITY_SETTINGS"; 454 455 /** 456 * Activity Action: Show settings to allow configuration of trusted external sources 457 * 458 * Input: Optionally, the Intent's data URI can specify the application package name to 459 * directly invoke the management GUI specific to the package name. For example 460 * "package:com.my.app". 461 * <p> 462 * Output: Nothing. 463 */ 464 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 465 public static final String ACTION_MANAGE_UNKNOWN_APP_SOURCES = 466 "android.settings.MANAGE_UNKNOWN_APP_SOURCES"; 467 468 /** 469 * Activity Action: Show settings to allow configuration of 470 * {@link Manifest.permission#SCHEDULE_EXACT_ALARM} permission 471 * 472 * Input: Optionally, the Intent's data URI can specify the application package name to 473 * directly invoke the management GUI specific to the package name. For example 474 * "package:com.my.app". 475 * <p> 476 * Output: When a package data uri is passed as input, the activity result is set to 477 * {@link android.app.Activity#RESULT_OK} if the permission was granted to the app. Otherwise, 478 * the result is set to {@link android.app.Activity#RESULT_CANCELED}. 479 */ 480 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 481 public static final String ACTION_REQUEST_SCHEDULE_EXACT_ALARM = 482 "android.settings.REQUEST_SCHEDULE_EXACT_ALARM"; 483 484 /** 485 * Activity Action: Show settings to allow configuration of 486 * {@link Manifest.permission#MANAGE_MEDIA} permission 487 * 488 * Input: Optionally, the Intent's data URI can specify the application package name to 489 * directly invoke the management GUI specific to the package name. For example 490 * "package:com.my.app". 491 * <p> 492 * Output: Nothing. 493 */ 494 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 495 public static final String ACTION_REQUEST_MANAGE_MEDIA = 496 "android.settings.REQUEST_MANAGE_MEDIA"; 497 498 /** 499 * Activity Action: Show settings to allow configuration of cross-profile access for apps 500 * 501 * Input: Optionally, the Intent's data URI can specify the application package name to 502 * directly invoke the management GUI specific to the package name. For example 503 * "package:com.my.app". 504 * <p> 505 * Output: Nothing. 506 * 507 * @hide 508 */ 509 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 510 public static final String ACTION_MANAGE_CROSS_PROFILE_ACCESS = 511 "android.settings.MANAGE_CROSS_PROFILE_ACCESS"; 512 513 /** 514 * Activity Action: Show the "Open by Default" page in a particular application's details page. 515 * <p> 516 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 517 * <p> 518 * Input: The Intent's data URI specifies the application package name 519 * to be shown, with the "package" scheme. That is "package:com.my.app". 520 * <p> 521 * Output: Nothing. 522 */ 523 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 524 public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS = 525 "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS"; 526 527 /** 528 * Activity Action: Show trusted credentials settings, opening to the user tab, 529 * to allow management of installed credentials. 530 * <p> 531 * In some cases, a matching Activity may not exist, so ensure you 532 * safeguard against this. 533 * <p> 534 * Input: Nothing. 535 * <p> 536 * Output: Nothing. 537 * @hide 538 */ 539 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 540 @UnsupportedAppUsage 541 public static final String ACTION_TRUSTED_CREDENTIALS_USER = 542 "com.android.settings.TRUSTED_CREDENTIALS_USER"; 543 544 /** 545 * Activity Action: Show dialog explaining that an installed CA cert may enable 546 * monitoring of encrypted network traffic. 547 * <p> 548 * In some cases, a matching Activity may not exist, so ensure you 549 * safeguard against this. Add {@link #EXTRA_NUMBER_OF_CERTIFICATES} extra to indicate the 550 * number of certificates. 551 * <p> 552 * Input: Nothing. 553 * <p> 554 * Output: Nothing. 555 * @hide 556 */ 557 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 558 public static final String ACTION_MONITORING_CERT_INFO = 559 "com.android.settings.MONITORING_CERT_INFO"; 560 561 /** 562 * Activity Action: Show settings to allow configuration of privacy options. 563 * <p> 564 * In some cases, a matching Activity may not exist, so ensure you 565 * safeguard against this. 566 * <p> 567 * Input: Nothing. 568 * <p> 569 * Output: Nothing. 570 */ 571 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 572 public static final String ACTION_PRIVACY_SETTINGS = 573 "android.settings.PRIVACY_SETTINGS"; 574 575 /** 576 * Activity Action: Show settings to allow configuration of VPN. 577 * <p> 578 * In some cases, a matching Activity may not exist, so ensure you 579 * safeguard against this. 580 * <p> 581 * Input: Nothing. 582 * <p> 583 * Output: Nothing. 584 */ 585 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 586 public static final String ACTION_VPN_SETTINGS = 587 "android.settings.VPN_SETTINGS"; 588 589 /** 590 * Activity Action: Show settings to allow configuration of Wi-Fi. 591 * <p> 592 * In some cases, a matching Activity may not exist, so ensure you 593 * safeguard against this. 594 * <p> 595 * Input: Nothing. 596 * <p> 597 * Output: Nothing. 598 */ 599 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 600 public static final String ACTION_WIFI_SETTINGS = 601 "android.settings.WIFI_SETTINGS"; 602 603 /** 604 * Activity Action: Show settings to allow configuration of a static IP 605 * address for Wi-Fi. 606 * <p> 607 * In some cases, a matching Activity may not exist, so ensure you safeguard 608 * against this. 609 * <p> 610 * Input: Nothing. 611 * <p> 612 * Output: Nothing. 613 */ 614 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 615 public static final String ACTION_WIFI_IP_SETTINGS = 616 "android.settings.WIFI_IP_SETTINGS"; 617 618 /** 619 * Activity Action: Show setting page to process a Wi-Fi Easy Connect (aka DPP) URI and start 620 * configuration. This intent should be used when you want to use this device to take on the 621 * configurator role for an IoT/other device. When provided with a valid DPP URI 622 * string, Settings will open a Wi-Fi selection screen for the user to indicate which network 623 * they would like to configure the device specified in the DPP URI string and 624 * carry them through the rest of the flow for provisioning the device. 625 * <p> 626 * In some cases, a matching Activity may not exist, so ensure to safeguard against this by 627 * checking {@link WifiManager#isEasyConnectSupported()}. 628 * <p> 629 * Input: The Intent's data URI specifies bootstrapping information for authenticating and 630 * provisioning the peer, and uses a "DPP" scheme. The URI should be attached to the intent 631 * using {@link Intent#setData(Uri)}. The calling app can obtain a DPP URI in any 632 * way, e.g. by scanning a QR code or other out-of-band methods. The calling app may also 633 * attach the {@link #EXTRA_EASY_CONNECT_BAND_LIST} extra to provide information 634 * about the bands supported by the enrollee device. 635 * <p> 636 * Output: After calling {@link android.app.Activity#startActivityForResult}, the callback 637 * {@code onActivityResult} will have resultCode {@link android.app.Activity#RESULT_OK} if 638 * the Wi-Fi Easy Connect configuration succeeded and the user tapped the 'Done' button, or 639 * {@link android.app.Activity#RESULT_CANCELED} if the operation failed and user tapped the 640 * 'Cancel' button. In case the operation has failed, a status code from 641 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*} will 642 * be returned as an Extra {@link #EXTRA_EASY_CONNECT_ERROR_CODE}. Easy Connect R2 643 * Enrollees report additional details about the error they encountered, which will be 644 * provided in the {@link #EXTRA_EASY_CONNECT_ATTEMPTED_SSID}, 645 * {@link #EXTRA_EASY_CONNECT_CHANNEL_LIST}, and {@link #EXTRA_EASY_CONNECT_BAND_LIST}. 646 */ 647 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 648 public static final String ACTION_PROCESS_WIFI_EASY_CONNECT_URI = 649 "android.settings.PROCESS_WIFI_EASY_CONNECT_URI"; 650 651 /** 652 * Activity Extra: The Easy Connect operation error code 653 * <p> 654 * An extra returned on the result intent received when using the 655 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. 656 * This extra contains the integer error code of the operation - one of 657 * {@link android.net.wifi.EasyConnectStatusCallback} {@code EASY_CONNECT_EVENT_FAILURE_*}. If 658 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, 659 * then this extra is not attached to the result intent. 660 * <p> 661 * Use the {@link Intent#hasExtra(String)} to determine whether the extra is attached and 662 * {@link Intent#getIntExtra(String, int)} to obtain the error code data. 663 */ 664 public static final String EXTRA_EASY_CONNECT_ERROR_CODE = 665 "android.provider.extra.EASY_CONNECT_ERROR_CODE"; 666 667 /** 668 * Activity Extra: The SSID that the Enrollee tried to connect to. 669 * <p> 670 * An extra returned on the result intent received when using the {@link 671 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 672 * extra contains the SSID of the Access Point that the remote Enrollee tried to connect to. 673 * This value is populated only by remote R2 devices, and only for the following error codes: 674 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK} 675 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}. 676 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 677 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 678 * this extra is not attached to the result intent. 679 * <p> 680 * Use the {@link Intent#getStringExtra(String)} to obtain the SSID. 681 */ 682 public static final String EXTRA_EASY_CONNECT_ATTEMPTED_SSID = 683 "android.provider.extra.EASY_CONNECT_ATTEMPTED_SSID"; 684 685 /** 686 * Activity Extra: The Channel List that the Enrollee used to scan a network. 687 * <p> 688 * An extra returned on the result intent received when using the {@link 689 * #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation. This 690 * extra contains the channel list that the Enrollee scanned for a network. This value is 691 * populated only by remote R2 devices, and only for the following error code: {@link 692 * android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}. 693 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. If 694 * there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK}, then 695 * this extra is not attached to the result intent. The list is JSON formatted, as an array 696 * (Wi-Fi global operating classes) of arrays (Wi-Fi channels). 697 * <p> 698 * Use the {@link Intent#getStringExtra(String)} to obtain the list. 699 */ 700 public static final String EXTRA_EASY_CONNECT_CHANNEL_LIST = 701 "android.provider.extra.EASY_CONNECT_CHANNEL_LIST"; 702 703 /** 704 * Activity Extra: The Band List that the Enrollee supports. 705 * <p> 706 * This extra contains the bands the Enrollee supports, expressed as the Global Operating 707 * Class, see Table E-4 in IEEE Std 802.11-2016 Global operating classes. It is used both as 708 * input, to configure the Easy Connect operation and as output of the operation. 709 * <p> 710 * As input: an optional extra to be attached to the 711 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI}. If attached, it indicates the bands which 712 * the remote device (enrollee, device-to-be-configured) supports. The Settings operation 713 * may take this into account when presenting the user with list of networks configurations 714 * to be used. The calling app may obtain this information in any out-of-band method. The 715 * information should be attached as an array of raw integers - using the 716 * {@link Intent#putExtra(String, int[])}. 717 * <p> 718 * As output: an extra returned on the result intent received when using the 719 * {@link #ACTION_PROCESS_WIFI_EASY_CONNECT_URI} intent to launch the Easy Connect Operation 720 * . This value is populated only by remote R2 devices, and only for the following error 721 * codes: 722 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_CANNOT_FIND_NETWORK}, 723 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_AUTHENTICATION}, 724 * or 725 * {@link android.net.wifi.EasyConnectStatusCallback#EASY_CONNECT_EVENT_FAILURE_ENROLLEE_REJECTED_CONFIGURATION}. 726 * Therefore, always check if this extra is available using {@link Intent#hasExtra(String)}. 727 * If there is no error, i.e. if the operation returns {@link android.app.Activity#RESULT_OK} 728 * , then this extra is not attached to the result intent. 729 * <p> 730 * Use the {@link Intent#getIntArrayExtra(String)} to obtain the list. 731 */ 732 public static final String EXTRA_EASY_CONNECT_BAND_LIST = 733 "android.provider.extra.EASY_CONNECT_BAND_LIST"; 734 735 /** 736 * Activity Action: Show settings to allow configuration of data and view data usage. 737 * <p> 738 * In some cases, a matching Activity may not exist, so ensure you 739 * safeguard against this. 740 * <p> 741 * Input: Nothing. 742 * <p> 743 * Output: Nothing. 744 */ 745 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 746 public static final String ACTION_DATA_USAGE_SETTINGS = 747 "android.settings.DATA_USAGE_SETTINGS"; 748 749 /** 750 * Activity Action: Show settings to allow configuration of Bluetooth. 751 * <p> 752 * In some cases, a matching Activity may not exist, so ensure you 753 * safeguard against this. 754 * <p> 755 * Input: Nothing. 756 * <p> 757 * Output: Nothing. 758 */ 759 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 760 public static final String ACTION_BLUETOOTH_SETTINGS = 761 "android.settings.BLUETOOTH_SETTINGS"; 762 763 /** 764 * Activity action: Show Settings app search UI when this action is available for device. 765 * <p> 766 * Input: Nothing. 767 * <p> 768 * Output: Nothing. 769 */ 770 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 771 public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS"; 772 773 /** 774 * Activity Action: Show settings to allow configuration of Assist Gesture. 775 * <p> 776 * In some cases, a matching Activity may not exist, so ensure you 777 * safeguard against this. 778 * <p> 779 * Input: Nothing. 780 * <p> 781 * Output: Nothing. 782 * @hide 783 */ 784 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 785 public static final String ACTION_ASSIST_GESTURE_SETTINGS = 786 "android.settings.ASSIST_GESTURE_SETTINGS"; 787 788 /** 789 * Activity Action: Show settings to enroll fingerprints, and setup PIN/Pattern/Pass if 790 * necessary. 791 * @deprecated See {@link #ACTION_BIOMETRIC_ENROLL}. 792 * <p> 793 * Input: Nothing. 794 * <p> 795 * Output: Nothing. 796 */ 797 @Deprecated 798 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 799 public static final String ACTION_FINGERPRINT_ENROLL = 800 "android.settings.FINGERPRINT_ENROLL"; 801 802 /** 803 * Activity Action: Show settings to enroll biometrics, and setup PIN/Pattern/Pass if 804 * necessary. By default, this prompts the user to enroll biometrics with strength 805 * Weak or above, as defined by the CDD. Only biometrics that meet or exceed Strong, as defined 806 * in the CDD are allowed to participate in Keystore operations. 807 * <p> 808 * Input: extras {@link #EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED} as an integer, with 809 * constants defined in {@link android.hardware.biometrics.BiometricManager.Authenticators}, 810 * e.g. {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_STRONG}. 811 * If not specified, the default behavior is 812 * {@link android.hardware.biometrics.BiometricManager.Authenticators#BIOMETRIC_WEAK}. 813 * <p> 814 * Output: Nothing. Note that callers should still check 815 * {@link android.hardware.biometrics.BiometricManager#canAuthenticate(int)} 816 * afterwards to ensure that the user actually completed enrollment. 817 */ 818 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 819 public static final String ACTION_BIOMETRIC_ENROLL = 820 "android.settings.BIOMETRIC_ENROLL"; 821 822 /** 823 * Activity Extra: The minimum strength to request enrollment for. 824 * <p> 825 * This can be passed as an extra field to the {@link #ACTION_BIOMETRIC_ENROLL} intent to 826 * indicate that only enrollment for sensors that meet these requirements should be shown. The 827 * value should be a combination of the constants defined in 828 * {@link android.hardware.biometrics.BiometricManager.Authenticators}. 829 */ 830 public static final String EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED = 831 "android.provider.extra.BIOMETRIC_AUTHENTICATORS_ALLOWED"; 832 833 /** 834 * Activity Action: Show settings to allow configuration of cast endpoints. 835 * <p> 836 * In some cases, a matching Activity may not exist, so ensure you 837 * safeguard against this. 838 * <p> 839 * Input: Nothing. 840 * <p> 841 * Output: Nothing. 842 */ 843 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 844 public static final String ACTION_CAST_SETTINGS = 845 "android.settings.CAST_SETTINGS"; 846 847 /** 848 * Activity Action: Show settings to allow configuration of date and time. 849 * <p> 850 * In some cases, a matching Activity may not exist, so ensure you 851 * safeguard against this. 852 * <p> 853 * Input: Nothing. 854 * <p> 855 * Output: Nothing. 856 */ 857 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 858 public static final String ACTION_DATE_SETTINGS = 859 "android.settings.DATE_SETTINGS"; 860 861 /** 862 * Activity Action: Show settings to allow configuration of sound and volume. 863 * <p> 864 * In some cases, a matching Activity may not exist, so ensure you 865 * safeguard against this. 866 * <p> 867 * Input: Nothing. 868 * <p> 869 * Output: Nothing. 870 */ 871 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 872 public static final String ACTION_SOUND_SETTINGS = 873 "android.settings.SOUND_SETTINGS"; 874 875 /** 876 * Activity Action: Show settings to allow configuration of display. 877 * <p> 878 * In some cases, a matching Activity may not exist, so ensure you 879 * safeguard against this. 880 * <p> 881 * Input: Nothing. 882 * <p> 883 * Output: Nothing. 884 */ 885 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 886 public static final String ACTION_DISPLAY_SETTINGS = 887 "android.settings.DISPLAY_SETTINGS"; 888 889 /** 890 * Activity Action: Show Auto Rotate configuration settings. 891 */ 892 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 893 public static final String ACTION_AUTO_ROTATE_SETTINGS = 894 "android.settings.AUTO_ROTATE_SETTINGS"; 895 896 /** 897 * Activity Action: Show settings to allow configuration of Night display. 898 * <p> 899 * In some cases, a matching Activity may not exist, so ensure you 900 * safeguard against this. 901 * <p> 902 * Input: Nothing. 903 * <p> 904 * Output: Nothing. 905 */ 906 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 907 public static final String ACTION_NIGHT_DISPLAY_SETTINGS = 908 "android.settings.NIGHT_DISPLAY_SETTINGS"; 909 910 /** 911 * Activity Action: Show settings to allow configuration of Dark theme. 912 * <p> 913 * In some cases, a matching Activity may not exist, so ensure you 914 * safeguard against this. 915 * <p> 916 * Input: Nothing. 917 * <p> 918 * Output: Nothing. 919 * 920 * @hide 921 */ 922 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 923 public static final String ACTION_DARK_THEME_SETTINGS = 924 "android.settings.DARK_THEME_SETTINGS"; 925 926 /** 927 * Activity Action: Show settings to allow configuration of locale. 928 * <p> 929 * In some cases, a matching Activity may not exist, so ensure you 930 * safeguard against this. 931 * <p> 932 * Input: Nothing. 933 * <p> 934 * Output: Nothing. 935 */ 936 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 937 public static final String ACTION_LOCALE_SETTINGS = 938 "android.settings.LOCALE_SETTINGS"; 939 940 /** 941 * Activity Action: Show settings to allow configuration of lockscreen. 942 * <p> 943 * In some cases, a matching Activity may not exist, so ensure you 944 * safeguard against this. 945 * <p> 946 * Input: Nothing. 947 * <p> 948 * Output: Nothing. 949 * 950 * @hide 951 */ 952 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 953 public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS"; 954 955 /** 956 * Activity Action: Show settings to allow pairing bluetooth devices. 957 * <p> 958 * In some cases, a matching Activity may not exist, so ensure you 959 * safeguard against this. 960 * <p> 961 * Input: Nothing. 962 * <p> 963 * Output: Nothing. 964 * 965 * @hide 966 */ 967 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 968 public static final String ACTION_BLUETOOTH_PAIRING_SETTINGS = 969 "android.settings.BLUETOOTH_PAIRING_SETTINGS"; 970 971 /** 972 * Activity Action: Show settings to configure input methods, in particular 973 * allowing the user to enable input methods. 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_VOICE_INPUT_SETTINGS = 984 "android.settings.VOICE_INPUT_SETTINGS"; 985 986 /** 987 * Activity Action: Show settings to configure input methods, in particular 988 * allowing the user to enable input methods. 989 * <p> 990 * In some cases, a matching Activity may not exist, so ensure you 991 * safeguard against this. 992 * <p> 993 * Input: Nothing. 994 * <p> 995 * Output: Nothing. 996 */ 997 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 998 public static final String ACTION_INPUT_METHOD_SETTINGS = 999 "android.settings.INPUT_METHOD_SETTINGS"; 1000 1001 /** 1002 * Activity Action: Show settings to enable/disable input method subtypes. 1003 * <p> 1004 * In some cases, a matching Activity may not exist, so ensure you 1005 * safeguard against this. 1006 * <p> 1007 * To tell which input method's subtypes are displayed in the settings, add 1008 * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id. 1009 * If there is no extra in this Intent, subtypes from all installed input methods 1010 * will be displayed in the settings. 1011 * 1012 * @see android.view.inputmethod.InputMethodInfo#getId 1013 * <p> 1014 * Input: Nothing. 1015 * <p> 1016 * Output: Nothing. 1017 */ 1018 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1019 public static final String ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 1020 "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"; 1021 1022 /** 1023 * Activity Action: Show settings to manage the user input dictionary. 1024 * <p> 1025 * Starting with {@link android.os.Build.VERSION_CODES#KITKAT}, 1026 * it is guaranteed there will always be an appropriate implementation for this Intent action. 1027 * In prior releases of the platform this was optional, so ensure you safeguard against it. 1028 * <p> 1029 * Input: Nothing. 1030 * <p> 1031 * Output: Nothing. 1032 */ 1033 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1034 public static final String ACTION_USER_DICTIONARY_SETTINGS = 1035 "android.settings.USER_DICTIONARY_SETTINGS"; 1036 1037 /** 1038 * Activity Action: Show settings to configure the hardware keyboard. 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 */ 1047 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1048 public static final String ACTION_HARD_KEYBOARD_SETTINGS = 1049 "android.settings.HARD_KEYBOARD_SETTINGS"; 1050 1051 /** 1052 * Activity Action: Adds a word to the user dictionary. 1053 * <p> 1054 * In some cases, a matching Activity may not exist, so ensure you 1055 * safeguard against this. 1056 * <p> 1057 * Input: An extra with key <code>word</code> that contains the word 1058 * that should be added to the dictionary. 1059 * <p> 1060 * Output: Nothing. 1061 * 1062 * @hide 1063 */ 1064 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1065 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 1066 public static final String ACTION_USER_DICTIONARY_INSERT = 1067 "com.android.settings.USER_DICTIONARY_INSERT"; 1068 1069 /** 1070 * Activity Action: Show settings to allow configuration of application-related settings. 1071 * <p> 1072 * In some cases, a matching Activity may not exist, so ensure you 1073 * safeguard against this. 1074 * <p> 1075 * Input: Nothing. 1076 * <p> 1077 * Output: Nothing. 1078 */ 1079 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1080 public static final String ACTION_APPLICATION_SETTINGS = 1081 "android.settings.APPLICATION_SETTINGS"; 1082 1083 /** 1084 * Activity Action: Show settings to allow configuration of application 1085 * development-related settings. As of 1086 * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is 1087 * a required part of the platform. 1088 * <p> 1089 * Input: Nothing. 1090 * <p> 1091 * Output: Nothing. 1092 */ 1093 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1094 public static final String ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 1095 "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"; 1096 1097 /** 1098 * Activity Action: Show settings to allow configuration of quick launch shortcuts. 1099 * <p> 1100 * In some cases, a matching Activity may not exist, so ensure you 1101 * safeguard against this. 1102 * <p> 1103 * Input: Nothing. 1104 * <p> 1105 * Output: Nothing. 1106 */ 1107 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1108 public static final String ACTION_QUICK_LAUNCH_SETTINGS = 1109 "android.settings.QUICK_LAUNCH_SETTINGS"; 1110 1111 /** 1112 * Activity Action: Show settings to manage installed applications. 1113 * <p> 1114 * In some cases, a matching Activity may not exist, so ensure you 1115 * safeguard against this. 1116 * <p> 1117 * Input: Nothing. 1118 * <p> 1119 * Output: Nothing. 1120 */ 1121 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1122 public static final String ACTION_MANAGE_APPLICATIONS_SETTINGS = 1123 "android.settings.MANAGE_APPLICATIONS_SETTINGS"; 1124 1125 /** 1126 * Activity Action: Show settings to manage all applications. 1127 * <p> 1128 * In some cases, a matching Activity may not exist, so ensure you 1129 * safeguard against this. 1130 * <p> 1131 * Input: Nothing. 1132 * <p> 1133 * Output: Nothing. 1134 */ 1135 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1136 public static final String ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 1137 "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"; 1138 1139 /** 1140 * Activity Action: Show settings to manage all SIM profiles. 1141 * <p> 1142 * In some cases, a matching Activity may not exist, so ensure you 1143 * safeguard against this. 1144 * <p> 1145 * Input: Nothing. 1146 * <p> 1147 * Output: Nothing. 1148 */ 1149 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1150 public static final String ACTION_MANAGE_ALL_SIM_PROFILES_SETTINGS = 1151 "android.settings.MANAGE_ALL_SIM_PROFILES_SETTINGS"; 1152 1153 /** 1154 * Activity Action: Show screen for controlling which apps can draw on top of other apps. 1155 * <p> 1156 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1157 * <p> 1158 * Input: Optionally, in versions of Android prior to {@link android.os.Build.VERSION_CODES#R}, 1159 * the Intent's data URI can specify the application package name to directly invoke the 1160 * management GUI specific to the package name. 1161 * For example "package:com.my.app". 1162 * <p> 1163 * Output: Nothing. 1164 */ 1165 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1166 public static final String ACTION_MANAGE_OVERLAY_PERMISSION = 1167 "android.settings.action.MANAGE_OVERLAY_PERMISSION"; 1168 1169 /** 1170 * Activity Action: Show screen for controlling if the app specified in the data URI of the 1171 * intent can draw on top of other apps. 1172 * <p> 1173 * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android {@link 1174 * android.os.Build.VERSION_CODES#R} can't be used to show a GUI for a specific package, 1175 * permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is needed to start an activity 1176 * with this intent. 1177 * <p> 1178 * In some cases, a matching Activity may not exist, so ensure you 1179 * safeguard against this. 1180 * <p> 1181 * Input: The Intent's data URI MUST specify the application package name whose ability of 1182 * drawing on top of other apps you want to control. 1183 * For example "package:com.my.app". 1184 * <p> 1185 * Output: Nothing. 1186 * 1187 * @hide 1188 */ 1189 @SystemApi 1190 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1191 public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = 1192 "android.settings.MANAGE_APP_OVERLAY_PERMISSION"; 1193 1194 /** 1195 * Activity Action: Show screen for controlling which apps are allowed to write/modify 1196 * system settings. 1197 * <p> 1198 * In some cases, a matching Activity may not exist, so ensure you 1199 * safeguard against this. 1200 * <p> 1201 * Input: Optionally, the Intent's data URI can specify the application package name to 1202 * directly invoke the management GUI specific to the package name. For example 1203 * "package:com.my.app". 1204 * <p> 1205 * Output: Nothing. 1206 */ 1207 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1208 public static final String ACTION_MANAGE_WRITE_SETTINGS = 1209 "android.settings.action.MANAGE_WRITE_SETTINGS"; 1210 1211 /** 1212 * Activity Action: Show screen for controlling app usage properties for an app. 1213 * Input: Intent's extra {@link android.content.Intent#EXTRA_PACKAGE_NAME} must specify the 1214 * application package name. 1215 * Output: Nothing. 1216 */ 1217 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1218 public static final String ACTION_APP_USAGE_SETTINGS = 1219 "android.settings.action.APP_USAGE_SETTINGS"; 1220 1221 /** 1222 * Activity Action: Show screen of details about a particular application. 1223 * <p> 1224 * In some cases, a matching Activity may not exist, so ensure you 1225 * safeguard against this. 1226 * <p> 1227 * Input: The Intent's data URI specifies the application package name 1228 * to be shown, with the "package" scheme. That is "package:com.my.app". 1229 * <p> 1230 * Output: Nothing. 1231 */ 1232 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1233 public static final String ACTION_APPLICATION_DETAILS_SETTINGS = 1234 "android.settings.APPLICATION_DETAILS_SETTINGS"; 1235 1236 /** 1237 * Activity Action: Show list of applications that have been running 1238 * foreground services (to the user "running in the background"). 1239 * <p> 1240 * Input: Extras "packages" is a string array of package names. 1241 * <p> 1242 * Output: Nothing. 1243 * @hide 1244 */ 1245 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1246 public static final String ACTION_FOREGROUND_SERVICES_SETTINGS = 1247 "android.settings.FOREGROUND_SERVICES_SETTINGS"; 1248 1249 /** 1250 * Activity Action: Show screen for controlling which apps can ignore battery optimizations. 1251 * <p> 1252 * Input: Nothing. 1253 * <p> 1254 * Output: Nothing. 1255 * <p> 1256 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1257 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1258 * already ignoring optimizations. You can use 1259 * {@link #ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} to ask the user to put you 1260 * on this list. 1261 */ 1262 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1263 public static final String ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 1264 "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"; 1265 1266 /** 1267 * Activity Action: Ask the user to allow an app to ignore battery optimizations (that is, 1268 * put them on the whitelist of apps shown by 1269 * {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also 1270 * must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS} 1271 * permission. 1272 * <p><b>Note:</b> most applications should <em>not</em> use this; there are many facilities 1273 * provided by the platform for applications to operate correctly in the various power 1274 * saving modes. This is only for unusual applications that need to deeply control their own 1275 * execution, at the potential expense of the user's battery life. Note that these applications 1276 * greatly run the risk of showing to the user as high power consumers on their device.</p> 1277 * <p> 1278 * Input: The Intent's data URI must specify the application package name 1279 * to be shown, with the "package" scheme. That is "package:com.my.app". 1280 * <p> 1281 * Output: Nothing. 1282 * <p> 1283 * You can use {@link android.os.PowerManager#isIgnoringBatteryOptimizations 1284 * PowerManager.isIgnoringBatteryOptimizations()} to determine if an application is 1285 * already ignoring optimizations. 1286 */ 1287 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1288 public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 1289 "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; 1290 1291 /** 1292 * Activity Action: Open the advanced power usage details page of an associated app. 1293 * <p> 1294 * Input: Intent's data URI set with an application name, using the 1295 * "package" schema (like "package:com.my.app") 1296 * <p> 1297 * Output: Nothing. 1298 * 1299 * @hide 1300 */ 1301 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1302 public static final String ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL = 1303 "android.settings.VIEW_ADVANCED_POWER_USAGE_DETAIL"; 1304 1305 /** 1306 * Activity Action: Show screen for controlling background data 1307 * restrictions for a particular application. 1308 * <p> 1309 * Input: Intent's data URI set with an application name, using the 1310 * "package" schema (like "package:com.my.app"). 1311 * 1312 * <p> 1313 * Output: Nothing. 1314 * <p> 1315 * Applications can also use {@link android.net.ConnectivityManager#getRestrictBackgroundStatus 1316 * ConnectivityManager#getRestrictBackgroundStatus()} to determine the 1317 * status of the background data restrictions for them. 1318 * 1319 * <p class="note"> 1320 * In some cases, a matching Activity may not exist, so ensure you 1321 * safeguard against this. 1322 */ 1323 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1324 public static final String ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 1325 "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"; 1326 1327 /** 1328 * @hide 1329 * Activity Action: Show the "app ops" settings screen. 1330 * <p> 1331 * Input: Nothing. 1332 * <p> 1333 * Output: Nothing. 1334 */ 1335 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1336 public static final String ACTION_APP_OPS_SETTINGS = 1337 "android.settings.APP_OPS_SETTINGS"; 1338 1339 /** 1340 * Activity Action: Show settings for system update functionality. 1341 * <p> 1342 * In some cases, a matching Activity may not exist, so ensure you 1343 * safeguard against this. 1344 * <p> 1345 * Input: Nothing. 1346 * <p> 1347 * Output: Nothing. 1348 * 1349 * @hide 1350 */ 1351 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1352 public static final String ACTION_SYSTEM_UPDATE_SETTINGS = 1353 "android.settings.SYSTEM_UPDATE_SETTINGS"; 1354 1355 /** 1356 * Activity Action: Show settings for managed profile settings. 1357 * <p> 1358 * In some cases, a matching Activity may not exist, so ensure you 1359 * safeguard against this. 1360 * <p> 1361 * Input: Nothing. 1362 * <p> 1363 * Output: Nothing. 1364 * 1365 * @hide 1366 */ 1367 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1368 public static final String ACTION_MANAGED_PROFILE_SETTINGS = 1369 "android.settings.MANAGED_PROFILE_SETTINGS"; 1370 1371 /** 1372 * Activity Action: Show settings to allow configuration of sync settings. 1373 * <p> 1374 * In some cases, a matching Activity may not exist, so ensure you 1375 * safeguard against this. 1376 * <p> 1377 * The account types available to add via the add account button may be restricted by adding an 1378 * {@link #EXTRA_AUTHORITIES} extra to this Intent with one or more syncable content provider's 1379 * authorities. Only account types which can sync with that content provider will be offered to 1380 * the user. 1381 * <p> 1382 * Input: Nothing. 1383 * <p> 1384 * Output: Nothing. 1385 */ 1386 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1387 public static final String ACTION_SYNC_SETTINGS = 1388 "android.settings.SYNC_SETTINGS"; 1389 1390 /** 1391 * Activity Action: Show add account screen for creating a new account. 1392 * <p> 1393 * In some cases, a matching Activity may not exist, so ensure you 1394 * safeguard against this. 1395 * <p> 1396 * The account types available to add may be restricted by adding an {@link #EXTRA_AUTHORITIES} 1397 * extra to the Intent with one or more syncable content provider's authorities. Only account 1398 * types which can sync with that content provider will be offered to the user. 1399 * <p> 1400 * Account types can also be filtered by adding an {@link #EXTRA_ACCOUNT_TYPES} extra to the 1401 * Intent with one or more account types. 1402 * <p> 1403 * Input: Nothing. 1404 * <p> 1405 * Output: Nothing. 1406 */ 1407 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1408 public static final String ACTION_ADD_ACCOUNT = 1409 "android.settings.ADD_ACCOUNT_SETTINGS"; 1410 1411 /** 1412 * Activity Action: Show settings for enabling or disabling data saver 1413 * <p></p> 1414 * In some cases, a matching Activity may not exist, so ensure you 1415 * safeguard against this. 1416 * <p> 1417 * Input: Nothing. 1418 * <p> 1419 * Output: Nothing. 1420 * 1421 * @hide 1422 */ 1423 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1424 public static final String ACTION_DATA_SAVER_SETTINGS = 1425 "android.settings.DATA_SAVER_SETTINGS"; 1426 1427 /** 1428 * Activity Action: Show settings for selecting the network operator. 1429 * <p> 1430 * In some cases, a matching Activity may not exist, so ensure you 1431 * safeguard against this. 1432 * <p> 1433 * The subscription ID of the subscription for which available network operators should be 1434 * displayed may be optionally specified with {@link #EXTRA_SUB_ID}. 1435 * <p> 1436 * Input: Nothing. 1437 * <p> 1438 * Output: Nothing. 1439 */ 1440 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1441 public static final String ACTION_NETWORK_OPERATOR_SETTINGS = 1442 "android.settings.NETWORK_OPERATOR_SETTINGS"; 1443 1444 /** 1445 * Activity Action: Show settings for selection of 2G/3G. 1446 * <p> 1447 * In some cases, a matching Activity may not exist, so ensure you 1448 * safeguard against this. 1449 * <p> 1450 * Input: Nothing. 1451 * <p> 1452 * Output: Nothing. 1453 */ 1454 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1455 public static final String ACTION_DATA_ROAMING_SETTINGS = 1456 "android.settings.DATA_ROAMING_SETTINGS"; 1457 1458 /** 1459 * Activity Action: Show settings for internal storage. 1460 * <p> 1461 * In some cases, a matching Activity may not exist, so ensure you 1462 * safeguard against this. 1463 * <p> 1464 * Input: Nothing. 1465 * <p> 1466 * Output: Nothing. 1467 */ 1468 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1469 public static final String ACTION_INTERNAL_STORAGE_SETTINGS = 1470 "android.settings.INTERNAL_STORAGE_SETTINGS"; 1471 /** 1472 * Activity Action: Show settings for memory card storage. 1473 * <p> 1474 * In some cases, a matching Activity may not exist, so ensure you 1475 * safeguard against this. 1476 * <p> 1477 * Input: Nothing. 1478 * <p> 1479 * Output: Nothing. 1480 */ 1481 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1482 public static final String ACTION_MEMORY_CARD_SETTINGS = 1483 "android.settings.MEMORY_CARD_SETTINGS"; 1484 1485 /** 1486 * Activity Action: Show settings for global search. 1487 * <p> 1488 * In some cases, a matching Activity may not exist, so ensure you 1489 * safeguard against this. 1490 * <p> 1491 * Input: Nothing. 1492 * <p> 1493 * Output: Nothing 1494 */ 1495 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1496 public static final String ACTION_SEARCH_SETTINGS = 1497 "android.search.action.SEARCH_SETTINGS"; 1498 1499 /** 1500 * Activity Action: Show general device information settings (serial 1501 * number, software version, phone number, etc.). 1502 * <p> 1503 * In some cases, a matching Activity may not exist, so ensure you 1504 * safeguard against this. 1505 * <p> 1506 * Input: Nothing. 1507 * <p> 1508 * Output: Nothing 1509 */ 1510 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1511 public static final String ACTION_DEVICE_INFO_SETTINGS = 1512 "android.settings.DEVICE_INFO_SETTINGS"; 1513 1514 /** 1515 * Activity Action: Show NFC settings. 1516 * <p> 1517 * This shows UI that allows NFC to be turned on or off. 1518 * <p> 1519 * In some cases, a matching Activity may not exist, so ensure you 1520 * safeguard against this. 1521 * <p> 1522 * Input: Nothing. 1523 * <p> 1524 * Output: Nothing 1525 * @see android.nfc.NfcAdapter#isEnabled() 1526 */ 1527 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1528 public static final String ACTION_NFC_SETTINGS = "android.settings.NFC_SETTINGS"; 1529 1530 /** 1531 * Activity Action: Show NFC Sharing settings. 1532 * <p> 1533 * This shows UI that allows NDEF Push (Android Beam) to be turned on or 1534 * off. 1535 * <p> 1536 * In some cases, a matching Activity may not exist, so ensure you 1537 * safeguard against this. 1538 * <p> 1539 * Input: Nothing. 1540 * <p> 1541 * Output: Nothing 1542 * @see android.nfc.NfcAdapter#isNdefPushEnabled() 1543 */ 1544 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1545 public static final String ACTION_NFCSHARING_SETTINGS = 1546 "android.settings.NFCSHARING_SETTINGS"; 1547 1548 /** 1549 * Activity Action: Show NFC Tap & Pay settings 1550 * <p> 1551 * This shows UI that allows the user to configure Tap&Pay 1552 * settings. 1553 * <p> 1554 * In some cases, a matching Activity may not exist, so ensure you 1555 * safeguard against this. 1556 * <p> 1557 * Input: Nothing. 1558 * <p> 1559 * Output: Nothing 1560 */ 1561 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1562 public static final String ACTION_NFC_PAYMENT_SETTINGS = 1563 "android.settings.NFC_PAYMENT_SETTINGS"; 1564 1565 /** 1566 * Activity Action: Show Daydream settings. 1567 * <p> 1568 * In some cases, a matching Activity may not exist, so ensure you 1569 * safeguard against this. 1570 * <p> 1571 * Input: Nothing. 1572 * <p> 1573 * Output: Nothing. 1574 * @see android.service.dreams.DreamService 1575 */ 1576 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1577 public static final String ACTION_DREAM_SETTINGS = "android.settings.DREAM_SETTINGS"; 1578 1579 /** 1580 * Activity Action: Show Notification assistant settings. 1581 * <p> 1582 * In some cases, a matching Activity may not exist, so ensure you 1583 * safeguard against this. 1584 * <p> 1585 * Input: Nothing. 1586 * <p> 1587 * Output: Nothing. 1588 * @see android.service.notification.NotificationAssistantService 1589 */ 1590 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1591 public static final String ACTION_NOTIFICATION_ASSISTANT_SETTINGS = 1592 "android.settings.NOTIFICATION_ASSISTANT_SETTINGS"; 1593 1594 /** 1595 * Activity Action: Show Notification listener settings. 1596 * <p> 1597 * In some cases, a matching Activity may not exist, so ensure you 1598 * safeguard against this. 1599 * <p> 1600 * Input: Nothing. 1601 * <p> 1602 * Output: Nothing. 1603 * @see android.service.notification.NotificationListenerService 1604 */ 1605 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1606 public static final String ACTION_NOTIFICATION_LISTENER_SETTINGS 1607 = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 1608 1609 /** 1610 * Activity Action: Show notification listener permission settings page for app. 1611 * <p> 1612 * Users can grant and deny access to notifications for a {@link ComponentName} from here. 1613 * See 1614 * {@link android.app.NotificationManager#isNotificationListenerAccessGranted(ComponentName)} 1615 * for more details. 1616 * <p> 1617 * Input: The extra {@link #EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME} containing the name 1618 * of the component to grant or revoke notification listener access to. 1619 * <p> 1620 * Output: Nothing. 1621 */ 1622 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1623 public static final String ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS = 1624 "android.settings.NOTIFICATION_LISTENER_DETAIL_SETTINGS"; 1625 1626 /** 1627 * Activity Extra: What component name to show the notification listener permission 1628 * page for. 1629 * <p> 1630 * A string extra containing a {@link ComponentName}. This must be passed as an extra field to 1631 * {@link #ACTION_NOTIFICATION_LISTENER_DETAIL_SETTINGS}. 1632 */ 1633 public static final String EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME = 1634 "android.provider.extra.NOTIFICATION_LISTENER_COMPONENT_NAME"; 1635 1636 /** 1637 * Activity Action: Show Do Not Disturb access settings. 1638 * <p> 1639 * Users can grant and deny access to Do Not Disturb configuration from here. Managed 1640 * profiles cannot grant Do Not Disturb access. 1641 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1642 * details. 1643 * <p> 1644 * Input: Nothing. 1645 * <p> 1646 * Output: Nothing. 1647 * 1648 * <p class="note"> 1649 * In some cases, a matching Activity may not exist, so ensure you 1650 * safeguard against this. 1651 */ 1652 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1653 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS 1654 = "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"; 1655 1656 /** 1657 * Activity Action: Show do not disturb setting page for app. 1658 * <p> 1659 * Users can grant and deny access to Do Not Disturb configuration for an app from here. 1660 * See {@link android.app.NotificationManager#isNotificationPolicyAccessGranted()} for more 1661 * details. 1662 * <p> 1663 * Input: Intent's data URI set with an application name, using the 1664 * "package" schema (like "package:com.my.app"). 1665 * <p> 1666 * Output: Nothing. 1667 * 1668 * @hide 1669 */ 1670 @SystemApi 1671 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1672 public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = 1673 "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS"; 1674 1675 /** 1676 * Activity Action: Show the automatic do not disturb rule listing page 1677 * <p> 1678 * Users can add, enable, disable, and remove automatic do not disturb rules from this 1679 * screen. See {@link NotificationManager#addAutomaticZenRule(AutomaticZenRule)} for more 1680 * details. 1681 * </p> 1682 * <p> 1683 * Input: Nothing 1684 * Output: Nothing 1685 * </p> 1686 * 1687 */ 1688 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1689 public static final String ACTION_CONDITION_PROVIDER_SETTINGS 1690 = "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"; 1691 1692 /** 1693 * Activity Action: Show settings for video captioning. 1694 * <p> 1695 * In some cases, a matching Activity may not exist, so ensure you safeguard 1696 * against this. 1697 * <p> 1698 * Input: Nothing. 1699 * <p> 1700 * Output: Nothing. 1701 */ 1702 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1703 public static final String ACTION_CAPTIONING_SETTINGS = "android.settings.CAPTIONING_SETTINGS"; 1704 1705 /** 1706 * Activity Action: Show the top level print settings. 1707 * <p> 1708 * In some cases, a matching Activity may not exist, so ensure you 1709 * safeguard against this. 1710 * <p> 1711 * Input: Nothing. 1712 * <p> 1713 * Output: Nothing. 1714 */ 1715 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1716 public static final String ACTION_PRINT_SETTINGS = 1717 "android.settings.ACTION_PRINT_SETTINGS"; 1718 1719 /** 1720 * Activity Action: Show Zen Mode configuration settings. 1721 * 1722 * @hide 1723 */ 1724 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1725 public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS"; 1726 1727 /** 1728 * Activity Action: Show Zen Mode visual effects configuration settings. 1729 * 1730 * @hide 1731 */ 1732 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1733 public static final String ZEN_MODE_BLOCKED_EFFECTS_SETTINGS = 1734 "android.settings.ZEN_MODE_BLOCKED_EFFECTS_SETTINGS"; 1735 1736 /** 1737 * Activity Action: Show Zen Mode onboarding activity. 1738 * 1739 * @hide 1740 */ 1741 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1742 public static final String ZEN_MODE_ONBOARDING = "android.settings.ZEN_MODE_ONBOARDING"; 1743 1744 /** 1745 * Activity Action: Show Zen Mode (aka Do Not Disturb) priority configuration settings. 1746 */ 1747 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1748 public static final String ACTION_ZEN_MODE_PRIORITY_SETTINGS 1749 = "android.settings.ZEN_MODE_PRIORITY_SETTINGS"; 1750 1751 /** 1752 * Activity Action: Show Zen Mode automation configuration settings. 1753 * 1754 * @hide 1755 */ 1756 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1757 public static final String ACTION_ZEN_MODE_AUTOMATION_SETTINGS 1758 = "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"; 1759 1760 /** 1761 * Activity Action: Modify do not disturb mode settings. 1762 * <p> 1763 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1764 * <p> 1765 * This intent MUST be started using 1766 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1767 * startVoiceActivity}. 1768 * <p> 1769 * Note: The Activity implementing this intent MUST verify that 1770 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}. 1771 * returns true before modifying the setting. 1772 * <p> 1773 * Input: The optional {@link #EXTRA_DO_NOT_DISTURB_MODE_MINUTES} extra can be used to indicate 1774 * how long the user wishes to avoid interruptions for. The optional 1775 * {@link #EXTRA_DO_NOT_DISTURB_MODE_ENABLED} extra can be to indicate if the user is 1776 * enabling or disabling do not disturb mode. If either extra is not included, the 1777 * user maybe asked to provide the value. 1778 * <p> 1779 * Output: Nothing. 1780 */ 1781 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1782 public static final String ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 1783 "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"; 1784 1785 /** 1786 * Activity Action: Show Zen Mode schedule rule configuration settings. 1787 * 1788 * @hide 1789 */ 1790 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1791 public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS 1792 = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; 1793 1794 /** 1795 * Activity Action: Show Zen Mode event rule configuration settings. 1796 * 1797 * @hide 1798 */ 1799 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1800 public static final String ACTION_ZEN_MODE_EVENT_RULE_SETTINGS 1801 = "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"; 1802 1803 /** 1804 * Activity Action: Show Zen Mode external rule configuration settings. 1805 * 1806 * @hide 1807 */ 1808 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1809 public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS 1810 = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; 1811 1812 /** 1813 * Activity Action: Show the regulatory information screen for the device. 1814 * <p> 1815 * In some cases, a matching Activity may not exist, so ensure you safeguard 1816 * against this. 1817 * <p> 1818 * Input: Nothing. 1819 * <p> 1820 * Output: Nothing. 1821 */ 1822 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1823 public static final String 1824 ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO"; 1825 1826 /** 1827 * Activity Action: Show Device Name Settings. 1828 * <p> 1829 * In some cases, a matching Activity may not exist, so ensure you safeguard 1830 * against this. 1831 * 1832 * @hide 1833 */ 1834 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1835 public static final String DEVICE_NAME_SETTINGS = "android.settings.DEVICE_NAME"; 1836 1837 /** 1838 * Activity Action: Show pairing settings. 1839 * <p> 1840 * In some cases, a matching Activity may not exist, so ensure you safeguard 1841 * against this. 1842 * 1843 * @hide 1844 */ 1845 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1846 public static final String ACTION_PAIRING_SETTINGS = "android.settings.PAIRING_SETTINGS"; 1847 1848 /** 1849 * Activity Action: Show battery saver settings. 1850 * <p> 1851 * In some cases, a matching Activity may not exist, so ensure you safeguard 1852 * against this. 1853 */ 1854 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1855 public static final String ACTION_BATTERY_SAVER_SETTINGS 1856 = "android.settings.BATTERY_SAVER_SETTINGS"; 1857 1858 /** 1859 * Activity Action: Modify Battery Saver mode setting using a voice command. 1860 * <p> 1861 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1862 * <p> 1863 * This intent MUST be started using 1864 * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity 1865 * startVoiceActivity}. 1866 * <p> 1867 * Note: The activity implementing this intent MUST verify that 1868 * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before 1869 * modifying the setting. 1870 * <p> 1871 * Input: To tell which state batter saver mode should be set to, add the 1872 * {@link #EXTRA_BATTERY_SAVER_MODE_ENABLED} extra to this Intent with the state specified. 1873 * If the extra is not included, no changes will be made. 1874 * <p> 1875 * Output: Nothing. 1876 */ 1877 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1878 public static final String ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 1879 "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"; 1880 1881 /** 1882 * Activity Action: Show Home selection settings. If there are multiple activities 1883 * that can satisfy the {@link Intent#CATEGORY_HOME} intent, this screen allows you 1884 * to pick your preferred activity. 1885 */ 1886 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1887 public static final String ACTION_HOME_SETTINGS 1888 = "android.settings.HOME_SETTINGS"; 1889 1890 /** 1891 * Activity Action: Show Default apps settings. 1892 * <p> 1893 * In some cases, a matching Activity may not exist, so ensure you 1894 * safeguard against this. 1895 * <p> 1896 * Input: Nothing. 1897 * <p> 1898 * Output: Nothing. 1899 */ 1900 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1901 public static final String ACTION_MANAGE_DEFAULT_APPS_SETTINGS 1902 = "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"; 1903 1904 /** 1905 * Activity Action: Show More default apps settings. 1906 * <p> 1907 * If a Settings activity handles this intent action, a "More defaults" entry will be shown in 1908 * the Default apps settings, and clicking it will launch that activity. 1909 * <p> 1910 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 1911 * <p> 1912 * Input: Nothing. 1913 * <p> 1914 * Output: Nothing. 1915 * 1916 * @hide 1917 */ 1918 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1919 @SystemApi 1920 public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = 1921 "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS"; 1922 1923 /** 1924 * Activity Action: Show notification settings. 1925 * 1926 * @hide 1927 */ 1928 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1929 public static final String ACTION_NOTIFICATION_SETTINGS 1930 = "android.settings.NOTIFICATION_SETTINGS"; 1931 1932 /** 1933 * Activity Action: Show conversation settings. 1934 * 1935 * @hide 1936 */ 1937 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1938 public static final String ACTION_CONVERSATION_SETTINGS 1939 = "android.settings.CONVERSATION_SETTINGS"; 1940 1941 /** 1942 * Activity Action: Show notification history screen. 1943 * 1944 * @hide 1945 */ 1946 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1947 public static final String ACTION_NOTIFICATION_HISTORY 1948 = "android.settings.NOTIFICATION_HISTORY"; 1949 1950 /** 1951 * Activity Action: Show app listing settings, filtered by those that send notifications. 1952 * 1953 * @hide 1954 */ 1955 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1956 public static final String ACTION_ALL_APPS_NOTIFICATION_SETTINGS = 1957 "android.settings.ALL_APPS_NOTIFICATION_SETTINGS"; 1958 1959 /** 1960 * Activity Action: Show notification settings for a single app. 1961 * <p> 1962 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1963 * <p> 1964 * Output: Nothing. 1965 */ 1966 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1967 public static final String ACTION_APP_NOTIFICATION_SETTINGS 1968 = "android.settings.APP_NOTIFICATION_SETTINGS"; 1969 1970 /** 1971 * Activity Action: Show notification settings for a single {@link NotificationChannel}. 1972 * <p> 1973 * Input: {@link #EXTRA_APP_PACKAGE}, the package containing the channel to display. 1974 * Input: {@link #EXTRA_CHANNEL_ID}, the id of the channel to display. 1975 * <p> 1976 * Output: Nothing. 1977 */ 1978 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1979 public static final String ACTION_CHANNEL_NOTIFICATION_SETTINGS 1980 = "android.settings.CHANNEL_NOTIFICATION_SETTINGS"; 1981 1982 /** 1983 * Activity Action: Show notification bubble settings for a single app. 1984 * See {@link NotificationManager#getBubblePreference()}. 1985 * <p> 1986 * Input: {@link #EXTRA_APP_PACKAGE}, the package to display. 1987 * <p> 1988 * Output: Nothing. 1989 */ 1990 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1991 public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS 1992 = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS"; 1993 1994 /** 1995 * Activity Extra: The package owner of the notification channel settings to display. 1996 * <p> 1997 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 1998 */ 1999 public static final String EXTRA_APP_PACKAGE = "android.provider.extra.APP_PACKAGE"; 2000 2001 /** 2002 * Activity Extra: The {@link NotificationChannel#getId()} of the notification channel settings 2003 * to display. 2004 * <p> 2005 * This must be passed as an extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. 2006 */ 2007 public static final String EXTRA_CHANNEL_ID = "android.provider.extra.CHANNEL_ID"; 2008 2009 /** 2010 * Activity Extra: The {@link NotificationChannel#getConversationId()} of the notification 2011 * conversation settings to display. 2012 * <p> 2013 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If 2014 * included the system will first look up notification settings by channel and conversation id, 2015 * and will fall back to channel id if a specialized channel for this conversation doesn't 2016 * exist, similar to {@link NotificationManager#getNotificationChannel(String, String)}. 2017 */ 2018 public static final String EXTRA_CONVERSATION_ID = "android.provider.extra.CONVERSATION_ID"; 2019 2020 /** 2021 * Activity Extra: An {@code Arraylist<String>} of {@link NotificationChannel} field names to 2022 * show on the Settings UI. 2023 * 2024 * <p> 2025 * This is an optional extra field to the {@link #ACTION_CHANNEL_NOTIFICATION_SETTINGS}. If 2026 * included the system will filter out any Settings that doesn't appear in this list that 2027 * otherwise would display. 2028 */ 2029 public static final String EXTRA_CHANNEL_FILTER_LIST 2030 = "android.provider.extra.CHANNEL_FILTER_LIST"; 2031 2032 /** 2033 * Activity Action: Show notification redaction settings. 2034 * 2035 * @hide 2036 */ 2037 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2038 public static final String ACTION_APP_NOTIFICATION_REDACTION 2039 = "android.settings.ACTION_APP_NOTIFICATION_REDACTION"; 2040 2041 /** @hide */ 2042 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 2043 public static final String EXTRA_APP_UID = "app_uid"; 2044 2045 /** 2046 * Activity Action: Show power menu settings. 2047 * 2048 * @hide 2049 */ 2050 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2051 public static final String ACTION_POWER_MENU_SETTINGS = 2052 "android.settings.ACTION_POWER_MENU_SETTINGS"; 2053 2054 /** 2055 * Activity Action: Show controls settings. 2056 * 2057 * @hide 2058 */ 2059 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2060 public static final String ACTION_DEVICE_CONTROLS_SETTINGS = 2061 "android.settings.ACTION_DEVICE_CONTROLS_SETTINGS"; 2062 2063 /** 2064 * Activity Action: Show media control settings 2065 * 2066 * @hide 2067 */ 2068 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2069 public static final String ACTION_MEDIA_CONTROLS_SETTINGS = 2070 "android.settings.ACTION_MEDIA_CONTROLS_SETTINGS"; 2071 2072 /** 2073 * Activity Action: Show a dialog with disabled by policy message. 2074 * <p> If an user action is disabled by policy, this dialog can be triggered to let 2075 * the user know about this. 2076 * <p> 2077 * Input: {@link Intent#EXTRA_USER}: The user of the admin. 2078 * <p> 2079 * Output: Nothing. 2080 * 2081 * @hide 2082 */ 2083 // Intent#EXTRA_USER_ID can also be used 2084 @SystemApi 2085 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2086 public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS 2087 = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"; 2088 2089 /** 2090 * Activity Action: Show a dialog for remote bugreport flow. 2091 * <p> 2092 * Input: Nothing. 2093 * <p> 2094 * Output: Nothing. 2095 * 2096 * @hide 2097 */ 2098 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2099 public static final String ACTION_SHOW_REMOTE_BUGREPORT_DIALOG 2100 = "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"; 2101 2102 /** 2103 * Activity Action: Show VR listener settings. 2104 * <p> 2105 * Input: Nothing. 2106 * <p> 2107 * Output: Nothing. 2108 * 2109 * @see android.service.vr.VrListenerService 2110 */ 2111 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2112 public static final String ACTION_VR_LISTENER_SETTINGS 2113 = "android.settings.VR_LISTENER_SETTINGS"; 2114 2115 /** 2116 * Activity Action: Show Picture-in-picture settings. 2117 * <p> 2118 * Input: Nothing. 2119 * <p> 2120 * Output: Nothing. 2121 * 2122 * @hide 2123 */ 2124 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2125 public static final String ACTION_PICTURE_IN_PICTURE_SETTINGS 2126 = "android.settings.PICTURE_IN_PICTURE_SETTINGS"; 2127 2128 /** 2129 * Activity Action: Show Storage Manager settings. 2130 * <p> 2131 * Input: Nothing. 2132 * <p> 2133 * Output: Nothing. 2134 * 2135 * @hide 2136 */ 2137 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2138 public static final String ACTION_STORAGE_MANAGER_SETTINGS 2139 = "android.settings.STORAGE_MANAGER_SETTINGS"; 2140 2141 /** 2142 * Activity Action: Allows user to select current webview implementation. 2143 * <p> 2144 * Input: Nothing. 2145 * <p> 2146 * Output: Nothing. 2147 * <p class="note"> 2148 * In some cases, a matching Activity may not exist, so ensure you 2149 * safeguard against this. 2150 2151 */ 2152 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2153 public static final String ACTION_WEBVIEW_SETTINGS = "android.settings.WEBVIEW_SETTINGS"; 2154 2155 /** 2156 * Activity Action: Show enterprise privacy section. 2157 * <p> 2158 * Input: Nothing. 2159 * <p> 2160 * Output: Nothing. 2161 * @hide 2162 */ 2163 @SystemApi 2164 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2165 public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS 2166 = "android.settings.ENTERPRISE_PRIVACY_SETTINGS"; 2167 2168 /** 2169 * Activity Action: Show Work Policy info. 2170 * DPC apps can implement an activity that handles this intent in order to show device policies 2171 * associated with the work profile or managed device. 2172 * <p> 2173 * Input: Nothing. 2174 * <p> 2175 * Output: Nothing. 2176 * 2177 */ 2178 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2179 public static final String ACTION_SHOW_WORK_POLICY_INFO = 2180 "android.settings.SHOW_WORK_POLICY_INFO"; 2181 2182 /** 2183 * Activity Action: Show screen that let user select its Autofill Service. 2184 * <p> 2185 * Input: Intent's data URI set with an application name, using the 2186 * "package" schema (like "package:com.my.app"). 2187 * 2188 * <p> 2189 * Output: {@link android.app.Activity#RESULT_OK} if user selected an Autofill Service belonging 2190 * to the caller package. 2191 * 2192 * <p> 2193 * <b>NOTE: </b> Applications should call 2194 * {@link android.view.autofill.AutofillManager#hasEnabledAutofillServices()} and 2195 * {@link android.view.autofill.AutofillManager#isAutofillSupported()}, and only use this action 2196 * to start an activity if they return {@code false} and {@code true} respectively. 2197 */ 2198 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2199 public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = 2200 "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; 2201 2202 /** 2203 * Activity Action: Show screen for controlling the Quick Access Wallet. 2204 * <p> 2205 * In some cases, a matching Activity may not exist, so ensure you 2206 * safeguard against this. 2207 * <p> 2208 * Input: Nothing. 2209 * <p> 2210 * Output: Nothing. 2211 */ 2212 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2213 public static final String ACTION_QUICK_ACCESS_WALLET_SETTINGS = 2214 "android.settings.QUICK_ACCESS_WALLET_SETTINGS"; 2215 2216 /** 2217 * Activity Action: Show screen for controlling which apps have access on volume directories. 2218 * <p> 2219 * Input: Nothing. 2220 * <p> 2221 * Output: Nothing. 2222 * <p> 2223 * Applications typically use this action to ask the user to revert the "Do not ask again" 2224 * status of directory access requests made by 2225 * {@link android.os.storage.StorageVolume#createAccessIntent(String)}. 2226 * @deprecated use {@link #ACTION_APPLICATION_DETAILS_SETTINGS} to manage storage permissions 2227 * for a specific application 2228 */ 2229 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2230 @Deprecated 2231 public static final String ACTION_STORAGE_VOLUME_ACCESS_SETTINGS = 2232 "android.settings.STORAGE_VOLUME_ACCESS_SETTINGS"; 2233 2234 2235 /** 2236 * Activity Action: Show screen that let user select enable (or disable) Content Capture. 2237 * <p> 2238 * Input: Nothing. 2239 * 2240 * <p> 2241 * Output: Nothing 2242 * 2243 * @hide 2244 */ 2245 @SystemApi 2246 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2247 public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = 2248 "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE"; 2249 2250 /** 2251 * Activity Action: Show screen that let user manage how Android handles URL resolution. 2252 * <p> 2253 * Input: Nothing. 2254 * <p> 2255 * Output: Nothing 2256 * 2257 * @hide 2258 */ 2259 @SystemApi 2260 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2261 public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS"; 2262 2263 /** 2264 * Activity Action: Show screen that let user select enable (or disable) tethering. 2265 * <p> 2266 * Input: Nothing. 2267 * <p> 2268 * Output: Nothing 2269 * 2270 * @hide 2271 */ 2272 @SystemApi 2273 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2274 public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_SETTINGS"; 2275 2276 /** 2277 * Activity Action: Show screen that lets user configure wifi tethering. 2278 * <p> 2279 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 2280 * <p> 2281 * Input: Nothing 2282 * <p> 2283 * Output: Nothing 2284 * 2285 * @hide 2286 */ 2287 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2288 public static final String ACTION_WIFI_TETHER_SETTING = 2289 "com.android.settings.WIFI_TETHER_SETTINGS"; 2290 2291 /** 2292 * Broadcast to trigger notification of asking user to enable MMS. 2293 * Need to specify {@link #EXTRA_ENABLE_MMS_DATA_REQUEST_REASON} and {@link #EXTRA_SUB_ID}. 2294 * 2295 * @hide 2296 */ 2297 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2298 public static final String ACTION_ENABLE_MMS_DATA_REQUEST = 2299 "android.settings.ENABLE_MMS_DATA_REQUEST"; 2300 2301 /** 2302 * Integer value that specifies the reason triggering enable MMS data notification. 2303 * This must be passed as an extra field to the {@link #ACTION_ENABLE_MMS_DATA_REQUEST}. 2304 * Extra with value of EnableMmsDataReason interface. 2305 * @hide 2306 */ 2307 public static final String EXTRA_ENABLE_MMS_DATA_REQUEST_REASON = 2308 "android.settings.extra.ENABLE_MMS_DATA_REQUEST_REASON"; 2309 2310 /** @hide */ 2311 @Retention(RetentionPolicy.SOURCE) 2312 @IntDef(prefix = { "ENABLE_MMS_DATA_REQUEST_REASON_" }, value = { 2313 ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS, 2314 ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS, 2315 }) 2316 public @interface EnableMmsDataReason{} 2317 2318 /** 2319 * Requesting to enable MMS data because there's an incoming MMS. 2320 * @hide 2321 */ 2322 public static final int ENABLE_MMS_DATA_REQUEST_REASON_INCOMING_MMS = 0; 2323 2324 /** 2325 * Requesting to enable MMS data because user is sending MMS. 2326 * @hide 2327 */ 2328 public static final int ENABLE_MMS_DATA_REQUEST_REASON_OUTGOING_MMS = 1; 2329 2330 /** 2331 * Activity Action: Show screen of a cellular subscription and highlight the 2332 * "enable MMS" toggle. 2333 * <p> 2334 * Input: {@link #EXTRA_SUB_ID}: Sub ID of the subscription. 2335 * <p> 2336 * Output: Nothing 2337 * 2338 * @hide 2339 */ 2340 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 2341 public static final String ACTION_MMS_MESSAGE_SETTING = "android.settings.MMS_MESSAGE_SETTING"; 2342 2343 // End of Intent actions for Settings 2344 2345 /** 2346 * @hide - Private call() method on SettingsProvider to read from 'system' table. 2347 */ 2348 public static final String CALL_METHOD_GET_SYSTEM = "GET_system"; 2349 2350 /** 2351 * @hide - Private call() method on SettingsProvider to read from 'secure' table. 2352 */ 2353 public static final String CALL_METHOD_GET_SECURE = "GET_secure"; 2354 2355 /** 2356 * @hide - Private call() method on SettingsProvider to read from 'global' table. 2357 */ 2358 public static final String CALL_METHOD_GET_GLOBAL = "GET_global"; 2359 2360 /** 2361 * @hide - Private call() method on SettingsProvider to read from 'config' table. 2362 */ 2363 public static final String CALL_METHOD_GET_CONFIG = "GET_config"; 2364 2365 /** 2366 * @hide - Specifies that the caller of the fast-path call()-based flow tracks 2367 * the settings generation in order to cache values locally. If this key is 2368 * mapped to a <code>null</code> string extra in the request bundle, the response 2369 * bundle will contain the same key mapped to a parcelable extra which would be 2370 * an {@link android.util.MemoryIntArray}. The response will also contain an 2371 * integer mapped to the {@link #CALL_METHOD_GENERATION_INDEX_KEY} which is the 2372 * index in the array clients should use to lookup the generation. For efficiency 2373 * the caller should request the generation tracking memory array only if it 2374 * doesn't already have it. 2375 * 2376 * @see #CALL_METHOD_GENERATION_INDEX_KEY 2377 */ 2378 public static final String CALL_METHOD_TRACK_GENERATION_KEY = "_track_generation"; 2379 2380 /** 2381 * @hide Key with the location in the {@link android.util.MemoryIntArray} where 2382 * to look up the generation id of the backing table. The value is an integer. 2383 * 2384 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2385 */ 2386 public static final String CALL_METHOD_GENERATION_INDEX_KEY = "_generation_index"; 2387 2388 /** 2389 * @hide Key with the settings table generation. The value is an integer. 2390 * 2391 * @see #CALL_METHOD_TRACK_GENERATION_KEY 2392 */ 2393 public static final String CALL_METHOD_GENERATION_KEY = "_generation"; 2394 2395 /** 2396 * @hide - User handle argument extra to the fast-path call()-based requests 2397 */ 2398 public static final String CALL_METHOD_USER_KEY = "_user"; 2399 2400 /** 2401 * @hide - Boolean argument extra to the fast-path call()-based requests 2402 */ 2403 public static final String CALL_METHOD_MAKE_DEFAULT_KEY = "_make_default"; 2404 2405 /** 2406 * @hide - User handle argument extra to the fast-path call()-based requests 2407 */ 2408 public static final String CALL_METHOD_RESET_MODE_KEY = "_reset_mode"; 2409 2410 /** 2411 * @hide - String argument extra to the fast-path call()-based requests 2412 */ 2413 public static final String CALL_METHOD_TAG_KEY = "_tag"; 2414 2415 /** 2416 * @hide - String argument extra to the fast-path call()-based requests 2417 */ 2418 public static final String CALL_METHOD_PREFIX_KEY = "_prefix"; 2419 2420 /** 2421 * @hide - String argument extra to the fast-path call()-based requests 2422 */ 2423 public static final String CALL_METHOD_SYNC_DISABLED_MODE_KEY = "_disabled_mode"; 2424 2425 /** 2426 * @hide - RemoteCallback monitor callback argument extra to the fast-path call()-based requests 2427 */ 2428 public static final String CALL_METHOD_MONITOR_CALLBACK_KEY = "_monitor_callback_key"; 2429 2430 /** 2431 * @hide - String argument extra to the fast-path call()-based requests 2432 */ 2433 public static final String CALL_METHOD_FLAGS_KEY = "_flags"; 2434 2435 /** 2436 * @hide - String argument extra to the fast-path call()-based requests 2437 */ 2438 public static final String CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY = "_overrideable_by_restore"; 2439 2440 /** @hide - Private call() method to write to 'system' table */ 2441 public static final String CALL_METHOD_PUT_SYSTEM = "PUT_system"; 2442 2443 /** @hide - Private call() method to write to 'secure' table */ 2444 public static final String CALL_METHOD_PUT_SECURE = "PUT_secure"; 2445 2446 /** @hide - Private call() method to write to 'global' table */ 2447 public static final String CALL_METHOD_PUT_GLOBAL= "PUT_global"; 2448 2449 /** @hide - Private call() method to write to 'configuration' table */ 2450 public static final String CALL_METHOD_PUT_CONFIG = "PUT_config"; 2451 2452 /** @hide - Private call() method to write to and delete from the 'configuration' table */ 2453 public static final String CALL_METHOD_SET_ALL_CONFIG = "SET_ALL_config"; 2454 2455 /** @hide - Private call() method to delete from the 'system' table */ 2456 public static final String CALL_METHOD_DELETE_SYSTEM = "DELETE_system"; 2457 2458 /** @hide - Private call() method to delete from the 'secure' table */ 2459 public static final String CALL_METHOD_DELETE_SECURE = "DELETE_secure"; 2460 2461 /** @hide - Private call() method to delete from the 'global' table */ 2462 public static final String CALL_METHOD_DELETE_GLOBAL = "DELETE_global"; 2463 2464 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2465 public static final String CALL_METHOD_DELETE_CONFIG = "DELETE_config"; 2466 2467 /** @hide - Private call() method to reset to defaults the 'secure' table */ 2468 public static final String CALL_METHOD_RESET_SECURE = "RESET_secure"; 2469 2470 /** @hide - Private call() method to reset to defaults the 'global' table */ 2471 public static final String CALL_METHOD_RESET_GLOBAL = "RESET_global"; 2472 2473 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2474 public static final String CALL_METHOD_RESET_CONFIG = "RESET_config"; 2475 2476 /** @hide - Private call() method to query the 'system' table */ 2477 public static final String CALL_METHOD_LIST_SYSTEM = "LIST_system"; 2478 2479 /** @hide - Private call() method to query the 'secure' table */ 2480 public static final String CALL_METHOD_LIST_SECURE = "LIST_secure"; 2481 2482 /** @hide - Private call() method to query the 'global' table */ 2483 public static final String CALL_METHOD_LIST_GLOBAL = "LIST_global"; 2484 2485 /** @hide - Private call() method to reset to defaults the 'configuration' table */ 2486 public static final String CALL_METHOD_LIST_CONFIG = "LIST_config"; 2487 2488 /** @hide - Private call() method to disable / re-enable syncs to the 'configuration' table */ 2489 public static final String CALL_METHOD_SET_SYNC_DISABLED_CONFIG = "SET_SYNC_DISABLED_config"; 2490 2491 /** 2492 * @hide - Private call() method to return whether syncs are disabled for the 'configuration' 2493 * table 2494 */ 2495 public static final String CALL_METHOD_IS_SYNC_DISABLED_CONFIG = "IS_SYNC_DISABLED_config"; 2496 2497 /** @hide - Private call() method to register monitor callback for 'configuration' table */ 2498 public static final String CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG = 2499 "REGISTER_MONITOR_CALLBACK_config"; 2500 2501 /** @hide - String argument extra to the config monitor callback */ 2502 public static final String EXTRA_MONITOR_CALLBACK_TYPE = "monitor_callback_type"; 2503 2504 /** @hide - String argument extra to the config monitor callback */ 2505 public static final String EXTRA_ACCESS_CALLBACK = "access_callback"; 2506 2507 /** @hide - String argument extra to the config monitor callback */ 2508 public static final String EXTRA_NAMESPACE_UPDATED_CALLBACK = 2509 "namespace_updated_callback"; 2510 2511 /** @hide - String argument extra to the config monitor callback */ 2512 public static final String EXTRA_NAMESPACE = "namespace"; 2513 2514 /** @hide - String argument extra to the config monitor callback */ 2515 public static final String EXTRA_CALLING_PACKAGE = "calling_package"; 2516 2517 /** 2518 * Activity Extra: Limit available options in launched activity based on the given authority. 2519 * <p> 2520 * This can be passed as an extra field in an Activity Intent with one or more syncable content 2521 * provider's authorities as a String[]. This field is used by some intents to alter the 2522 * behavior of the called activity. 2523 * <p> 2524 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types available based 2525 * on the authority given. 2526 */ 2527 public static final String EXTRA_AUTHORITIES = "authorities"; 2528 2529 /** 2530 * Activity Extra: Limit available options in launched activity based on the given account 2531 * types. 2532 * <p> 2533 * This can be passed as an extra field in an Activity Intent with one or more account types 2534 * as a String[]. This field is used by some intents to alter the behavior of the called 2535 * activity. 2536 * <p> 2537 * Example: The {@link #ACTION_ADD_ACCOUNT} intent restricts the account types to the specified 2538 * list. 2539 */ 2540 public static final String EXTRA_ACCOUNT_TYPES = "account_types"; 2541 2542 public static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; 2543 2544 /** 2545 * Activity Extra: The device identifier to act upon. 2546 * <p> 2547 * This can be passed as an extra field in an Activity Intent with a single 2548 * InputDeviceIdentifier. This field is used by some activities to jump straight into the 2549 * settings for the given device. 2550 * <p> 2551 * Example: The {@link #ACTION_INPUT_METHOD_SETTINGS} intent opens the keyboard layout 2552 * dialog for the given device. 2553 * @hide 2554 */ 2555 public static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier"; 2556 2557 /** 2558 * Activity Extra: Enable or disable Airplane Mode. 2559 * <p> 2560 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE} 2561 * intent as a boolean to indicate if it should be enabled. 2562 */ 2563 public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; 2564 2565 /** 2566 * Activity Extra: Enable or disable Battery saver mode. 2567 * <p> 2568 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE} 2569 * intent as a boolean to indicate if it should be enabled. 2570 */ 2571 public static final String EXTRA_BATTERY_SAVER_MODE_ENABLED = 2572 "android.settings.extra.battery_saver_mode_enabled"; 2573 2574 /** 2575 * Activity Extra: Enable or disable Do Not Disturb mode. 2576 * <p> 2577 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2578 * intent as a boolean to indicate if it should be enabled. 2579 */ 2580 public static final String EXTRA_DO_NOT_DISTURB_MODE_ENABLED = 2581 "android.settings.extra.do_not_disturb_mode_enabled"; 2582 2583 /** 2584 * Activity Extra: How many minutes to enable do not disturb mode for. 2585 * <p> 2586 * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE} 2587 * intent to indicate how long do not disturb mode should be enabled for. 2588 */ 2589 public static final String EXTRA_DO_NOT_DISTURB_MODE_MINUTES = 2590 "android.settings.extra.do_not_disturb_mode_minutes"; 2591 2592 /** 2593 * Reset mode: reset to defaults only settings changed by the 2594 * calling package. If there is a default set the setting 2595 * will be set to it, otherwise the setting will be deleted. 2596 * This is the only type of reset available to non-system clients. 2597 * @hide 2598 */ 2599 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 2600 @TestApi 2601 public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; 2602 2603 /** 2604 * Reset mode: reset all settings set by untrusted packages, which is 2605 * packages that aren't a part of the system, to the current defaults. 2606 * If there is a default set the setting will be set to it, otherwise 2607 * the setting will be deleted. This mode is only available to the system. 2608 * @hide 2609 */ 2610 public static final int RESET_MODE_UNTRUSTED_DEFAULTS = 2; 2611 2612 /** 2613 * Reset mode: delete all settings set by untrusted packages, which is 2614 * packages that aren't a part of the system. If a setting is set by an 2615 * untrusted package it will be deleted if its default is not provided 2616 * by the system, otherwise the setting will be set to its default. 2617 * This mode is only available to the system. 2618 * @hide 2619 */ 2620 public static final int RESET_MODE_UNTRUSTED_CHANGES = 3; 2621 2622 /** 2623 * Reset mode: reset all settings to defaults specified by trusted 2624 * packages, which is packages that are a part of the system, and 2625 * delete all settings set by untrusted packages. If a setting has 2626 * a default set by a system package it will be set to the default, 2627 * otherwise the setting will be deleted. This mode is only available 2628 * to the system. 2629 * @hide 2630 */ 2631 public static final int RESET_MODE_TRUSTED_DEFAULTS = 4; 2632 2633 /** @hide */ 2634 @Retention(RetentionPolicy.SOURCE) 2635 @IntDef(prefix = { "RESET_MODE_" }, value = { 2636 RESET_MODE_PACKAGE_DEFAULTS, 2637 RESET_MODE_UNTRUSTED_DEFAULTS, 2638 RESET_MODE_UNTRUSTED_CHANGES, 2639 RESET_MODE_TRUSTED_DEFAULTS 2640 }) 2641 public @interface ResetMode{} 2642 2643 /** 2644 * Activity Extra: Number of certificates 2645 * <p> 2646 * This can be passed as an extra field to the {@link #ACTION_MONITORING_CERT_INFO} 2647 * intent to indicate the number of certificates 2648 * @hide 2649 */ 2650 public static final String EXTRA_NUMBER_OF_CERTIFICATES = 2651 "android.settings.extra.number_of_certificates"; 2652 2653 private static final String SYSTEM_PACKAGE_NAME = "android"; 2654 2655 public static final String AUTHORITY = "settings"; 2656 2657 private static final String TAG = "Settings"; 2658 private static final boolean LOCAL_LOGV = false; 2659 2660 // Used in system server calling uid workaround in call() 2661 private static boolean sInSystemServer = false; 2662 private static final Object sInSystemServerLock = new Object(); 2663 2664 /** @hide */ setInSystemServer()2665 public static void setInSystemServer() { 2666 synchronized (sInSystemServerLock) { 2667 sInSystemServer = true; 2668 } 2669 } 2670 2671 /** @hide */ isInSystemServer()2672 public static boolean isInSystemServer() { 2673 synchronized (sInSystemServerLock) { 2674 return sInSystemServer; 2675 } 2676 } 2677 2678 public static class SettingNotFoundException extends AndroidException { SettingNotFoundException(String msg)2679 public SettingNotFoundException(String msg) { 2680 super(msg); 2681 } 2682 } 2683 2684 /** 2685 * Common base for tables of name/value settings. 2686 */ 2687 public static class NameValueTable implements BaseColumns { 2688 public static final String NAME = "name"; 2689 public static final String VALUE = "value"; 2690 // A flag indicating whether the current value of a setting should be preserved during 2691 // restore. 2692 /** @hide */ 2693 public static final String IS_PRESERVED_IN_RESTORE = "is_preserved_in_restore"; 2694 putString(ContentResolver resolver, Uri uri, String name, String value)2695 protected static boolean putString(ContentResolver resolver, Uri uri, 2696 String name, String value) { 2697 // The database will take care of replacing duplicates. 2698 try { 2699 ContentValues values = new ContentValues(); 2700 values.put(NAME, name); 2701 values.put(VALUE, value); 2702 resolver.insert(uri, values); 2703 return true; 2704 } catch (SQLException e) { 2705 Log.w(TAG, "Can't set key " + name + " in " + uri, e); 2706 return false; 2707 } 2708 } 2709 getUriFor(Uri uri, String name)2710 public static Uri getUriFor(Uri uri, String name) { 2711 return Uri.withAppendedPath(uri, name); 2712 } 2713 } 2714 2715 private static final class GenerationTracker { 2716 private final MemoryIntArray mArray; 2717 private final Runnable mErrorHandler; 2718 private final int mIndex; 2719 private int mCurrentGeneration; 2720 GenerationTracker(@onNull MemoryIntArray array, int index, int generation, Runnable errorHandler)2721 public GenerationTracker(@NonNull MemoryIntArray array, int index, 2722 int generation, Runnable errorHandler) { 2723 mArray = array; 2724 mIndex = index; 2725 mErrorHandler = errorHandler; 2726 mCurrentGeneration = generation; 2727 } 2728 isGenerationChanged()2729 public boolean isGenerationChanged() { 2730 final int currentGeneration = readCurrentGeneration(); 2731 if (currentGeneration >= 0) { 2732 if (currentGeneration == mCurrentGeneration) { 2733 return false; 2734 } 2735 mCurrentGeneration = currentGeneration; 2736 } 2737 return true; 2738 } 2739 getCurrentGeneration()2740 public int getCurrentGeneration() { 2741 return mCurrentGeneration; 2742 } 2743 readCurrentGeneration()2744 private int readCurrentGeneration() { 2745 try { 2746 return mArray.get(mIndex); 2747 } catch (IOException e) { 2748 Log.e(TAG, "Error getting current generation", e); 2749 if (mErrorHandler != null) { 2750 mErrorHandler.run(); 2751 } 2752 } 2753 return -1; 2754 } 2755 destroy()2756 public void destroy() { 2757 try { 2758 mArray.close(); 2759 } catch (IOException e) { 2760 Log.e(TAG, "Error closing backing array", e); 2761 if (mErrorHandler != null) { 2762 mErrorHandler.run(); 2763 } 2764 } 2765 } 2766 } 2767 2768 private static final class ContentProviderHolder { 2769 private final Object mLock = new Object(); 2770 2771 private final Uri mUri; 2772 @GuardedBy("mLock") 2773 @UnsupportedAppUsage 2774 private IContentProvider mContentProvider; 2775 ContentProviderHolder(Uri uri)2776 public ContentProviderHolder(Uri uri) { 2777 mUri = uri; 2778 } 2779 getProvider(ContentResolver contentResolver)2780 public IContentProvider getProvider(ContentResolver contentResolver) { 2781 synchronized (mLock) { 2782 if (mContentProvider == null) { 2783 mContentProvider = contentResolver 2784 .acquireProvider(mUri.getAuthority()); 2785 } 2786 return mContentProvider; 2787 } 2788 } 2789 clearProviderForTest()2790 public void clearProviderForTest() { 2791 synchronized (mLock) { 2792 mContentProvider = null; 2793 } 2794 } 2795 } 2796 2797 // Thread-safe. 2798 private static class NameValueCache { 2799 private static final boolean DEBUG = false; 2800 2801 private static final String[] SELECT_VALUE_PROJECTION = new String[] { 2802 Settings.NameValueTable.VALUE 2803 }; 2804 2805 private static final String NAME_EQ_PLACEHOLDER = "name=?"; 2806 2807 // Must synchronize on 'this' to access mValues and mValuesVersion. 2808 private final ArrayMap<String, String> mValues = new ArrayMap<>(); 2809 2810 private final Uri mUri; 2811 @UnsupportedAppUsage 2812 private final ContentProviderHolder mProviderHolder; 2813 2814 // The method we'll call (or null, to not use) on the provider 2815 // for the fast path of retrieving settings. 2816 private final String mCallGetCommand; 2817 private final String mCallSetCommand; 2818 private final String mCallListCommand; 2819 private final String mCallSetAllCommand; 2820 2821 private final ArraySet<String> mReadableFields; 2822 private final ArraySet<String> mAllFields; 2823 private final ArrayMap<String, Integer> mReadableFieldsWithMaxTargetSdk; 2824 2825 @GuardedBy("this") 2826 private GenerationTracker mGenerationTracker; 2827 NameValueCache(Uri uri, String getCommand, String setCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2828 <T extends NameValueTable> NameValueCache(Uri uri, String getCommand, 2829 String setCommand, ContentProviderHolder providerHolder, Class<T> callerClass) { 2830 this(uri, getCommand, setCommand, null, null, providerHolder, 2831 callerClass); 2832 } 2833 NameValueCache(Uri uri, String getCommand, String setCommand, String listCommand, String setAllCommand, ContentProviderHolder providerHolder, Class<T> callerClass)2834 private <T extends NameValueTable> NameValueCache(Uri uri, String getCommand, 2835 String setCommand, String listCommand, String setAllCommand, 2836 ContentProviderHolder providerHolder, Class<T> callerClass) { 2837 mUri = uri; 2838 mCallGetCommand = getCommand; 2839 mCallSetCommand = setCommand; 2840 mCallListCommand = listCommand; 2841 mCallSetAllCommand = setAllCommand; 2842 mProviderHolder = providerHolder; 2843 mReadableFields = new ArraySet<>(); 2844 mAllFields = new ArraySet<>(); 2845 mReadableFieldsWithMaxTargetSdk = new ArrayMap<>(); 2846 getPublicSettingsForClass(callerClass, mAllFields, mReadableFields, 2847 mReadableFieldsWithMaxTargetSdk); 2848 } 2849 putStringForUser(ContentResolver cr, String name, String value, String tag, boolean makeDefault, final int userHandle, boolean overrideableByRestore)2850 public boolean putStringForUser(ContentResolver cr, String name, String value, 2851 String tag, boolean makeDefault, final int userHandle, 2852 boolean overrideableByRestore) { 2853 try { 2854 Bundle arg = new Bundle(); 2855 arg.putString(Settings.NameValueTable.VALUE, value); 2856 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 2857 if (tag != null) { 2858 arg.putString(CALL_METHOD_TAG_KEY, tag); 2859 } 2860 if (makeDefault) { 2861 arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true); 2862 } 2863 if (overrideableByRestore) { 2864 arg.putBoolean(CALL_METHOD_OVERRIDEABLE_BY_RESTORE_KEY, true); 2865 } 2866 IContentProvider cp = mProviderHolder.getProvider(cr); 2867 cp.call(cr.getAttributionSource(), 2868 mProviderHolder.mUri.getAuthority(), mCallSetCommand, name, arg); 2869 } catch (RemoteException e) { 2870 Log.w(TAG, "Can't set key " + name + " in " + mUri, e); 2871 return false; 2872 } 2873 return true; 2874 } 2875 setStringsForPrefix(ContentResolver cr, String prefix, HashMap<String, String> keyValues)2876 public @SetAllResult int setStringsForPrefix(ContentResolver cr, String prefix, 2877 HashMap<String, String> keyValues) { 2878 if (mCallSetAllCommand == null) { 2879 // This NameValueCache does not support atomically setting multiple flags 2880 return SET_ALL_RESULT_FAILURE; 2881 } 2882 try { 2883 Bundle args = new Bundle(); 2884 args.putString(CALL_METHOD_PREFIX_KEY, prefix); 2885 args.putSerializable(CALL_METHOD_FLAGS_KEY, keyValues); 2886 IContentProvider cp = mProviderHolder.getProvider(cr); 2887 Bundle bundle = cp.call(cr.getAttributionSource(), 2888 mProviderHolder.mUri.getAuthority(), 2889 mCallSetAllCommand, null, args); 2890 return bundle.getInt(KEY_CONFIG_SET_ALL_RETURN); 2891 } catch (RemoteException e) { 2892 // Not supported by the remote side 2893 return SET_ALL_RESULT_FAILURE; 2894 } 2895 } 2896 2897 @UnsupportedAppUsage getStringForUser(ContentResolver cr, String name, final int userHandle)2898 public String getStringForUser(ContentResolver cr, String name, final int userHandle) { 2899 // Check if the target settings key is readable. Reject if the caller is not system and 2900 // is trying to access a settings key defined in the Settings.Secure, Settings.System or 2901 // Settings.Global and is not annotated as @Readable. 2902 // Notice that a key string that is not defined in any of the Settings.* classes will 2903 // still be regarded as readable. 2904 if (!isCallerExemptFromReadableRestriction() && mAllFields.contains(name)) { 2905 if (!mReadableFields.contains(name)) { 2906 throw new SecurityException( 2907 "Settings key: <" + name + "> is not readable. From S+, settings keys " 2908 + "annotated with @hide are restricted to system_server and " 2909 + "system apps only, unless they are annotated with @Readable." 2910 ); 2911 } else { 2912 // When the target settings key has @Readable annotation, if the caller app's 2913 // target sdk is higher than the maxTargetSdk of the annotation, reject access. 2914 if (mReadableFieldsWithMaxTargetSdk.containsKey(name)) { 2915 final int maxTargetSdk = mReadableFieldsWithMaxTargetSdk.get(name); 2916 final Application application = ActivityThread.currentApplication(); 2917 final boolean targetSdkCheckOk = application != null 2918 && application.getApplicationInfo() != null 2919 && application.getApplicationInfo().targetSdkVersion 2920 <= maxTargetSdk; 2921 if (!targetSdkCheckOk) { 2922 throw new SecurityException( 2923 "Settings key: <" + name + "> is only readable to apps with " 2924 + "targetSdkVersion lower than or equal to: " 2925 + maxTargetSdk 2926 ); 2927 } 2928 } 2929 } 2930 } 2931 2932 final boolean isSelf = (userHandle == UserHandle.myUserId()); 2933 int currentGeneration = -1; 2934 if (isSelf) { 2935 synchronized (NameValueCache.this) { 2936 if (mGenerationTracker != null) { 2937 if (mGenerationTracker.isGenerationChanged()) { 2938 if (DEBUG) { 2939 Log.i(TAG, "Generation changed for type:" 2940 + mUri.getPath() + " in package:" 2941 + cr.getPackageName() +" and user:" + userHandle); 2942 } 2943 mValues.clear(); 2944 } else if (mValues.containsKey(name)) { 2945 return mValues.get(name); 2946 } 2947 if (mGenerationTracker != null) { 2948 currentGeneration = mGenerationTracker.getCurrentGeneration(); 2949 } 2950 } 2951 } 2952 } else { 2953 if (LOCAL_LOGV) Log.v(TAG, "get setting for user " + userHandle 2954 + " by user " + UserHandle.myUserId() + " so skipping cache"); 2955 } 2956 2957 IContentProvider cp = mProviderHolder.getProvider(cr); 2958 2959 // Try the fast path first, not using query(). If this 2960 // fails (alternate Settings provider that doesn't support 2961 // this interface?) then we fall back to the query/table 2962 // interface. 2963 if (mCallGetCommand != null) { 2964 try { 2965 Bundle args = null; 2966 if (!isSelf) { 2967 args = new Bundle(); 2968 args.putInt(CALL_METHOD_USER_KEY, userHandle); 2969 } 2970 boolean needsGenerationTracker = false; 2971 synchronized (NameValueCache.this) { 2972 if (isSelf && mGenerationTracker == null) { 2973 needsGenerationTracker = true; 2974 if (args == null) { 2975 args = new Bundle(); 2976 } 2977 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 2978 if (DEBUG) { 2979 Log.i(TAG, "Requested generation tracker for type: "+ mUri.getPath() 2980 + " in package:" + cr.getPackageName() +" and user:" 2981 + userHandle); 2982 } 2983 } 2984 } 2985 Bundle b; 2986 // If we're in system server and in a binder transaction we need to clear the 2987 // calling uid. This works around code in system server that did not call 2988 // clearCallingIdentity, previously this wasn't needed because reading settings 2989 // did not do permission checking but thats no longer the case. 2990 // Long term this should be removed and callers should properly call 2991 // clearCallingIdentity or use a ContentResolver from the caller as needed. 2992 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 2993 final long token = Binder.clearCallingIdentity(); 2994 try { 2995 b = cp.call(cr.getAttributionSource(), 2996 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, 2997 args); 2998 } finally { 2999 Binder.restoreCallingIdentity(token); 3000 } 3001 } else { 3002 b = cp.call(cr.getAttributionSource(), 3003 mProviderHolder.mUri.getAuthority(), mCallGetCommand, name, args); 3004 } 3005 if (b != null) { 3006 String value = b.getString(Settings.NameValueTable.VALUE); 3007 // Don't update our cache for reads of other users' data 3008 if (isSelf) { 3009 synchronized (NameValueCache.this) { 3010 if (needsGenerationTracker) { 3011 MemoryIntArray array = b.getParcelable( 3012 CALL_METHOD_TRACK_GENERATION_KEY); 3013 final int index = b.getInt( 3014 CALL_METHOD_GENERATION_INDEX_KEY, -1); 3015 if (array != null && index >= 0) { 3016 final int generation = b.getInt( 3017 CALL_METHOD_GENERATION_KEY, 0); 3018 if (DEBUG) { 3019 Log.i(TAG, "Received generation tracker for type:" 3020 + mUri.getPath() + " in package:" 3021 + cr.getPackageName() + " and user:" 3022 + userHandle + " with index:" + index); 3023 } 3024 if (mGenerationTracker != null) { 3025 mGenerationTracker.destroy(); 3026 } 3027 mGenerationTracker = new GenerationTracker(array, index, 3028 generation, () -> { 3029 synchronized (NameValueCache.this) { 3030 Log.e(TAG, "Error accessing generation" 3031 + " tracker - removing"); 3032 if (mGenerationTracker != null) { 3033 GenerationTracker generationTracker = 3034 mGenerationTracker; 3035 mGenerationTracker = null; 3036 generationTracker.destroy(); 3037 mValues.clear(); 3038 } 3039 } 3040 }); 3041 currentGeneration = generation; 3042 } 3043 } 3044 if (mGenerationTracker != null && currentGeneration == 3045 mGenerationTracker.getCurrentGeneration()) { 3046 mValues.put(name, value); 3047 } 3048 } 3049 } else { 3050 if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle 3051 + " by " + UserHandle.myUserId() 3052 + " so not updating cache"); 3053 } 3054 return value; 3055 } 3056 // If the response Bundle is null, we fall through 3057 // to the query interface below. 3058 } catch (RemoteException e) { 3059 // Not supported by the remote side? Fall through 3060 // to query(). 3061 } 3062 } 3063 3064 Cursor c = null; 3065 try { 3066 Bundle queryArgs = ContentResolver.createSqlQueryBundle( 3067 NAME_EQ_PLACEHOLDER, new String[]{name}, null); 3068 // Same workaround as above. 3069 if (Settings.isInSystemServer() && Binder.getCallingUid() != Process.myUid()) { 3070 final long token = Binder.clearCallingIdentity(); 3071 try { 3072 c = cp.query(cr.getAttributionSource(), mUri, 3073 SELECT_VALUE_PROJECTION, queryArgs, null); 3074 } finally { 3075 Binder.restoreCallingIdentity(token); 3076 } 3077 } else { 3078 c = cp.query(cr.getAttributionSource(), mUri, 3079 SELECT_VALUE_PROJECTION, queryArgs, null); 3080 } 3081 if (c == null) { 3082 Log.w(TAG, "Can't get key " + name + " from " + mUri); 3083 return null; 3084 } 3085 3086 String value = c.moveToNext() ? c.getString(0) : null; 3087 synchronized (NameValueCache.this) { 3088 if (mGenerationTracker != null 3089 && currentGeneration == mGenerationTracker.getCurrentGeneration()) { 3090 mValues.put(name, value); 3091 } 3092 } 3093 if (LOCAL_LOGV) { 3094 Log.v(TAG, "cache miss [" + mUri.getLastPathSegment() + "]: " + 3095 name + " = " + (value == null ? "(null)" : value)); 3096 } 3097 return value; 3098 } catch (RemoteException e) { 3099 Log.w(TAG, "Can't get key " + name + " from " + mUri, e); 3100 return null; // Return null, but don't cache it. 3101 } finally { 3102 if (c != null) c.close(); 3103 } 3104 } 3105 isCallerExemptFromReadableRestriction()3106 private static boolean isCallerExemptFromReadableRestriction() { 3107 if (Settings.isInSystemServer()) { 3108 return true; 3109 } 3110 if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { 3111 return true; 3112 } 3113 final Application application = ActivityThread.currentApplication(); 3114 if (application == null || application.getApplicationInfo() == null) { 3115 return false; 3116 } 3117 final ApplicationInfo applicationInfo = application.getApplicationInfo(); 3118 final boolean isTestOnly = 3119 (applicationInfo.flags & ApplicationInfo.FLAG_TEST_ONLY) != 0; 3120 return isTestOnly || applicationInfo.isSystemApp() || applicationInfo.isPrivilegedApp() 3121 || applicationInfo.isSignedWithPlatformKey(); 3122 } 3123 getStringsForPrefix(ContentResolver cr, String prefix, List<String> names)3124 public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix, 3125 List<String> names) { 3126 String namespace = prefix.substring(0, prefix.length() - 1); 3127 DeviceConfig.enforceReadPermission(ActivityThread.currentApplication(), namespace); 3128 ArrayMap<String, String> keyValues = new ArrayMap<>(); 3129 int currentGeneration = -1; 3130 3131 synchronized (NameValueCache.this) { 3132 if (mGenerationTracker != null) { 3133 if (mGenerationTracker.isGenerationChanged()) { 3134 if (DEBUG) { 3135 Log.i(TAG, "Generation changed for type:" + mUri.getPath() 3136 + " in package:" + cr.getPackageName()); 3137 } 3138 mValues.clear(); 3139 } else { 3140 boolean prefixCached = mValues.containsKey(prefix); 3141 if (prefixCached) { 3142 if (!names.isEmpty()) { 3143 for (String name : names) { 3144 if (mValues.containsKey(name)) { 3145 keyValues.put(name, mValues.get(name)); 3146 } 3147 } 3148 } else { 3149 for (int i = 0; i < mValues.size(); ++i) { 3150 String key = mValues.keyAt(i); 3151 // Explicitly exclude the prefix as it is only there to 3152 // signal that the prefix has been cached. 3153 if (key.startsWith(prefix) && !key.equals(prefix)) { 3154 keyValues.put(key, mValues.get(key)); 3155 } 3156 } 3157 } 3158 return keyValues; 3159 } 3160 } 3161 if (mGenerationTracker != null) { 3162 currentGeneration = mGenerationTracker.getCurrentGeneration(); 3163 } 3164 } 3165 } 3166 3167 if (mCallListCommand == null) { 3168 // No list command specified, return empty map 3169 return keyValues; 3170 } 3171 IContentProvider cp = mProviderHolder.getProvider(cr); 3172 3173 try { 3174 Bundle args = new Bundle(); 3175 args.putString(Settings.CALL_METHOD_PREFIX_KEY, prefix); 3176 boolean needsGenerationTracker = false; 3177 synchronized (NameValueCache.this) { 3178 if (mGenerationTracker == null) { 3179 needsGenerationTracker = true; 3180 args.putString(CALL_METHOD_TRACK_GENERATION_KEY, null); 3181 if (DEBUG) { 3182 Log.i(TAG, "Requested generation tracker for type: " 3183 + mUri.getPath() + " in package:" + cr.getPackageName()); 3184 } 3185 } 3186 } 3187 3188 // Fetch all flags for the namespace at once for caching purposes 3189 Bundle b = cp.call(cr.getAttributionSource(), 3190 mProviderHolder.mUri.getAuthority(), mCallListCommand, null, args); 3191 if (b == null) { 3192 // Invalid response, return an empty map 3193 return keyValues; 3194 } 3195 3196 // All flags for the namespace 3197 Map<String, String> flagsToValues = 3198 (HashMap) b.getSerializable(Settings.NameValueTable.VALUE); 3199 // Only the flags requested by the caller 3200 if (!names.isEmpty()) { 3201 for (Map.Entry<String, String> flag : flagsToValues.entrySet()) { 3202 if (names.contains(flag.getKey())) { 3203 keyValues.put(flag.getKey(), flag.getValue()); 3204 } 3205 } 3206 } else { 3207 keyValues.putAll(flagsToValues); 3208 } 3209 3210 synchronized (NameValueCache.this) { 3211 if (needsGenerationTracker) { 3212 MemoryIntArray array = b.getParcelable( 3213 CALL_METHOD_TRACK_GENERATION_KEY); 3214 final int index = b.getInt( 3215 CALL_METHOD_GENERATION_INDEX_KEY, -1); 3216 if (array != null && index >= 0) { 3217 final int generation = b.getInt( 3218 CALL_METHOD_GENERATION_KEY, 0); 3219 if (DEBUG) { 3220 Log.i(TAG, "Received generation tracker for type:" 3221 + mUri.getPath() + " in package:" 3222 + cr.getPackageName() + " with index:" + index); 3223 } 3224 if (mGenerationTracker != null) { 3225 mGenerationTracker.destroy(); 3226 } 3227 mGenerationTracker = new GenerationTracker(array, index, 3228 generation, () -> { 3229 synchronized (NameValueCache.this) { 3230 Log.e(TAG, "Error accessing generation tracker" 3231 + " - removing"); 3232 if (mGenerationTracker != null) { 3233 GenerationTracker generationTracker = 3234 mGenerationTracker; 3235 mGenerationTracker = null; 3236 generationTracker.destroy(); 3237 mValues.clear(); 3238 } 3239 } 3240 }); 3241 currentGeneration = generation; 3242 } 3243 } 3244 if (mGenerationTracker != null && currentGeneration 3245 == mGenerationTracker.getCurrentGeneration()) { 3246 // cache the complete list of flags for the namespace 3247 mValues.putAll(flagsToValues); 3248 // Adding the prefix as a signal that the prefix is cached. 3249 mValues.put(prefix, null); 3250 } 3251 } 3252 return keyValues; 3253 } catch (RemoteException e) { 3254 // Not supported by the remote side, return an empty map 3255 return keyValues; 3256 } 3257 } 3258 clearGenerationTrackerForTest()3259 public void clearGenerationTrackerForTest() { 3260 synchronized (NameValueCache.this) { 3261 if (mGenerationTracker != null) { 3262 mGenerationTracker.destroy(); 3263 } 3264 mValues.clear(); 3265 mGenerationTracker = null; 3266 } 3267 } 3268 } 3269 3270 /** 3271 * Checks if the specified context can draw on top of other apps. As of API 3272 * level 23, an app cannot draw on top of other apps unless it declares the 3273 * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its 3274 * manifest, <em>and</em> the user specifically grants the app this 3275 * capability. To prompt the user to grant this approval, the app must send an 3276 * intent with the action 3277 * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which 3278 * causes the system to display a permission management screen. 3279 * 3280 * @param context App context. 3281 * @return true if the specified context can draw on top of other apps, false otherwise 3282 */ canDrawOverlays(Context context)3283 public static boolean canDrawOverlays(Context context) { 3284 return Settings.isCallingPackageAllowedToDrawOverlays(context, Process.myUid(), 3285 context.getOpPackageName(), false) || context.checkSelfPermission( 3286 Manifest.permission.SYSTEM_APPLICATION_OVERLAY) 3287 == PackageManager.PERMISSION_GRANTED; 3288 } 3289 3290 /** 3291 * This annotation indicates that the value of a setting is allowed to be read 3292 * with the get* methods. The following settings should be readable: 3293 * 1) all the public settings 3294 * 2) all the hidden settings added before S 3295 */ 3296 @Target({ ElementType.FIELD }) 3297 @Retention(RetentionPolicy.RUNTIME) 3298 private @interface Readable { maxTargetSdk()3299 int maxTargetSdk() default 0; 3300 } 3301 getPublicSettingsForClass( Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> keysWithMaxTargetSdk)3302 private static <T extends NameValueTable> void getPublicSettingsForClass( 3303 Class<T> callerClass, Set<String> allKeys, Set<String> readableKeys, 3304 ArrayMap<String, Integer> keysWithMaxTargetSdk) { 3305 final Field[] allFields = callerClass.getDeclaredFields(); 3306 try { 3307 for (int i = 0; i < allFields.length; i++) { 3308 final Field field = allFields[i]; 3309 if (!field.getType().equals(String.class)) { 3310 continue; 3311 } 3312 final Object value = field.get(callerClass); 3313 if (!value.getClass().equals(String.class)) { 3314 continue; 3315 } 3316 allKeys.add((String) value); 3317 final Readable annotation = field.getAnnotation(Readable.class); 3318 3319 if (annotation != null) { 3320 final String key = (String) value; 3321 final int maxTargetSdk = annotation.maxTargetSdk(); 3322 readableKeys.add(key); 3323 if (maxTargetSdk != 0) { 3324 keysWithMaxTargetSdk.put(key, maxTargetSdk); 3325 } 3326 } 3327 } 3328 } catch (IllegalAccessException ignored) { 3329 } 3330 } 3331 3332 /** 3333 * System settings, containing miscellaneous system preferences. This 3334 * table holds simple name/value pairs. There are convenience 3335 * functions for accessing individual settings entries. 3336 */ 3337 public static final class System extends NameValueTable { 3338 // NOTE: If you add new settings here, be sure to add them to 3339 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked. 3340 3341 private static final float DEFAULT_FONT_SCALE = 1.0f; 3342 private static final int DEFAULT_FONT_WEIGHT = 0; 3343 3344 /** 3345 * The content:// style URL for this table 3346 */ 3347 public static final Uri CONTENT_URI = 3348 Uri.parse("content://" + AUTHORITY + "/system"); 3349 3350 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3351 private static final ContentProviderHolder sProviderHolder = 3352 new ContentProviderHolder(CONTENT_URI); 3353 3354 @UnsupportedAppUsage 3355 private static final NameValueCache sNameValueCache = new NameValueCache( 3356 CONTENT_URI, 3357 CALL_METHOD_GET_SYSTEM, 3358 CALL_METHOD_PUT_SYSTEM, 3359 sProviderHolder, 3360 System.class); 3361 3362 @UnsupportedAppUsage 3363 private static final HashSet<String> MOVED_TO_SECURE; 3364 static { 3365 MOVED_TO_SECURE = new HashSet<>(30); 3366 MOVED_TO_SECURE.add(Secure.ADAPTIVE_SLEEP); 3367 MOVED_TO_SECURE.add(Secure.ANDROID_ID); 3368 MOVED_TO_SECURE.add(Secure.HTTP_PROXY); 3369 MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED); 3370 MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS); 3371 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED); 3372 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE); 3373 MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 3374 MOVED_TO_SECURE.add(Secure.LOGGING_ID); 3375 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_ENABLED); 3376 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_LAST_UPDATE); 3377 MOVED_TO_SECURE.add(Secure.PARENTAL_CONTROL_REDIRECT_URL); 3378 MOVED_TO_SECURE.add(Secure.SETTINGS_CLASSNAME); 3379 MOVED_TO_SECURE.add(Secure.USE_GOOGLE_MAIL); 3380 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 3381 MOVED_TO_SECURE.add(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 3382 MOVED_TO_SECURE.add(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT); 3383 MOVED_TO_SECURE.add(Secure.WIFI_ON); 3384 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE); 3385 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_AP_COUNT); 3386 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS); 3387 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED); 3388 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS); 3389 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT); 3390 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_MAX_AP_CHECKS); 3391 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_ON); 3392 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT); 3393 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS); 3394 MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS); 3395 3396 // At one time in System, then Global, but now back in Secure 3397 MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS); 3398 } 3399 3400 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3401 private static final HashSet<String> MOVED_TO_GLOBAL; 3402 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 3403 private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL; 3404 static { 3405 MOVED_TO_GLOBAL = new HashSet<>(); 3406 MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<>(); 3407 3408 // these were originally in system but migrated to secure in the past, 3409 // so are duplicated in the Secure.* namespace 3410 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED); 3411 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON); 3412 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING); 3413 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED); 3414 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY); 3415 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.NETWORK_PREFERENCE); 3416 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED); 3417 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 3418 MOVED_TO_SECURE_THEN_GLOBAL.add(Global.WIFI_MAX_DHCP_RETRY_COUNT); 3419 3420 // these are moving directly from system to global 3421 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON); 3422 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_RADIOS); 3423 MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); 3424 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME); 3425 MOVED_TO_GLOBAL.add(Settings.Global.AUTO_TIME_ZONE); 3426 MOVED_TO_GLOBAL.add(Settings.Global.CAR_DOCK_SOUND); 3427 MOVED_TO_GLOBAL.add(Settings.Global.CAR_UNDOCK_SOUND); 3428 MOVED_TO_GLOBAL.add(Settings.Global.DESK_DOCK_SOUND); 3429 MOVED_TO_GLOBAL.add(Settings.Global.DESK_UNDOCK_SOUND); 3430 MOVED_TO_GLOBAL.add(Settings.Global.DOCK_SOUNDS_ENABLED); 3431 MOVED_TO_GLOBAL.add(Settings.Global.LOCK_SOUND); 3432 MOVED_TO_GLOBAL.add(Settings.Global.UNLOCK_SOUND); 3433 MOVED_TO_GLOBAL.add(Settings.Global.LOW_BATTERY_SOUND); 3434 MOVED_TO_GLOBAL.add(Settings.Global.POWER_SOUNDS_ENABLED); 3435 MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN); 3436 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY); 3437 MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); 3438 MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE); 3439 MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE); 3440 MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE); 3441 MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS); 3442 MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE); 3443 MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE); 3444 MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY); 3445 MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP); 3446 MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER); 3447 MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES); 3448 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_CONTENT_URL); 3449 MOVED_TO_GLOBAL.add(Settings.Global.TZINFO_UPDATE_METADATA_URL); 3450 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_CONTENT_URL); 3451 MOVED_TO_GLOBAL.add(Settings.Global.SELINUX_UPDATE_METADATA_URL); 3452 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_CONTENT_URL); 3453 MOVED_TO_GLOBAL.add(Settings.Global.SMS_SHORT_CODES_UPDATE_METADATA_URL); 3454 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_CONTENT_URL); 3455 MOVED_TO_GLOBAL.add(Settings.Global.CERT_PIN_UPDATE_METADATA_URL); 3456 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_NFC); 3457 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_CELL); 3458 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIFI); 3459 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_BLUETOOTH); 3460 MOVED_TO_GLOBAL.add(Settings.Global.RADIO_WIMAX); 3461 MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES); 3462 } 3463 3464 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)3465 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 3466 outKeySet.addAll(MOVED_TO_GLOBAL); 3467 outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL); 3468 } 3469 3470 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)3471 public static void getMovedToSecureSettings(Set<String> outKeySet) { 3472 outKeySet.addAll(MOVED_TO_SECURE); 3473 } 3474 3475 /** @hide */ getNonLegacyMovedKeys(HashSet<String> outKeySet)3476 public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) { 3477 outKeySet.addAll(MOVED_TO_GLOBAL); 3478 } 3479 3480 /** @hide */ clearProviderForTest()3481 public static void clearProviderForTest() { 3482 sProviderHolder.clearProviderForTest(); 3483 sNameValueCache.clearGenerationTrackerForTest(); 3484 } 3485 3486 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)3487 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 3488 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 3489 getPublicSettingsForClass(System.class, allKeys, readableKeys, 3490 readableKeysWithMaxTargetSdk); 3491 } 3492 3493 /** 3494 * Look up a name in the database. 3495 * @param resolver to access the database with 3496 * @param name to look up in the table 3497 * @return the corresponding value, or null if not present 3498 */ getString(ContentResolver resolver, String name)3499 public static String getString(ContentResolver resolver, String name) { 3500 return getStringForUser(resolver, name, resolver.getUserId()); 3501 } 3502 3503 /** @hide */ 3504 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)3505 public static String getStringForUser(ContentResolver resolver, String name, 3506 int userHandle) { 3507 if (MOVED_TO_SECURE.contains(name)) { 3508 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3509 + " to android.provider.Settings.Secure, returning read-only value."); 3510 return Secure.getStringForUser(resolver, name, userHandle); 3511 } 3512 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3513 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3514 + " to android.provider.Settings.Global, returning read-only value."); 3515 return Global.getStringForUser(resolver, name, userHandle); 3516 } 3517 3518 return sNameValueCache.getStringForUser(resolver, name, userHandle); 3519 } 3520 3521 /** 3522 * Store a name/value pair into the database. 3523 * @param resolver to access the database with 3524 * @param name to store 3525 * @param value to associate with the name 3526 * @return true if the value was set, false on database errors 3527 */ putString(ContentResolver resolver, String name, String value)3528 public static boolean putString(ContentResolver resolver, String name, String value) { 3529 return putStringForUser(resolver, name, value, resolver.getUserId()); 3530 } 3531 3532 /** 3533 * Store a name/value pair into the database. Values written by this method will be 3534 * overridden if a restore happens in the future. 3535 * 3536 * @param resolver to access the database with 3537 * @param name to store 3538 * @param value to associate with the name 3539 * 3540 * @return true if the value was set, false on database errors 3541 * 3542 * @hide 3543 */ 3544 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) 3545 @SystemApi putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, boolean overrideableByRestore)3546 public static boolean putString(@NonNull ContentResolver resolver, 3547 @NonNull String name, @Nullable String value, boolean overrideableByRestore) { 3548 return putStringForUser(resolver, name, value, resolver.getUserId(), 3549 overrideableByRestore); 3550 } 3551 3552 /** @hide */ 3553 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)3554 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 3555 int userHandle) { 3556 return putStringForUser(resolver, name, value, userHandle, 3557 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3558 } 3559 putStringForUser(ContentResolver resolver, String name, String value, int userHandle, boolean overrideableByRestore)3560 private static boolean putStringForUser(ContentResolver resolver, String name, String value, 3561 int userHandle, boolean overrideableByRestore) { 3562 if (MOVED_TO_SECURE.contains(name)) { 3563 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3564 + " to android.provider.Settings.Secure, value is unchanged."); 3565 return false; 3566 } 3567 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3568 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3569 + " to android.provider.Settings.Global, value is unchanged."); 3570 return false; 3571 } 3572 return sNameValueCache.putStringForUser(resolver, name, value, null, false, userHandle, 3573 overrideableByRestore); 3574 } 3575 3576 /** 3577 * Construct the content URI for a particular name/value pair, 3578 * useful for monitoring changes with a ContentObserver. 3579 * @param name to look up in the table 3580 * @return the corresponding content URI, or null if not present 3581 */ getUriFor(String name)3582 public static Uri getUriFor(String name) { 3583 if (MOVED_TO_SECURE.contains(name)) { 3584 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3585 + " to android.provider.Settings.Secure, returning Secure URI."); 3586 return Secure.getUriFor(Secure.CONTENT_URI, name); 3587 } 3588 if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) { 3589 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" 3590 + " to android.provider.Settings.Global, returning read-only global URI."); 3591 return Global.getUriFor(Global.CONTENT_URI, name); 3592 } 3593 return getUriFor(CONTENT_URI, name); 3594 } 3595 3596 /** 3597 * Convenience function for retrieving a single system settings value 3598 * as an integer. Note that internally setting values are always 3599 * stored as strings; this function converts the string to an integer 3600 * for you. The default value will be returned if the setting is 3601 * not defined or not an integer. 3602 * 3603 * @param cr The ContentResolver to access. 3604 * @param name The name of the setting to retrieve. 3605 * @param def Value to return if the setting is not defined. 3606 * 3607 * @return The setting's current value, or 'def' if it is not defined 3608 * or not a valid integer. 3609 */ getInt(ContentResolver cr, String name, int def)3610 public static int getInt(ContentResolver cr, String name, int def) { 3611 return getIntForUser(cr, name, def, cr.getUserId()); 3612 } 3613 3614 /** @hide */ 3615 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)3616 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 3617 String v = getStringForUser(cr, name, userHandle); 3618 try { 3619 return v != null ? Integer.parseInt(v) : def; 3620 } catch (NumberFormatException e) { 3621 return def; 3622 } 3623 } 3624 3625 /** 3626 * Convenience function for retrieving a single system settings value 3627 * as an integer. Note that internally setting values are always 3628 * stored as strings; this function converts the string to an integer 3629 * for you. 3630 * <p> 3631 * This version does not take a default value. If the setting has not 3632 * been set, or the string value is not a number, 3633 * it throws {@link SettingNotFoundException}. 3634 * 3635 * @param cr The ContentResolver to access. 3636 * @param name The name of the setting to retrieve. 3637 * 3638 * @throws SettingNotFoundException Thrown if a setting by the given 3639 * name can't be found or the setting value is not an integer. 3640 * 3641 * @return The setting's current value. 3642 */ getInt(ContentResolver cr, String name)3643 public static int getInt(ContentResolver cr, String name) 3644 throws SettingNotFoundException { 3645 return getIntForUser(cr, name, cr.getUserId()); 3646 } 3647 3648 /** @hide */ 3649 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int userHandle)3650 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 3651 throws SettingNotFoundException { 3652 String v = getStringForUser(cr, name, userHandle); 3653 try { 3654 return Integer.parseInt(v); 3655 } catch (NumberFormatException e) { 3656 throw new SettingNotFoundException(name); 3657 } 3658 } 3659 3660 /** 3661 * Convenience function for updating a single settings value as an 3662 * integer. This will either create a new entry in the table if the 3663 * given name does not exist, or modify the value of the existing row 3664 * with that name. Note that internally setting values are always 3665 * stored as strings, so this function converts the given value to a 3666 * string before storing it. 3667 * 3668 * @param cr The ContentResolver to access. 3669 * @param name The name of the setting to modify. 3670 * @param value The new value for the setting. 3671 * @return true if the value was set, false on database errors 3672 */ putInt(ContentResolver cr, String name, int value)3673 public static boolean putInt(ContentResolver cr, String name, int value) { 3674 return putIntForUser(cr, name, value, cr.getUserId()); 3675 } 3676 3677 /** @hide */ 3678 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)3679 public static boolean putIntForUser(ContentResolver cr, String name, int value, 3680 int userHandle) { 3681 return putStringForUser(cr, name, Integer.toString(value), userHandle); 3682 } 3683 3684 /** 3685 * Convenience function for retrieving a single system settings value 3686 * as a {@code long}. Note that internally setting values are always 3687 * stored as strings; this function converts the string to a {@code long} 3688 * for you. The default value will be returned if the setting is 3689 * not defined or not a {@code long}. 3690 * 3691 * @param cr The ContentResolver to access. 3692 * @param name The name of the setting to retrieve. 3693 * @param def Value to return if the setting is not defined. 3694 * 3695 * @return The setting's current value, or 'def' if it is not defined 3696 * or not a valid {@code long}. 3697 */ getLong(ContentResolver cr, String name, long def)3698 public static long getLong(ContentResolver cr, String name, long def) { 3699 return getLongForUser(cr, name, def, cr.getUserId()); 3700 } 3701 3702 /** @hide */ getLongForUser(ContentResolver cr, String name, long def, int userHandle)3703 public static long getLongForUser(ContentResolver cr, String name, long def, 3704 int userHandle) { 3705 String valString = getStringForUser(cr, name, userHandle); 3706 long value; 3707 try { 3708 value = valString != null ? Long.parseLong(valString) : def; 3709 } catch (NumberFormatException e) { 3710 value = def; 3711 } 3712 return value; 3713 } 3714 3715 /** 3716 * Convenience function for retrieving a single system settings value 3717 * as a {@code long}. Note that internally setting values are always 3718 * stored as strings; this function converts the string to a {@code long} 3719 * for you. 3720 * <p> 3721 * This version does not take a default value. If the setting has not 3722 * been set, or the string value is not a number, 3723 * it throws {@link SettingNotFoundException}. 3724 * 3725 * @param cr The ContentResolver to access. 3726 * @param name The name of the setting to retrieve. 3727 * 3728 * @return The setting's current value. 3729 * @throws SettingNotFoundException Thrown if a setting by the given 3730 * name can't be found or the setting value is not an integer. 3731 */ getLong(ContentResolver cr, String name)3732 public static long getLong(ContentResolver cr, String name) 3733 throws SettingNotFoundException { 3734 return getLongForUser(cr, name, cr.getUserId()); 3735 } 3736 3737 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)3738 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 3739 throws SettingNotFoundException { 3740 String valString = getStringForUser(cr, name, userHandle); 3741 try { 3742 return Long.parseLong(valString); 3743 } catch (NumberFormatException e) { 3744 throw new SettingNotFoundException(name); 3745 } 3746 } 3747 3748 /** 3749 * Convenience function for updating a single settings value as a long 3750 * integer. This will either create a new entry in the table if the 3751 * given name does not exist, or modify the value of the existing row 3752 * with that name. Note that internally setting values are always 3753 * stored as strings, so this function converts the given value to a 3754 * string before storing it. 3755 * 3756 * @param cr The ContentResolver to access. 3757 * @param name The name of the setting to modify. 3758 * @param value The new value for the setting. 3759 * @return true if the value was set, false on database errors 3760 */ putLong(ContentResolver cr, String name, long value)3761 public static boolean putLong(ContentResolver cr, String name, long value) { 3762 return putLongForUser(cr, name, value, cr.getUserId()); 3763 } 3764 3765 /** @hide */ putLongForUser(ContentResolver cr, String name, long value, int userHandle)3766 public static boolean putLongForUser(ContentResolver cr, String name, long value, 3767 int userHandle) { 3768 return putStringForUser(cr, name, Long.toString(value), userHandle); 3769 } 3770 3771 /** 3772 * Convenience function for retrieving a single system settings value 3773 * as a floating point number. Note that internally setting values are 3774 * always stored as strings; this function converts the string to an 3775 * float for you. The default value will be returned if the setting 3776 * is not defined or not a valid float. 3777 * 3778 * @param cr The ContentResolver to access. 3779 * @param name The name of the setting to retrieve. 3780 * @param def Value to return if the setting is not defined. 3781 * 3782 * @return The setting's current value, or 'def' if it is not defined 3783 * or not a valid float. 3784 */ getFloat(ContentResolver cr, String name, float def)3785 public static float getFloat(ContentResolver cr, String name, float def) { 3786 return getFloatForUser(cr, name, def, cr.getUserId()); 3787 } 3788 3789 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)3790 public static float getFloatForUser(ContentResolver cr, String name, float def, 3791 int userHandle) { 3792 String v = getStringForUser(cr, name, userHandle); 3793 try { 3794 return v != null ? Float.parseFloat(v) : def; 3795 } catch (NumberFormatException e) { 3796 return def; 3797 } 3798 } 3799 3800 /** 3801 * Convenience function for retrieving a single system settings value 3802 * as a float. Note that internally setting values are always 3803 * stored as strings; this function converts the string to a float 3804 * for you. 3805 * <p> 3806 * This version does not take a default value. If the setting has not 3807 * been set, or the string value is not a number, 3808 * it throws {@link SettingNotFoundException}. 3809 * 3810 * @param cr The ContentResolver to access. 3811 * @param name The name of the setting to retrieve. 3812 * 3813 * @throws SettingNotFoundException Thrown if a setting by the given 3814 * name can't be found or the setting value is not a float. 3815 * 3816 * @return The setting's current value. 3817 */ getFloat(ContentResolver cr, String name)3818 public static float getFloat(ContentResolver cr, String name) 3819 throws SettingNotFoundException { 3820 return getFloatForUser(cr, name, cr.getUserId()); 3821 } 3822 3823 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)3824 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 3825 throws SettingNotFoundException { 3826 String v = getStringForUser(cr, name, userHandle); 3827 if (v == null) { 3828 throw new SettingNotFoundException(name); 3829 } 3830 try { 3831 return Float.parseFloat(v); 3832 } catch (NumberFormatException e) { 3833 throw new SettingNotFoundException(name); 3834 } 3835 } 3836 3837 /** 3838 * Convenience function for updating a single settings value as a 3839 * floating point number. This will either create a new entry in the 3840 * table if the given name does not exist, or modify the value of the 3841 * existing row with that name. Note that internally setting values 3842 * are always stored as strings, so this function converts the given 3843 * value to a string before storing it. 3844 * 3845 * @param cr The ContentResolver to access. 3846 * @param name The name of the setting to modify. 3847 * @param value The new value for the setting. 3848 * @return true if the value was set, false on database errors 3849 */ putFloat(ContentResolver cr, String name, float value)3850 public static boolean putFloat(ContentResolver cr, String name, float value) { 3851 return putFloatForUser(cr, name, value, cr.getUserId()); 3852 } 3853 3854 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)3855 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 3856 int userHandle) { 3857 return putStringForUser(cr, name, Float.toString(value), userHandle); 3858 } 3859 3860 /** 3861 * Convenience function to read all of the current 3862 * configuration-related settings into a 3863 * {@link Configuration} object. 3864 * 3865 * @param cr The ContentResolver to access. 3866 * @param outConfig Where to place the configuration settings. 3867 */ getConfiguration(ContentResolver cr, Configuration outConfig)3868 public static void getConfiguration(ContentResolver cr, Configuration outConfig) { 3869 adjustConfigurationForUser(cr, outConfig, cr.getUserId(), 3870 false /* updateSettingsIfEmpty */); 3871 } 3872 3873 /** @hide */ adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle, boolean updateSettingsIfEmpty)3874 public static void adjustConfigurationForUser(ContentResolver cr, Configuration outConfig, 3875 int userHandle, boolean updateSettingsIfEmpty) { 3876 outConfig.fontScale = Settings.System.getFloatForUser( 3877 cr, FONT_SCALE, DEFAULT_FONT_SCALE, userHandle); 3878 if (outConfig.fontScale < 0) { 3879 outConfig.fontScale = DEFAULT_FONT_SCALE; 3880 } 3881 outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser( 3882 cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle); 3883 3884 final String localeValue = 3885 Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle); 3886 if (localeValue != null) { 3887 outConfig.setLocales(LocaleList.forLanguageTags(localeValue)); 3888 } else { 3889 // Do not update configuration with emtpy settings since we need to take over the 3890 // locale list of previous user if the settings value is empty. This happens when a 3891 // new user is created. 3892 3893 if (updateSettingsIfEmpty) { 3894 // Make current configuration persistent. This is necessary the first time a 3895 // user log in. At the first login, the configuration settings are empty, so we 3896 // need to store the adjusted configuration as the initial settings. 3897 Settings.System.putStringForUser( 3898 cr, SYSTEM_LOCALES, outConfig.getLocales().toLanguageTags(), 3899 userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 3900 } 3901 } 3902 } 3903 3904 /** 3905 * @hide Erase the fields in the Configuration that should be applied 3906 * by the settings. 3907 */ clearConfiguration(Configuration inoutConfig)3908 public static void clearConfiguration(Configuration inoutConfig) { 3909 inoutConfig.fontScale = 0; 3910 if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) { 3911 inoutConfig.clearLocales(); 3912 } 3913 inoutConfig.fontWeightAdjustment = Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED; 3914 } 3915 3916 /** 3917 * Convenience function to write a batch of configuration-related 3918 * settings from a {@link Configuration} object. 3919 * 3920 * @param cr The ContentResolver to access. 3921 * @param config The settings to write. 3922 * @return true if the values were set, false on database errors 3923 */ putConfiguration(ContentResolver cr, Configuration config)3924 public static boolean putConfiguration(ContentResolver cr, Configuration config) { 3925 return putConfigurationForUser(cr, config, cr.getUserId()); 3926 } 3927 3928 /** @hide */ putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle)3929 public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, 3930 int userHandle) { 3931 return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && 3932 Settings.System.putStringForUser( 3933 cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle, 3934 DEFAULT_OVERRIDEABLE_BY_RESTORE); 3935 } 3936 3937 /** 3938 * Convenience function for checking if settings should be overwritten with config changes. 3939 * @see #putConfigurationForUser(ContentResolver, Configuration, int) 3940 * @hide 3941 */ hasInterestingConfigurationChanges(int changes)3942 public static boolean hasInterestingConfigurationChanges(int changes) { 3943 return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || 3944 (changes & ActivityInfo.CONFIG_LOCALE) != 0; 3945 } 3946 3947 /** @deprecated - Do not use */ 3948 @Deprecated getShowGTalkServiceStatus(ContentResolver cr)3949 public static boolean getShowGTalkServiceStatus(ContentResolver cr) { 3950 return getShowGTalkServiceStatusForUser(cr, cr.getUserId()); 3951 } 3952 3953 /** 3954 * @hide 3955 * @deprecated - Do not use 3956 */ 3957 @Deprecated getShowGTalkServiceStatusForUser(ContentResolver cr, int userHandle)3958 public static boolean getShowGTalkServiceStatusForUser(ContentResolver cr, 3959 int userHandle) { 3960 return getIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, 0, userHandle) != 0; 3961 } 3962 3963 /** @deprecated - Do not use */ 3964 @Deprecated setShowGTalkServiceStatus(ContentResolver cr, boolean flag)3965 public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) { 3966 setShowGTalkServiceStatusForUser(cr, flag, cr.getUserId()); 3967 } 3968 3969 /** 3970 * @hide 3971 * @deprecated - Do not use 3972 */ 3973 @Deprecated setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, int userHandle)3974 public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean flag, 3975 int userHandle) { 3976 putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); 3977 } 3978 3979 /** 3980 * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead 3981 */ 3982 @Deprecated 3983 public static final String STAY_ON_WHILE_PLUGGED_IN = Global.STAY_ON_WHILE_PLUGGED_IN; 3984 3985 /** 3986 * What happens when the user presses the end call button if they're not 3987 * on a call.<br/> 3988 * <b>Values:</b><br/> 3989 * 0 - The end button does nothing.<br/> 3990 * 1 - The end button goes to the home screen.<br/> 3991 * 2 - The end button puts the device to sleep and locks the keyguard.<br/> 3992 * 3 - The end button goes to the home screen. If the user is already on the 3993 * home screen, it puts the device to sleep. 3994 */ 3995 @Readable 3996 public static final String END_BUTTON_BEHAVIOR = "end_button_behavior"; 3997 3998 /** 3999 * END_BUTTON_BEHAVIOR value for "go home". 4000 * @hide 4001 */ 4002 public static final int END_BUTTON_BEHAVIOR_HOME = 0x1; 4003 4004 /** 4005 * END_BUTTON_BEHAVIOR value for "go to sleep". 4006 * @hide 4007 */ 4008 public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2; 4009 4010 /** 4011 * END_BUTTON_BEHAVIOR default value. 4012 * @hide 4013 */ 4014 public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP; 4015 4016 /** 4017 * Is advanced settings mode turned on. 0 == no, 1 == yes 4018 * @hide 4019 */ 4020 @Readable 4021 public static final String ADVANCED_SETTINGS = "advanced_settings"; 4022 4023 /** 4024 * ADVANCED_SETTINGS default value. 4025 * @hide 4026 */ 4027 public static final int ADVANCED_SETTINGS_DEFAULT = 0; 4028 4029 /** 4030 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead 4031 */ 4032 @Deprecated 4033 public static final String AIRPLANE_MODE_ON = Global.AIRPLANE_MODE_ON; 4034 4035 /** 4036 * @deprecated Use {@link android.provider.Settings.Global#RADIO_BLUETOOTH} instead 4037 */ 4038 @Deprecated 4039 public static final String RADIO_BLUETOOTH = Global.RADIO_BLUETOOTH; 4040 4041 /** 4042 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIFI} instead 4043 */ 4044 @Deprecated 4045 public static final String RADIO_WIFI = Global.RADIO_WIFI; 4046 4047 /** 4048 * @deprecated Use {@link android.provider.Settings.Global#RADIO_WIMAX} instead 4049 * {@hide} 4050 */ 4051 @Deprecated 4052 public static final String RADIO_WIMAX = Global.RADIO_WIMAX; 4053 4054 /** 4055 * @deprecated Use {@link android.provider.Settings.Global#RADIO_CELL} instead 4056 */ 4057 @Deprecated 4058 public static final String RADIO_CELL = Global.RADIO_CELL; 4059 4060 /** 4061 * @deprecated Use {@link android.provider.Settings.Global#RADIO_NFC} instead 4062 */ 4063 @Deprecated 4064 public static final String RADIO_NFC = Global.RADIO_NFC; 4065 4066 /** 4067 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_RADIOS} instead 4068 */ 4069 @Deprecated 4070 public static final String AIRPLANE_MODE_RADIOS = Global.AIRPLANE_MODE_RADIOS; 4071 4072 /** 4073 * @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_TOGGLEABLE_RADIOS} instead 4074 * 4075 * {@hide} 4076 */ 4077 @Deprecated 4078 @UnsupportedAppUsage 4079 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = 4080 Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS; 4081 4082 /** 4083 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY} instead 4084 */ 4085 @Deprecated 4086 public static final String WIFI_SLEEP_POLICY = Global.WIFI_SLEEP_POLICY; 4087 4088 /** 4089 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_DEFAULT} instead 4090 */ 4091 @Deprecated 4092 public static final int WIFI_SLEEP_POLICY_DEFAULT = Global.WIFI_SLEEP_POLICY_DEFAULT; 4093 4094 /** 4095 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED} instead 4096 */ 4097 @Deprecated 4098 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 4099 Global.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED; 4100 4101 /** 4102 * @deprecated Use {@link android.provider.Settings.Global#WIFI_SLEEP_POLICY_NEVER} instead 4103 */ 4104 @Deprecated 4105 public static final int WIFI_SLEEP_POLICY_NEVER = Global.WIFI_SLEEP_POLICY_NEVER; 4106 4107 /** 4108 * @deprecated Use {@link android.provider.Settings.Global#MODE_RINGER} instead 4109 */ 4110 @Deprecated 4111 public static final String MODE_RINGER = Global.MODE_RINGER; 4112 4113 /** 4114 * Whether to use static IP and other static network attributes. 4115 * <p> 4116 * Set to 1 for true and 0 for false. 4117 * 4118 * @deprecated Use {@link WifiManager} instead 4119 */ 4120 @Deprecated 4121 @Readable 4122 public static final String WIFI_USE_STATIC_IP = "wifi_use_static_ip"; 4123 4124 /** 4125 * The static IP address. 4126 * <p> 4127 * Example: "192.168.1.51" 4128 * 4129 * @deprecated Use {@link WifiManager} instead 4130 */ 4131 @Deprecated 4132 @Readable 4133 public static final String WIFI_STATIC_IP = "wifi_static_ip"; 4134 4135 /** 4136 * If using static IP, the gateway's IP address. 4137 * <p> 4138 * Example: "192.168.1.1" 4139 * 4140 * @deprecated Use {@link WifiManager} instead 4141 */ 4142 @Deprecated 4143 @Readable 4144 public static final String WIFI_STATIC_GATEWAY = "wifi_static_gateway"; 4145 4146 /** 4147 * If using static IP, the net mask. 4148 * <p> 4149 * Example: "255.255.255.0" 4150 * 4151 * @deprecated Use {@link WifiManager} instead 4152 */ 4153 @Deprecated 4154 @Readable 4155 public static final String WIFI_STATIC_NETMASK = "wifi_static_netmask"; 4156 4157 /** 4158 * If using static IP, the primary DNS's IP address. 4159 * <p> 4160 * Example: "192.168.1.1" 4161 * 4162 * @deprecated Use {@link WifiManager} instead 4163 */ 4164 @Deprecated 4165 @Readable 4166 public static final String WIFI_STATIC_DNS1 = "wifi_static_dns1"; 4167 4168 /** 4169 * If using static IP, the secondary DNS's IP address. 4170 * <p> 4171 * Example: "192.168.1.2" 4172 * 4173 * @deprecated Use {@link WifiManager} instead 4174 */ 4175 @Deprecated 4176 @Readable 4177 public static final String WIFI_STATIC_DNS2 = "wifi_static_dns2"; 4178 4179 /** 4180 * Determines whether remote devices may discover and/or connect to 4181 * this device. 4182 * <P>Type: INT</P> 4183 * 2 -- discoverable and connectable 4184 * 1 -- connectable but not discoverable 4185 * 0 -- neither connectable nor discoverable 4186 */ 4187 @Readable 4188 public static final String BLUETOOTH_DISCOVERABILITY = 4189 "bluetooth_discoverability"; 4190 4191 /** 4192 * Bluetooth discoverability timeout. If this value is nonzero, then 4193 * Bluetooth becomes discoverable for a certain number of seconds, 4194 * after which is becomes simply connectable. The value is in seconds. 4195 */ 4196 @Readable 4197 public static final String BLUETOOTH_DISCOVERABILITY_TIMEOUT = 4198 "bluetooth_discoverability_timeout"; 4199 4200 /** 4201 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_ENABLED} 4202 * instead 4203 */ 4204 @Deprecated 4205 public static final String LOCK_PATTERN_ENABLED = Secure.LOCK_PATTERN_ENABLED; 4206 4207 /** 4208 * @deprecated Use {@link android.provider.Settings.Secure#LOCK_PATTERN_VISIBLE} 4209 * instead 4210 */ 4211 @Deprecated 4212 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 4213 4214 /** 4215 * @deprecated Use 4216 * {@link android.provider.Settings.Secure#LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED} 4217 * instead 4218 */ 4219 @Deprecated 4220 public static final String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = 4221 "lock_pattern_tactile_feedback_enabled"; 4222 4223 /** 4224 * A formatted string of the next alarm that is set, or the empty string 4225 * if there is no alarm set. 4226 * 4227 * @deprecated Use {@link android.app.AlarmManager#getNextAlarmClock()}. 4228 */ 4229 @Deprecated 4230 @Readable 4231 public static final String NEXT_ALARM_FORMATTED = "next_alarm_formatted"; 4232 4233 /** 4234 * Scaling factor for fonts, float. 4235 */ 4236 @Readable 4237 public static final String FONT_SCALE = "font_scale"; 4238 4239 /** 4240 * The serialized system locale value. 4241 * 4242 * Do not use this value directory. 4243 * To get system locale, use {@link LocaleList#getDefault} instead. 4244 * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} 4245 * instead. 4246 * @hide 4247 */ 4248 @Readable 4249 public static final String SYSTEM_LOCALES = "system_locales"; 4250 4251 4252 /** 4253 * Name of an application package to be debugged. 4254 * 4255 * @deprecated Use {@link Global#DEBUG_APP} instead 4256 */ 4257 @Deprecated 4258 public static final String DEBUG_APP = Global.DEBUG_APP; 4259 4260 /** 4261 * If 1, when launching DEBUG_APP it will wait for the debugger before 4262 * starting user code. If 0, it will run normally. 4263 * 4264 * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead 4265 */ 4266 @Deprecated 4267 public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER; 4268 4269 /** 4270 * Whether or not to dim the screen. 0=no 1=yes 4271 * @deprecated This setting is no longer used. 4272 */ 4273 @Deprecated 4274 @Readable 4275 public static final String DIM_SCREEN = "dim_screen"; 4276 4277 /** 4278 * The display color mode. 4279 * @hide 4280 */ 4281 @Readable 4282 public static final String DISPLAY_COLOR_MODE = "display_color_mode"; 4283 4284 /** 4285 * Hint to decide whether restored vendor color modes are compatible with the new device. If 4286 * unset or a match is not made, only the standard color modes will be restored. 4287 * @hide 4288 */ 4289 public static final String DISPLAY_COLOR_MODE_VENDOR_HINT = 4290 "display_color_mode_vendor_hint"; 4291 4292 /** 4293 * The user selected min refresh rate in frames per second. 4294 * 4295 * If this isn't set, 0 will be used. 4296 * @hide 4297 */ 4298 @Readable 4299 public static final String MIN_REFRESH_RATE = "min_refresh_rate"; 4300 4301 /** 4302 * The user selected peak refresh rate in frames per second. 4303 * 4304 * If this isn't set, the system falls back to a device specific default. 4305 * @hide 4306 */ 4307 @Readable 4308 public static final String PEAK_REFRESH_RATE = "peak_refresh_rate"; 4309 4310 /** 4311 * The amount of time in milliseconds before the device goes to sleep or begins 4312 * to dream after a period of inactivity. This value is also known as the 4313 * user activity timeout period since the screen isn't necessarily turned off 4314 * when it expires. 4315 * 4316 * <p> 4317 * This value is bounded by maximum timeout set by 4318 * {@link android.app.admin.DevicePolicyManager#setMaximumTimeToLock(ComponentName, long)}. 4319 */ 4320 @Readable 4321 public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; 4322 4323 /** 4324 * The screen backlight brightness between 0 and 255. 4325 */ 4326 @Readable 4327 public static final String SCREEN_BRIGHTNESS = "screen_brightness"; 4328 4329 /** 4330 * The screen backlight brightness between 0 and 255. 4331 * @hide 4332 */ 4333 @Readable 4334 public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr"; 4335 4336 /** 4337 * The screen backlight brightness between 0.0f and 1.0f. 4338 * @hide 4339 */ 4340 @Readable 4341 public static final String SCREEN_BRIGHTNESS_FOR_VR_FLOAT = 4342 "screen_brightness_for_vr_float"; 4343 4344 /** 4345 * The screen backlight brightness between 0.0f and 1.0f. 4346 * @hide 4347 */ 4348 @Readable 4349 public static final String SCREEN_BRIGHTNESS_FLOAT = "screen_brightness_float"; 4350 4351 /** 4352 * Control whether to enable automatic brightness mode. 4353 */ 4354 @Readable 4355 public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; 4356 4357 /** 4358 * Adjustment to auto-brightness to make it generally more (>0.0 <1.0) 4359 * or less (<0.0 >-1.0) bright. 4360 * @hide 4361 */ 4362 @UnsupportedAppUsage 4363 @Readable 4364 public static final String SCREEN_AUTO_BRIGHTNESS_ADJ = "screen_auto_brightness_adj"; 4365 4366 /** 4367 * SCREEN_BRIGHTNESS_MODE value for manual mode. 4368 */ 4369 public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; 4370 4371 /** 4372 * SCREEN_BRIGHTNESS_MODE value for automatic mode. 4373 */ 4374 public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; 4375 4376 /** 4377 * Control whether to enable adaptive sleep mode. 4378 * @deprecated Use {@link android.provider.Settings.Secure#ADAPTIVE_SLEEP} instead. 4379 * @hide 4380 */ 4381 @Deprecated 4382 @Readable 4383 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 4384 4385 /** 4386 * Control whether the process CPU usage meter should be shown. 4387 * 4388 * @deprecated This functionality is no longer available as of 4389 * {@link android.os.Build.VERSION_CODES#N_MR1}. 4390 */ 4391 @Deprecated 4392 public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES; 4393 4394 /** 4395 * If 1, the activity manager will aggressively finish activities and 4396 * processes as soon as they are no longer needed. If 0, the normal 4397 * extended lifetime is used. 4398 * 4399 * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead 4400 */ 4401 @Deprecated 4402 public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES; 4403 4404 /** 4405 * Determines which streams are affected by ringer and zen mode changes. The 4406 * stream type's bit should be set to 1 if it should be muted when going 4407 * into an inaudible ringer mode. 4408 */ 4409 @Readable 4410 public static final String MODE_RINGER_STREAMS_AFFECTED = "mode_ringer_streams_affected"; 4411 4412 /** 4413 * Determines which streams are affected by mute. The 4414 * stream type's bit should be set to 1 if it should be muted when a mute request 4415 * is received. 4416 */ 4417 @Readable 4418 public static final String MUTE_STREAMS_AFFECTED = "mute_streams_affected"; 4419 4420 /** 4421 * Whether vibrate is on for different events. This is used internally, 4422 * changing this value will not change the vibrate. See AudioManager. 4423 */ 4424 @Readable 4425 public static final String VIBRATE_ON = "vibrate_on"; 4426 4427 /** 4428 * If 1, redirects the system vibrator to all currently attached input devices 4429 * that support vibration. If there are no such input devices, then the system 4430 * vibrator is used instead. 4431 * If 0, does not register the system vibrator. 4432 * 4433 * This setting is mainly intended to provide a compatibility mechanism for 4434 * applications that only know about the system vibrator and do not use the 4435 * input device vibrator API. 4436 * 4437 * @hide 4438 */ 4439 @Readable 4440 public static final String VIBRATE_INPUT_DEVICES = "vibrate_input_devices"; 4441 4442 /** 4443 * The intensity of notification vibrations, if configurable. 4444 * 4445 * Not all devices are capable of changing their vibration intensity; on these devices 4446 * there will likely be no difference between the various vibration intensities except for 4447 * intensity 0 (off) and the rest. 4448 * 4449 * <b>Values:</b><br/> 4450 * 0 - Vibration is disabled<br/> 4451 * 1 - Weak vibrations<br/> 4452 * 2 - Medium vibrations<br/> 4453 * 3 - Strong vibrations 4454 * @hide 4455 */ 4456 @Readable 4457 public static final String NOTIFICATION_VIBRATION_INTENSITY = 4458 "notification_vibration_intensity"; 4459 /** 4460 * The intensity of ringtone vibrations, if configurable. 4461 * 4462 * Not all devices are capable of changing their vibration intensity; on these devices 4463 * there will likely be no difference between the various vibration intensities except for 4464 * intensity 0 (off) and the rest. 4465 * 4466 * <b>Values:</b><br/> 4467 * 0 - Vibration is disabled<br/> 4468 * 1 - Weak vibrations<br/> 4469 * 2 - Medium vibrations<br/> 4470 * 3 - Strong vibrations 4471 * @hide 4472 */ 4473 @Readable 4474 public static final String RING_VIBRATION_INTENSITY = 4475 "ring_vibration_intensity"; 4476 4477 /** 4478 * The intensity of haptic feedback vibrations, if configurable. 4479 * 4480 * Not all devices are capable of changing their feedback intensity; on these devices 4481 * there will likely be no difference between the various vibration intensities except for 4482 * intensity 0 (off) and the rest. 4483 * 4484 * <b>Values:</b><br/> 4485 * 0 - Vibration is disabled<br/> 4486 * 1 - Weak vibrations<br/> 4487 * 2 - Medium vibrations<br/> 4488 * 3 - Strong vibrations 4489 * @hide 4490 */ 4491 @Readable 4492 public static final String HAPTIC_FEEDBACK_INTENSITY = 4493 "haptic_feedback_intensity"; 4494 4495 /** 4496 * Ringer volume. This is used internally, changing this value will not 4497 * change the volume. See AudioManager. 4498 * 4499 * @removed Not used by anything since API 2. 4500 */ 4501 @Readable 4502 public static final String VOLUME_RING = "volume_ring"; 4503 4504 /** 4505 * System/notifications volume. This is used internally, changing this 4506 * value will not change the volume. See AudioManager. 4507 * 4508 * @removed Not used by anything since API 2. 4509 */ 4510 @Readable 4511 public static final String VOLUME_SYSTEM = "volume_system"; 4512 4513 /** 4514 * Voice call volume. This is used internally, changing this value will 4515 * not change the volume. See AudioManager. 4516 * 4517 * @removed Not used by anything since API 2. 4518 */ 4519 @Readable 4520 public static final String VOLUME_VOICE = "volume_voice"; 4521 4522 /** 4523 * Music/media/gaming volume. This is used internally, changing this 4524 * value will not change the volume. See AudioManager. 4525 * 4526 * @removed Not used by anything since API 2. 4527 */ 4528 @Readable 4529 public static final String VOLUME_MUSIC = "volume_music"; 4530 4531 /** 4532 * Alarm volume. This is used internally, changing this 4533 * value will not change the volume. See AudioManager. 4534 * 4535 * @removed Not used by anything since API 2. 4536 */ 4537 @Readable 4538 public static final String VOLUME_ALARM = "volume_alarm"; 4539 4540 /** 4541 * Notification volume. This is used internally, changing this 4542 * value will not change the volume. See AudioManager. 4543 * 4544 * @removed Not used by anything since API 2. 4545 */ 4546 @Readable 4547 public static final String VOLUME_NOTIFICATION = "volume_notification"; 4548 4549 /** 4550 * Bluetooth Headset volume. This is used internally, changing this value will 4551 * not change the volume. See AudioManager. 4552 * 4553 * @removed Not used by anything since API 2. 4554 */ 4555 @Readable 4556 public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco"; 4557 4558 /** 4559 * @hide 4560 * Acessibility volume. This is used internally, changing this 4561 * value will not change the volume. 4562 */ 4563 @Readable 4564 public static final String VOLUME_ACCESSIBILITY = "volume_a11y"; 4565 4566 /** 4567 * @hide 4568 * Volume index for virtual assistant. 4569 */ 4570 @Readable 4571 public static final String VOLUME_ASSISTANT = "volume_assistant"; 4572 4573 /** 4574 * Master volume (float in the range 0.0f to 1.0f). 4575 * 4576 * @hide 4577 */ 4578 @Readable 4579 public static final String VOLUME_MASTER = "volume_master"; 4580 4581 /** 4582 * Master mono (int 1 = mono, 0 = normal). 4583 * 4584 * @hide 4585 */ 4586 @UnsupportedAppUsage 4587 @Readable 4588 public static final String MASTER_MONO = "master_mono"; 4589 4590 /** 4591 * Master balance (float -1.f = 100% left, 0.f = dead center, 1.f = 100% right). 4592 * 4593 * @hide 4594 */ 4595 @Readable 4596 public static final String MASTER_BALANCE = "master_balance"; 4597 4598 /** 4599 * Whether the notifications should use the ring volume (value of 1) or 4600 * a separate notification volume (value of 0). In most cases, users 4601 * will have this enabled so the notification and ringer volumes will be 4602 * the same. However, power users can disable this and use the separate 4603 * notification volume control. 4604 * <p> 4605 * Note: This is a one-off setting that will be removed in the future 4606 * when there is profile support. For this reason, it is kept hidden 4607 * from the public APIs. 4608 * 4609 * @hide 4610 * @deprecated 4611 */ 4612 @Deprecated 4613 @Readable 4614 public static final String NOTIFICATIONS_USE_RING_VOLUME = 4615 "notifications_use_ring_volume"; 4616 4617 /** 4618 * Whether silent mode should allow vibration feedback. This is used 4619 * internally in AudioService and the Sound settings activity to 4620 * coordinate decoupling of vibrate and silent modes. This setting 4621 * will likely be removed in a future release with support for 4622 * audio/vibe feedback profiles. 4623 * 4624 * Not used anymore. On devices with vibrator, the user explicitly selects 4625 * silent or vibrate mode. 4626 * Kept for use by legacy database upgrade code in DatabaseHelper. 4627 * @hide 4628 */ 4629 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4630 @Readable 4631 public static final String VIBRATE_IN_SILENT = "vibrate_in_silent"; 4632 4633 /** 4634 * The mapping of stream type (integer) to its setting. 4635 * 4636 * @removed Not used by anything since API 2. 4637 */ 4638 public static final String[] VOLUME_SETTINGS = { 4639 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4640 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO 4641 }; 4642 4643 /** 4644 * @hide 4645 * The mapping of stream type (integer) to its setting. 4646 * Unlike the VOLUME_SETTINGS array, this one contains as many entries as 4647 * AudioSystem.NUM_STREAM_TYPES, and has empty strings for stream types whose volumes 4648 * are never persisted. 4649 */ 4650 public static final String[] VOLUME_SETTINGS_INT = { 4651 VOLUME_VOICE, VOLUME_SYSTEM, VOLUME_RING, VOLUME_MUSIC, 4652 VOLUME_ALARM, VOLUME_NOTIFICATION, VOLUME_BLUETOOTH_SCO, 4653 "" /*STREAM_SYSTEM_ENFORCED, no setting for this stream*/, 4654 "" /*STREAM_DTMF, no setting for this stream*/, 4655 "" /*STREAM_TTS, no setting for this stream*/, 4656 VOLUME_ACCESSIBILITY, VOLUME_ASSISTANT 4657 }; 4658 4659 /** 4660 * Appended to various volume related settings to record the previous 4661 * values before they the settings were affected by a silent/vibrate 4662 * ringer mode change. 4663 * 4664 * @removed Not used by anything since API 2. 4665 */ 4666 @Readable 4667 public static final String APPEND_FOR_LAST_AUDIBLE = "_last_audible"; 4668 4669 /** 4670 * Persistent store for the system-wide default ringtone URI. 4671 * <p> 4672 * If you need to play the default ringtone at any given time, it is recommended 4673 * you give {@link #DEFAULT_RINGTONE_URI} to the media player. It will resolve 4674 * to the set default ringtone at the time of playing. 4675 * 4676 * @see #DEFAULT_RINGTONE_URI 4677 */ 4678 @Readable 4679 public static final String RINGTONE = "ringtone"; 4680 4681 /** 4682 * A {@link Uri} that will point to the current default ringtone at any 4683 * given time. 4684 * <p> 4685 * If the current default ringtone is in the DRM provider and the caller 4686 * does not have permission, the exception will be a 4687 * FileNotFoundException. 4688 */ 4689 public static final Uri DEFAULT_RINGTONE_URI = getUriFor(RINGTONE); 4690 4691 /** {@hide} */ 4692 @Readable 4693 public static final String RINGTONE_CACHE = "ringtone_cache"; 4694 /** {@hide} */ 4695 public static final Uri RINGTONE_CACHE_URI = getUriFor(RINGTONE_CACHE); 4696 4697 /** 4698 * Persistent store for the system-wide default notification sound. 4699 * 4700 * @see #RINGTONE 4701 * @see #DEFAULT_NOTIFICATION_URI 4702 */ 4703 @Readable 4704 public static final String NOTIFICATION_SOUND = "notification_sound"; 4705 4706 /** 4707 * A {@link Uri} that will point to the current default notification 4708 * sound at any given time. 4709 * 4710 * @see #DEFAULT_RINGTONE_URI 4711 */ 4712 public static final Uri DEFAULT_NOTIFICATION_URI = getUriFor(NOTIFICATION_SOUND); 4713 4714 /** {@hide} */ 4715 @Readable 4716 public static final String NOTIFICATION_SOUND_CACHE = "notification_sound_cache"; 4717 /** {@hide} */ 4718 public static final Uri NOTIFICATION_SOUND_CACHE_URI = getUriFor(NOTIFICATION_SOUND_CACHE); 4719 4720 /** 4721 * Persistent store for the system-wide default alarm alert. 4722 * 4723 * @see #RINGTONE 4724 * @see #DEFAULT_ALARM_ALERT_URI 4725 */ 4726 @Readable 4727 public static final String ALARM_ALERT = "alarm_alert"; 4728 4729 /** 4730 * A {@link Uri} that will point to the current default alarm alert at 4731 * any given time. 4732 * 4733 * @see #DEFAULT_ALARM_ALERT_URI 4734 */ 4735 public static final Uri DEFAULT_ALARM_ALERT_URI = getUriFor(ALARM_ALERT); 4736 4737 /** {@hide} */ 4738 @Readable 4739 public static final String ALARM_ALERT_CACHE = "alarm_alert_cache"; 4740 /** {@hide} */ 4741 public static final Uri ALARM_ALERT_CACHE_URI = getUriFor(ALARM_ALERT_CACHE); 4742 4743 /** 4744 * Persistent store for the system default media button event receiver. 4745 * 4746 * @hide 4747 */ 4748 @Readable 4749 public static final String MEDIA_BUTTON_RECEIVER = "media_button_receiver"; 4750 4751 /** 4752 * Setting to enable Auto Replace (AutoText) in text editors. 1 = On, 0 = Off 4753 */ 4754 @Readable 4755 public static final String TEXT_AUTO_REPLACE = "auto_replace"; 4756 4757 /** 4758 * Setting to enable Auto Caps in text editors. 1 = On, 0 = Off 4759 */ 4760 @Readable 4761 public static final String TEXT_AUTO_CAPS = "auto_caps"; 4762 4763 /** 4764 * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This 4765 * feature converts two spaces to a "." and space. 4766 */ 4767 @Readable 4768 public static final String TEXT_AUTO_PUNCTUATE = "auto_punctuate"; 4769 4770 /** 4771 * Setting to showing password characters in text editors. 1 = On, 0 = Off 4772 */ 4773 @Readable 4774 public static final String TEXT_SHOW_PASSWORD = "show_password"; 4775 4776 @Readable 4777 public static final String SHOW_GTALK_SERVICE_STATUS = 4778 "SHOW_GTALK_SERVICE_STATUS"; 4779 4780 /** 4781 * Name of activity to use for wallpaper on the home screen. 4782 * 4783 * @deprecated Use {@link WallpaperManager} instead. 4784 */ 4785 @Deprecated 4786 @Readable 4787 public static final String WALLPAPER_ACTIVITY = "wallpaper_activity"; 4788 4789 /** 4790 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME} 4791 * instead 4792 */ 4793 @Deprecated 4794 public static final String AUTO_TIME = Global.AUTO_TIME; 4795 4796 /** 4797 * @deprecated Use {@link android.provider.Settings.Global#AUTO_TIME_ZONE} 4798 * instead 4799 */ 4800 @Deprecated 4801 public static final String AUTO_TIME_ZONE = Global.AUTO_TIME_ZONE; 4802 4803 /** 4804 * Display the user's times, e.g. in the status bar, as 12 or 24 hours. 4805 * <ul> 4806 * <li>24 = 24 hour</li> 4807 * <li>12 = 12 hour</li> 4808 * <li>[unset] = use the device locale's default</li> 4809 * </ul> 4810 */ 4811 @Readable 4812 public static final String TIME_12_24 = "time_12_24"; 4813 4814 /** 4815 * @deprecated No longer used. Use {@link #TIME_12_24} instead. 4816 */ 4817 @Deprecated 4818 @Readable 4819 public static final String DATE_FORMAT = "date_format"; 4820 4821 /** 4822 * Whether the setup wizard has been run before (on first boot), or if 4823 * it still needs to be run. 4824 * 4825 * nonzero = it has been run in the past 4826 * 0 = it has not been run in the past 4827 */ 4828 @Readable 4829 public static final String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run"; 4830 4831 /** 4832 * Scaling factor for normal window animations. Setting to 0 will disable window 4833 * animations. 4834 * 4835 * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead 4836 */ 4837 @Deprecated 4838 public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE; 4839 4840 /** 4841 * Scaling factor for activity transition animations. Setting to 0 will disable window 4842 * animations. 4843 * 4844 * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead 4845 */ 4846 @Deprecated 4847 public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE; 4848 4849 /** 4850 * Scaling factor for Animator-based animations. This affects both the start delay and 4851 * duration of all such animations. Setting to 0 will cause animations to end immediately. 4852 * The default value is 1. 4853 * 4854 * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead 4855 */ 4856 @Deprecated 4857 public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE; 4858 4859 /** 4860 * Control whether the accelerometer will be used to change screen 4861 * orientation. If 0, it will not be used unless explicitly requested 4862 * by the application; if 1, it will be used by default unless explicitly 4863 * disabled by the application. 4864 */ 4865 @Readable 4866 public static final String ACCELEROMETER_ROTATION = "accelerometer_rotation"; 4867 4868 /** 4869 * Default screen rotation when no other policy applies. 4870 * When {@link #ACCELEROMETER_ROTATION} is zero and no on-screen Activity expresses a 4871 * preference, this rotation value will be used. Must be one of the 4872 * {@link android.view.Surface#ROTATION_0 Surface rotation constants}. 4873 * 4874 * @see Display#getRotation 4875 */ 4876 @Readable 4877 public static final String USER_ROTATION = "user_rotation"; 4878 4879 /** 4880 * Control whether the rotation lock toggle in the System UI should be hidden. 4881 * Typically this is done for accessibility purposes to make it harder for 4882 * the user to accidentally toggle the rotation lock while the display rotation 4883 * has been locked for accessibility. 4884 * 4885 * If 0, then rotation lock toggle is not hidden for accessibility (although it may be 4886 * unavailable for other reasons). If 1, then the rotation lock toggle is hidden. 4887 * 4888 * @hide 4889 */ 4890 @UnsupportedAppUsage 4891 @Readable 4892 public static final String HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY = 4893 "hide_rotation_lock_toggle_for_accessibility"; 4894 4895 /** 4896 * Whether the phone vibrates when it is ringing due to an incoming call. This will 4897 * be used by Phone and Setting apps; it shouldn't affect other apps. 4898 * The value is boolean (1 or 0). 4899 * 4900 * Note: this is not same as "vibrate on ring", which had been available until ICS. 4901 * It was about AudioManager's setting and thus affected all the applications which 4902 * relied on the setting, while this is purely about the vibration setting for incoming 4903 * calls. 4904 */ 4905 @Readable 4906 public static final String VIBRATE_WHEN_RINGING = "vibrate_when_ringing"; 4907 4908 /** 4909 * When {@code 1}, Telecom enhanced call blocking functionality is enabled. When 4910 * {@code 0}, enhanced call blocking functionality is disabled. 4911 * @hide 4912 */ 4913 @Readable 4914 public static final String DEBUG_ENABLE_ENHANCED_CALL_BLOCKING = 4915 "debug.enable_enhanced_calling"; 4916 4917 /** 4918 * Whether the audible DTMF tones are played by the dialer when dialing. The value is 4919 * boolean (1 or 0). 4920 */ 4921 @Readable 4922 public static final String DTMF_TONE_WHEN_DIALING = "dtmf_tone"; 4923 4924 /** 4925 * CDMA only settings 4926 * DTMF tone type played by the dialer when dialing. 4927 * 0 = Normal 4928 * 1 = Long 4929 */ 4930 @Readable 4931 public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type"; 4932 4933 /** 4934 * Whether the hearing aid is enabled. The value is 4935 * boolean (1 or 0). 4936 * @hide 4937 */ 4938 @UnsupportedAppUsage 4939 @Readable 4940 public static final String HEARING_AID = "hearing_aid"; 4941 4942 /** 4943 * CDMA only settings 4944 * TTY Mode 4945 * 0 = OFF 4946 * 1 = FULL 4947 * 2 = VCO 4948 * 3 = HCO 4949 * @hide 4950 */ 4951 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4952 @Readable 4953 public static final String TTY_MODE = "tty_mode"; 4954 4955 /** 4956 * Whether the sounds effects (key clicks, lid open ...) are enabled. The value is 4957 * boolean (1 or 0). 4958 */ 4959 @Readable 4960 public static final String SOUND_EFFECTS_ENABLED = "sound_effects_enabled"; 4961 4962 /** 4963 * Whether haptic feedback (Vibrate on tap) is enabled. The value is 4964 * boolean (1 or 0). 4965 */ 4966 @Readable 4967 public static final String HAPTIC_FEEDBACK_ENABLED = "haptic_feedback_enabled"; 4968 4969 /** 4970 * @deprecated Each application that shows web suggestions should have its own 4971 * setting for this. 4972 */ 4973 @Deprecated 4974 @Readable 4975 public static final String SHOW_WEB_SUGGESTIONS = "show_web_suggestions"; 4976 4977 /** 4978 * Whether the notification LED should repeatedly flash when a notification is 4979 * pending. The value is boolean (1 or 0). 4980 * @hide 4981 */ 4982 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4983 @Readable 4984 public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; 4985 4986 /** 4987 * Show pointer location on screen? 4988 * 0 = no 4989 * 1 = yes 4990 * @hide 4991 */ 4992 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 4993 @Readable 4994 public static final String POINTER_LOCATION = "pointer_location"; 4995 4996 /** 4997 * Show touch positions on screen? 4998 * 0 = no 4999 * 1 = yes 5000 * @hide 5001 */ 5002 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5003 @Readable 5004 public static final String SHOW_TOUCHES = "show_touches"; 5005 5006 /** 5007 * Log raw orientation data from 5008 * {@link com.android.server.policy.WindowOrientationListener} for use with the 5009 * orientationplot.py tool. 5010 * 0 = no 5011 * 1 = yes 5012 * @hide 5013 */ 5014 @Readable 5015 public static final String WINDOW_ORIENTATION_LISTENER_LOG = 5016 "window_orientation_listener_log"; 5017 5018 /** 5019 * @deprecated Use {@link android.provider.Settings.Global#POWER_SOUNDS_ENABLED} 5020 * instead 5021 * @hide 5022 */ 5023 @Deprecated 5024 public static final String POWER_SOUNDS_ENABLED = Global.POWER_SOUNDS_ENABLED; 5025 5026 /** 5027 * @deprecated Use {@link android.provider.Settings.Global#DOCK_SOUNDS_ENABLED} 5028 * instead 5029 * @hide 5030 */ 5031 @Deprecated 5032 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5033 public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED; 5034 5035 /** 5036 * Whether to play sounds when the keyguard is shown and dismissed. 5037 * @hide 5038 */ 5039 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5040 @Readable 5041 public static final String LOCKSCREEN_SOUNDS_ENABLED = "lockscreen_sounds_enabled"; 5042 5043 /** 5044 * Whether the lockscreen should be completely disabled. 5045 * @hide 5046 */ 5047 @Readable 5048 public static final String LOCKSCREEN_DISABLED = "lockscreen.disabled"; 5049 5050 /** 5051 * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} 5052 * instead 5053 * @hide 5054 */ 5055 @Deprecated 5056 public static final String LOW_BATTERY_SOUND = Global.LOW_BATTERY_SOUND; 5057 5058 /** 5059 * @deprecated Use {@link android.provider.Settings.Global#DESK_DOCK_SOUND} 5060 * instead 5061 * @hide 5062 */ 5063 @Deprecated 5064 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5065 public static final String DESK_DOCK_SOUND = Global.DESK_DOCK_SOUND; 5066 5067 /** 5068 * @deprecated Use {@link android.provider.Settings.Global#DESK_UNDOCK_SOUND} 5069 * instead 5070 * @hide 5071 */ 5072 @Deprecated 5073 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5074 public static final String DESK_UNDOCK_SOUND = Global.DESK_UNDOCK_SOUND; 5075 5076 /** 5077 * @deprecated Use {@link android.provider.Settings.Global#CAR_DOCK_SOUND} 5078 * instead 5079 * @hide 5080 */ 5081 @Deprecated 5082 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5083 public static final String CAR_DOCK_SOUND = Global.CAR_DOCK_SOUND; 5084 5085 /** 5086 * @deprecated Use {@link android.provider.Settings.Global#CAR_UNDOCK_SOUND} 5087 * instead 5088 * @hide 5089 */ 5090 @Deprecated 5091 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5092 public static final String CAR_UNDOCK_SOUND = Global.CAR_UNDOCK_SOUND; 5093 5094 /** 5095 * @deprecated Use {@link android.provider.Settings.Global#LOCK_SOUND} 5096 * instead 5097 * @hide 5098 */ 5099 @Deprecated 5100 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5101 public static final String LOCK_SOUND = Global.LOCK_SOUND; 5102 5103 /** 5104 * @deprecated Use {@link android.provider.Settings.Global#UNLOCK_SOUND} 5105 * instead 5106 * @hide 5107 */ 5108 @Deprecated 5109 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5110 public static final String UNLOCK_SOUND = Global.UNLOCK_SOUND; 5111 5112 /** 5113 * Receive incoming SIP calls? 5114 * 0 = no 5115 * 1 = yes 5116 * @hide 5117 */ 5118 @Readable 5119 public static final String SIP_RECEIVE_CALLS = "sip_receive_calls"; 5120 5121 /** 5122 * Call Preference String. 5123 * "SIP_ALWAYS" : Always use SIP with network access 5124 * "SIP_ADDRESS_ONLY" : Only if destination is a SIP address 5125 * @hide 5126 */ 5127 @Readable 5128 public static final String SIP_CALL_OPTIONS = "sip_call_options"; 5129 5130 /** 5131 * One of the sip call options: Always use SIP with network access. 5132 * @hide 5133 */ 5134 @Readable 5135 public static final String SIP_ALWAYS = "SIP_ALWAYS"; 5136 5137 /** 5138 * One of the sip call options: Only if destination is a SIP address. 5139 * @hide 5140 */ 5141 @Readable 5142 public static final String SIP_ADDRESS_ONLY = "SIP_ADDRESS_ONLY"; 5143 5144 /** 5145 * @deprecated Use SIP_ALWAYS or SIP_ADDRESS_ONLY instead. Formerly used to indicate that 5146 * the user should be prompted each time a call is made whether it should be placed using 5147 * SIP. The {@link com.android.providers.settings.DatabaseHelper} replaces this with 5148 * SIP_ADDRESS_ONLY. 5149 * @hide 5150 */ 5151 @Deprecated 5152 @Readable 5153 public static final String SIP_ASK_ME_EACH_TIME = "SIP_ASK_ME_EACH_TIME"; 5154 5155 /** 5156 * Pointer speed setting. 5157 * This is an integer value in a range between -7 and +7, so there are 15 possible values. 5158 * -7 = slowest 5159 * 0 = default speed 5160 * +7 = fastest 5161 * @hide 5162 */ 5163 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5164 @Readable 5165 public static final String POINTER_SPEED = "pointer_speed"; 5166 5167 /** 5168 * Whether lock-to-app will be triggered by long-press on recents. 5169 * @hide 5170 */ 5171 @Readable 5172 public static final String LOCK_TO_APP_ENABLED = "lock_to_app_enabled"; 5173 5174 /** 5175 * I am the lolrus. 5176 * <p> 5177 * Nonzero values indicate that the user has a bukkit. 5178 * Backward-compatible with <code>PrefGetPreference(prefAllowEasterEggs)</code>. 5179 * @hide 5180 */ 5181 @Readable 5182 public static final String EGG_MODE = "egg_mode"; 5183 5184 /** 5185 * Setting to determine whether or not to show the battery percentage in the status bar. 5186 * 0 - Don't show percentage 5187 * 1 - Show percentage 5188 * @hide 5189 */ 5190 @Readable 5191 public static final String SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent"; 5192 5193 /** 5194 * Whether or not to enable multiple audio focus. 5195 * When enabled, requires more management by user over application playback activity, 5196 * for instance pausing media apps when another starts. 5197 * @hide 5198 */ 5199 @Readable 5200 public static final String MULTI_AUDIO_FOCUS_ENABLED = "multi_audio_focus_enabled"; 5201 5202 /** 5203 * IMPORTANT: If you add a new public settings you also have to add it to 5204 * PUBLIC_SETTINGS below. If the new setting is hidden you have to add 5205 * it to PRIVATE_SETTINGS below. Also add a validator that can validate 5206 * the setting value. See an example above. 5207 */ 5208 5209 /** 5210 * Keys we no longer back up under the current schema, but want to continue to 5211 * process when restoring historical backup datasets. 5212 * 5213 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 5214 * otherwise they won't be restored. 5215 * 5216 * @hide 5217 */ 5218 public static final String[] LEGACY_RESTORE_SETTINGS = { 5219 }; 5220 5221 /** 5222 * These are all public system settings 5223 * 5224 * @hide 5225 */ 5226 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5227 public static final Set<String> PUBLIC_SETTINGS = new ArraySet<>(); 5228 static { 5229 PUBLIC_SETTINGS.add(END_BUTTON_BEHAVIOR); 5230 PUBLIC_SETTINGS.add(WIFI_USE_STATIC_IP); 5231 PUBLIC_SETTINGS.add(WIFI_STATIC_IP); 5232 PUBLIC_SETTINGS.add(WIFI_STATIC_GATEWAY); 5233 PUBLIC_SETTINGS.add(WIFI_STATIC_NETMASK); 5234 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS1); 5235 PUBLIC_SETTINGS.add(WIFI_STATIC_DNS2); 5236 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY); 5237 PUBLIC_SETTINGS.add(BLUETOOTH_DISCOVERABILITY_TIMEOUT); 5238 PUBLIC_SETTINGS.add(NEXT_ALARM_FORMATTED); 5239 PUBLIC_SETTINGS.add(FONT_SCALE); 5240 PUBLIC_SETTINGS.add(SYSTEM_LOCALES); 5241 PUBLIC_SETTINGS.add(DIM_SCREEN); 5242 PUBLIC_SETTINGS.add(SCREEN_OFF_TIMEOUT); 5243 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS); 5244 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FLOAT); 5245 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR); 5246 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR_FLOAT); 5247 PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE); 5248 PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED); 5249 PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED); 5250 PUBLIC_SETTINGS.add(VIBRATE_ON); 5251 PUBLIC_SETTINGS.add(VOLUME_RING); 5252 PUBLIC_SETTINGS.add(VOLUME_SYSTEM); 5253 PUBLIC_SETTINGS.add(VOLUME_VOICE); 5254 PUBLIC_SETTINGS.add(VOLUME_MUSIC); 5255 PUBLIC_SETTINGS.add(VOLUME_ALARM); 5256 PUBLIC_SETTINGS.add(VOLUME_NOTIFICATION); 5257 PUBLIC_SETTINGS.add(VOLUME_BLUETOOTH_SCO); 5258 PUBLIC_SETTINGS.add(VOLUME_ASSISTANT); 5259 PUBLIC_SETTINGS.add(RINGTONE); 5260 PUBLIC_SETTINGS.add(NOTIFICATION_SOUND); 5261 PUBLIC_SETTINGS.add(ALARM_ALERT); 5262 PUBLIC_SETTINGS.add(TEXT_AUTO_REPLACE); 5263 PUBLIC_SETTINGS.add(TEXT_AUTO_CAPS); 5264 PUBLIC_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 5265 PUBLIC_SETTINGS.add(TEXT_SHOW_PASSWORD); 5266 PUBLIC_SETTINGS.add(SHOW_GTALK_SERVICE_STATUS); 5267 PUBLIC_SETTINGS.add(WALLPAPER_ACTIVITY); 5268 PUBLIC_SETTINGS.add(TIME_12_24); 5269 PUBLIC_SETTINGS.add(DATE_FORMAT); 5270 PUBLIC_SETTINGS.add(SETUP_WIZARD_HAS_RUN); 5271 PUBLIC_SETTINGS.add(ACCELEROMETER_ROTATION); 5272 PUBLIC_SETTINGS.add(USER_ROTATION); 5273 PUBLIC_SETTINGS.add(DTMF_TONE_WHEN_DIALING); 5274 PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); 5275 PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 5276 PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); 5277 PUBLIC_SETTINGS.add(VIBRATE_WHEN_RINGING); 5278 } 5279 5280 /** 5281 * These are all hidden system settings. 5282 * 5283 * @hide 5284 */ 5285 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5286 public static final Set<String> PRIVATE_SETTINGS = new ArraySet<>(); 5287 static { 5288 PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP); 5289 PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR); 5290 PRIVATE_SETTINGS.add(ADVANCED_SETTINGS); 5291 PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ); 5292 PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES); 5293 PRIVATE_SETTINGS.add(VOLUME_MASTER); 5294 PRIVATE_SETTINGS.add(MASTER_MONO); 5295 PRIVATE_SETTINGS.add(MASTER_BALANCE); 5296 PRIVATE_SETTINGS.add(NOTIFICATIONS_USE_RING_VOLUME); 5297 PRIVATE_SETTINGS.add(VIBRATE_IN_SILENT); 5298 PRIVATE_SETTINGS.add(MEDIA_BUTTON_RECEIVER); 5299 PRIVATE_SETTINGS.add(HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY); 5300 PRIVATE_SETTINGS.add(DTMF_TONE_TYPE_WHEN_DIALING); 5301 PRIVATE_SETTINGS.add(HEARING_AID); 5302 PRIVATE_SETTINGS.add(TTY_MODE); 5303 PRIVATE_SETTINGS.add(NOTIFICATION_LIGHT_PULSE); 5304 PRIVATE_SETTINGS.add(POINTER_LOCATION); 5305 PRIVATE_SETTINGS.add(SHOW_TOUCHES); 5306 PRIVATE_SETTINGS.add(WINDOW_ORIENTATION_LISTENER_LOG); 5307 PRIVATE_SETTINGS.add(POWER_SOUNDS_ENABLED); 5308 PRIVATE_SETTINGS.add(DOCK_SOUNDS_ENABLED); 5309 PRIVATE_SETTINGS.add(LOCKSCREEN_SOUNDS_ENABLED); 5310 PRIVATE_SETTINGS.add(LOCKSCREEN_DISABLED); 5311 PRIVATE_SETTINGS.add(LOW_BATTERY_SOUND); 5312 PRIVATE_SETTINGS.add(DESK_DOCK_SOUND); 5313 PRIVATE_SETTINGS.add(DESK_UNDOCK_SOUND); 5314 PRIVATE_SETTINGS.add(CAR_DOCK_SOUND); 5315 PRIVATE_SETTINGS.add(CAR_UNDOCK_SOUND); 5316 PRIVATE_SETTINGS.add(LOCK_SOUND); 5317 PRIVATE_SETTINGS.add(UNLOCK_SOUND); 5318 PRIVATE_SETTINGS.add(SIP_RECEIVE_CALLS); 5319 PRIVATE_SETTINGS.add(SIP_CALL_OPTIONS); 5320 PRIVATE_SETTINGS.add(SIP_ALWAYS); 5321 PRIVATE_SETTINGS.add(SIP_ADDRESS_ONLY); 5322 PRIVATE_SETTINGS.add(SIP_ASK_ME_EACH_TIME); 5323 PRIVATE_SETTINGS.add(POINTER_SPEED); 5324 PRIVATE_SETTINGS.add(LOCK_TO_APP_ENABLED); 5325 PRIVATE_SETTINGS.add(EGG_MODE); 5326 PRIVATE_SETTINGS.add(SHOW_BATTERY_PERCENT); 5327 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE); 5328 PRIVATE_SETTINGS.add(DISPLAY_COLOR_MODE_VENDOR_HINT); 5329 } 5330 5331 /** 5332 * These entries are considered common between the personal and the managed profile, 5333 * since the managed profile doesn't get to change them. 5334 */ 5335 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5336 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 5337 static { 5338 CLONE_TO_MANAGED_PROFILE.add(DATE_FORMAT); 5339 CLONE_TO_MANAGED_PROFILE.add(HAPTIC_FEEDBACK_ENABLED); 5340 CLONE_TO_MANAGED_PROFILE.add(SOUND_EFFECTS_ENABLED); 5341 CLONE_TO_MANAGED_PROFILE.add(TEXT_SHOW_PASSWORD); 5342 CLONE_TO_MANAGED_PROFILE.add(TIME_12_24); 5343 } 5344 5345 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)5346 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 5347 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 5348 } 5349 5350 /** 5351 * These entries should be cloned from this profile's parent only if the dependency's 5352 * value is true ("1") 5353 * 5354 * Note: the dependencies must be Secure settings 5355 * 5356 * @hide 5357 */ 5358 public static final Map<String, String> CLONE_FROM_PARENT_ON_VALUE = new ArrayMap<>(); 5359 static { CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS)5360 CLONE_FROM_PARENT_ON_VALUE.put(RINGTONE, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS)5361 CLONE_FROM_PARENT_ON_VALUE.put(NOTIFICATION_SOUND, Secure.SYNC_PARENT_SOUNDS); CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS)5362 CLONE_FROM_PARENT_ON_VALUE.put(ALARM_ALERT, Secure.SYNC_PARENT_SOUNDS); 5363 } 5364 5365 /** @hide */ getCloneFromParentOnValueSettings(Map<String, String> outMap)5366 public static void getCloneFromParentOnValueSettings(Map<String, String> outMap) { 5367 outMap.putAll(CLONE_FROM_PARENT_ON_VALUE); 5368 } 5369 5370 /** 5371 * System settings which can be accessed by instant apps. 5372 * @hide 5373 */ 5374 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 5375 static { 5376 INSTANT_APP_SETTINGS.add(TEXT_AUTO_REPLACE); 5377 INSTANT_APP_SETTINGS.add(TEXT_AUTO_CAPS); 5378 INSTANT_APP_SETTINGS.add(TEXT_AUTO_PUNCTUATE); 5379 INSTANT_APP_SETTINGS.add(TEXT_SHOW_PASSWORD); 5380 INSTANT_APP_SETTINGS.add(DATE_FORMAT); 5381 INSTANT_APP_SETTINGS.add(FONT_SCALE); 5382 INSTANT_APP_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); 5383 INSTANT_APP_SETTINGS.add(TIME_12_24); 5384 INSTANT_APP_SETTINGS.add(SOUND_EFFECTS_ENABLED); 5385 INSTANT_APP_SETTINGS.add(ACCELEROMETER_ROTATION); 5386 } 5387 5388 /** 5389 * When to use Wi-Fi calling 5390 * 5391 * @see android.telephony.TelephonyManager.WifiCallingChoices 5392 * @hide 5393 */ 5394 @Readable 5395 public static final String WHEN_TO_MAKE_WIFI_CALLS = "when_to_make_wifi_calls"; 5396 5397 // Settings moved to Settings.Secure 5398 5399 /** 5400 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} 5401 * instead 5402 */ 5403 @Deprecated 5404 public static final String ADB_ENABLED = Global.ADB_ENABLED; 5405 5406 /** 5407 * @deprecated Use {@link android.provider.Settings.Secure#ANDROID_ID} instead 5408 */ 5409 @Deprecated 5410 public static final String ANDROID_ID = Secure.ANDROID_ID; 5411 5412 /** 5413 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 5414 */ 5415 @Deprecated 5416 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 5417 5418 /** 5419 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 5420 */ 5421 @Deprecated 5422 public static final String DATA_ROAMING = Global.DATA_ROAMING; 5423 5424 /** 5425 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 5426 */ 5427 @Deprecated 5428 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 5429 5430 /** 5431 * @deprecated Use {@link android.provider.Settings.Global#HTTP_PROXY} instead 5432 */ 5433 @Deprecated 5434 public static final String HTTP_PROXY = Global.HTTP_PROXY; 5435 5436 /** 5437 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 5438 */ 5439 @Deprecated 5440 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 5441 5442 /** 5443 * @deprecated Use {@link android.provider.Settings.Secure#LOCATION_PROVIDERS_ALLOWED} 5444 * instead 5445 */ 5446 @Deprecated 5447 public static final String LOCATION_PROVIDERS_ALLOWED = Secure.LOCATION_PROVIDERS_ALLOWED; 5448 5449 /** 5450 * @deprecated Use {@link android.provider.Settings.Secure#LOGGING_ID} instead 5451 */ 5452 @Deprecated 5453 public static final String LOGGING_ID = Secure.LOGGING_ID; 5454 5455 /** 5456 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 5457 */ 5458 @Deprecated 5459 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 5460 5461 /** 5462 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_ENABLED} 5463 * instead 5464 */ 5465 @Deprecated 5466 public static final String PARENTAL_CONTROL_ENABLED = Secure.PARENTAL_CONTROL_ENABLED; 5467 5468 /** 5469 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_LAST_UPDATE} 5470 * instead 5471 */ 5472 @Deprecated 5473 public static final String PARENTAL_CONTROL_LAST_UPDATE = Secure.PARENTAL_CONTROL_LAST_UPDATE; 5474 5475 /** 5476 * @deprecated Use {@link android.provider.Settings.Secure#PARENTAL_CONTROL_REDIRECT_URL} 5477 * instead 5478 */ 5479 @Deprecated 5480 public static final String PARENTAL_CONTROL_REDIRECT_URL = 5481 Secure.PARENTAL_CONTROL_REDIRECT_URL; 5482 5483 /** 5484 * @deprecated Use {@link android.provider.Settings.Secure#SETTINGS_CLASSNAME} instead 5485 */ 5486 @Deprecated 5487 public static final String SETTINGS_CLASSNAME = Secure.SETTINGS_CLASSNAME; 5488 5489 /** 5490 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 5491 */ 5492 @Deprecated 5493 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 5494 5495 /** 5496 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 5497 */ 5498 @Deprecated 5499 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 5500 5501 /** 5502 * @deprecated Use 5503 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 5504 */ 5505 @Deprecated 5506 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 5507 5508 /** 5509 * @deprecated Use 5510 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 5511 */ 5512 @Deprecated 5513 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 5514 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 5515 5516 /** 5517 * @deprecated Use 5518 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} instead 5519 */ 5520 @Deprecated 5521 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 5522 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 5523 5524 /** 5525 * @deprecated Use 5526 * {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead 5527 */ 5528 @Deprecated 5529 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 5530 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 5531 5532 /** 5533 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 5534 * instead 5535 */ 5536 @Deprecated 5537 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 5538 5539 /** 5540 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} instead 5541 */ 5542 @Deprecated 5543 public static final String WIFI_ON = Global.WIFI_ON; 5544 5545 /** 5546 * @deprecated Use 5547 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE} 5548 * instead 5549 */ 5550 @Deprecated 5551 @Readable 5552 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 5553 Secure.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE; 5554 5555 /** 5556 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_AP_COUNT} instead 5557 */ 5558 @Deprecated 5559 public static final String WIFI_WATCHDOG_AP_COUNT = Secure.WIFI_WATCHDOG_AP_COUNT; 5560 5561 /** 5562 * @deprecated Use 5563 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS} instead 5564 */ 5565 @Deprecated 5566 @Readable 5567 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 5568 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS; 5569 5570 /** 5571 * @deprecated Use 5572 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED} instead 5573 */ 5574 @Deprecated 5575 @Readable 5576 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 5577 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED; 5578 5579 /** 5580 * @deprecated Use 5581 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS} 5582 * instead 5583 */ 5584 @Deprecated 5585 @Readable 5586 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 5587 Secure.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS; 5588 5589 /** 5590 * @deprecated Use 5591 * {@link android.provider.Settings.Secure#WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT} instead 5592 */ 5593 @Deprecated 5594 @Readable 5595 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 5596 Secure.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT; 5597 5598 /** 5599 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_MAX_AP_CHECKS} 5600 * instead 5601 */ 5602 @Deprecated 5603 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = Secure.WIFI_WATCHDOG_MAX_AP_CHECKS; 5604 5605 /** 5606 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 5607 */ 5608 @Deprecated 5609 public static final String WIFI_WATCHDOG_ON = Global.WIFI_WATCHDOG_ON; 5610 5611 /** 5612 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_COUNT} instead 5613 */ 5614 @Deprecated 5615 public static final String WIFI_WATCHDOG_PING_COUNT = Secure.WIFI_WATCHDOG_PING_COUNT; 5616 5617 /** 5618 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_DELAY_MS} 5619 * instead 5620 */ 5621 @Deprecated 5622 public static final String WIFI_WATCHDOG_PING_DELAY_MS = Secure.WIFI_WATCHDOG_PING_DELAY_MS; 5623 5624 /** 5625 * @deprecated Use {@link android.provider.Settings.Secure#WIFI_WATCHDOG_PING_TIMEOUT_MS} 5626 * instead 5627 */ 5628 @Deprecated 5629 @Readable 5630 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = 5631 Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; 5632 5633 /** 5634 * Checks if the specified app can modify system settings. As of API 5635 * level 23, an app cannot modify system settings unless it declares the 5636 * {@link android.Manifest.permission#WRITE_SETTINGS} 5637 * permission in its manifest, <em>and</em> the user specifically grants 5638 * the app this capability. To prompt the user to grant this approval, 5639 * the app must send an intent with the action {@link 5640 * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes 5641 * the system to display a permission management screen. 5642 * 5643 * @param context App context. 5644 * @return true if the calling app can write to system settings, false otherwise 5645 */ canWrite(Context context)5646 public static boolean canWrite(Context context) { 5647 return isCallingPackageAllowedToWriteSettings(context, Process.myUid(), 5648 context.getOpPackageName(), false); 5649 } 5650 } 5651 5652 /** 5653 * Secure system settings, containing system preferences that applications 5654 * can read but are not allowed to write. These are for preferences that 5655 * the user must explicitly modify through the UI of a system app. Normal 5656 * applications cannot modify the secure settings database, either directly 5657 * or by calling the "put" methods that this class contains. 5658 */ 5659 public static final class Secure extends NameValueTable { 5660 // NOTE: If you add new settings here, be sure to add them to 5661 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSecureSettingsLocked. 5662 5663 /** 5664 * The content:// style URL for this table 5665 */ 5666 public static final Uri CONTENT_URI = 5667 Uri.parse("content://" + AUTHORITY + "/secure"); 5668 5669 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 5670 private static final ContentProviderHolder sProviderHolder = 5671 new ContentProviderHolder(CONTENT_URI); 5672 5673 // Populated lazily, guarded by class object: 5674 @UnsupportedAppUsage 5675 private static final NameValueCache sNameValueCache = new NameValueCache( 5676 CONTENT_URI, 5677 CALL_METHOD_GET_SECURE, 5678 CALL_METHOD_PUT_SECURE, 5679 sProviderHolder, 5680 Secure.class); 5681 5682 private static ILockSettings sLockSettings = null; 5683 5684 private static boolean sIsSystemProcess; 5685 @UnsupportedAppUsage 5686 private static final HashSet<String> MOVED_TO_LOCK_SETTINGS; 5687 @UnsupportedAppUsage 5688 private static final HashSet<String> MOVED_TO_GLOBAL; 5689 static { 5690 MOVED_TO_LOCK_SETTINGS = new HashSet<>(3); 5691 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_ENABLED); 5692 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_VISIBLE); 5693 MOVED_TO_LOCK_SETTINGS.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED); 5694 5695 MOVED_TO_GLOBAL = new HashSet<>(); 5696 MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); 5697 MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); 5698 MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); 5699 MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); 5700 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); 5701 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); 5702 MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); 5703 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE); 5704 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI); 5705 MOVED_TO_GLOBAL.add(Settings.Global.DATA_ROAMING); 5706 MOVED_TO_GLOBAL.add(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED); 5707 MOVED_TO_GLOBAL.add(Settings.Global.DEVICE_PROVISIONED); 5708 MOVED_TO_GLOBAL.add(Settings.Global.DISPLAY_SIZE_FORCED); 5709 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_MAX_BYTES_OVER_MOBILE); 5710 MOVED_TO_GLOBAL.add(Settings.Global.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE); 5711 MOVED_TO_GLOBAL.add(Settings.Global.MOBILE_DATA); 5712 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_BUCKET_DURATION); 5713 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_DELETE_AGE); 5714 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_PERSIST_BYTES); 5715 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_DEV_ROTATE_AGE); 5716 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_ENABLED); 5717 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_GLOBAL_ALERT_BYTES); 5718 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_POLL_INTERVAL); 5719 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_SAMPLE_ENABLED); 5720 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_TIME_CACHE_MAX_AGE); 5721 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_BUCKET_DURATION); 5722 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_DELETE_AGE); 5723 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_PERSIST_BYTES); 5724 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_ROTATE_AGE); 5725 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION); 5726 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_DELETE_AGE); 5727 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_PERSIST_BYTES); 5728 MOVED_TO_GLOBAL.add(Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE); 5729 MOVED_TO_GLOBAL.add(Settings.Global.NETWORK_PREFERENCE); 5730 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_DIFF); 5731 MOVED_TO_GLOBAL.add(Settings.Global.NITZ_UPDATE_SPACING); 5732 MOVED_TO_GLOBAL.add(Settings.Global.NTP_SERVER); 5733 MOVED_TO_GLOBAL.add(Settings.Global.NTP_TIMEOUT); 5734 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_ERROR_POLL_COUNT); 5735 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_LONG_POLL_INTERVAL_MS); 5736 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT); 5737 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_POLL_INTERVAL_MS); 5738 MOVED_TO_GLOBAL.add(Settings.Global.PDP_WATCHDOG_TRIGGER_PACKET_COUNT); 5739 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DATA_SERVICE_URL); 5740 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST); 5741 MOVED_TO_GLOBAL.add(Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL); 5742 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_APN); 5743 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_DUN_REQUIRED); 5744 MOVED_TO_GLOBAL.add(Settings.Global.TETHER_SUPPORTED); 5745 MOVED_TO_GLOBAL.add(Settings.Global.USB_MASS_STORAGE_ENABLED); 5746 MOVED_TO_GLOBAL.add(Settings.Global.USE_GOOGLE_MAIL); 5747 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_COUNTRY_CODE); 5748 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FRAMEWORK_SCAN_INTERVAL_MS); 5749 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_FREQUENCY_BAND); 5750 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_IDLE_MS); 5751 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT); 5752 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS); 5753 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5754 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY); 5755 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NUM_OPEN_NETWORKS_KEPT); 5756 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ON); 5757 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_DEVICE_NAME); 5758 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS); 5759 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_VERBOSE_LOGGING_ENABLED); 5760 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_ENHANCED_AUTO_JOIN); 5761 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_NETWORK_SHOW_RSSI); 5762 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_ON); 5763 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED); 5764 MOVED_TO_GLOBAL.add(Settings.Global.WIFI_P2P_PENDING_FACTORY_RESET); 5765 MOVED_TO_GLOBAL.add(Settings.Global.WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON); 5766 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_TIMEOUT); 5767 MOVED_TO_GLOBAL.add(Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE); 5768 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS); 5769 MOVED_TO_GLOBAL.add(Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS); 5770 MOVED_TO_GLOBAL.add(Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS); 5771 MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); 5772 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_DURATION_THRESHOLD); 5773 MOVED_TO_GLOBAL.add(Settings.Global.BATTERY_DISCHARGE_THRESHOLD); 5774 MOVED_TO_GLOBAL.add(Settings.Global.SEND_ACTION_APP_ERROR); 5775 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_AGE_SECONDS); 5776 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_MAX_FILES); 5777 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_KB); 5778 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_QUOTA_PERCENT); 5779 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_RESERVE_PERCENT); 5780 MOVED_TO_GLOBAL.add(Settings.Global.DROPBOX_TAG_PREFIX); 5781 MOVED_TO_GLOBAL.add(Settings.Global.ERROR_LOGCAT_PREFIX); 5782 MOVED_TO_GLOBAL.add(Settings.Global.SYS_FREE_STORAGE_LOG_INTERVAL); 5783 MOVED_TO_GLOBAL.add(Settings.Global.DISK_FREE_CHANGE_REPORTING_THRESHOLD); 5784 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_PERCENTAGE); 5785 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_THRESHOLD_MAX_BYTES); 5786 MOVED_TO_GLOBAL.add(Settings.Global.SYS_STORAGE_FULL_THRESHOLD_BYTES); 5787 MOVED_TO_GLOBAL.add(Settings.Global.SYNC_MAX_RETRY_DELAY_IN_SECONDS); 5788 MOVED_TO_GLOBAL.add(Settings.Global.CONNECTIVITY_CHANGE_DELAY); 5789 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_DETECTION_ENABLED); 5790 MOVED_TO_GLOBAL.add(Settings.Global.CAPTIVE_PORTAL_SERVER); 5791 MOVED_TO_GLOBAL.add(Settings.Global.NSD_ON); 5792 MOVED_TO_GLOBAL.add(Settings.Global.SET_INSTALL_LOCATION); 5793 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_INSTALL_LOCATION); 5794 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_UP_DELAY); 5795 MOVED_TO_GLOBAL.add(Settings.Global.INET_CONDITION_DEBOUNCE_DOWN_DELAY); 5796 MOVED_TO_GLOBAL.add(Settings.Global.READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT); 5797 MOVED_TO_GLOBAL.add(Settings.Global.HTTP_PROXY); 5798 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_HOST); 5799 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_PORT); 5800 MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST); 5801 MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY); 5802 MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER); 5803 MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE); 5804 MOVED_TO_GLOBAL.add(Settings.Global.WEBVIEW_DATA_REDUCTION_PROXY_KEY); 5805 } 5806 5807 /** @hide */ getMovedToGlobalSettings(Set<String> outKeySet)5808 public static void getMovedToGlobalSettings(Set<String> outKeySet) { 5809 outKeySet.addAll(MOVED_TO_GLOBAL); 5810 } 5811 5812 /** @hide */ clearProviderForTest()5813 public static void clearProviderForTest() { 5814 sProviderHolder.clearProviderForTest(); 5815 sNameValueCache.clearGenerationTrackerForTest(); 5816 } 5817 5818 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)5819 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 5820 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 5821 getPublicSettingsForClass(Secure.class, allKeys, readableKeys, 5822 readableKeysWithMaxTargetSdk); 5823 } 5824 5825 /** 5826 * Look up a name in the database. 5827 * @param resolver to access the database with 5828 * @param name to look up in the table 5829 * @return the corresponding value, or null if not present 5830 */ getString(ContentResolver resolver, String name)5831 public static String getString(ContentResolver resolver, String name) { 5832 return getStringForUser(resolver, name, resolver.getUserId()); 5833 } 5834 5835 /** @hide */ 5836 @UnsupportedAppUsage getStringForUser(ContentResolver resolver, String name, int userHandle)5837 public static String getStringForUser(ContentResolver resolver, String name, 5838 int userHandle) { 5839 if (MOVED_TO_GLOBAL.contains(name)) { 5840 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5841 + " to android.provider.Settings.Global."); 5842 return Global.getStringForUser(resolver, name, userHandle); 5843 } 5844 5845 if (MOVED_TO_LOCK_SETTINGS.contains(name)) { 5846 synchronized (Secure.class) { 5847 if (sLockSettings == null) { 5848 sLockSettings = ILockSettings.Stub.asInterface( 5849 (IBinder) ServiceManager.getService("lock_settings")); 5850 sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; 5851 } 5852 } 5853 if (sLockSettings != null && !sIsSystemProcess) { 5854 // No context; use the ActivityThread's context as an approximation for 5855 // determining the target API level. 5856 Application application = ActivityThread.currentApplication(); 5857 5858 boolean isPreMnc = application != null 5859 && application.getApplicationInfo() != null 5860 && application.getApplicationInfo().targetSdkVersion 5861 <= VERSION_CODES.LOLLIPOP_MR1; 5862 if (isPreMnc) { 5863 try { 5864 return sLockSettings.getString(name, "0", userHandle); 5865 } catch (RemoteException re) { 5866 // Fall through 5867 } 5868 } else { 5869 throw new SecurityException("Settings.Secure." + name 5870 + " is deprecated and no longer accessible." 5871 + " See API documentation for potential replacements."); 5872 } 5873 } 5874 } 5875 5876 return sNameValueCache.getStringForUser(resolver, name, userHandle); 5877 } 5878 5879 /** 5880 * Store a name/value pair into the database. Values written by this method will be 5881 * overridden if a restore happens in the future. 5882 * 5883 * @param resolver to access the database with 5884 * @param name to store 5885 * @param value to associate with the name 5886 * @return true if the value was set, false on database errors 5887 * 5888 * @hide 5889 */ 5890 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) putString(ContentResolver resolver, String name, String value, boolean overrideableByRestore)5891 public static boolean putString(ContentResolver resolver, String name, 5892 String value, boolean overrideableByRestore) { 5893 return putStringForUser(resolver, name, value, /* tag */ null, /* makeDefault */ false, 5894 resolver.getUserId(), overrideableByRestore); 5895 } 5896 5897 /** 5898 * Store a name/value pair into the database. 5899 * @param resolver to access the database with 5900 * @param name to store 5901 * @param value to associate with the name 5902 * @return true if the value was set, false on database errors 5903 */ putString(ContentResolver resolver, String name, String value)5904 public static boolean putString(ContentResolver resolver, String name, String value) { 5905 return putStringForUser(resolver, name, value, resolver.getUserId()); 5906 } 5907 5908 /** @hide */ 5909 @UnsupportedAppUsage putStringForUser(ContentResolver resolver, String name, String value, int userHandle)5910 public static boolean putStringForUser(ContentResolver resolver, String name, String value, 5911 int userHandle) { 5912 return putStringForUser(resolver, name, value, null, false, userHandle, 5913 DEFAULT_OVERRIDEABLE_BY_RESTORE); 5914 } 5915 5916 /** @hide */ 5917 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)5918 public static boolean putStringForUser(@NonNull ContentResolver resolver, 5919 @NonNull String name, @Nullable String value, @Nullable String tag, 5920 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 5921 if (MOVED_TO_GLOBAL.contains(name)) { 5922 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 5923 + " to android.provider.Settings.Global"); 5924 return Global.putStringForUser(resolver, name, value, 5925 tag, makeDefault, userHandle, DEFAULT_OVERRIDEABLE_BY_RESTORE); 5926 } 5927 return sNameValueCache.putStringForUser(resolver, name, value, tag, 5928 makeDefault, userHandle, overrideableByRestore); 5929 } 5930 5931 /** 5932 * Store a name/value pair into the database. 5933 * <p> 5934 * The method takes an optional tag to associate with the setting 5935 * which can be used to clear only settings made by your package and 5936 * associated with this tag by passing the tag to {@link 5937 * #resetToDefaults(ContentResolver, String)}. Anyone can override 5938 * the current tag. Also if another package changes the setting 5939 * then the tag will be set to the one specified in the set call 5940 * which can be null. Also any of the settings setters that do not 5941 * take a tag as an argument effectively clears the tag. 5942 * </p><p> 5943 * For example, if you set settings A and B with tags T1 and T2 and 5944 * another app changes setting A (potentially to the same value), it 5945 * can assign to it a tag T3 (note that now the package that changed 5946 * the setting is not yours). Now if you reset your changes for T1 and 5947 * T2 only setting B will be reset and A not (as it was changed by 5948 * another package) but since A did not change you are in the desired 5949 * initial state. Now if the other app changes the value of A (assuming 5950 * you registered an observer in the beginning) you would detect that 5951 * the setting was changed by another app and handle this appropriately 5952 * (ignore, set back to some value, etc). 5953 * </p><p> 5954 * Also the method takes an argument whether to make the value the 5955 * default for this setting. If the system already specified a default 5956 * value, then the one passed in here will <strong>not</strong> 5957 * be set as the default. 5958 * </p> 5959 * 5960 * @param resolver to access the database with. 5961 * @param name to store. 5962 * @param value to associate with the name. 5963 * @param tag to associate with the setting. 5964 * @param makeDefault whether to make the value the default one. 5965 * @return true if the value was set, false on database errors. 5966 * 5967 * @see #resetToDefaults(ContentResolver, String) 5968 * 5969 * @hide 5970 */ 5971 @SystemApi 5972 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)5973 public static boolean putString(@NonNull ContentResolver resolver, 5974 @NonNull String name, @Nullable String value, @Nullable String tag, 5975 boolean makeDefault) { 5976 return putStringForUser(resolver, name, value, tag, makeDefault, 5977 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 5978 } 5979 5980 /** 5981 * Reset the settings to their defaults. This would reset <strong>only</strong> 5982 * settings set by the caller's package. Think of it of a way to undo your own 5983 * changes to the global settings. Passing in the optional tag will reset only 5984 * settings changed by your package and associated with this tag. 5985 * 5986 * @param resolver Handle to the content resolver. 5987 * @param tag Optional tag which should be associated with the settings to reset. 5988 * 5989 * @see #putString(ContentResolver, String, String, String, boolean) 5990 * 5991 * @hide 5992 */ 5993 @SystemApi 5994 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)5995 public static void resetToDefaults(@NonNull ContentResolver resolver, 5996 @Nullable String tag) { 5997 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 5998 resolver.getUserId()); 5999 } 6000 6001 /** 6002 * 6003 * Reset the settings to their defaults for a given user with a specific mode. The 6004 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 6005 * allowing resetting the settings made by a package and associated with the tag. 6006 * 6007 * @param resolver Handle to the content resolver. 6008 * @param tag Optional tag which should be associated with the settings to reset. 6009 * @param mode The reset mode. 6010 * @param userHandle The user for which to reset to defaults. 6011 * 6012 * @see #RESET_MODE_PACKAGE_DEFAULTS 6013 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 6014 * @see #RESET_MODE_UNTRUSTED_CHANGES 6015 * @see #RESET_MODE_TRUSTED_DEFAULTS 6016 * 6017 * @hide 6018 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)6019 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 6020 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 6021 try { 6022 Bundle arg = new Bundle(); 6023 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 6024 if (tag != null) { 6025 arg.putString(CALL_METHOD_TAG_KEY, tag); 6026 } 6027 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 6028 IContentProvider cp = sProviderHolder.getProvider(resolver); 6029 cp.call(resolver.getAttributionSource(), 6030 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_SECURE, null, arg); 6031 } catch (RemoteException e) { 6032 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 6033 } 6034 } 6035 6036 /** 6037 * Construct the content URI for a particular name/value pair, 6038 * useful for monitoring changes with a ContentObserver. 6039 * @param name to look up in the table 6040 * @return the corresponding content URI, or null if not present 6041 */ getUriFor(String name)6042 public static Uri getUriFor(String name) { 6043 if (MOVED_TO_GLOBAL.contains(name)) { 6044 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" 6045 + " to android.provider.Settings.Global, returning global URI."); 6046 return Global.getUriFor(Global.CONTENT_URI, name); 6047 } 6048 return getUriFor(CONTENT_URI, name); 6049 } 6050 6051 /** 6052 * Convenience function for retrieving a single secure settings value 6053 * as an integer. Note that internally setting values are always 6054 * stored as strings; this function converts the string to an integer 6055 * for you. The default value will be returned if the setting is 6056 * not defined or not an integer. 6057 * 6058 * @param cr The ContentResolver to access. 6059 * @param name The name of the setting to retrieve. 6060 * @param def Value to return if the setting is not defined. 6061 * 6062 * @return The setting's current value, or 'def' if it is not defined 6063 * or not a valid integer. 6064 */ getInt(ContentResolver cr, String name, int def)6065 public static int getInt(ContentResolver cr, String name, int def) { 6066 return getIntForUser(cr, name, def, cr.getUserId()); 6067 } 6068 6069 /** @hide */ 6070 @UnsupportedAppUsage getIntForUser(ContentResolver cr, String name, int def, int userHandle)6071 public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) { 6072 String v = getStringForUser(cr, name, userHandle); 6073 try { 6074 return v != null ? Integer.parseInt(v) : def; 6075 } catch (NumberFormatException e) { 6076 return def; 6077 } 6078 } 6079 6080 /** 6081 * Convenience function for retrieving a single secure settings value 6082 * as an integer. Note that internally setting values are always 6083 * stored as strings; this function converts the string to an integer 6084 * for you. 6085 * <p> 6086 * This version does not take a default value. If the setting has not 6087 * been set, or the string value is not a number, 6088 * it throws {@link SettingNotFoundException}. 6089 * 6090 * @param cr The ContentResolver to access. 6091 * @param name The name of the setting to retrieve. 6092 * 6093 * @throws SettingNotFoundException Thrown if a setting by the given 6094 * name can't be found or the setting value is not an integer. 6095 * 6096 * @return The setting's current value. 6097 */ getInt(ContentResolver cr, String name)6098 public static int getInt(ContentResolver cr, String name) 6099 throws SettingNotFoundException { 6100 return getIntForUser(cr, name, cr.getUserId()); 6101 } 6102 6103 /** @hide */ getIntForUser(ContentResolver cr, String name, int userHandle)6104 public static int getIntForUser(ContentResolver cr, String name, int userHandle) 6105 throws SettingNotFoundException { 6106 String v = getStringForUser(cr, name, userHandle); 6107 try { 6108 return Integer.parseInt(v); 6109 } catch (NumberFormatException e) { 6110 throw new SettingNotFoundException(name); 6111 } 6112 } 6113 6114 /** 6115 * Convenience function for updating a single settings value as an 6116 * integer. This will either create a new entry in the table if the 6117 * given name does not exist, or modify the value of the existing row 6118 * with that name. Note that internally setting values are always 6119 * stored as strings, so this function converts the given value to a 6120 * string before storing it. 6121 * 6122 * @param cr The ContentResolver to access. 6123 * @param name The name of the setting to modify. 6124 * @param value The new value for the setting. 6125 * @return true if the value was set, false on database errors 6126 */ putInt(ContentResolver cr, String name, int value)6127 public static boolean putInt(ContentResolver cr, String name, int value) { 6128 return putIntForUser(cr, name, value, cr.getUserId()); 6129 } 6130 6131 /** @hide */ 6132 @UnsupportedAppUsage putIntForUser(ContentResolver cr, String name, int value, int userHandle)6133 public static boolean putIntForUser(ContentResolver cr, String name, int value, 6134 int userHandle) { 6135 return putStringForUser(cr, name, Integer.toString(value), userHandle); 6136 } 6137 6138 /** 6139 * Convenience function for retrieving a single secure settings value 6140 * as a {@code long}. Note that internally setting values are always 6141 * stored as strings; this function converts the string to a {@code long} 6142 * for you. The default value will be returned if the setting is 6143 * not defined or not a {@code long}. 6144 * 6145 * @param cr The ContentResolver to access. 6146 * @param name The name of the setting to retrieve. 6147 * @param def Value to return if the setting is not defined. 6148 * 6149 * @return The setting's current value, or 'def' if it is not defined 6150 * or not a valid {@code long}. 6151 */ getLong(ContentResolver cr, String name, long def)6152 public static long getLong(ContentResolver cr, String name, long def) { 6153 return getLongForUser(cr, name, def, cr.getUserId()); 6154 } 6155 6156 /** @hide */ 6157 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) getLongForUser(ContentResolver cr, String name, long def, int userHandle)6158 public static long getLongForUser(ContentResolver cr, String name, long def, 6159 int userHandle) { 6160 String valString = getStringForUser(cr, name, userHandle); 6161 long value; 6162 try { 6163 value = valString != null ? Long.parseLong(valString) : def; 6164 } catch (NumberFormatException e) { 6165 value = def; 6166 } 6167 return value; 6168 } 6169 6170 /** 6171 * Convenience function for retrieving a single secure settings value 6172 * as a {@code long}. Note that internally setting values are always 6173 * stored as strings; this function converts the string to a {@code long} 6174 * for you. 6175 * <p> 6176 * This version does not take a default value. If the setting has not 6177 * been set, or the string value is not a number, 6178 * it throws {@link SettingNotFoundException}. 6179 * 6180 * @param cr The ContentResolver to access. 6181 * @param name The name of the setting to retrieve. 6182 * 6183 * @return The setting's current value. 6184 * @throws SettingNotFoundException Thrown if a setting by the given 6185 * name can't be found or the setting value is not an integer. 6186 */ getLong(ContentResolver cr, String name)6187 public static long getLong(ContentResolver cr, String name) 6188 throws SettingNotFoundException { 6189 return getLongForUser(cr, name, cr.getUserId()); 6190 } 6191 6192 /** @hide */ getLongForUser(ContentResolver cr, String name, int userHandle)6193 public static long getLongForUser(ContentResolver cr, String name, int userHandle) 6194 throws SettingNotFoundException { 6195 String valString = getStringForUser(cr, name, userHandle); 6196 try { 6197 return Long.parseLong(valString); 6198 } catch (NumberFormatException e) { 6199 throw new SettingNotFoundException(name); 6200 } 6201 } 6202 6203 /** 6204 * Convenience function for updating a secure settings value as a long 6205 * integer. This will either create a new entry in the table if the 6206 * given name does not exist, or modify the value of the existing row 6207 * with that name. Note that internally setting values are always 6208 * stored as strings, so this function converts the given value to a 6209 * string before storing it. 6210 * 6211 * @param cr The ContentResolver to access. 6212 * @param name The name of the setting to modify. 6213 * @param value The new value for the setting. 6214 * @return true if the value was set, false on database errors 6215 */ putLong(ContentResolver cr, String name, long value)6216 public static boolean putLong(ContentResolver cr, String name, long value) { 6217 return putLongForUser(cr, name, value, cr.getUserId()); 6218 } 6219 6220 /** @hide */ 6221 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) putLongForUser(ContentResolver cr, String name, long value, int userHandle)6222 public static boolean putLongForUser(ContentResolver cr, String name, long value, 6223 int userHandle) { 6224 return putStringForUser(cr, name, Long.toString(value), userHandle); 6225 } 6226 6227 /** 6228 * Convenience function for retrieving a single secure settings value 6229 * as a floating point number. Note that internally setting values are 6230 * always stored as strings; this function converts the string to an 6231 * float for you. The default value will be returned if the setting 6232 * is not defined or not a valid float. 6233 * 6234 * @param cr The ContentResolver to access. 6235 * @param name The name of the setting to retrieve. 6236 * @param def Value to return if the setting is not defined. 6237 * 6238 * @return The setting's current value, or 'def' if it is not defined 6239 * or not a valid float. 6240 */ getFloat(ContentResolver cr, String name, float def)6241 public static float getFloat(ContentResolver cr, String name, float def) { 6242 return getFloatForUser(cr, name, def, cr.getUserId()); 6243 } 6244 6245 /** @hide */ getFloatForUser(ContentResolver cr, String name, float def, int userHandle)6246 public static float getFloatForUser(ContentResolver cr, String name, float def, 6247 int userHandle) { 6248 String v = getStringForUser(cr, name, userHandle); 6249 try { 6250 return v != null ? Float.parseFloat(v) : def; 6251 } catch (NumberFormatException e) { 6252 return def; 6253 } 6254 } 6255 6256 /** 6257 * Convenience function for retrieving a single secure settings value 6258 * as a float. Note that internally setting values are always 6259 * stored as strings; this function converts the string to a float 6260 * for you. 6261 * <p> 6262 * This version does not take a default value. If the setting has not 6263 * been set, or the string value is not a number, 6264 * it throws {@link SettingNotFoundException}. 6265 * 6266 * @param cr The ContentResolver to access. 6267 * @param name The name of the setting to retrieve. 6268 * 6269 * @throws SettingNotFoundException Thrown if a setting by the given 6270 * name can't be found or the setting value is not a float. 6271 * 6272 * @return The setting's current value. 6273 */ getFloat(ContentResolver cr, String name)6274 public static float getFloat(ContentResolver cr, String name) 6275 throws SettingNotFoundException { 6276 return getFloatForUser(cr, name, cr.getUserId()); 6277 } 6278 6279 /** @hide */ getFloatForUser(ContentResolver cr, String name, int userHandle)6280 public static float getFloatForUser(ContentResolver cr, String name, int userHandle) 6281 throws SettingNotFoundException { 6282 String v = getStringForUser(cr, name, userHandle); 6283 if (v == null) { 6284 throw new SettingNotFoundException(name); 6285 } 6286 try { 6287 return Float.parseFloat(v); 6288 } catch (NumberFormatException e) { 6289 throw new SettingNotFoundException(name); 6290 } 6291 } 6292 6293 /** 6294 * Convenience function for updating a single settings value as a 6295 * floating point number. This will either create a new entry in the 6296 * table if the given name does not exist, or modify the value of the 6297 * existing row with that name. Note that internally setting values 6298 * are always stored as strings, so this function converts the given 6299 * value to a string before storing it. 6300 * 6301 * @param cr The ContentResolver to access. 6302 * @param name The name of the setting to modify. 6303 * @param value The new value for the setting. 6304 * @return true if the value was set, false on database errors 6305 */ putFloat(ContentResolver cr, String name, float value)6306 public static boolean putFloat(ContentResolver cr, String name, float value) { 6307 return putFloatForUser(cr, name, value, cr.getUserId()); 6308 } 6309 6310 /** @hide */ putFloatForUser(ContentResolver cr, String name, float value, int userHandle)6311 public static boolean putFloatForUser(ContentResolver cr, String name, float value, 6312 int userHandle) { 6313 return putStringForUser(cr, name, Float.toString(value), userHandle); 6314 } 6315 6316 /** 6317 * Control whether to enable adaptive sleep mode. 6318 * @hide 6319 */ 6320 @Readable 6321 public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; 6322 6323 /** 6324 * Setting key to indicate whether camera-based autorotate is enabled. 6325 * 6326 * @hide 6327 */ 6328 public static final String CAMERA_AUTOROTATE = "camera_autorotate"; 6329 6330 /** 6331 * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} 6332 * instead 6333 */ 6334 @Deprecated 6335 public static final String DEVELOPMENT_SETTINGS_ENABLED = 6336 Global.DEVELOPMENT_SETTINGS_ENABLED; 6337 6338 /** 6339 * When the user has enable the option to have a "bug report" command 6340 * in the power menu. 6341 * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead 6342 * @hide 6343 */ 6344 @Deprecated 6345 @Readable 6346 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 6347 6348 /** 6349 * @deprecated Use {@link android.provider.Settings.Global#ADB_ENABLED} instead 6350 */ 6351 @Deprecated 6352 public static final String ADB_ENABLED = Global.ADB_ENABLED; 6353 6354 /** 6355 * Setting to allow mock locations and location provider status to be injected into the 6356 * LocationManager service for testing purposes during application development. These 6357 * locations and status values override actual location and status information generated 6358 * by network, gps, or other location providers. 6359 * 6360 * @deprecated This settings is not used anymore. 6361 */ 6362 @Deprecated 6363 @Readable 6364 public static final String ALLOW_MOCK_LOCATION = "mock_location"; 6365 6366 /** 6367 * This is used by Bluetooth Manager to store adapter name 6368 * @hide 6369 */ 6370 @Readable(maxTargetSdk = Build.VERSION_CODES.S) 6371 public static final String BLUETOOTH_NAME = "bluetooth_name"; 6372 6373 /** 6374 * This is used by Bluetooth Manager to store adapter address 6375 * @hide 6376 */ 6377 @Readable(maxTargetSdk = Build.VERSION_CODES.S) 6378 public static final String BLUETOOTH_ADDRESS = "bluetooth_address"; 6379 6380 /** 6381 * This is used by Bluetooth Manager to store whether adapter address is valid 6382 * @hide 6383 */ 6384 @Readable(maxTargetSdk = Build.VERSION_CODES.S) 6385 public static final String BLUETOOTH_ADDR_VALID = "bluetooth_addr_valid"; 6386 6387 /** 6388 * Setting to indicate that on device captions are enabled. 6389 * 6390 * @hide 6391 */ 6392 @SystemApi 6393 @Readable 6394 public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled"; 6395 6396 /** 6397 * On Android 8.0 (API level 26) and higher versions of the platform, 6398 * a 64-bit number (expressed as a hexadecimal string), unique to 6399 * each combination of app-signing key, user, and device. 6400 * Values of {@code ANDROID_ID} are scoped by signing key and user. 6401 * The value may change if a factory reset is performed on the 6402 * device or if an APK signing key changes. 6403 * 6404 * For more information about how the platform handles {@code ANDROID_ID} 6405 * in Android 8.0 (API level 26) and higher, see <a 6406 * href="{@docRoot}about/versions/oreo/android-8.0-changes.html#privacy-all"> 6407 * Android 8.0 Behavior Changes</a>. 6408 * 6409 * <p class="note"><strong>Note:</strong> For apps that were installed 6410 * prior to updating the device to a version of Android 8.0 6411 * (API level 26) or higher, the value of {@code ANDROID_ID} changes 6412 * if the app is uninstalled and then reinstalled after the OTA. 6413 * To preserve values across uninstalls after an OTA to Android 8.0 6414 * or higher, developers can use 6415 * <a href="{@docRoot}guide/topics/data/keyvaluebackup.html"> 6416 * Key/Value Backup</a>.</p> 6417 * 6418 * <p>In versions of the platform lower than Android 8.0 (API level 26), 6419 * a 64-bit number (expressed as a hexadecimal string) that is randomly 6420 * generated when the user first sets up the device and should remain 6421 * constant for the lifetime of the user's device. 6422 * 6423 * On devices that have 6424 * <a href="{@docRoot}about/versions/android-4.2.html#MultipleUsers"> 6425 * multiple users</a>, each user appears as a 6426 * completely separate device, so the {@code ANDROID_ID} value is 6427 * unique to each user.</p> 6428 * 6429 * <p class="note"><strong>Note:</strong> If the caller is an Instant App the ID is scoped 6430 * to the Instant App, it is generated when the Instant App is first installed and reset if 6431 * the user clears the Instant App. 6432 */ 6433 @Readable 6434 public static final String ANDROID_ID = "android_id"; 6435 6436 /** 6437 * @deprecated Use {@link android.provider.Settings.Global#BLUETOOTH_ON} instead 6438 */ 6439 @Deprecated 6440 public static final String BLUETOOTH_ON = Global.BLUETOOTH_ON; 6441 6442 /** 6443 * @deprecated Use {@link android.provider.Settings.Global#DATA_ROAMING} instead 6444 */ 6445 @Deprecated 6446 public static final String DATA_ROAMING = Global.DATA_ROAMING; 6447 6448 /** 6449 * Setting to record the input method used by default, holding the ID 6450 * of the desired method. 6451 */ 6452 @Readable 6453 public static final String DEFAULT_INPUT_METHOD = "default_input_method"; 6454 6455 /** 6456 * Setting to record the input method subtype used by default, holding the ID 6457 * of the desired method. 6458 */ 6459 @Readable 6460 public static final String SELECTED_INPUT_METHOD_SUBTYPE = 6461 "selected_input_method_subtype"; 6462 6463 /** 6464 * The {@link android.view.inputmethod.InputMethodInfo.InputMethodInfo#getId() ID} of the 6465 * default voice input method. 6466 * <p> 6467 * This stores the last known default voice IME. If the related system config value changes, 6468 * this is reset by InputMethodManagerService. 6469 * <p> 6470 * This IME is not necessarily in the enabled IME list. That state is still stored in 6471 * {@link #ENABLED_INPUT_METHODS}. 6472 * 6473 * @hide 6474 */ 6475 public static final String DEFAULT_VOICE_INPUT_METHOD = "default_voice_input_method"; 6476 6477 /** 6478 * Setting to record the history of input method subtype, holding the pair of ID of IME 6479 * and its last used subtype. 6480 * @hide 6481 */ 6482 @Readable 6483 public static final String INPUT_METHODS_SUBTYPE_HISTORY = 6484 "input_methods_subtype_history"; 6485 6486 /** 6487 * Setting to record the visibility of input method selector 6488 */ 6489 @Readable 6490 public static final String INPUT_METHOD_SELECTOR_VISIBILITY = 6491 "input_method_selector_visibility"; 6492 6493 /** 6494 * The currently selected voice interaction service flattened ComponentName. 6495 * @hide 6496 */ 6497 @TestApi 6498 @Readable 6499 public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; 6500 6501 /** 6502 * The currently selected autofill service flattened ComponentName. 6503 * @hide 6504 */ 6505 @TestApi 6506 @Readable 6507 public static final String AUTOFILL_SERVICE = "autofill_service"; 6508 6509 /** 6510 * Boolean indicating if Autofill supports field classification. 6511 * 6512 * @see android.service.autofill.AutofillService 6513 * 6514 * @hide 6515 */ 6516 @SystemApi 6517 @Readable 6518 public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = 6519 "autofill_field_classification"; 6520 6521 /** 6522 * Boolean indicating if the dark mode dialog shown on first toggle has been seen. 6523 * 6524 * @hide 6525 */ 6526 @Readable 6527 public static final String DARK_MODE_DIALOG_SEEN = 6528 "dark_mode_dialog_seen"; 6529 6530 /** 6531 * Custom time when Dark theme is scheduled to activate. 6532 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6533 * @hide 6534 */ 6535 @Readable 6536 public static final String DARK_THEME_CUSTOM_START_TIME = 6537 "dark_theme_custom_start_time"; 6538 6539 /** 6540 * Custom time when Dark theme is scheduled to deactivate. 6541 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 6542 * @hide 6543 */ 6544 @Readable 6545 public static final String DARK_THEME_CUSTOM_END_TIME = 6546 "dark_theme_custom_end_time"; 6547 6548 /** 6549 * Defines value returned by {@link android.service.autofill.UserData#getMaxUserDataSize()}. 6550 * 6551 * @hide 6552 */ 6553 @SystemApi 6554 @Readable 6555 public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = 6556 "autofill_user_data_max_user_data_size"; 6557 6558 /** 6559 * Defines value returned by 6560 * {@link android.service.autofill.UserData#getMaxFieldClassificationIdsSize()}. 6561 * 6562 * @hide 6563 */ 6564 @SystemApi 6565 @Readable 6566 public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = 6567 "autofill_user_data_max_field_classification_size"; 6568 6569 /** 6570 * Defines value returned by 6571 * {@link android.service.autofill.UserData#getMaxCategoryCount()}. 6572 * 6573 * @hide 6574 */ 6575 @SystemApi 6576 @Readable 6577 public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = 6578 "autofill_user_data_max_category_count"; 6579 6580 /** 6581 * Defines value returned by {@link android.service.autofill.UserData#getMaxValueLength()}. 6582 * 6583 * @hide 6584 */ 6585 @SystemApi 6586 @Readable 6587 public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = 6588 "autofill_user_data_max_value_length"; 6589 6590 /** 6591 * Defines value returned by {@link android.service.autofill.UserData#getMinValueLength()}. 6592 * 6593 * @hide 6594 */ 6595 @SystemApi 6596 @Readable 6597 public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = 6598 "autofill_user_data_min_value_length"; 6599 6600 /** 6601 * Defines whether Content Capture is enabled for the user. 6602 * 6603 * <p>Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled). 6604 * <p>Default: enabled 6605 * 6606 * @hide 6607 */ 6608 @TestApi 6609 @Readable 6610 public static final String CONTENT_CAPTURE_ENABLED = "content_capture_enabled"; 6611 6612 /** 6613 * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead 6614 */ 6615 @Deprecated 6616 public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED; 6617 6618 /** 6619 * Indicates whether a DPC has been downloaded during provisioning. 6620 * 6621 * <p>Type: int (0 for false, 1 for true) 6622 * 6623 * <p>If this is true, then any attempts to begin setup again should result in factory reset 6624 * 6625 * @hide 6626 */ 6627 @Readable 6628 public static final String MANAGED_PROVISIONING_DPC_DOWNLOADED = 6629 "managed_provisioning_dpc_downloaded"; 6630 6631 /** 6632 * Indicates whether the device is under restricted secure FRP mode. 6633 * Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge, 6634 * device is removed from this mode. 6635 * <p> 6636 * Type: int (0 for false, 1 for true) 6637 */ 6638 @Readable 6639 public static final String SECURE_FRP_MODE = "secure_frp_mode"; 6640 6641 /** 6642 * Indicates whether the current user has completed setup via the setup wizard. 6643 * <p> 6644 * Type: int (0 for false, 1 for true) 6645 * 6646 * @hide 6647 */ 6648 @SystemApi 6649 @Readable 6650 public static final String USER_SETUP_COMPLETE = "user_setup_complete"; 6651 6652 /** 6653 * Indicates that the user has not started setup personalization. 6654 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6655 * 6656 * @hide 6657 */ 6658 @SystemApi 6659 public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; 6660 6661 /** 6662 * Indicates that the user has not yet completed setup personalization. 6663 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6664 * 6665 * @hide 6666 */ 6667 @SystemApi 6668 public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; 6669 6670 /** 6671 * Indicates that the user has snoozed personalization and will complete it later. 6672 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6673 * 6674 * @hide 6675 */ 6676 @SystemApi 6677 public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; 6678 6679 /** 6680 * Indicates that the user has completed setup personalization. 6681 * One of the possible states for {@link #USER_SETUP_PERSONALIZATION_STATE}. 6682 * 6683 * @hide 6684 */ 6685 @SystemApi 6686 public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; 6687 6688 /** @hide */ 6689 @Retention(RetentionPolicy.SOURCE) 6690 @IntDef({ 6691 USER_SETUP_PERSONALIZATION_NOT_STARTED, 6692 USER_SETUP_PERSONALIZATION_STARTED, 6693 USER_SETUP_PERSONALIZATION_PAUSED, 6694 USER_SETUP_PERSONALIZATION_COMPLETE 6695 }) 6696 public @interface UserSetupPersonalization {} 6697 6698 /** 6699 * Defines the user's current state of device personalization. 6700 * The possible states are defined in {@link UserSetupPersonalization}. 6701 * 6702 * @hide 6703 */ 6704 @SystemApi 6705 @Readable 6706 public static final String USER_SETUP_PERSONALIZATION_STATE = 6707 "user_setup_personalization_state"; 6708 6709 /** 6710 * Whether the current user has been set up via setup wizard (0 = false, 1 = true) 6711 * This value differs from USER_SETUP_COMPLETE in that it can be reset back to 0 6712 * in case SetupWizard has been re-enabled on TV devices. 6713 * 6714 * @hide 6715 */ 6716 @Readable 6717 public static final String TV_USER_SETUP_COMPLETE = "tv_user_setup_complete"; 6718 6719 /** 6720 * The prefix for a category name that indicates whether a suggested action from that 6721 * category was marked as completed. 6722 * <p> 6723 * Type: int (0 for false, 1 for true) 6724 * 6725 * @hide 6726 */ 6727 @SystemApi 6728 @Readable 6729 public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category."; 6730 6731 /** 6732 * Whether or not compress blocks should be released on install. 6733 * <p>The setting only determines if the platform will attempt to release 6734 * compress blocks; it does not guarantee that the files will have their 6735 * compress blocks released. Compression is currently only supported on 6736 * some f2fs filesystems. 6737 * <p> 6738 * Type: int (0 for false, 1 for true) 6739 * 6740 * @hide 6741 */ 6742 public static final String RELEASE_COMPRESS_BLOCKS_ON_INSTALL = 6743 "release_compress_blocks_on_install"; 6744 6745 /** 6746 * List of input methods that are currently enabled. This is a string 6747 * containing the IDs of all enabled input methods, each ID separated 6748 * by ':'. 6749 * 6750 * Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" 6751 * where imeId is ComponentName and subtype is int32. 6752 */ 6753 @Readable 6754 public static final String ENABLED_INPUT_METHODS = "enabled_input_methods"; 6755 6756 /** 6757 * List of system input methods that are currently disabled. This is a string 6758 * containing the IDs of all disabled input methods, each ID separated 6759 * by ':'. 6760 * @hide 6761 */ 6762 @Readable 6763 public static final String DISABLED_SYSTEM_INPUT_METHODS = "disabled_system_input_methods"; 6764 6765 /** 6766 * Whether to show the IME when a hard keyboard is connected. This is a boolean that 6767 * determines if the IME should be shown when a hard keyboard is attached. 6768 * @hide 6769 */ 6770 @TestApi 6771 @Readable 6772 @SuppressLint("NoSettingsProvider") 6773 public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; 6774 6775 /** 6776 * Host name and port for global http proxy. Uses ':' seperator for 6777 * between host and port. 6778 * 6779 * @deprecated Use {@link Global#HTTP_PROXY} 6780 */ 6781 @Deprecated 6782 public static final String HTTP_PROXY = Global.HTTP_PROXY; 6783 6784 /** 6785 * Package designated as always-on VPN provider. 6786 * 6787 * @hide 6788 */ 6789 public static final String ALWAYS_ON_VPN_APP = "always_on_vpn_app"; 6790 6791 /** 6792 * Whether to block networking outside of VPN connections while always-on is set. 6793 * @see #ALWAYS_ON_VPN_APP 6794 * 6795 * @hide 6796 */ 6797 @Readable 6798 public static final String ALWAYS_ON_VPN_LOCKDOWN = "always_on_vpn_lockdown"; 6799 6800 /** 6801 * Comma separated list of packages that are allowed to access the network when VPN is in 6802 * lockdown mode but not running. 6803 * @see #ALWAYS_ON_VPN_LOCKDOWN 6804 * 6805 * @hide 6806 */ 6807 @Readable 6808 public static final String ALWAYS_ON_VPN_LOCKDOWN_WHITELIST = 6809 "always_on_vpn_lockdown_whitelist"; 6810 6811 /** 6812 * Whether applications can be installed for this user via the system's 6813 * {@link Intent#ACTION_INSTALL_PACKAGE} mechanism. 6814 * 6815 * <p>1 = permit app installation via the system package installer intent 6816 * <p>0 = do not allow use of the package installer 6817 * @deprecated Starting from {@link android.os.Build.VERSION_CODES#O}, apps should use 6818 * {@link PackageManager#canRequestPackageInstalls()} 6819 * @see PackageManager#canRequestPackageInstalls() 6820 */ 6821 @Deprecated 6822 @Readable 6823 public static final String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; 6824 6825 /** 6826 * A flag to tell {@link com.android.server.devicepolicy.DevicePolicyManagerService} that 6827 * the default for {@link #INSTALL_NON_MARKET_APPS} is reversed for this user on OTA. So it 6828 * can set the restriction {@link android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES} 6829 * on behalf of the profile owner if needed to make the change transparent for profile 6830 * owners. 6831 * 6832 * @hide 6833 */ 6834 @Readable 6835 public static final String UNKNOWN_SOURCES_DEFAULT_REVERSED = 6836 "unknown_sources_default_reversed"; 6837 6838 /** 6839 * Comma-separated list of location providers that are enabled. Do not rely on this value 6840 * being present or correct, or on ContentObserver notifications on the corresponding Uri. 6841 * 6842 * @deprecated This setting no longer exists from Android S onwards as it no longer is 6843 * capable of realistically reflecting location settings. Use {@link 6844 * LocationManager#isProviderEnabled(String)} or {@link LocationManager#isLocationEnabled()} 6845 * instead. 6846 */ 6847 @Deprecated 6848 @Readable 6849 public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; 6850 6851 /** 6852 * The current location mode of the device. Do not rely on this value being present or on 6853 * ContentObserver notifications on the corresponding Uri. 6854 * 6855 * @deprecated The preferred methods for checking location mode and listening for changes 6856 * are via {@link LocationManager#isLocationEnabled()} and 6857 * {@link LocationManager#MODE_CHANGED_ACTION}. 6858 */ 6859 @Deprecated 6860 @Readable 6861 public static final String LOCATION_MODE = "location_mode"; 6862 6863 /** 6864 * The App or module that changes the location mode. 6865 * @hide 6866 */ 6867 @Readable 6868 public static final String LOCATION_CHANGER = "location_changer"; 6869 6870 /** 6871 * The location changer is unknown or unable to detect. 6872 * @hide 6873 */ 6874 public static final int LOCATION_CHANGER_UNKNOWN = 0; 6875 6876 /** 6877 * Location settings in system settings. 6878 * @hide 6879 */ 6880 public static final int LOCATION_CHANGER_SYSTEM_SETTINGS = 1; 6881 6882 /** 6883 * The location icon in drop down notification drawer. 6884 * @hide 6885 */ 6886 public static final int LOCATION_CHANGER_QUICK_SETTINGS = 2; 6887 6888 /** 6889 * Location mode is off. 6890 */ 6891 public static final int LOCATION_MODE_OFF = 0; 6892 6893 /** 6894 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6895 * on. 6896 * 6897 * @deprecated See {@link #LOCATION_MODE}. 6898 */ 6899 @Deprecated 6900 public static final int LOCATION_MODE_SENSORS_ONLY = 1; 6901 6902 /** 6903 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6904 * on. 6905 * 6906 * @deprecated See {@link #LOCATION_MODE}. 6907 */ 6908 @Deprecated 6909 public static final int LOCATION_MODE_BATTERY_SAVING = 2; 6910 6911 /** 6912 * This mode no longer has any distinct meaning, but is interpreted as the location mode is 6913 * on. 6914 * 6915 * @deprecated See {@link #LOCATION_MODE}. 6916 */ 6917 @Deprecated 6918 public static final int LOCATION_MODE_HIGH_ACCURACY = 3; 6919 6920 /** 6921 * Location mode is on. 6922 * 6923 * @hide 6924 */ 6925 @SystemApi 6926 public static final int LOCATION_MODE_ON = LOCATION_MODE_HIGH_ACCURACY; 6927 6928 /** 6929 * The current location time zone detection enabled state for the user. 6930 * 6931 * See {@link android.app.time.TimeManager#getTimeZoneCapabilitiesAndConfig} for access. 6932 * See {@link android.app.time.TimeManager#updateTimeZoneConfiguration} to update. 6933 * @hide 6934 */ 6935 public static final String LOCATION_TIME_ZONE_DETECTION_ENABLED = 6936 "location_time_zone_detection_enabled"; 6937 6938 /** 6939 * The accuracy in meters used for coarsening location for clients with only the coarse 6940 * location permission. 6941 * 6942 * @hide 6943 */ 6944 @Readable 6945 public static final String LOCATION_COARSE_ACCURACY_M = "locationCoarseAccuracy"; 6946 6947 /** 6948 * A flag containing settings used for biometric weak 6949 * @hide 6950 */ 6951 @Deprecated 6952 @Readable 6953 public static final String LOCK_BIOMETRIC_WEAK_FLAGS = 6954 "lock_biometric_weak_flags"; 6955 6956 /** 6957 * Whether lock-to-app will lock the keyguard when exiting. 6958 * @hide 6959 */ 6960 @Readable 6961 public static final String LOCK_TO_APP_EXIT_LOCKED = "lock_to_app_exit_locked"; 6962 6963 /** 6964 * Whether autolock is enabled (0 = false, 1 = true) 6965 * 6966 * @deprecated Use {@link android.app.KeyguardManager} to determine the state and security 6967 * level of the keyguard. Accessing this setting from an app that is targeting 6968 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6969 */ 6970 @Deprecated 6971 @Readable 6972 public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; 6973 6974 /** 6975 * Whether lock pattern is visible as user enters (0 = false, 1 = true) 6976 * 6977 * @deprecated Accessing this setting from an app that is targeting 6978 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6979 */ 6980 @Deprecated 6981 @Readable 6982 public static final String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern"; 6983 6984 /** 6985 * Whether lock pattern will vibrate as user enters (0 = false, 1 = 6986 * true) 6987 * 6988 * @deprecated Starting in {@link VERSION_CODES#JELLY_BEAN_MR1} the 6989 * lockscreen uses 6990 * {@link Settings.System#HAPTIC_FEEDBACK_ENABLED}. 6991 * Accessing this setting from an app that is targeting 6992 * {@link VERSION_CODES#M} or later throws a {@code SecurityException}. 6993 */ 6994 @Deprecated 6995 @Readable 6996 public static final String 6997 LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled"; 6998 6999 /** 7000 * This preference allows the device to be locked given time after screen goes off, 7001 * subject to current DeviceAdmin policy limits. 7002 * @hide 7003 */ 7004 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7005 @Readable 7006 public static final String LOCK_SCREEN_LOCK_AFTER_TIMEOUT = "lock_screen_lock_after_timeout"; 7007 7008 7009 /** 7010 * This preference contains the string that shows for owner info on LockScreen. 7011 * @hide 7012 * @deprecated 7013 */ 7014 @Deprecated 7015 @Readable 7016 public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info"; 7017 7018 /** 7019 * Ids of the user-selected appwidgets on the lockscreen (comma-delimited). 7020 * @hide 7021 */ 7022 @Deprecated 7023 @Readable 7024 public static final String LOCK_SCREEN_APPWIDGET_IDS = 7025 "lock_screen_appwidget_ids"; 7026 7027 /** 7028 * Id of the appwidget shown on the lock screen when appwidgets are disabled. 7029 * @hide 7030 */ 7031 @Deprecated 7032 @Readable 7033 public static final String LOCK_SCREEN_FALLBACK_APPWIDGET_ID = 7034 "lock_screen_fallback_appwidget_id"; 7035 7036 /** 7037 * Index of the lockscreen appwidget to restore, -1 if none. 7038 * @hide 7039 */ 7040 @Deprecated 7041 @Readable 7042 public static final String LOCK_SCREEN_STICKY_APPWIDGET = 7043 "lock_screen_sticky_appwidget"; 7044 7045 /** 7046 * This preference enables showing the owner info on LockScreen. 7047 * @hide 7048 * @deprecated 7049 */ 7050 @Deprecated 7051 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7052 @Readable 7053 public static final String LOCK_SCREEN_OWNER_INFO_ENABLED = 7054 "lock_screen_owner_info_enabled"; 7055 7056 /** 7057 * Indicates whether the user has allowed notifications to be shown atop a securely locked 7058 * screen in their full "private" form (same as when the device is unlocked). 7059 * <p> 7060 * Type: int (0 for false, 1 for true) 7061 * 7062 * @hide 7063 */ 7064 @SystemApi 7065 @Readable 7066 public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = 7067 "lock_screen_allow_private_notifications"; 7068 7069 /** 7070 * When set by a user, allows notification remote input atop a securely locked screen 7071 * without having to unlock 7072 * @hide 7073 */ 7074 @Readable 7075 public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = 7076 "lock_screen_allow_remote_input"; 7077 7078 /** 7079 * Indicates which clock face to show on lock screen and AOD formatted as a serialized 7080 * {@link org.json.JSONObject} with the format: 7081 * {"clock": id, "_applied_timestamp": timestamp} 7082 * @hide 7083 */ 7084 @Readable 7085 public static final String LOCK_SCREEN_CUSTOM_CLOCK_FACE = "lock_screen_custom_clock_face"; 7086 7087 /** 7088 * Indicates which clock face to show on lock screen and AOD while docked. 7089 * @hide 7090 */ 7091 @Readable 7092 public static final String DOCKED_CLOCK_FACE = "docked_clock_face"; 7093 7094 /** 7095 * Set by the system to track if the user needs to see the call to action for 7096 * the lockscreen notification policy. 7097 * @hide 7098 */ 7099 @Readable 7100 public static final String SHOW_NOTE_ABOUT_NOTIFICATION_HIDING = 7101 "show_note_about_notification_hiding"; 7102 7103 /** 7104 * Set to 1 by the system after trust agents have been initialized. 7105 * @hide 7106 */ 7107 @Readable 7108 public static final String TRUST_AGENTS_INITIALIZED = 7109 "trust_agents_initialized"; 7110 7111 /** 7112 * The Logging ID (a unique 64-bit value) as a hex string. 7113 * Used as a pseudonymous identifier for logging. 7114 * @deprecated This identifier is poorly initialized and has 7115 * many collisions. It should not be used. 7116 */ 7117 @Deprecated 7118 @Readable 7119 public static final String LOGGING_ID = "logging_id"; 7120 7121 /** 7122 * @deprecated Use {@link android.provider.Settings.Global#NETWORK_PREFERENCE} instead 7123 */ 7124 @Deprecated 7125 public static final String NETWORK_PREFERENCE = Global.NETWORK_PREFERENCE; 7126 7127 /** 7128 * No longer supported. 7129 */ 7130 @Readable 7131 public static final String PARENTAL_CONTROL_ENABLED = "parental_control_enabled"; 7132 7133 /** 7134 * No longer supported. 7135 */ 7136 @Readable 7137 public static final String PARENTAL_CONTROL_LAST_UPDATE = "parental_control_last_update"; 7138 7139 /** 7140 * No longer supported. 7141 */ 7142 @Readable 7143 public static final String PARENTAL_CONTROL_REDIRECT_URL = "parental_control_redirect_url"; 7144 7145 /** 7146 * Settings classname to launch when Settings is clicked from All 7147 * Applications. Needed because of user testing between the old 7148 * and new Settings apps. 7149 */ 7150 // TODO: 881807 7151 @Readable 7152 public static final String SETTINGS_CLASSNAME = "settings_classname"; 7153 7154 /** 7155 * @deprecated Use {@link android.provider.Settings.Global#USB_MASS_STORAGE_ENABLED} instead 7156 */ 7157 @Deprecated 7158 public static final String USB_MASS_STORAGE_ENABLED = Global.USB_MASS_STORAGE_ENABLED; 7159 7160 /** 7161 * @deprecated Use {@link android.provider.Settings.Global#USE_GOOGLE_MAIL} instead 7162 */ 7163 @Deprecated 7164 public static final String USE_GOOGLE_MAIL = Global.USE_GOOGLE_MAIL; 7165 7166 /** 7167 * If accessibility is enabled. 7168 */ 7169 @Readable 7170 public static final String ACCESSIBILITY_ENABLED = "accessibility_enabled"; 7171 7172 /** 7173 * Setting specifying if the accessibility shortcut is enabled. 7174 * @hide 7175 */ 7176 @Readable 7177 public static final String ACCESSIBILITY_SHORTCUT_ON_LOCK_SCREEN = 7178 "accessibility_shortcut_on_lock_screen"; 7179 7180 /** 7181 * Setting specifying if the accessibility shortcut dialog has been shown to this user. 7182 * @hide 7183 */ 7184 @Readable 7185 public static final String ACCESSIBILITY_SHORTCUT_DIALOG_SHOWN = 7186 "accessibility_shortcut_dialog_shown"; 7187 7188 /** 7189 * Setting specifying the accessibility services, accessibility shortcut targets, 7190 * or features to be toggled via the accessibility shortcut. 7191 * 7192 * <p> This is a colon-separated string list which contains the flattened 7193 * {@link ComponentName} and the class name of a system class implementing a supported 7194 * accessibility feature. 7195 * @hide 7196 */ 7197 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7198 @TestApi 7199 @Readable 7200 public static final String ACCESSIBILITY_SHORTCUT_TARGET_SERVICE = 7201 "accessibility_shortcut_target_service"; 7202 7203 /** 7204 * Setting specifying the accessibility service or feature to be toggled via the 7205 * accessibility button in the navigation bar. This is either a flattened 7206 * {@link ComponentName} or the class name of a system class implementing a supported 7207 * accessibility feature. 7208 * @hide 7209 */ 7210 @Readable 7211 public static final String ACCESSIBILITY_BUTTON_TARGET_COMPONENT = 7212 "accessibility_button_target_component"; 7213 7214 /** 7215 * Setting specifying the accessibility services, accessibility shortcut targets, 7216 * or features to be toggled via the accessibility button in the navigation bar. 7217 * 7218 * <p> This is a colon-separated string list which contains the flattened 7219 * {@link ComponentName} and the class name of a system class implementing a supported 7220 * accessibility feature. 7221 * @hide 7222 */ 7223 @Readable 7224 public static final String ACCESSIBILITY_BUTTON_TARGETS = "accessibility_button_targets"; 7225 7226 /** 7227 * The system class name of magnification controller which is a target to be toggled via 7228 * accessibility shortcut or accessibility button. 7229 * 7230 * @hide 7231 */ 7232 @Readable 7233 public static final String ACCESSIBILITY_SHORTCUT_TARGET_MAGNIFICATION_CONTROLLER = 7234 "com.android.server.accessibility.MagnificationController"; 7235 7236 /** 7237 * If touch exploration is enabled. 7238 */ 7239 @Readable 7240 public static final String TOUCH_EXPLORATION_ENABLED = "touch_exploration_enabled"; 7241 7242 /** 7243 * List of the enabled accessibility providers. 7244 */ 7245 @Readable 7246 public static final String ENABLED_ACCESSIBILITY_SERVICES = 7247 "enabled_accessibility_services"; 7248 7249 /** 7250 * List of the notified non-accessibility category accessibility services. 7251 * 7252 * @hide 7253 */ 7254 @Readable 7255 public static final String NOTIFIED_NON_ACCESSIBILITY_CATEGORY_SERVICES = 7256 "notified_non_accessibility_category_services"; 7257 7258 /** 7259 * List of the accessibility services to which the user has granted 7260 * permission to put the device into touch exploration mode. 7261 * 7262 * @hide 7263 */ 7264 @Readable 7265 public static final String TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES = 7266 "touch_exploration_granted_accessibility_services"; 7267 7268 /** 7269 * Whether the Global Actions Panel is enabled. 7270 * @hide 7271 */ 7272 @Readable 7273 public static final String GLOBAL_ACTIONS_PANEL_ENABLED = "global_actions_panel_enabled"; 7274 7275 /** 7276 * Whether the Global Actions Panel can be toggled on or off in Settings. 7277 * @hide 7278 */ 7279 @Readable 7280 public static final String GLOBAL_ACTIONS_PANEL_AVAILABLE = 7281 "global_actions_panel_available"; 7282 7283 /** 7284 * Enables debug mode for the Global Actions Panel. 7285 * @hide 7286 */ 7287 @Readable 7288 public static final String GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED = 7289 "global_actions_panel_debug_enabled"; 7290 7291 /** 7292 * Whether the hush gesture has ever been used 7293 * @hide 7294 */ 7295 @SystemApi 7296 @Readable 7297 public static final String HUSH_GESTURE_USED = "hush_gesture_used"; 7298 7299 /** 7300 * Number of times the user has manually clicked the ringer toggle 7301 * @hide 7302 */ 7303 @Readable 7304 public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count"; 7305 7306 /** 7307 * Whether to play a sound for charging events. 7308 * @hide 7309 */ 7310 @Readable 7311 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 7312 7313 /** 7314 * Whether to vibrate for charging events. 7315 * @hide 7316 */ 7317 @Readable 7318 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 7319 7320 /** 7321 * If 0, turning on dnd manually will last indefinitely. 7322 * Else if non-negative, turning on dnd manually will last for this many minutes. 7323 * Else (if negative), turning on dnd manually will surface a dialog that prompts 7324 * user to specify a duration. 7325 * @hide 7326 */ 7327 @Readable 7328 public static final String ZEN_DURATION = "zen_duration"; 7329 7330 /** @hide */ public static final int ZEN_DURATION_PROMPT = -1; 7331 /** @hide */ public static final int ZEN_DURATION_FOREVER = 0; 7332 7333 /** 7334 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 7335 * @hide 7336 */ 7337 @Readable 7338 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 7339 7340 /** 7341 * If nonzero, will show the zen update settings suggestion. 7342 * @hide 7343 */ 7344 @Readable 7345 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 7346 7347 /** 7348 * If nonzero, zen has not been updated to reflect new changes. 7349 * @hide 7350 */ 7351 @Readable 7352 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 7353 7354 /** 7355 * If nonzero, zen setting suggestion has been viewed by user 7356 * @hide 7357 */ 7358 @Readable 7359 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 7360 "zen_settings_suggestion_viewed"; 7361 7362 /** 7363 * Whether the in call notification is enabled to play sound during calls. The value is 7364 * boolean (1 or 0). 7365 * @hide 7366 */ 7367 @Readable 7368 public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled"; 7369 7370 /** 7371 * Uri of the slice that's presented on the keyguard. 7372 * Defaults to a slice with the date and next alarm. 7373 * 7374 * @hide 7375 */ 7376 @Readable 7377 public static final String KEYGUARD_SLICE_URI = "keyguard_slice_uri"; 7378 7379 /** 7380 * The adjustment in font weight. This is used to draw text in bold. 7381 * 7382 * <p> This value can be negative. To display bolded text, the adjustment used is 300, 7383 * which is the difference between 7384 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_NORMAL} and 7385 * {@link android.graphics.fonts.FontStyle#FONT_WEIGHT_BOLD}. 7386 * 7387 * @hide 7388 */ 7389 @Readable 7390 public static final String FONT_WEIGHT_ADJUSTMENT = "font_weight_adjustment"; 7391 7392 /** 7393 * Whether to speak passwords while in accessibility mode. 7394 * 7395 * @deprecated The speaking of passwords is controlled by individual accessibility services. 7396 * Apps should ignore this setting and provide complete information to accessibility 7397 * at all times, which was the behavior when this value was {@code true}. 7398 */ 7399 @Deprecated 7400 @Readable 7401 public static final String ACCESSIBILITY_SPEAK_PASSWORD = "speak_password"; 7402 7403 /** 7404 * Whether to draw text with high contrast while in accessibility mode. 7405 * 7406 * @hide 7407 */ 7408 @Readable 7409 public static final String ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 7410 "high_text_contrast_enabled"; 7411 7412 /** 7413 * Setting that specifies whether the display magnification is enabled via a system-wide 7414 * triple tap gesture. Display magnifications allows the user to zoom in the display content 7415 * and is targeted to low vision users. The current magnification scale is controlled by 7416 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 7417 * 7418 * @hide 7419 */ 7420 @UnsupportedAppUsage 7421 @TestApi 7422 @Readable 7423 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED = 7424 "accessibility_display_magnification_enabled"; 7425 7426 /** 7427 * Setting that specifies whether the display magnification is enabled via a shortcut 7428 * affordance within the system's navigation area. Display magnifications allows the user to 7429 * zoom in the display content and is targeted to low vision users. The current 7430 * magnification scale is controlled by {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE}. 7431 * 7432 * @deprecated Use {@link #ACCESSIBILITY_BUTTON_TARGETS} instead. 7433 * {@link #ACCESSIBILITY_BUTTON_TARGETS} holds the magnification system class name 7434 * when navigation bar magnification is enabled. 7435 * @hide 7436 */ 7437 @SystemApi 7438 @Readable 7439 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = 7440 "accessibility_display_magnification_navbar_enabled"; 7441 7442 /** 7443 * Setting that specifies what the display magnification scale is. 7444 * Display magnifications allows the user to zoom in the display 7445 * content and is targeted to low vision users. Whether a display 7446 * magnification is performed is controlled by 7447 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED} and 7448 * {@link #ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED} 7449 * 7450 * @hide 7451 */ 7452 @Readable 7453 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE = 7454 "accessibility_display_magnification_scale"; 7455 7456 /** 7457 * Unused mangnification setting 7458 * 7459 * @hide 7460 * @deprecated 7461 */ 7462 @Deprecated 7463 @Readable 7464 public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE = 7465 "accessibility_display_magnification_auto_update"; 7466 7467 /** 7468 * Setting that specifies what mode the soft keyboard is in (default or hidden). Can be 7469 * modified from an AccessibilityService using the SoftKeyboardController. 7470 * 7471 * @hide 7472 */ 7473 @Readable 7474 public static final String ACCESSIBILITY_SOFT_KEYBOARD_MODE = 7475 "accessibility_soft_keyboard_mode"; 7476 7477 /** 7478 * Default soft keyboard behavior. 7479 * 7480 * @hide 7481 */ 7482 public static final int SHOW_MODE_AUTO = 0; 7483 7484 /** 7485 * Soft keyboard is never shown. 7486 * 7487 * @hide 7488 */ 7489 public static final int SHOW_MODE_HIDDEN = 1; 7490 7491 /** 7492 * Setting that specifies whether timed text (captions) should be 7493 * displayed in video content. Text display properties are controlled by 7494 * the following settings: 7495 * <ul> 7496 * <li>{@link #ACCESSIBILITY_CAPTIONING_LOCALE} 7497 * <li>{@link #ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR} 7498 * <li>{@link #ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR} 7499 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_COLOR} 7500 * <li>{@link #ACCESSIBILITY_CAPTIONING_EDGE_TYPE} 7501 * <li>{@link #ACCESSIBILITY_CAPTIONING_TYPEFACE} 7502 * <li>{@link #ACCESSIBILITY_CAPTIONING_FONT_SCALE} 7503 * </ul> 7504 * 7505 * @hide 7506 */ 7507 @Readable 7508 public static final String ACCESSIBILITY_CAPTIONING_ENABLED = 7509 "accessibility_captioning_enabled"; 7510 7511 /** 7512 * Setting that specifies the language for captions as a locale string, 7513 * e.g. en_US. 7514 * 7515 * @see java.util.Locale#toString 7516 * @hide 7517 */ 7518 @Readable 7519 public static final String ACCESSIBILITY_CAPTIONING_LOCALE = 7520 "accessibility_captioning_locale"; 7521 7522 /** 7523 * Integer property that specifies the preset style for captions, one 7524 * of: 7525 * <ul> 7526 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESET_CUSTOM} 7527 * <li>a valid index of {@link android.view.accessibility.CaptioningManager.CaptionStyle#PRESETS} 7528 * </ul> 7529 * 7530 * @see java.util.Locale#toString 7531 * @hide 7532 */ 7533 @Readable 7534 public static final String ACCESSIBILITY_CAPTIONING_PRESET = 7535 "accessibility_captioning_preset"; 7536 7537 /** 7538 * Integer property that specifes the background color for captions as a 7539 * packed 32-bit color. 7540 * 7541 * @see android.graphics.Color#argb 7542 * @hide 7543 */ 7544 @Readable 7545 public static final String ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR = 7546 "accessibility_captioning_background_color"; 7547 7548 /** 7549 * Integer property that specifes the foreground color for captions as a 7550 * packed 32-bit color. 7551 * 7552 * @see android.graphics.Color#argb 7553 * @hide 7554 */ 7555 @Readable 7556 public static final String ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR = 7557 "accessibility_captioning_foreground_color"; 7558 7559 /** 7560 * Integer property that specifes the edge type for captions, one of: 7561 * <ul> 7562 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_NONE} 7563 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE} 7564 * <li>{@link android.view.accessibility.CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW} 7565 * </ul> 7566 * 7567 * @see #ACCESSIBILITY_CAPTIONING_EDGE_COLOR 7568 * @hide 7569 */ 7570 @Readable 7571 public static final String ACCESSIBILITY_CAPTIONING_EDGE_TYPE = 7572 "accessibility_captioning_edge_type"; 7573 7574 /** 7575 * Integer property that specifes the edge color for captions as a 7576 * packed 32-bit color. 7577 * 7578 * @see #ACCESSIBILITY_CAPTIONING_EDGE_TYPE 7579 * @see android.graphics.Color#argb 7580 * @hide 7581 */ 7582 @Readable 7583 public static final String ACCESSIBILITY_CAPTIONING_EDGE_COLOR = 7584 "accessibility_captioning_edge_color"; 7585 7586 /** 7587 * Integer property that specifes the window color for captions as a 7588 * packed 32-bit color. 7589 * 7590 * @see android.graphics.Color#argb 7591 * @hide 7592 */ 7593 @Readable 7594 public static final String ACCESSIBILITY_CAPTIONING_WINDOW_COLOR = 7595 "accessibility_captioning_window_color"; 7596 7597 /** 7598 * String property that specifies the typeface for captions, one of: 7599 * <ul> 7600 * <li>DEFAULT 7601 * <li>MONOSPACE 7602 * <li>SANS_SERIF 7603 * <li>SERIF 7604 * </ul> 7605 * 7606 * @see android.graphics.Typeface 7607 * @hide 7608 */ 7609 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7610 @Readable 7611 public static final String ACCESSIBILITY_CAPTIONING_TYPEFACE = 7612 "accessibility_captioning_typeface"; 7613 7614 /** 7615 * Floating point property that specifies font scaling for captions. 7616 * 7617 * @hide 7618 */ 7619 @Readable 7620 public static final String ACCESSIBILITY_CAPTIONING_FONT_SCALE = 7621 "accessibility_captioning_font_scale"; 7622 7623 /** 7624 * Setting that specifies whether display color inversion is enabled. 7625 */ 7626 @Readable 7627 public static final String ACCESSIBILITY_DISPLAY_INVERSION_ENABLED = 7628 "accessibility_display_inversion_enabled"; 7629 7630 /** 7631 * Setting that specifies whether display color space adjustment is 7632 * enabled. 7633 * 7634 * @hide 7635 */ 7636 @UnsupportedAppUsage 7637 @Readable 7638 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED = 7639 "accessibility_display_daltonizer_enabled"; 7640 7641 /** 7642 * Integer property that specifies the type of color space adjustment to 7643 * perform. Valid values are defined in AccessibilityManager and Settings arrays.xml: 7644 * - AccessibilityManager.DALTONIZER_DISABLED = -1 7645 * - AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY = 0 7646 * - <item>@string/daltonizer_mode_protanomaly</item> = 11 7647 * - AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY and 7648 * <item>@string/daltonizer_mode_deuteranomaly</item> = 12 7649 * - <item>@string/daltonizer_mode_tritanomaly</item> = 13 7650 * 7651 * @hide 7652 */ 7653 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 7654 @Readable 7655 public static final String ACCESSIBILITY_DISPLAY_DALTONIZER = 7656 "accessibility_display_daltonizer"; 7657 7658 /** 7659 * Setting that specifies whether automatic click when the mouse pointer stops moving is 7660 * enabled. 7661 * 7662 * @hide 7663 */ 7664 @UnsupportedAppUsage 7665 @Readable 7666 public static final String ACCESSIBILITY_AUTOCLICK_ENABLED = 7667 "accessibility_autoclick_enabled"; 7668 7669 /** 7670 * Integer setting specifying amount of time in ms the mouse pointer has to stay still 7671 * before performing click when {@link #ACCESSIBILITY_AUTOCLICK_ENABLED} is set. 7672 * 7673 * @see #ACCESSIBILITY_AUTOCLICK_ENABLED 7674 * @hide 7675 */ 7676 @Readable 7677 public static final String ACCESSIBILITY_AUTOCLICK_DELAY = 7678 "accessibility_autoclick_delay"; 7679 7680 /** 7681 * Whether or not larger size icons are used for the pointer of mouse/trackpad for 7682 * accessibility. 7683 * (0 = false, 1 = true) 7684 * @hide 7685 */ 7686 @UnsupportedAppUsage 7687 @Readable 7688 public static final String ACCESSIBILITY_LARGE_POINTER_ICON = 7689 "accessibility_large_pointer_icon"; 7690 7691 /** 7692 * The timeout for considering a press to be a long press in milliseconds. 7693 * @hide 7694 */ 7695 @UnsupportedAppUsage 7696 @Readable 7697 public static final String LONG_PRESS_TIMEOUT = "long_press_timeout"; 7698 7699 /** 7700 * The duration in milliseconds between the first tap's up event and the second tap's 7701 * down event for an interaction to be considered part of the same multi-press. 7702 * @hide 7703 */ 7704 @Readable 7705 public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout"; 7706 7707 /** 7708 * Setting that specifies recommended timeout in milliseconds for controls 7709 * which don't need user's interactions. 7710 * 7711 * @hide 7712 */ 7713 @Readable 7714 public static final String ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS = 7715 "accessibility_non_interactive_ui_timeout_ms"; 7716 7717 /** 7718 * Setting that specifies recommended timeout in milliseconds for controls 7719 * which need user's interactions. 7720 * 7721 * @hide 7722 */ 7723 @Readable 7724 public static final String ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS = 7725 "accessibility_interactive_ui_timeout_ms"; 7726 7727 7728 /** 7729 * Setting that specifies whether Reduce Bright Colors, or brightness dimming by color 7730 * adjustment, is enabled. 7731 * 7732 * @hide 7733 */ 7734 public static final String REDUCE_BRIGHT_COLORS_ACTIVATED = 7735 "reduce_bright_colors_activated"; 7736 7737 /** 7738 * Setting that specifies the level of Reduce Bright Colors in intensity. The range is 7739 * [0, 100]. 7740 * 7741 * @hide 7742 */ 7743 public static final String REDUCE_BRIGHT_COLORS_LEVEL = 7744 "reduce_bright_colors_level"; 7745 7746 /** 7747 * Setting that specifies whether Reduce Bright Colors should persist across reboots. 7748 * 7749 * @hide 7750 */ 7751 public static final String REDUCE_BRIGHT_COLORS_PERSIST_ACROSS_REBOOTS = 7752 "reduce_bright_colors_persist_across_reboots"; 7753 7754 /** 7755 * List of the enabled print services. 7756 * 7757 * N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade 7758 * from pre-N. 7759 * 7760 * @hide 7761 */ 7762 @UnsupportedAppUsage 7763 @Readable 7764 public static final String ENABLED_PRINT_SERVICES = 7765 "enabled_print_services"; 7766 7767 /** 7768 * List of the disabled print services. 7769 * 7770 * @hide 7771 */ 7772 @TestApi 7773 @Readable 7774 public static final String DISABLED_PRINT_SERVICES = 7775 "disabled_print_services"; 7776 7777 /** 7778 * The saved value for WindowManagerService.setForcedDisplayDensity() 7779 * formatted as a single integer representing DPI. If unset, then use 7780 * the real display density. 7781 * 7782 * @hide 7783 */ 7784 @Readable 7785 public static final String DISPLAY_DENSITY_FORCED = "display_density_forced"; 7786 7787 /** 7788 * Setting to always use the default text-to-speech settings regardless 7789 * of the application settings. 7790 * 1 = override application settings, 7791 * 0 = use application settings (if specified). 7792 * 7793 * @deprecated The value of this setting is no longer respected by 7794 * the framework text to speech APIs as of the Ice Cream Sandwich release. 7795 */ 7796 @Deprecated 7797 @Readable 7798 public static final String TTS_USE_DEFAULTS = "tts_use_defaults"; 7799 7800 /** 7801 * Default text-to-speech engine speech rate. 100 = 1x 7802 */ 7803 @Readable 7804 public static final String TTS_DEFAULT_RATE = "tts_default_rate"; 7805 7806 /** 7807 * Default text-to-speech engine pitch. 100 = 1x 7808 */ 7809 @Readable 7810 public static final String TTS_DEFAULT_PITCH = "tts_default_pitch"; 7811 7812 /** 7813 * Default text-to-speech engine. 7814 */ 7815 @Readable 7816 public static final String TTS_DEFAULT_SYNTH = "tts_default_synth"; 7817 7818 /** 7819 * Default text-to-speech language. 7820 * 7821 * @deprecated this setting is no longer in use, as of the Ice Cream 7822 * Sandwich release. Apps should never need to read this setting directly, 7823 * instead can query the TextToSpeech framework classes for the default 7824 * locale. {@link TextToSpeech#getLanguage()}. 7825 */ 7826 @Deprecated 7827 @Readable 7828 public static final String TTS_DEFAULT_LANG = "tts_default_lang"; 7829 7830 /** 7831 * Default text-to-speech country. 7832 * 7833 * @deprecated this setting is no longer in use, as of the Ice Cream 7834 * Sandwich release. Apps should never need to read this setting directly, 7835 * instead can query the TextToSpeech framework classes for the default 7836 * locale. {@link TextToSpeech#getLanguage()}. 7837 */ 7838 @Deprecated 7839 @Readable 7840 public static final String TTS_DEFAULT_COUNTRY = "tts_default_country"; 7841 7842 /** 7843 * Default text-to-speech locale variant. 7844 * 7845 * @deprecated this setting is no longer in use, as of the Ice Cream 7846 * Sandwich release. Apps should never need to read this setting directly, 7847 * instead can query the TextToSpeech framework classes for the 7848 * locale that is in use {@link TextToSpeech#getLanguage()}. 7849 */ 7850 @Deprecated 7851 @Readable 7852 public static final String TTS_DEFAULT_VARIANT = "tts_default_variant"; 7853 7854 /** 7855 * Stores the default tts locales on a per engine basis. Stored as 7856 * a comma seperated list of values, each value being of the form 7857 * {@code engine_name:locale} for example, 7858 * {@code com.foo.ttsengine:eng-USA,com.bar.ttsengine:esp-ESP}. This 7859 * supersedes {@link #TTS_DEFAULT_LANG}, {@link #TTS_DEFAULT_COUNTRY} and 7860 * {@link #TTS_DEFAULT_VARIANT}. Apps should never need to read this 7861 * setting directly, and can query the TextToSpeech framework classes 7862 * for the locale that is in use. 7863 * 7864 * @hide 7865 */ 7866 @Readable 7867 public static final String TTS_DEFAULT_LOCALE = "tts_default_locale"; 7868 7869 /** 7870 * Space delimited list of plugin packages that are enabled. 7871 */ 7872 @Readable 7873 public static final String TTS_ENABLED_PLUGINS = "tts_enabled_plugins"; 7874 7875 /** 7876 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON} 7877 * instead. 7878 */ 7879 @Deprecated 7880 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 7881 Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 7882 7883 /** 7884 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} 7885 * instead. 7886 */ 7887 @Deprecated 7888 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 7889 Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY; 7890 7891 /** 7892 * @deprecated Use {@link android.provider.Settings.Global#WIFI_NUM_OPEN_NETWORKS_KEPT} 7893 * instead. 7894 */ 7895 @Deprecated 7896 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = 7897 Global.WIFI_NUM_OPEN_NETWORKS_KEPT; 7898 7899 /** 7900 * @deprecated Use {@link android.provider.Settings.Global#WIFI_ON} 7901 * instead. 7902 */ 7903 @Deprecated 7904 public static final String WIFI_ON = Global.WIFI_ON; 7905 7906 /** 7907 * The acceptable packet loss percentage (range 0 - 100) before trying 7908 * another AP on the same network. 7909 * @deprecated This setting is not used. 7910 */ 7911 @Deprecated 7912 @Readable 7913 public static final String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE = 7914 "wifi_watchdog_acceptable_packet_loss_percentage"; 7915 7916 /** 7917 * The number of access points required for a network in order for the 7918 * watchdog to monitor it. 7919 * @deprecated This setting is not used. 7920 */ 7921 @Deprecated 7922 @Readable 7923 public static final String WIFI_WATCHDOG_AP_COUNT = "wifi_watchdog_ap_count"; 7924 7925 /** 7926 * The delay between background checks. 7927 * @deprecated This setting is not used. 7928 */ 7929 @Deprecated 7930 @Readable 7931 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS = 7932 "wifi_watchdog_background_check_delay_ms"; 7933 7934 /** 7935 * Whether the Wi-Fi watchdog is enabled for background checking even 7936 * after it thinks the user has connected to a good access point. 7937 * @deprecated This setting is not used. 7938 */ 7939 @Deprecated 7940 @Readable 7941 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED = 7942 "wifi_watchdog_background_check_enabled"; 7943 7944 /** 7945 * The timeout for a background ping 7946 * @deprecated This setting is not used. 7947 */ 7948 @Deprecated 7949 @Readable 7950 public static final String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS = 7951 "wifi_watchdog_background_check_timeout_ms"; 7952 7953 /** 7954 * The number of initial pings to perform that *may* be ignored if they 7955 * fail. Again, if these fail, they will *not* be used in packet loss 7956 * calculation. For example, one network always seemed to time out for 7957 * the first couple pings, so this is set to 3 by default. 7958 * @deprecated This setting is not used. 7959 */ 7960 @Deprecated 7961 @Readable 7962 public static final String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT = 7963 "wifi_watchdog_initial_ignored_ping_count"; 7964 7965 /** 7966 * The maximum number of access points (per network) to attempt to test. 7967 * If this number is reached, the watchdog will no longer monitor the 7968 * initial connection state for the network. This is a safeguard for 7969 * networks containing multiple APs whose DNS does not respond to pings. 7970 * @deprecated This setting is not used. 7971 */ 7972 @Deprecated 7973 @Readable 7974 public static final String WIFI_WATCHDOG_MAX_AP_CHECKS = "wifi_watchdog_max_ap_checks"; 7975 7976 /** 7977 * @deprecated Use {@link android.provider.Settings.Global#WIFI_WATCHDOG_ON} instead 7978 */ 7979 @Deprecated 7980 @Readable 7981 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 7982 7983 /** 7984 * A comma-separated list of SSIDs for which the Wi-Fi watchdog should be enabled. 7985 * @deprecated This setting is not used. 7986 */ 7987 @Deprecated 7988 @Readable 7989 public static final String WIFI_WATCHDOG_WATCH_LIST = "wifi_watchdog_watch_list"; 7990 7991 /** 7992 * The number of pings to test if an access point is a good connection. 7993 * @deprecated This setting is not used. 7994 */ 7995 @Deprecated 7996 @Readable 7997 public static final String WIFI_WATCHDOG_PING_COUNT = "wifi_watchdog_ping_count"; 7998 7999 /** 8000 * The delay between pings. 8001 * @deprecated This setting is not used. 8002 */ 8003 @Deprecated 8004 @Readable 8005 public static final String WIFI_WATCHDOG_PING_DELAY_MS = "wifi_watchdog_ping_delay_ms"; 8006 8007 /** 8008 * The timeout per ping. 8009 * @deprecated This setting is not used. 8010 */ 8011 @Deprecated 8012 @Readable 8013 public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS = "wifi_watchdog_ping_timeout_ms"; 8014 8015 /** 8016 * @deprecated Use 8017 * {@link android.provider.Settings.Global#WIFI_MAX_DHCP_RETRY_COUNT} instead 8018 */ 8019 @Deprecated 8020 public static final String WIFI_MAX_DHCP_RETRY_COUNT = Global.WIFI_MAX_DHCP_RETRY_COUNT; 8021 8022 /** 8023 * @deprecated Use 8024 * {@link android.provider.Settings.Global#WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS} instead 8025 */ 8026 @Deprecated 8027 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 8028 Global.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS; 8029 8030 /** 8031 * The number of milliseconds to hold on to a PendingIntent based request. This delay gives 8032 * the receivers of the PendingIntent an opportunity to make a new network request before 8033 * the Network satisfying the request is potentially removed. 8034 * 8035 * @hide 8036 */ 8037 @Readable 8038 public static final String CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS = 8039 "connectivity_release_pending_intent_delay_ms"; 8040 8041 /** 8042 * Whether background data usage is allowed. 8043 * 8044 * @deprecated As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, 8045 * availability of background data depends on several 8046 * combined factors. When background data is unavailable, 8047 * {@link ConnectivityManager#getActiveNetworkInfo()} will 8048 * now appear disconnected. 8049 */ 8050 @Deprecated 8051 @Readable 8052 public static final String BACKGROUND_DATA = "background_data"; 8053 8054 /** 8055 * Origins for which browsers should allow geolocation by default. 8056 * The value is a space-separated list of origins. 8057 */ 8058 @Readable 8059 public static final String ALLOWED_GEOLOCATION_ORIGINS 8060 = "allowed_geolocation_origins"; 8061 8062 /** 8063 * The preferred TTY mode 0 = TTy Off, CDMA default 8064 * 1 = TTY Full 8065 * 2 = TTY HCO 8066 * 3 = TTY VCO 8067 * @hide 8068 */ 8069 @Readable 8070 public static final String PREFERRED_TTY_MODE = 8071 "preferred_tty_mode"; 8072 8073 /** 8074 * Whether the enhanced voice privacy mode is enabled. 8075 * 0 = normal voice privacy 8076 * 1 = enhanced voice privacy 8077 * @hide 8078 */ 8079 @Readable 8080 public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled"; 8081 8082 /** 8083 * Whether the TTY mode mode is enabled. 8084 * 0 = disabled 8085 * 1 = enabled 8086 * @hide 8087 */ 8088 @Readable 8089 public static final String TTY_MODE_ENABLED = "tty_mode_enabled"; 8090 8091 /** 8092 * User-selected RTT mode. When on, outgoing and incoming calls will be answered as RTT 8093 * calls when supported by the device and carrier. Boolean value. 8094 * 0 = OFF 8095 * 1 = ON 8096 */ 8097 @Readable 8098 public static final String RTT_CALLING_MODE = "rtt_calling_mode"; 8099 8100 /** 8101 /** 8102 * Controls whether settings backup is enabled. 8103 * Type: int ( 0 = disabled, 1 = enabled ) 8104 * @hide 8105 */ 8106 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8107 @Readable 8108 public static final String BACKUP_ENABLED = "backup_enabled"; 8109 8110 /** 8111 * Controls whether application data is automatically restored from backup 8112 * at install time. 8113 * Type: int ( 0 = disabled, 1 = enabled ) 8114 * @hide 8115 */ 8116 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8117 @Readable 8118 public static final String BACKUP_AUTO_RESTORE = "backup_auto_restore"; 8119 8120 /** 8121 * Indicates whether settings backup has been fully provisioned. 8122 * Type: int ( 0 = unprovisioned, 1 = fully provisioned ) 8123 * @hide 8124 */ 8125 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8126 @Readable 8127 public static final String BACKUP_PROVISIONED = "backup_provisioned"; 8128 8129 /** 8130 * Component of the transport to use for backup/restore. 8131 * @hide 8132 */ 8133 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8134 @Readable 8135 public static final String BACKUP_TRANSPORT = "backup_transport"; 8136 8137 /** 8138 * Indicates the version for which the setup wizard was last shown. The version gets 8139 * bumped for each release when there is new setup information to show. 8140 * 8141 * @hide 8142 */ 8143 @SystemApi 8144 @Readable 8145 public static final String LAST_SETUP_SHOWN = "last_setup_shown"; 8146 8147 /** 8148 * The interval in milliseconds after which Wi-Fi is considered idle. 8149 * When idle, it is possible for the device to be switched from Wi-Fi to 8150 * the mobile data network. 8151 * @hide 8152 * @deprecated Use {@link android.provider.Settings.Global#WIFI_IDLE_MS} 8153 * instead. 8154 */ 8155 @Deprecated 8156 public static final String WIFI_IDLE_MS = Global.WIFI_IDLE_MS; 8157 8158 /** 8159 * The global search provider chosen by the user (if multiple global 8160 * search providers are installed). This will be the provider returned 8161 * by {@link SearchManager#getGlobalSearchActivity()} if it's still 8162 * installed. This setting is stored as a flattened component name as 8163 * per {@link ComponentName#flattenToString()}. 8164 * 8165 * @hide 8166 */ 8167 @Readable 8168 public static final String SEARCH_GLOBAL_SEARCH_ACTIVITY = 8169 "search_global_search_activity"; 8170 8171 /** 8172 * The number of promoted sources in GlobalSearch. 8173 * @hide 8174 */ 8175 @Readable 8176 public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources"; 8177 /** 8178 * The maximum number of suggestions returned by GlobalSearch. 8179 * @hide 8180 */ 8181 @Readable 8182 public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display"; 8183 /** 8184 * The number of suggestions GlobalSearch will ask each non-web search source for. 8185 * @hide 8186 */ 8187 @Readable 8188 public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source"; 8189 /** 8190 * The number of suggestions the GlobalSearch will ask the web search source for. 8191 * @hide 8192 */ 8193 @Readable 8194 public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT = 8195 "search_web_results_override_limit"; 8196 /** 8197 * The number of milliseconds that GlobalSearch will wait for suggestions from 8198 * promoted sources before continuing with all other sources. 8199 * @hide 8200 */ 8201 @Readable 8202 public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS = 8203 "search_promoted_source_deadline_millis"; 8204 /** 8205 * The number of milliseconds before GlobalSearch aborts search suggesiton queries. 8206 * @hide 8207 */ 8208 @Readable 8209 public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis"; 8210 /** 8211 * The maximum number of milliseconds that GlobalSearch shows the previous results 8212 * after receiving a new query. 8213 * @hide 8214 */ 8215 @Readable 8216 public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis"; 8217 /** 8218 * The maximum age of log data used for shortcuts in GlobalSearch. 8219 * @hide 8220 */ 8221 @Readable 8222 public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis"; 8223 /** 8224 * The maximum age of log data used for source ranking in GlobalSearch. 8225 * @hide 8226 */ 8227 @Readable 8228 public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS = 8229 "search_max_source_event_age_millis"; 8230 /** 8231 * The minimum number of impressions needed to rank a source in GlobalSearch. 8232 * @hide 8233 */ 8234 @Readable 8235 public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING = 8236 "search_min_impressions_for_source_ranking"; 8237 /** 8238 * The minimum number of clicks needed to rank a source in GlobalSearch. 8239 * @hide 8240 */ 8241 @Readable 8242 public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING = 8243 "search_min_clicks_for_source_ranking"; 8244 /** 8245 * The maximum number of shortcuts shown by GlobalSearch. 8246 * @hide 8247 */ 8248 @Readable 8249 public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned"; 8250 /** 8251 * The size of the core thread pool for suggestion queries in GlobalSearch. 8252 * @hide 8253 */ 8254 @Readable 8255 public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE = 8256 "search_query_thread_core_pool_size"; 8257 /** 8258 * The maximum size of the thread pool for suggestion queries in GlobalSearch. 8259 * @hide 8260 */ 8261 @Readable 8262 public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE = 8263 "search_query_thread_max_pool_size"; 8264 /** 8265 * The size of the core thread pool for shortcut refreshing in GlobalSearch. 8266 * @hide 8267 */ 8268 @Readable 8269 public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE = 8270 "search_shortcut_refresh_core_pool_size"; 8271 /** 8272 * The maximum size of the thread pool for shortcut refreshing in GlobalSearch. 8273 * @hide 8274 */ 8275 @Readable 8276 public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE = 8277 "search_shortcut_refresh_max_pool_size"; 8278 /** 8279 * The maximun time that excess threads in the GlobalSeach thread pools will 8280 * wait before terminating. 8281 * @hide 8282 */ 8283 @Readable 8284 public static final String SEARCH_THREAD_KEEPALIVE_SECONDS = 8285 "search_thread_keepalive_seconds"; 8286 /** 8287 * The maximum number of concurrent suggestion queries to each source. 8288 * @hide 8289 */ 8290 @Readable 8291 public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT = 8292 "search_per_source_concurrent_query_limit"; 8293 8294 /** 8295 * Whether or not alert sounds are played on StorageManagerService events. 8296 * (0 = false, 1 = true) 8297 * @hide 8298 */ 8299 @Readable 8300 public static final String MOUNT_PLAY_NOTIFICATION_SND = "mount_play_not_snd"; 8301 8302 /** 8303 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true) 8304 * @hide 8305 */ 8306 @Readable 8307 public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart"; 8308 8309 /** 8310 * Whether or not a notification is displayed on UMS host detection. (0 = false, 1 = true) 8311 * @hide 8312 */ 8313 @Readable 8314 public static final String MOUNT_UMS_PROMPT = "mount_ums_prompt"; 8315 8316 /** 8317 * Whether or not a notification is displayed while UMS is enabled. (0 = false, 1 = true) 8318 * @hide 8319 */ 8320 @Readable 8321 public static final String MOUNT_UMS_NOTIFY_ENABLED = "mount_ums_notify_enabled"; 8322 8323 /** 8324 * If nonzero, ANRs in invisible background processes bring up a dialog. 8325 * Otherwise, the process will be silently killed. 8326 * 8327 * Also prevents ANRs and crash dialogs from being suppressed. 8328 * @hide 8329 */ 8330 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8331 @TestApi 8332 @Readable 8333 @SuppressLint("NoSettingsProvider") 8334 public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; 8335 8336 /** 8337 * If nonzero, crashes in foreground processes will bring up a dialog. 8338 * Otherwise, the process will be silently killed. 8339 * @hide 8340 */ 8341 @TestApi 8342 @Readable 8343 @SuppressLint("NoSettingsProvider") 8344 public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION = 8345 "show_first_crash_dialog_dev_option"; 8346 8347 /** 8348 * The {@link ComponentName} string of the service to be used as the voice recognition 8349 * service. 8350 * 8351 * @hide 8352 */ 8353 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8354 @Readable 8355 public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service"; 8356 8357 /** 8358 * The {@link ComponentName} string of the selected spell checker service which is 8359 * one of the services managed by the text service manager. 8360 * 8361 * @hide 8362 */ 8363 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8364 @TestApi 8365 @Readable 8366 @SuppressLint("NoSettingsProvider") 8367 public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker"; 8368 8369 /** 8370 * {@link android.view.textservice.SpellCheckerSubtype#hashCode()} of the selected subtype 8371 * of the selected spell checker service which is one of the services managed by the text 8372 * service manager. 8373 * 8374 * @hide 8375 */ 8376 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8377 @TestApi 8378 @Readable 8379 @SuppressLint("NoSettingsProvider") 8380 public static final String SELECTED_SPELL_CHECKER_SUBTYPE = 8381 "selected_spell_checker_subtype"; 8382 8383 /** 8384 * Whether spell checker is enabled or not. 8385 * 8386 * @hide 8387 */ 8388 @Readable 8389 public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; 8390 8391 /** 8392 * What happens when the user presses the Power button while in-call 8393 * and the screen is on.<br/> 8394 * <b>Values:</b><br/> 8395 * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/> 8396 * 2 - The Power button hangs up the current call.<br/> 8397 * 8398 * @hide 8399 */ 8400 @UnsupportedAppUsage 8401 @Readable 8402 public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior"; 8403 8404 /** 8405 * Whether the user allows minimal post processing or not. 8406 * 8407 * <p>Values: 8408 * 0 - Not allowed. Any preferences set through the Window.setPreferMinimalPostProcessing 8409 * API will be ignored. 8410 * 1 - Allowed. Any preferences set through the Window.setPreferMinimalPostProcessing API 8411 * will be respected and the appropriate signals will be sent to display. 8412 * (Default behaviour) 8413 * 8414 * @hide 8415 */ 8416 @Readable 8417 public static final String MINIMAL_POST_PROCESSING_ALLOWED = 8418 "minimal_post_processing_allowed"; 8419 8420 /** 8421 * No mode switching will happen. 8422 * 8423 * @see #MATCH_CONTENT_FRAME_RATE 8424 * @hide 8425 */ 8426 public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0; 8427 8428 /** 8429 * Allow only refresh rate switching between modes in the same configuration group. 8430 * This way only switches without visual interruptions for the user will be allowed. 8431 * 8432 * @see #MATCH_CONTENT_FRAME_RATE 8433 * @hide 8434 */ 8435 public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1; 8436 8437 /** 8438 * Allow refresh rate switching between all refresh rates even if the switch will have 8439 * visual interruptions for the user. 8440 * 8441 * @see #MATCH_CONTENT_FRAME_RATE 8442 * @hide 8443 */ 8444 public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2; 8445 8446 /** 8447 * User's preference for refresh rate switching. 8448 * 8449 * <p>Values: 8450 * 0 - Never switch refresh rates. 8451 * 1 - Switch refresh rates only when it can be done seamlessly. (Default behaviour) 8452 * 2 - Always prefer refresh rate switching even if it's going to have visual interruptions 8453 * for the user. 8454 * 8455 * @see android.view.Surface#setFrameRate 8456 * @see #MATCH_CONTENT_FRAMERATE_NEVER 8457 * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY 8458 * @see #MATCH_CONTENT_FRAMERATE_ALWAYS 8459 * @hide 8460 */ 8461 public static final String MATCH_CONTENT_FRAME_RATE = 8462 "match_content_frame_rate"; 8463 8464 /** 8465 * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen". 8466 * @hide 8467 */ 8468 public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1; 8469 8470 /** 8471 * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up". 8472 * @hide 8473 */ 8474 public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2; 8475 8476 /** 8477 * INCALL_POWER_BUTTON_BEHAVIOR default value. 8478 * @hide 8479 */ 8480 public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = 8481 INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; 8482 8483 /** 8484 * What happens when the user presses the Back button while in-call 8485 * and the screen is on.<br/> 8486 * <b>Values:</b><br/> 8487 * 0 - The Back buttons does nothing different.<br/> 8488 * 1 - The Back button hangs up the current call.<br/> 8489 * 8490 * @hide 8491 */ 8492 @Readable 8493 public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; 8494 8495 /** 8496 * INCALL_BACK_BUTTON_BEHAVIOR value for no action. 8497 * @hide 8498 */ 8499 public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; 8500 8501 /** 8502 * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". 8503 * @hide 8504 */ 8505 public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; 8506 8507 /** 8508 * INCALL_POWER_BUTTON_BEHAVIOR default value. 8509 * @hide 8510 */ 8511 public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = 8512 INCALL_BACK_BUTTON_BEHAVIOR_NONE; 8513 8514 /** 8515 * Whether the device should wake when the wake gesture sensor detects motion. 8516 * @hide 8517 */ 8518 @Readable 8519 public static final String WAKE_GESTURE_ENABLED = "wake_gesture_enabled"; 8520 8521 /** 8522 * Whether the device should doze if configured. 8523 * @hide 8524 */ 8525 @UnsupportedAppUsage 8526 @Readable 8527 public static final String DOZE_ENABLED = "doze_enabled"; 8528 8529 /** 8530 * Indicates whether doze should be always on. 8531 * <p> 8532 * Type: int (0 for false, 1 for true) 8533 * 8534 * @hide 8535 */ 8536 @SystemApi 8537 @Readable 8538 public static final String DOZE_ALWAYS_ON = "doze_always_on"; 8539 8540 /** 8541 * Whether the device should pulse on pick up gesture. 8542 * @hide 8543 */ 8544 @Readable 8545 public static final String DOZE_PICK_UP_GESTURE = "doze_pulse_on_pick_up"; 8546 8547 /** 8548 * Whether the device should pulse on long press gesture. 8549 * @hide 8550 */ 8551 @Readable 8552 public static final String DOZE_PULSE_ON_LONG_PRESS = "doze_pulse_on_long_press"; 8553 8554 /** 8555 * Whether the device should pulse on double tap gesture. 8556 * @hide 8557 */ 8558 @Readable 8559 public static final String DOZE_DOUBLE_TAP_GESTURE = "doze_pulse_on_double_tap"; 8560 8561 /** 8562 * Whether the device should respond to the SLPI tap gesture. 8563 * @hide 8564 */ 8565 @Readable 8566 public static final String DOZE_TAP_SCREEN_GESTURE = "doze_tap_gesture"; 8567 8568 /** 8569 * Gesture that wakes up the display, showing some version of the lock screen. 8570 * @hide 8571 */ 8572 @Readable 8573 public static final String DOZE_WAKE_LOCK_SCREEN_GESTURE = "doze_wake_screen_gesture"; 8574 8575 /** 8576 * Gesture that wakes up the display, toggling between {@link Display.STATE_OFF} and 8577 * {@link Display.STATE_DOZE}. 8578 * @hide 8579 */ 8580 @Readable 8581 public static final String DOZE_WAKE_DISPLAY_GESTURE = "doze_wake_display_gesture"; 8582 8583 /** 8584 * Gesture that wakes up the display on quick pickup, toggling between 8585 * {@link Display.STATE_OFF} and {@link Display.STATE_DOZE}. 8586 * @hide 8587 */ 8588 public static final String DOZE_QUICK_PICKUP_GESTURE = "doze_quick_pickup_gesture"; 8589 8590 /** 8591 * Whether the device should suppress the current doze configuration and disable dozing. 8592 * @hide 8593 */ 8594 @Readable 8595 public static final String SUPPRESS_DOZE = "suppress_doze"; 8596 8597 /** 8598 * Gesture that skips media. 8599 * @hide 8600 */ 8601 @Readable 8602 public static final String SKIP_GESTURE = "skip_gesture"; 8603 8604 /** 8605 * Count of successful gestures. 8606 * @hide 8607 */ 8608 @Readable 8609 public static final String SKIP_GESTURE_COUNT = "skip_gesture_count"; 8610 8611 /** 8612 * Count of non-gesture interaction. 8613 * @hide 8614 */ 8615 @Readable 8616 public static final String SKIP_TOUCH_COUNT = "skip_touch_count"; 8617 8618 /** 8619 * Direction to advance media for skip gesture 8620 * @hide 8621 */ 8622 @Readable 8623 public static final String SKIP_DIRECTION = "skip_gesture_direction"; 8624 8625 /** 8626 * Gesture that silences sound (alarms, notification, calls). 8627 * @hide 8628 */ 8629 @Readable 8630 public static final String SILENCE_GESTURE = "silence_gesture"; 8631 8632 /** 8633 * Count of successful silence alarms gestures. 8634 * @hide 8635 */ 8636 @Readable 8637 public static final String SILENCE_ALARMS_GESTURE_COUNT = "silence_alarms_gesture_count"; 8638 8639 /** 8640 * Count of successful silence timer gestures. 8641 * @hide 8642 */ 8643 @Readable 8644 public static final String SILENCE_TIMER_GESTURE_COUNT = "silence_timer_gesture_count"; 8645 8646 /** 8647 * Count of successful silence call gestures. 8648 * @hide 8649 */ 8650 @Readable 8651 public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count"; 8652 8653 /** 8654 * Count of non-gesture interaction. 8655 * @hide 8656 */ 8657 @Readable 8658 public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count"; 8659 8660 /** 8661 * Count of non-gesture interaction. 8662 * @hide 8663 */ 8664 @Readable 8665 public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count"; 8666 8667 /** 8668 * Count of non-gesture interaction. 8669 * @hide 8670 */ 8671 @Readable 8672 public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count"; 8673 8674 /** 8675 * Number of successful "Motion Sense" tap gestures to pause media. 8676 * @hide 8677 */ 8678 @Readable 8679 public static final String AWARE_TAP_PAUSE_GESTURE_COUNT = "aware_tap_pause_gesture_count"; 8680 8681 /** 8682 * Number of touch interactions to pause media when a "Motion Sense" gesture could 8683 * have been used. 8684 * @hide 8685 */ 8686 @Readable 8687 public static final String AWARE_TAP_PAUSE_TOUCH_COUNT = "aware_tap_pause_touch_count"; 8688 8689 /** 8690 * For user preference if swipe bottom to expand notification gesture enabled. 8691 * @hide 8692 */ 8693 public static final String SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED = 8694 "swipe_bottom_to_notification_enabled"; 8695 8696 /** 8697 * Controls whether One-Handed mode is currently activated. 8698 * @hide 8699 */ 8700 public static final String ONE_HANDED_MODE_ACTIVATED = "one_handed_mode_activated"; 8701 8702 /** 8703 * For user preference if One-Handed Mode enabled. 8704 * @hide 8705 */ 8706 public static final String ONE_HANDED_MODE_ENABLED = "one_handed_mode_enabled"; 8707 8708 /** 8709 * For user preference if One-Handed Mode timeout. 8710 * @hide 8711 */ 8712 public static final String ONE_HANDED_MODE_TIMEOUT = "one_handed_mode_timeout"; 8713 8714 /** 8715 * For user taps app to exit One-Handed Mode. 8716 * @hide 8717 */ 8718 public static final String TAPS_APP_TO_EXIT = "taps_app_to_exit"; 8719 8720 /** 8721 * Internal use, one handed mode tutorial showed times. 8722 * @hide 8723 */ 8724 public static final String ONE_HANDED_TUTORIAL_SHOW_COUNT = 8725 "one_handed_tutorial_show_count"; 8726 8727 /** 8728 * Toggle to enable/disable for the apps to use the Ui translation for Views. The value 8729 * indicates whether the Ui translation is enabled by the user. 8730 * <p> 8731 * Type: {@code int} ({@code 0} for disabled, {@code 1} for enabled) 8732 * 8733 * @hide 8734 */ 8735 @SystemApi 8736 @Readable 8737 @SuppressLint("NoSettingsProvider") 8738 public static final String UI_TRANSLATION_ENABLED = "ui_translation_enabled"; 8739 8740 /** 8741 * The current night mode that has been selected by the user. Owned 8742 * and controlled by UiModeManagerService. Constants are as per 8743 * UiModeManager. 8744 * @hide 8745 */ 8746 @Readable 8747 public static final String UI_NIGHT_MODE = "ui_night_mode"; 8748 8749 /** 8750 * The current night mode that has been overridden to turn on by the system. Owned 8751 * and controlled by UiModeManagerService. Constants are as per 8752 * UiModeManager. 8753 * @hide 8754 */ 8755 @Readable 8756 public static final String UI_NIGHT_MODE_OVERRIDE_ON = "ui_night_mode_override_on"; 8757 8758 /** 8759 * The last computed night mode bool the last time the phone was on 8760 * @hide 8761 */ 8762 public static final String UI_NIGHT_MODE_LAST_COMPUTED = "ui_night_mode_last_computed"; 8763 8764 /** 8765 * The current night mode that has been overridden to turn off by the system. Owned 8766 * and controlled by UiModeManagerService. Constants are as per 8767 * UiModeManager. 8768 * @hide 8769 */ 8770 @Readable 8771 public static final String UI_NIGHT_MODE_OVERRIDE_OFF = "ui_night_mode_override_off"; 8772 8773 /** 8774 * Whether screensavers are enabled. 8775 * @hide 8776 */ 8777 @Readable 8778 public static final String SCREENSAVER_ENABLED = "screensaver_enabled"; 8779 8780 /** 8781 * The user's chosen screensaver components. 8782 * 8783 * These will be launched by the PhoneWindowManager after a timeout when not on 8784 * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1). 8785 * @hide 8786 */ 8787 @Readable 8788 public static final String SCREENSAVER_COMPONENTS = "screensaver_components"; 8789 8790 /** 8791 * If screensavers are enabled, whether the screensaver should be automatically launched 8792 * when the device is inserted into a (desk) dock. 8793 * @hide 8794 */ 8795 @Readable 8796 public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock"; 8797 8798 /** 8799 * If screensavers are enabled, whether the screensaver should be automatically launched 8800 * when the screen times out when not on battery. 8801 * @hide 8802 */ 8803 @Readable 8804 public static final String SCREENSAVER_ACTIVATE_ON_SLEEP = "screensaver_activate_on_sleep"; 8805 8806 /** 8807 * If screensavers are enabled, the default screensaver component. 8808 * @hide 8809 */ 8810 @Readable 8811 public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; 8812 8813 /** 8814 * The default NFC payment component 8815 * @hide 8816 */ 8817 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8818 public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component"; 8819 8820 /** 8821 * Whether NFC payment is handled by the foreground application or a default. 8822 * @hide 8823 */ 8824 @Readable 8825 public static final String NFC_PAYMENT_FOREGROUND = "nfc_payment_foreground"; 8826 8827 /** 8828 * Specifies the package name currently configured to be the primary sms application 8829 * @hide 8830 */ 8831 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8832 @Readable 8833 public static final String SMS_DEFAULT_APPLICATION = "sms_default_application"; 8834 8835 /** 8836 * Specifies the package name currently configured to be the default dialer application 8837 * @hide 8838 */ 8839 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8840 @Readable 8841 public static final String DIALER_DEFAULT_APPLICATION = "dialer_default_application"; 8842 8843 /** 8844 * Specifies the component name currently configured to be the default call screening 8845 * application 8846 * @hide 8847 */ 8848 @Readable 8849 public static final String CALL_SCREENING_DEFAULT_COMPONENT = 8850 "call_screening_default_component"; 8851 8852 /** 8853 * Specifies the package name currently configured to be the emergency assistance application 8854 * 8855 * @see android.telephony.TelephonyManager#ACTION_EMERGENCY_ASSISTANCE 8856 * 8857 * @hide 8858 */ 8859 @Readable 8860 public static final String EMERGENCY_ASSISTANCE_APPLICATION = "emergency_assistance_application"; 8861 8862 /** 8863 * Specifies whether the current app context on scren (assist data) will be sent to the 8864 * assist application (active voice interaction service). 8865 * 8866 * @hide 8867 */ 8868 @Readable 8869 public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; 8870 8871 /** 8872 * Specifies whether a screenshot of the screen contents will be sent to the assist 8873 * application (active voice interaction service). 8874 * 8875 * @hide 8876 */ 8877 @Readable 8878 public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; 8879 8880 /** 8881 * Specifies whether the screen will show an animation if screen contents are sent to the 8882 * assist application (active voice interaction service). 8883 * 8884 * Note that the disclosure will be forced for third-party assistants or if the device 8885 * does not support disabling it. 8886 * 8887 * @hide 8888 */ 8889 @Readable 8890 public static final String ASSIST_DISCLOSURE_ENABLED = "assist_disclosure_enabled"; 8891 8892 /** 8893 * Control if rotation suggestions are sent to System UI when in rotation locked mode. 8894 * Done to enable screen rotation while the the screen rotation is locked. Enabling will 8895 * poll the accelerometer in rotation locked mode. 8896 * 8897 * If 0, then rotation suggestions are not sent to System UI. If 1, suggestions are sent. 8898 * 8899 * @hide 8900 */ 8901 @Readable 8902 public static final String SHOW_ROTATION_SUGGESTIONS = "show_rotation_suggestions"; 8903 8904 /** 8905 * The disabled state of SHOW_ROTATION_SUGGESTIONS. 8906 * @hide 8907 */ 8908 public static final int SHOW_ROTATION_SUGGESTIONS_DISABLED = 0x0; 8909 8910 /** 8911 * The enabled state of SHOW_ROTATION_SUGGESTIONS. 8912 * @hide 8913 */ 8914 public static final int SHOW_ROTATION_SUGGESTIONS_ENABLED = 0x1; 8915 8916 /** 8917 * The default state of SHOW_ROTATION_SUGGESTIONS. 8918 * @hide 8919 */ 8920 public static final int SHOW_ROTATION_SUGGESTIONS_DEFAULT = 8921 SHOW_ROTATION_SUGGESTIONS_ENABLED; 8922 8923 /** 8924 * The number of accepted rotation suggestions. Used to determine if the user has been 8925 * introduced to rotation suggestions. 8926 * @hide 8927 */ 8928 @Readable 8929 public static final String NUM_ROTATION_SUGGESTIONS_ACCEPTED = 8930 "num_rotation_suggestions_accepted"; 8931 8932 /** 8933 * Read only list of the service components that the current user has explicitly allowed to 8934 * see and assist with all of the user's notifications. 8935 * 8936 * @deprecated Use 8937 * {@link NotificationManager#isNotificationAssistantAccessGranted(ComponentName)}. 8938 * @hide 8939 */ 8940 @Deprecated 8941 @Readable 8942 public static final String ENABLED_NOTIFICATION_ASSISTANT = 8943 "enabled_notification_assistant"; 8944 8945 /** 8946 * Read only list of the service components that the current user has explicitly allowed to 8947 * see all of the user's notifications, separated by ':'. 8948 * 8949 * @hide 8950 * @deprecated Use 8951 * {@link NotificationManager#isNotificationListenerAccessGranted(ComponentName)}. 8952 */ 8953 @Deprecated 8954 @UnsupportedAppUsage 8955 @Readable 8956 public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; 8957 8958 /** 8959 * Read only list of the packages that the current user has explicitly allowed to 8960 * manage do not disturb, separated by ':'. 8961 * 8962 * @deprecated Use {@link NotificationManager#isNotificationPolicyAccessGranted()}. 8963 * @hide 8964 */ 8965 @Deprecated 8966 @TestApi 8967 @Readable 8968 public static final String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = 8969 "enabled_notification_policy_access_packages"; 8970 8971 /** 8972 * Defines whether managed profile ringtones should be synced from it's parent profile 8973 * <p> 8974 * 0 = ringtones are not synced 8975 * 1 = ringtones are synced from the profile's parent (default) 8976 * <p> 8977 * This value is only used for managed profiles. 8978 * @hide 8979 */ 8980 @TestApi 8981 @Readable 8982 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) 8983 public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; 8984 8985 /** 8986 * @hide 8987 */ 8988 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 8989 @TestApi 8990 @Readable 8991 public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations"; 8992 8993 /** 8994 * This is the query URI for finding a print service to install. 8995 * 8996 * @hide 8997 */ 8998 @Readable 8999 public static final String PRINT_SERVICE_SEARCH_URI = "print_service_search_uri"; 9000 9001 /** 9002 * This is the query URI for finding a NFC payment service to install. 9003 * 9004 * @hide 9005 */ 9006 @Readable 9007 public static final String PAYMENT_SERVICE_SEARCH_URI = "payment_service_search_uri"; 9008 9009 /** 9010 * This is the query URI for finding a auto fill service to install. 9011 * 9012 * @hide 9013 */ 9014 @Readable 9015 public static final String AUTOFILL_SERVICE_SEARCH_URI = "autofill_service_search_uri"; 9016 9017 /** 9018 * If enabled, apps should try to skip any introductory hints on first launch. This might 9019 * apply to users that are already familiar with the environment or temporary users. 9020 * <p> 9021 * Type : int (0 to show hints, 1 to skip showing hints) 9022 */ 9023 @Readable 9024 public static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints"; 9025 9026 /** 9027 * Persisted playback time after a user confirmation of an unsafe volume level. 9028 * 9029 * @hide 9030 */ 9031 @Readable 9032 public static final String UNSAFE_VOLUME_MUSIC_ACTIVE_MS = "unsafe_volume_music_active_ms"; 9033 9034 /** 9035 * Indicates whether the spatial audio feature was enabled for this user. 9036 * 9037 * Type : int (0 disabled, 1 enabled) 9038 * 9039 * @hide 9040 */ 9041 public static final String SPATIAL_AUDIO_ENABLED = "spatial_audio_enabled"; 9042 9043 /** 9044 * Indicates whether notification display on the lock screen is enabled. 9045 * <p> 9046 * Type: int (0 for false, 1 for true) 9047 * 9048 * @hide 9049 */ 9050 @SystemApi 9051 @Readable 9052 public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = 9053 "lock_screen_show_notifications"; 9054 9055 /** 9056 * Indicates whether the lock screen should display silent notifications. 9057 * <p> 9058 * Type: int (0 for false, 1 for true) 9059 * 9060 * @hide 9061 */ 9062 @Readable 9063 public static final String LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS = 9064 "lock_screen_show_silent_notifications"; 9065 9066 /** 9067 * Indicates whether snooze options should be shown on notifications 9068 * <p> 9069 * Type: int (0 for false, 1 for true) 9070 * 9071 * @hide 9072 */ 9073 @Readable 9074 public static final String SHOW_NOTIFICATION_SNOOZE = "show_notification_snooze"; 9075 9076 /** 9077 * List of TV inputs that are currently hidden. This is a string 9078 * containing the IDs of all hidden TV inputs. Each ID is encoded by 9079 * {@link android.net.Uri#encode(String)} and separated by ':'. 9080 * @hide 9081 */ 9082 @Readable 9083 public static final String TV_INPUT_HIDDEN_INPUTS = "tv_input_hidden_inputs"; 9084 9085 /** 9086 * List of custom TV input labels. This is a string containing <TV input id, custom name> 9087 * pairs. TV input id and custom name are encoded by {@link android.net.Uri#encode(String)} 9088 * and separated by ','. Each pair is separated by ':'. 9089 * @hide 9090 */ 9091 @Readable 9092 public static final String TV_INPUT_CUSTOM_LABELS = "tv_input_custom_labels"; 9093 9094 /** 9095 * Whether TV app uses non-system inputs. 9096 * 9097 * <p> 9098 * The value is boolean (1 or 0), where 1 means non-system TV inputs are allowed, 9099 * and 0 means non-system TV inputs are not allowed. 9100 * 9101 * <p> 9102 * Devices such as sound bars may have changed the system property allow_third_party_inputs 9103 * to false so the TV Application only uses HDMI and other built in inputs. This setting 9104 * allows user to override the default and have the TV Application use third party TV inputs 9105 * available on play store. 9106 * 9107 * @hide 9108 */ 9109 @Readable 9110 public static final String TV_APP_USES_NON_SYSTEM_INPUTS = "tv_app_uses_non_system_inputs"; 9111 9112 /** 9113 * Whether automatic routing of system audio to USB audio peripheral is disabled. 9114 * The value is boolean (1 or 0), where 1 means automatic routing is disabled, 9115 * and 0 means automatic routing is enabled. 9116 * 9117 * @hide 9118 */ 9119 @Readable 9120 public static final String USB_AUDIO_AUTOMATIC_ROUTING_DISABLED = 9121 "usb_audio_automatic_routing_disabled"; 9122 9123 /** 9124 * The timeout in milliseconds before the device fully goes to sleep after 9125 * a period of inactivity. This value sets an upper bound on how long the device 9126 * will stay awake or dreaming without user activity. It should generally 9127 * be longer than {@link Settings.System#SCREEN_OFF_TIMEOUT} as otherwise the device 9128 * will sleep before it ever has a chance to dream. 9129 * <p> 9130 * Use -1 to disable this timeout. 9131 * </p> 9132 * 9133 * @hide 9134 */ 9135 @Readable 9136 public static final String SLEEP_TIMEOUT = "sleep_timeout"; 9137 9138 /** 9139 * The timeout in milliseconds before the device goes to sleep due to user inattentiveness, 9140 * even if the system is holding wakelocks. It should generally be longer than {@code 9141 * config_attentiveWarningDuration}, as otherwise the device will show the attentive 9142 * warning constantly. Small timeouts are discouraged, as they will cause the device to 9143 * go to sleep quickly after waking up. 9144 * <p> 9145 * Use -1 to disable this timeout. 9146 * </p> 9147 * 9148 * @hide 9149 */ 9150 @Readable 9151 public static final String ATTENTIVE_TIMEOUT = "attentive_timeout"; 9152 9153 /** 9154 * Controls whether double tap to wake is enabled. 9155 * @hide 9156 */ 9157 @Readable 9158 public static final String DOUBLE_TAP_TO_WAKE = "double_tap_to_wake"; 9159 9160 /** 9161 * The current assistant component. It could be a voice interaction service, 9162 * or an activity that handles ACTION_ASSIST, or empty which means using the default 9163 * handling. 9164 * 9165 * <p>This should be set indirectly by setting the {@link 9166 * android.app.role.RoleManager#ROLE_ASSISTANT assistant role}. 9167 * 9168 * @hide 9169 */ 9170 @UnsupportedAppUsage 9171 @Readable 9172 public static final String ASSISTANT = "assistant"; 9173 9174 /** 9175 * Whether the camera launch gesture should be disabled. 9176 * 9177 * @hide 9178 */ 9179 @Readable 9180 public static final String CAMERA_GESTURE_DISABLED = "camera_gesture_disabled"; 9181 9182 /** 9183 * Whether the emergency gesture should be enabled. 9184 * 9185 * @hide 9186 */ 9187 public static final String EMERGENCY_GESTURE_ENABLED = "emergency_gesture_enabled"; 9188 9189 /** 9190 * Whether the emergency gesture sound should be enabled. 9191 * 9192 * @hide 9193 */ 9194 public static final String EMERGENCY_GESTURE_SOUND_ENABLED = 9195 "emergency_gesture_sound_enabled"; 9196 9197 /** 9198 * Whether the camera launch gesture to double tap the power button when the screen is off 9199 * should be disabled. 9200 * 9201 * @hide 9202 */ 9203 @Readable 9204 public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = 9205 "camera_double_tap_power_gesture_disabled"; 9206 9207 /** 9208 * Whether the camera double twist gesture to flip between front and back mode should be 9209 * enabled. 9210 * 9211 * @hide 9212 */ 9213 @Readable 9214 public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED = 9215 "camera_double_twist_to_flip_enabled"; 9216 9217 /** 9218 * Whether or not the smart camera lift trigger that launches the camera when the user moves 9219 * the phone into a position for taking photos should be enabled. 9220 * 9221 * @hide 9222 */ 9223 @Readable 9224 public static final String CAMERA_LIFT_TRIGGER_ENABLED = "camera_lift_trigger_enabled"; 9225 9226 /** 9227 * The default enable state of the camera lift trigger. 9228 * 9229 * @hide 9230 */ 9231 public static final int CAMERA_LIFT_TRIGGER_ENABLED_DEFAULT = 1; 9232 9233 /** 9234 * Whether or not the flashlight (camera torch mode) is available required to turn 9235 * on flashlight. 9236 * 9237 * @hide 9238 */ 9239 @Readable 9240 public static final String FLASHLIGHT_AVAILABLE = "flashlight_available"; 9241 9242 /** 9243 * Whether or not flashlight is enabled. 9244 * 9245 * @hide 9246 */ 9247 @Readable 9248 public static final String FLASHLIGHT_ENABLED = "flashlight_enabled"; 9249 9250 /** 9251 * Whether or not face unlock is allowed on Keyguard. 9252 * @hide 9253 */ 9254 @Readable 9255 public static final String FACE_UNLOCK_KEYGUARD_ENABLED = "face_unlock_keyguard_enabled"; 9256 9257 /** 9258 * Whether or not face unlock dismisses the keyguard. 9259 * @hide 9260 */ 9261 @Readable 9262 public static final String FACE_UNLOCK_DISMISSES_KEYGUARD = 9263 "face_unlock_dismisses_keyguard"; 9264 9265 /** 9266 * Whether or not media is shown automatically when bypassing as a heads up. 9267 * @hide 9268 */ 9269 @Readable 9270 public static final String SHOW_MEDIA_WHEN_BYPASSING = 9271 "show_media_when_bypassing"; 9272 9273 /** 9274 * Whether or not face unlock requires attention. This is a cached value, the source of 9275 * truth is obtained through the HAL. 9276 * @hide 9277 */ 9278 @Readable 9279 public static final String FACE_UNLOCK_ATTENTION_REQUIRED = 9280 "face_unlock_attention_required"; 9281 9282 /** 9283 * Whether or not face unlock requires a diverse set of poses during enrollment. This is a 9284 * cached value, the source of truth is obtained through the HAL. 9285 * @hide 9286 */ 9287 @Readable 9288 public static final String FACE_UNLOCK_DIVERSITY_REQUIRED = 9289 "face_unlock_diversity_required"; 9290 9291 9292 /** 9293 * Whether or not face unlock is allowed for apps (through BiometricPrompt). 9294 * @hide 9295 */ 9296 @Readable 9297 public static final String FACE_UNLOCK_APP_ENABLED = "face_unlock_app_enabled"; 9298 9299 /** 9300 * Whether or not face unlock always requires user confirmation, meaning {@link 9301 * android.hardware.biometrics.BiometricPrompt.Builder#setConfirmationRequired(boolean)} 9302 * is always 'true'. This overrides the behavior that apps choose in the 9303 * setConfirmationRequired API. 9304 * @hide 9305 */ 9306 @Readable 9307 public static final String FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION = 9308 "face_unlock_always_require_confirmation"; 9309 9310 /** 9311 * Whether or not a user should re enroll their face. 9312 * 9313 * Face unlock re enroll. 9314 * 0 = No re enrollment. 9315 * 1 = Re enrollment is suggested. 9316 * 2 = Re enrollment is required after a set time period. 9317 * 3 = Re enrollment is required immediately. 9318 * 9319 * @hide 9320 */ 9321 @Readable 9322 public static final String FACE_UNLOCK_RE_ENROLL = "face_unlock_re_enroll"; 9323 9324 /** 9325 * Whether or not debugging is enabled. 9326 * @hide 9327 */ 9328 @Readable 9329 public static final String BIOMETRIC_DEBUG_ENABLED = 9330 "biometric_debug_enabled"; 9331 9332 /** 9333 * Whether or not biometric is allowed on Keyguard. 9334 * @hide 9335 */ 9336 @Readable 9337 public static final String BIOMETRIC_KEYGUARD_ENABLED = "biometric_keyguard_enabled"; 9338 9339 /** 9340 * Whether or not biometric is allowed for apps (through BiometricPrompt). 9341 * @hide 9342 */ 9343 @Readable 9344 public static final String BIOMETRIC_APP_ENABLED = "biometric_app_enabled"; 9345 9346 /** 9347 * Whether the assist gesture should be enabled. 9348 * 9349 * @hide 9350 */ 9351 @Readable 9352 public static final String ASSIST_GESTURE_ENABLED = "assist_gesture_enabled"; 9353 9354 /** 9355 * Sensitivity control for the assist gesture. 9356 * 9357 * @hide 9358 */ 9359 @Readable 9360 public static final String ASSIST_GESTURE_SENSITIVITY = "assist_gesture_sensitivity"; 9361 9362 /** 9363 * Whether the assist gesture should silence alerts. 9364 * 9365 * @hide 9366 */ 9367 @Readable 9368 public static final String ASSIST_GESTURE_SILENCE_ALERTS_ENABLED = 9369 "assist_gesture_silence_alerts_enabled"; 9370 9371 /** 9372 * Whether the assist gesture should wake the phone. 9373 * 9374 * @hide 9375 */ 9376 @Readable 9377 public static final String ASSIST_GESTURE_WAKE_ENABLED = 9378 "assist_gesture_wake_enabled"; 9379 9380 /** 9381 * Indicates whether the Assist Gesture Deferred Setup has been completed. 9382 * <p> 9383 * Type: int (0 for false, 1 for true) 9384 * 9385 * @hide 9386 */ 9387 @SystemApi 9388 @Readable 9389 public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete"; 9390 9391 /** 9392 * Whether the assistant can be triggered by a touch gesture. 9393 * 9394 * @hide 9395 */ 9396 public static final String ASSIST_TOUCH_GESTURE_ENABLED = 9397 "assist_touch_gesture_enabled"; 9398 9399 /** 9400 * Whether the assistant can be triggered by long-pressing the home button 9401 * 9402 * @hide 9403 */ 9404 public static final String ASSIST_LONG_PRESS_HOME_ENABLED = 9405 "assist_long_press_home_enabled"; 9406 9407 /** 9408 * Control whether Trust Agents are in active unlock or extend unlock mode. 9409 * @hide 9410 */ 9411 @Readable 9412 public static final String TRUST_AGENTS_EXTEND_UNLOCK = "trust_agents_extend_unlock"; 9413 9414 /** 9415 * Control whether the screen locks when trust is lost. 9416 * @hide 9417 */ 9418 @Readable 9419 public static final String LOCK_SCREEN_WHEN_TRUST_LOST = "lock_screen_when_trust_lost"; 9420 9421 /** 9422 * Control whether Night display is currently activated. 9423 * @hide 9424 */ 9425 @Readable 9426 public static final String NIGHT_DISPLAY_ACTIVATED = "night_display_activated"; 9427 9428 /** 9429 * Control whether Night display will automatically activate/deactivate. 9430 * @hide 9431 */ 9432 @Readable 9433 public static final String NIGHT_DISPLAY_AUTO_MODE = "night_display_auto_mode"; 9434 9435 /** 9436 * Control the color temperature of Night Display, represented in Kelvin. 9437 * @hide 9438 */ 9439 @Readable 9440 public static final String NIGHT_DISPLAY_COLOR_TEMPERATURE = 9441 "night_display_color_temperature"; 9442 9443 /** 9444 * Custom time when Night display is scheduled to activate. 9445 * Represented as milliseconds from midnight (e.g. 79200000 == 10pm). 9446 * @hide 9447 */ 9448 @Readable 9449 public static final String NIGHT_DISPLAY_CUSTOM_START_TIME = 9450 "night_display_custom_start_time"; 9451 9452 /** 9453 * Custom time when Night display is scheduled to deactivate. 9454 * Represented as milliseconds from midnight (e.g. 21600000 == 6am). 9455 * @hide 9456 */ 9457 @Readable 9458 public static final String NIGHT_DISPLAY_CUSTOM_END_TIME = "night_display_custom_end_time"; 9459 9460 /** 9461 * A String representing the LocalDateTime when Night display was last activated. Use to 9462 * decide whether to apply the current activated state after a reboot or user change. In 9463 * legacy cases, this is represented by the time in milliseconds (since epoch). 9464 * @hide 9465 */ 9466 @Readable 9467 public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME = 9468 "night_display_last_activated_time"; 9469 9470 /** 9471 * Control whether display white balance is currently enabled. 9472 * @hide 9473 */ 9474 @Readable 9475 public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled"; 9476 9477 /** 9478 * Names of the service components that the current user has explicitly allowed to 9479 * be a VR mode listener, separated by ':'. 9480 * 9481 * @hide 9482 */ 9483 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 9484 @TestApi 9485 @Readable 9486 public static final String ENABLED_VR_LISTENERS = "enabled_vr_listeners"; 9487 9488 /** 9489 * Behavior of the display while in VR mode. 9490 * 9491 * One of {@link #VR_DISPLAY_MODE_LOW_PERSISTENCE} or {@link #VR_DISPLAY_MODE_OFF}. 9492 * 9493 * @hide 9494 */ 9495 @Readable 9496 public static final String VR_DISPLAY_MODE = "vr_display_mode"; 9497 9498 /** 9499 * Lower the display persistence while the system is in VR mode. 9500 * 9501 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 9502 * 9503 * @hide. 9504 */ 9505 public static final int VR_DISPLAY_MODE_LOW_PERSISTENCE = 0; 9506 9507 /** 9508 * Do not alter the display persistence while the system is in VR mode. 9509 * 9510 * @see PackageManager#FEATURE_VR_MODE_HIGH_PERFORMANCE 9511 * 9512 * @hide. 9513 */ 9514 public static final int VR_DISPLAY_MODE_OFF = 1; 9515 9516 /** 9517 * The latest SDK version that CarrierAppUtils#disableCarrierAppsUntilPrivileged has been 9518 * executed for. 9519 * 9520 * <p>This is used to ensure that we only take one pass which will disable apps that are not 9521 * privileged (if any). From then on, we only want to enable apps (when a matching SIM is 9522 * inserted), to avoid disabling an app that the user might actively be using. 9523 * 9524 * <p>Will be set to {@link android.os.Build.VERSION#SDK_INT} once executed. Note that older 9525 * SDK versions prior to R set 1 for this value. 9526 * 9527 * @hide 9528 */ 9529 @Readable 9530 public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled"; 9531 9532 /** 9533 * Whether parent user can access remote contact in managed profile. 9534 * 9535 * @hide 9536 */ 9537 @Readable 9538 public static final String MANAGED_PROFILE_CONTACT_REMOTE_SEARCH = 9539 "managed_profile_contact_remote_search"; 9540 9541 /** 9542 * Whether parent profile can access remote calendar data in managed profile. 9543 * 9544 * @hide 9545 */ 9546 @Readable 9547 public static final String CROSS_PROFILE_CALENDAR_ENABLED = 9548 "cross_profile_calendar_enabled"; 9549 9550 /** 9551 * Whether or not the automatic storage manager is enabled and should run on the device. 9552 * 9553 * @hide 9554 */ 9555 @Readable 9556 public static final String AUTOMATIC_STORAGE_MANAGER_ENABLED = 9557 "automatic_storage_manager_enabled"; 9558 9559 /** 9560 * How many days of information for the automatic storage manager to retain on the device. 9561 * 9562 * @hide 9563 */ 9564 @Readable 9565 public static final String AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN = 9566 "automatic_storage_manager_days_to_retain"; 9567 9568 /** 9569 * Default number of days of information for the automatic storage manager to retain. 9570 * 9571 * @hide 9572 */ 9573 public static final int AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN_DEFAULT = 90; 9574 9575 /** 9576 * How many bytes the automatic storage manager has cleared out. 9577 * 9578 * @hide 9579 */ 9580 @Readable 9581 public static final String AUTOMATIC_STORAGE_MANAGER_BYTES_CLEARED = 9582 "automatic_storage_manager_bytes_cleared"; 9583 9584 /** 9585 * Last run time for the automatic storage manager. 9586 * 9587 * @hide 9588 */ 9589 @Readable 9590 public static final String AUTOMATIC_STORAGE_MANAGER_LAST_RUN = 9591 "automatic_storage_manager_last_run"; 9592 /** 9593 * If the automatic storage manager has been disabled by policy. Note that this doesn't 9594 * mean that the automatic storage manager is prevented from being re-enabled -- this only 9595 * means that it was turned off by policy at least once. 9596 * 9597 * @hide 9598 */ 9599 @Readable 9600 public static final String AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY = 9601 "automatic_storage_manager_turned_off_by_policy"; 9602 9603 /** 9604 * Whether SystemUI navigation keys is enabled. 9605 * @hide 9606 */ 9607 @Readable 9608 public static final String SYSTEM_NAVIGATION_KEYS_ENABLED = 9609 "system_navigation_keys_enabled"; 9610 9611 /** 9612 * Holds comma separated list of ordering of QS tiles. 9613 * 9614 * @hide 9615 */ 9616 @Readable 9617 public static final String QS_TILES = "sysui_qs_tiles"; 9618 9619 /** 9620 * Whether this user has enabled Quick controls. 9621 * 9622 * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as 9623 * enabled. 9624 * 9625 * @deprecated Controls are migrated to Quick Settings, rendering this unnecessary and will 9626 * be removed in a future release. 9627 * @hide 9628 */ 9629 @Readable 9630 @Deprecated 9631 public static final String CONTROLS_ENABLED = "controls_enabled"; 9632 9633 /** 9634 * Whether power menu content (cards, passes, controls) will be shown when device is locked. 9635 * 9636 * 0 indicates hide and 1 indicates show. A non existent value will be treated as hide. 9637 * @hide 9638 */ 9639 @TestApi 9640 @Readable 9641 public static final String POWER_MENU_LOCKED_SHOW_CONTENT = 9642 "power_menu_locked_show_content"; 9643 9644 /** 9645 * Whether home controls should be accessible from the lockscreen 9646 * 9647 * @hide 9648 */ 9649 public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls"; 9650 9651 /** 9652 * Whether wallet should be accessible from the lockscreen 9653 * 9654 * @hide 9655 */ 9656 public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet"; 9657 9658 /** 9659 * Whether to use the lockscreen double-line clock 9660 * 9661 * @hide 9662 */ 9663 public static final String LOCKSCREEN_USE_DOUBLE_LINE_CLOCK = 9664 "lockscreen_use_double_line_clock"; 9665 9666 /** 9667 * Specifies whether the web action API is enabled. 9668 * 9669 * @hide 9670 */ 9671 @SystemApi 9672 @Readable 9673 public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled"; 9674 9675 /** 9676 * Has this pairable device been paired or upgraded from a previously paired system. 9677 * @hide 9678 */ 9679 @Readable 9680 public static final String DEVICE_PAIRED = "device_paired"; 9681 9682 /** 9683 * Specifies additional package name for broadcasting the CMAS messages. 9684 * @hide 9685 */ 9686 @Readable 9687 public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg"; 9688 9689 /** 9690 * Whether the launcher should show any notification badges. 9691 * The value is boolean (1 or 0). 9692 * @hide 9693 */ 9694 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 9695 @TestApi 9696 @Readable 9697 public static final String NOTIFICATION_BADGING = "notification_badging"; 9698 9699 /** 9700 * When enabled the system will maintain a rolling history of received notifications. When 9701 * disabled the history will be disabled and deleted. 9702 * 9703 * The value 1 - enable, 0 - disable 9704 * @hide 9705 */ 9706 @Readable 9707 public static final String NOTIFICATION_HISTORY_ENABLED = "notification_history_enabled"; 9708 9709 /** 9710 * When enabled conversations marked as favorites will be set to bubble. 9711 * 9712 * The value 1 - enable, 0 - disable 9713 * @hide 9714 */ 9715 @Readable 9716 public static final String BUBBLE_IMPORTANT_CONVERSATIONS 9717 = "bubble_important_conversations"; 9718 9719 /** 9720 * When enabled, notifications able to bubble will display an affordance allowing the user 9721 * to bubble them. 9722 * The value is boolean (1 to enable or 0 to disable). 9723 * 9724 * @hide 9725 */ 9726 @TestApi 9727 @SuppressLint("NoSettingsProvider") 9728 @Readable 9729 public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; 9730 9731 /** 9732 * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right 9733 * swipe). 9734 * 9735 * @hide 9736 */ 9737 @Readable 9738 public static final String NOTIFICATION_DISMISS_RTL = "notification_dismiss_rtl"; 9739 9740 /** 9741 * Comma separated list of QS tiles that have been auto-added already. 9742 * @hide 9743 */ 9744 @Readable 9745 public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; 9746 9747 /** 9748 * Backup manager behavioral parameters. 9749 * This is encoded as a key=value list, separated by commas. Ex: 9750 * 9751 * "key_value_backup_interval_milliseconds=14400000,key_value_backup_require_charging=true" 9752 * 9753 * The following keys are supported: 9754 * 9755 * <pre> 9756 * key_value_backup_interval_milliseconds (long) 9757 * key_value_backup_fuzz_milliseconds (long) 9758 * key_value_backup_require_charging (boolean) 9759 * key_value_backup_required_network_type (int) 9760 * full_backup_interval_milliseconds (long) 9761 * full_backup_require_charging (boolean) 9762 * full_backup_required_network_type (int) 9763 * backup_finished_notification_receivers (String[]) 9764 * </pre> 9765 * 9766 * backup_finished_notification_receivers uses ":" as delimeter for values. 9767 * 9768 * <p> 9769 * Type: string 9770 * @hide 9771 */ 9772 @Readable 9773 public static final String BACKUP_MANAGER_CONSTANTS = "backup_manager_constants"; 9774 9775 9776 /** 9777 * Local transport parameters so we can configure it for tests. 9778 * This is encoded as a key=value list, separated by commas. 9779 * 9780 * The following keys are supported: 9781 * 9782 * <pre> 9783 * fake_encryption_flag (boolean) 9784 * </pre> 9785 * 9786 * <p> 9787 * Type: string 9788 * @hide 9789 */ 9790 @Readable 9791 public static final String BACKUP_LOCAL_TRANSPORT_PARAMETERS = 9792 "backup_local_transport_parameters"; 9793 9794 /** 9795 * Flag to set if the system should predictively attempt to re-enable Bluetooth while 9796 * the user is driving. 9797 * @hide 9798 */ 9799 @Readable 9800 public static final String BLUETOOTH_ON_WHILE_DRIVING = "bluetooth_on_while_driving"; 9801 9802 /** 9803 * What behavior should be invoked when the volume hush gesture is triggered 9804 * One of VOLUME_HUSH_OFF, VOLUME_HUSH_VIBRATE, VOLUME_HUSH_MUTE. 9805 * 9806 * @hide 9807 */ 9808 @SystemApi 9809 @Readable 9810 public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture"; 9811 9812 /** @hide */ 9813 @SystemApi 9814 public static final int VOLUME_HUSH_OFF = 0; 9815 /** @hide */ 9816 @SystemApi 9817 public static final int VOLUME_HUSH_VIBRATE = 1; 9818 /** @hide */ 9819 @SystemApi 9820 public static final int VOLUME_HUSH_MUTE = 2; 9821 9822 /** 9823 * The number of times (integer) the user has manually enabled battery saver. 9824 * @hide 9825 */ 9826 @Readable 9827 public static final String LOW_POWER_MANUAL_ACTIVATION_COUNT = 9828 "low_power_manual_activation_count"; 9829 9830 /** 9831 * Whether the "first time battery saver warning" dialog needs to be shown (0: default) 9832 * or not (1). 9833 * 9834 * @hide 9835 */ 9836 @Readable 9837 public static final String LOW_POWER_WARNING_ACKNOWLEDGED = 9838 "low_power_warning_acknowledged"; 9839 9840 /** 9841 * 0 (default) Auto battery saver suggestion has not been suppressed. 1) it has been 9842 * suppressed. 9843 * @hide 9844 */ 9845 @Readable 9846 public static final String SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION = 9847 "suppress_auto_battery_saver_suggestion"; 9848 9849 /** 9850 * List of packages, which data need to be unconditionally cleared before full restore. 9851 * Type: string 9852 * @hide 9853 */ 9854 @Readable 9855 public static final String PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE = 9856 "packages_to_clear_data_before_full_restore"; 9857 9858 /** 9859 * How often to check for location access. 9860 * @hide 9861 */ 9862 @SystemApi 9863 @Readable 9864 public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = 9865 "location_access_check_interval_millis"; 9866 9867 /** 9868 * Delay between granting location access and checking it. 9869 * @hide 9870 */ 9871 @SystemApi 9872 @Readable 9873 public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = 9874 "location_access_check_delay_millis"; 9875 9876 /** 9877 * @deprecated This setting does not have any effect anymore 9878 * @hide 9879 */ 9880 @SystemApi 9881 @Deprecated 9882 @Readable 9883 public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = 9884 "location_permissions_upgrade_to_q_mode"; 9885 9886 /** 9887 * Whether or not the system Auto Revoke feature is disabled. 9888 * @hide 9889 */ 9890 @SystemApi 9891 @Readable 9892 public static final String AUTO_REVOKE_DISABLED = "auto_revoke_disabled"; 9893 9894 /** 9895 * Map of android.theme.customization.* categories to the enabled overlay package for that 9896 * category, formatted as a serialized {@link org.json.JSONObject}. If there is no 9897 * corresponding package included for a category, then all overlay packages in that 9898 * category must be disabled. 9899 * @hide 9900 */ 9901 @SystemApi 9902 @Readable 9903 public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES = 9904 "theme_customization_overlay_packages"; 9905 9906 /** 9907 * Navigation bar mode. 9908 * 0 = 3 button 9909 * 1 = 2 button 9910 * 2 = fully gestural 9911 * @hide 9912 */ 9913 @Readable 9914 public static final String NAVIGATION_MODE = 9915 "navigation_mode"; 9916 9917 /** 9918 * Scale factor for the back gesture inset size on the left side of the screen. 9919 * @hide 9920 */ 9921 @Readable 9922 public static final String BACK_GESTURE_INSET_SCALE_LEFT = 9923 "back_gesture_inset_scale_left"; 9924 9925 /** 9926 * Scale factor for the back gesture inset size on the right side of the screen. 9927 * @hide 9928 */ 9929 @Readable 9930 public static final String BACK_GESTURE_INSET_SCALE_RIGHT = 9931 "back_gesture_inset_scale_right"; 9932 9933 /** 9934 * Current provider of proximity-based sharing services. 9935 * Default value in @string/config_defaultNearbySharingComponent. 9936 * No VALIDATOR as this setting will not be backed up. 9937 * @hide 9938 */ 9939 @Readable 9940 public static final String NEARBY_SHARING_COMPONENT = "nearby_sharing_component"; 9941 9942 /** 9943 * Controls whether aware is enabled. 9944 * @hide 9945 */ 9946 @Readable 9947 public static final String AWARE_ENABLED = "aware_enabled"; 9948 9949 /** 9950 * Controls whether aware_lock is enabled. 9951 * @hide 9952 */ 9953 @Readable 9954 public static final String AWARE_LOCK_ENABLED = "aware_lock_enabled"; 9955 9956 /** 9957 * Controls whether tap gesture is enabled. 9958 * @hide 9959 */ 9960 @Readable 9961 public static final String TAP_GESTURE = "tap_gesture"; 9962 9963 /** 9964 * Controls whether the people strip is enabled. 9965 * @hide 9966 */ 9967 @Readable 9968 public static final String PEOPLE_STRIP = "people_strip"; 9969 9970 /** 9971 * Whether or not to enable media resumption 9972 * When enabled, media controls in quick settings will populate on boot and persist if 9973 * resumable via a MediaBrowserService. 9974 * @see Settings.Global#SHOW_MEDIA_ON_QUICK_SETTINGS 9975 * @hide 9976 */ 9977 @Readable 9978 public static final String MEDIA_CONTROLS_RESUME = "qs_media_resumption"; 9979 9980 /** 9981 * Controls whether contextual suggestions can be shown in the media controls. 9982 * @hide 9983 */ 9984 public static final String MEDIA_CONTROLS_RECOMMENDATION = "qs_media_recommend"; 9985 9986 /** 9987 * Controls magnification mode when magnification is enabled via a system-wide triple tap 9988 * gesture or the accessibility shortcut. 9989 * 9990 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN 9991 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW 9992 * @hide 9993 */ 9994 @TestApi 9995 @Readable 9996 public static final String ACCESSIBILITY_MAGNIFICATION_MODE = 9997 "accessibility_magnification_mode"; 9998 9999 /** 10000 * Magnification mode value that is a default value for the magnification logging feature. 10001 * @hide 10002 */ 10003 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_NONE = 0x0; 10004 10005 /** 10006 * Magnification mode value that magnifies whole display. 10007 * @hide 10008 */ 10009 @TestApi 10010 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN = 0x1; 10011 10012 /** 10013 * Magnification mode value that magnifies magnify particular region in a window 10014 * @hide 10015 */ 10016 @TestApi 10017 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW = 0x2; 10018 10019 /** 10020 * Magnification mode value that is capable of magnifying whole display and particular 10021 * region in a window. 10022 * @hide 10023 */ 10024 @TestApi 10025 public static final int ACCESSIBILITY_MAGNIFICATION_MODE_ALL = 0x3; 10026 10027 /** 10028 * Controls magnification capability. Accessibility magnification is capable of at least one 10029 * of the magnification modes. 10030 * 10031 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN 10032 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW 10033 * @see #ACCESSIBILITY_MAGNIFICATION_MODE_ALL 10034 * @hide 10035 */ 10036 @TestApi 10037 @Readable 10038 public static final String ACCESSIBILITY_MAGNIFICATION_CAPABILITY = 10039 "accessibility_magnification_capability"; 10040 10041 /** 10042 * Whether to show the window magnification prompt dialog when the user uses full-screen 10043 * magnification first time after database is upgraded. 10044 * 10045 * @hide 10046 */ 10047 public static final String ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT = 10048 "accessibility_show_window_magnification_prompt"; 10049 10050 /** 10051 * Controls the accessibility button mode. System will force-set the value to {@link 10052 * #ACCESSIBILITY_BUTTON_MODE_GESTURE} if {@link #NAVIGATION_MODE} is button; force-set the 10053 * value to {@link ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR} if {@link #NAVIGATION_MODE} is 10054 * gestural; otherwise, remain the option. 10055 * <ul> 10056 * <li> 0 = button in navigation bar </li> 10057 * <li> 1 = button floating on the display </li> 10058 * <li> 2 = button using gesture to trigger </li> 10059 * </ul> 10060 * 10061 * @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR 10062 * @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU 10063 * @see #ACCESSIBILITY_BUTTON_MODE_GESTURE 10064 * @hide 10065 */ 10066 public static final String ACCESSIBILITY_BUTTON_MODE = 10067 "accessibility_button_mode"; 10068 10069 /** 10070 * Accessibility button mode value that specifying the accessibility service or feature to 10071 * be toggled via the button in the navigation bar. 10072 * 10073 * @hide 10074 */ 10075 public static final int ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR = 0x0; 10076 10077 /** 10078 * Accessibility button mode value that specifying the accessibility service or feature to 10079 * be toggled via the button floating on the display. 10080 * 10081 * @hide 10082 */ 10083 public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1; 10084 10085 /** 10086 * Accessibility button mode value that specifying the accessibility service or feature to 10087 * be toggled via the gesture. 10088 * 10089 * @hide 10090 */ 10091 public static final int ACCESSIBILITY_BUTTON_MODE_GESTURE = 0x2; 10092 10093 /** 10094 * The size of the accessibility floating menu. 10095 * <ul> 10096 * <li> 0 = small size 10097 * <li> 1 = large size 10098 * </ul> 10099 * 10100 * @hide 10101 */ 10102 public static final String ACCESSIBILITY_FLOATING_MENU_SIZE = 10103 "accessibility_floating_menu_size"; 10104 10105 /** 10106 * The icon type of the accessibility floating menu. 10107 * <ul> 10108 * <li> 0 = full circle type 10109 * <li> 1 = half circle type 10110 * </ul> 10111 * 10112 * @hide 10113 */ 10114 public static final String ACCESSIBILITY_FLOATING_MENU_ICON_TYPE = 10115 "accessibility_floating_menu_icon_type"; 10116 10117 /** 10118 * Whether the fade effect for the accessibility floating menu is enabled. 10119 * 10120 * @hide 10121 */ 10122 public static final String ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED = 10123 "accessibility_floating_menu_fade_enabled"; 10124 10125 /** 10126 * The opacity value for the accessibility floating menu fade out effect, from 0.0 10127 * (transparent) to 1.0 (opaque). 10128 * 10129 * @hide 10130 */ 10131 public static final String ACCESSIBILITY_FLOATING_MENU_OPACITY = 10132 "accessibility_floating_menu_opacity"; 10133 10134 /** 10135 * Prompts the user to the Accessibility button is replaced with the floating menu. 10136 * <ul> 10137 * <li> 0 = disabled </li> 10138 * <li> 1 = enabled </li> 10139 * </ul> 10140 * 10141 * @hide 10142 */ 10143 public static final String ACCESSIBILITY_FLOATING_MENU_MIGRATION_TOOLTIP_PROMPT = 10144 "accessibility_floating_menu_migration_tooltip_prompt"; 10145 10146 /** 10147 * Whether the Adaptive connectivity option is enabled. 10148 * 10149 * @hide 10150 */ 10151 public static final String ADAPTIVE_CONNECTIVITY_ENABLED = "adaptive_connectivity_enabled"; 10152 10153 /** 10154 * Keys we no longer back up under the current schema, but want to continue to 10155 * process when restoring historical backup datasets. 10156 * 10157 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 10158 * otherwise they won't be restored. 10159 * 10160 * @hide 10161 */ 10162 @Readable 10163 public static final String[] LEGACY_RESTORE_SETTINGS = { 10164 ENABLED_NOTIFICATION_LISTENERS, 10165 ENABLED_NOTIFICATION_ASSISTANT, 10166 ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES 10167 }; 10168 10169 /** 10170 * How long Assistant handles have enabled in milliseconds. 10171 * 10172 * @hide 10173 */ 10174 public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS = 10175 "reminder_exp_learning_time_elapsed"; 10176 10177 /** 10178 * How many times the Assistant has been triggered using the touch gesture. 10179 * 10180 * @hide 10181 */ 10182 public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT = 10183 "reminder_exp_learning_event_count"; 10184 10185 /** 10186 * Whether to show clipboard access notifications. 10187 * 10188 * @hide 10189 */ 10190 public static final String CLIPBOARD_SHOW_ACCESS_NOTIFICATIONS = 10191 "clipboard_show_access_notifications"; 10192 10193 /** 10194 * If nonzero, nas has not been updated to reflect new changes. 10195 * @hide 10196 */ 10197 @Readable 10198 public static final String NAS_SETTINGS_UPDATED = "nas_settings_updated"; 10199 10200 /** 10201 * Control whether Game Dashboard shortcut is always on for all games. 10202 * @hide 10203 */ 10204 @Readable 10205 public static final String GAME_DASHBOARD_ALWAYS_ON = "game_dashboard_always_on"; 10206 10207 10208 /** 10209 * For this device state, no specific auto-rotation lock setting should be applied. 10210 * If the user toggles the auto-rotate lock in this state, the setting will apply to the 10211 * previously valid device state. 10212 * @hide 10213 */ 10214 public static final int DEVICE_STATE_ROTATION_LOCK_IGNORED = 0; 10215 /** 10216 * For this device state, the setting for auto-rotation is locked. 10217 * @hide 10218 */ 10219 public static final int DEVICE_STATE_ROTATION_LOCK_LOCKED = 1; 10220 /** 10221 * For this device state, the setting for auto-rotation is unlocked. 10222 * @hide 10223 */ 10224 public static final int DEVICE_STATE_ROTATION_LOCK_UNLOCKED = 2; 10225 10226 /** 10227 * The different settings that can be used as values with 10228 * {@link #DEVICE_STATE_ROTATION_LOCK}. 10229 * @hide 10230 */ 10231 @IntDef(prefix = {"DEVICE_STATE_ROTATION_LOCK_"}, value = { 10232 DEVICE_STATE_ROTATION_LOCK_IGNORED, 10233 DEVICE_STATE_ROTATION_LOCK_LOCKED, 10234 DEVICE_STATE_ROTATION_LOCK_UNLOCKED, 10235 }) 10236 @Retention(RetentionPolicy.SOURCE) 10237 @interface DeviceStateRotationLockSetting { 10238 } 10239 10240 /** 10241 * Rotation lock setting keyed on device state. 10242 * 10243 * This holds a serialized map using int keys that represent Device States and value of 10244 * {@link DeviceStateRotationLockSetting} representing the rotation lock setting for that 10245 * device state. 10246 * 10247 * Serialized as key0:value0:key1:value1:...:keyN:valueN. 10248 * 10249 * Example: "0:1:1:2:2:1" 10250 * This example represents a map of: 10251 * <ul> 10252 * <li>0 -> DEVICE_STATE_ROTATION_LOCK_LOCKED</li> 10253 * <li>1 -> DEVICE_STATE_ROTATION_LOCK_UNLOCKED</li> 10254 * <li>2 -> DEVICE_STATE_ROTATION_LOCK_IGNORED</li> 10255 * </ul> 10256 * 10257 * @hide 10258 */ 10259 public static final String DEVICE_STATE_ROTATION_LOCK = 10260 "device_state_rotation_lock"; 10261 10262 /** 10263 * These entries are considered common between the personal and the managed profile, 10264 * since the managed profile doesn't get to change them. 10265 */ 10266 private static final Set<String> CLONE_TO_MANAGED_PROFILE = new ArraySet<>(); 10267 10268 static { 10269 CLONE_TO_MANAGED_PROFILE.add(ACCESSIBILITY_ENABLED); 10270 CLONE_TO_MANAGED_PROFILE.add(ALLOW_MOCK_LOCATION); 10271 CLONE_TO_MANAGED_PROFILE.add(ALLOWED_GEOLOCATION_ORIGINS); 10272 CLONE_TO_MANAGED_PROFILE.add(CONTENT_CAPTURE_ENABLED); 10273 CLONE_TO_MANAGED_PROFILE.add(ENABLED_ACCESSIBILITY_SERVICES); 10274 CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER); 10275 CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE); 10276 CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD); 10277 CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES); 10278 } 10279 10280 /** @hide */ getCloneToManagedProfileSettings(Set<String> outKeySet)10281 public static void getCloneToManagedProfileSettings(Set<String> outKeySet) { 10282 outKeySet.addAll(CLONE_TO_MANAGED_PROFILE); 10283 } 10284 10285 /** 10286 * Secure settings which can be accessed by instant apps. 10287 * @hide 10288 */ 10289 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 10290 static { 10291 INSTANT_APP_SETTINGS.add(ENABLED_ACCESSIBILITY_SERVICES); 10292 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_SPEAK_PASSWORD); 10293 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_INVERSION_ENABLED); 10294 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_ENABLED); 10295 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_PRESET); 10296 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_TYPE); 10297 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_EDGE_COLOR); 10298 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_LOCALE); 10299 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR); 10300 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FOREGROUND_COLOR); 10301 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_TYPEFACE); 10302 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_FONT_SCALE); 10303 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_CAPTIONING_WINDOW_COLOR); 10304 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED); 10305 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_DISPLAY_DALTONIZER); 10306 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_DELAY); 10307 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_AUTOCLICK_ENABLED); 10308 INSTANT_APP_SETTINGS.add(ACCESSIBILITY_LARGE_POINTER_ICON); 10309 10310 INSTANT_APP_SETTINGS.add(DEFAULT_INPUT_METHOD); 10311 INSTANT_APP_SETTINGS.add(ENABLED_INPUT_METHODS); 10312 10313 INSTANT_APP_SETTINGS.add(ANDROID_ID); 10314 10315 INSTANT_APP_SETTINGS.add(ALLOW_MOCK_LOCATION); 10316 } 10317 10318 /** 10319 * Helper method for determining if a location provider is enabled. 10320 * 10321 * @param cr the content resolver to use 10322 * @param provider the location provider to query 10323 * @return true if the provider is enabled 10324 * 10325 * @deprecated use {@link LocationManager#isProviderEnabled(String)} 10326 */ 10327 @Deprecated isLocationProviderEnabled(ContentResolver cr, String provider)10328 public static boolean isLocationProviderEnabled(ContentResolver cr, String provider) { 10329 IBinder binder = ServiceManager.getService(Context.LOCATION_SERVICE); 10330 ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface(binder)); 10331 try { 10332 return lm.isProviderEnabledForUser(provider, cr.getUserId()); 10333 } catch (RemoteException e) { 10334 throw e.rethrowFromSystemServer(); 10335 } 10336 } 10337 10338 /** 10339 * Thread-safe method for enabling or disabling a single location provider. This will have 10340 * no effect on Android Q and above. 10341 * @param cr the content resolver to use 10342 * @param provider the location provider to enable or disable 10343 * @param enabled true if the provider should be enabled 10344 * @deprecated This API is deprecated 10345 */ 10346 @Deprecated setLocationProviderEnabled(ContentResolver cr, String provider, boolean enabled)10347 public static void setLocationProviderEnabled(ContentResolver cr, 10348 String provider, boolean enabled) { 10349 } 10350 } 10351 10352 /** 10353 * Global system settings, containing preferences that always apply identically 10354 * to all defined users. Applications can read these but are not allowed to write; 10355 * like the "Secure" settings, these are for preferences that the user must 10356 * explicitly modify through the system UI or specialized APIs for those values. 10357 */ 10358 public static final class Global extends NameValueTable { 10359 // NOTE: If you add new settings here, be sure to add them to 10360 // com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoGlobalSettingsLocked. 10361 10362 /** 10363 * The content:// style URL for global secure settings items. Not public. 10364 */ 10365 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global"); 10366 10367 /** 10368 * Whether the notification bubbles are globally enabled 10369 * The value is boolean (1 or 0). 10370 * @hide 10371 * @deprecated moved to secure settings. 10372 */ 10373 @Deprecated 10374 @TestApi 10375 @Readable 10376 public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; 10377 10378 /** 10379 * Whether users are allowed to add more users or guest from lockscreen. 10380 * <p> 10381 * Type: int 10382 * @hide 10383 */ 10384 @Readable 10385 public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked"; 10386 10387 /** 10388 * Whether applying ramping ringer on incoming phone call ringtone. 10389 * <p>1 = apply ramping ringer 10390 * <p>0 = do not apply ramping ringer 10391 */ 10392 @Readable 10393 public static final String APPLY_RAMPING_RINGER = "apply_ramping_ringer"; 10394 10395 /** 10396 * Setting whether the global gesture for enabling accessibility is enabled. 10397 * If this gesture is enabled the user will be able to perfrom it to enable 10398 * the accessibility state without visiting the settings app. 10399 * 10400 * @hide 10401 * No longer used. Should be removed once all dependencies have been updated. 10402 */ 10403 @UnsupportedAppUsage 10404 @Readable 10405 public static final String ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED = 10406 "enable_accessibility_global_gesture_enabled"; 10407 10408 /** 10409 * Whether Airplane Mode is on. 10410 */ 10411 @Readable 10412 public static final String AIRPLANE_MODE_ON = "airplane_mode_on"; 10413 10414 /** 10415 * Whether Theater Mode is on. 10416 * {@hide} 10417 */ 10418 @SystemApi 10419 @Readable 10420 public static final String THEATER_MODE_ON = "theater_mode_on"; 10421 10422 /** 10423 * Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio. 10424 */ 10425 @Readable 10426 public static final String RADIO_BLUETOOTH = "bluetooth"; 10427 10428 /** 10429 * Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio. 10430 */ 10431 @Readable 10432 public static final String RADIO_WIFI = "wifi"; 10433 10434 /** 10435 * {@hide} 10436 */ 10437 @Readable 10438 public static final String RADIO_WIMAX = "wimax"; 10439 /** 10440 * Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. 10441 */ 10442 @Readable 10443 public static final String RADIO_CELL = "cell"; 10444 10445 /** 10446 * Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio. 10447 */ 10448 @Readable 10449 public static final String RADIO_NFC = "nfc"; 10450 10451 /** 10452 * A comma separated list of radios that need to be disabled when airplane mode 10453 * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are 10454 * included in the comma separated list. 10455 */ 10456 @Readable 10457 public static final String AIRPLANE_MODE_RADIOS = "airplane_mode_radios"; 10458 10459 /** 10460 * A comma separated list of radios that should to be disabled when airplane mode 10461 * is on, but can be manually reenabled by the user. For example, if RADIO_WIFI is 10462 * added to both AIRPLANE_MODE_RADIOS and AIRPLANE_MODE_TOGGLEABLE_RADIOS, then Wifi 10463 * will be turned off when entering airplane mode, but the user will be able to reenable 10464 * Wifi in the Settings app. 10465 * @hide 10466 */ 10467 @SystemApi 10468 @Readable 10469 public static final String AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios"; 10470 10471 /** 10472 * An integer representing the Bluetooth Class of Device (CoD). 10473 * 10474 * @hide 10475 */ 10476 @Readable 10477 public static final String BLUETOOTH_CLASS_OF_DEVICE = "bluetooth_class_of_device"; 10478 10479 /** 10480 * A Long representing a bitmap of profiles that should be disabled when bluetooth starts. 10481 * See {@link android.bluetooth.BluetoothProfile}. 10482 * {@hide} 10483 */ 10484 @Readable 10485 public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles"; 10486 10487 /** 10488 * A semi-colon separated list of Bluetooth interoperability workarounds. 10489 * Each entry is a partial Bluetooth device address string and an integer representing 10490 * the feature to be disabled, separated by a comma. The integer must correspond 10491 * to a interoperability feature as defined in "interop.h" in /system/bt. 10492 * <p> 10493 * Example: <br/> 10494 * "00:11:22,0;01:02:03:04,2" 10495 * @hide 10496 */ 10497 @Readable 10498 public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list"; 10499 10500 /** 10501 * The policy for deciding when Wi-Fi should go to sleep (which will in 10502 * turn switch to using the mobile data as an Internet connection). 10503 * <p> 10504 * Set to one of {@link #WIFI_SLEEP_POLICY_DEFAULT}, 10505 * {@link #WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED}, or 10506 * {@link #WIFI_SLEEP_POLICY_NEVER}. 10507 * @deprecated This is no longer used or set by the platform. 10508 */ 10509 @Deprecated 10510 @Readable 10511 public static final String WIFI_SLEEP_POLICY = "wifi_sleep_policy"; 10512 10513 /** 10514 * Value for {@link #WIFI_SLEEP_POLICY} to use the default Wi-Fi sleep 10515 * policy, which is to sleep shortly after the turning off 10516 * according to the {@link #STAY_ON_WHILE_PLUGGED_IN} setting. 10517 * @deprecated This is no longer used by the platform. 10518 */ 10519 @Deprecated 10520 public static final int WIFI_SLEEP_POLICY_DEFAULT = 0; 10521 10522 /** 10523 * Value for {@link #WIFI_SLEEP_POLICY} to use the default policy when 10524 * the device is on battery, and never go to sleep when the device is 10525 * plugged in. 10526 * @deprecated This is no longer used by the platform. 10527 */ 10528 @Deprecated 10529 public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED = 1; 10530 10531 /** 10532 * Value for {@link #WIFI_SLEEP_POLICY} to never go to sleep. 10533 * @deprecated This is no longer used by the platform. 10534 */ 10535 @Deprecated 10536 public static final int WIFI_SLEEP_POLICY_NEVER = 2; 10537 10538 /** 10539 * Value to specify if the device's UTC system clock should be set automatically, e.g. using 10540 * telephony signals like NITZ, or other sources like GNSS or NTP. 1=yes, 0=no (manual) 10541 */ 10542 @Readable 10543 public static final String AUTO_TIME = "auto_time"; 10544 10545 /** 10546 * Value to specify if the device's time zone system property should be set automatically, 10547 * e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location. 10548 * 1=yes, 0=no (manual). 10549 */ 10550 @Readable 10551 public static final String AUTO_TIME_ZONE = "auto_time_zone"; 10552 10553 /** 10554 * URI for the car dock "in" event sound. 10555 * @hide 10556 */ 10557 @Readable 10558 public static final String CAR_DOCK_SOUND = "car_dock_sound"; 10559 10560 /** 10561 * URI for the car dock "out" event sound. 10562 * @hide 10563 */ 10564 @Readable 10565 public static final String CAR_UNDOCK_SOUND = "car_undock_sound"; 10566 10567 /** 10568 * URI for the desk dock "in" event sound. 10569 * @hide 10570 */ 10571 @Readable 10572 public static final String DESK_DOCK_SOUND = "desk_dock_sound"; 10573 10574 /** 10575 * URI for the desk dock "out" event sound. 10576 * @hide 10577 */ 10578 @Readable 10579 public static final String DESK_UNDOCK_SOUND = "desk_undock_sound"; 10580 10581 /** 10582 * Whether to play a sound for dock events. 10583 * @hide 10584 */ 10585 @Readable 10586 public static final String DOCK_SOUNDS_ENABLED = "dock_sounds_enabled"; 10587 10588 /** 10589 * Whether to play a sound for dock events, only when an accessibility service is on. 10590 * @hide 10591 */ 10592 @Readable 10593 public static final String DOCK_SOUNDS_ENABLED_WHEN_ACCESSIBILITY = "dock_sounds_enabled_when_accessbility"; 10594 10595 /** 10596 * URI for the "device locked" (keyguard shown) sound. 10597 * @hide 10598 */ 10599 @Readable 10600 public static final String LOCK_SOUND = "lock_sound"; 10601 10602 /** 10603 * URI for the "device unlocked" sound. 10604 * @hide 10605 */ 10606 @Readable 10607 public static final String UNLOCK_SOUND = "unlock_sound"; 10608 10609 /** 10610 * URI for the "device is trusted" sound, which is played when the device enters the trusted 10611 * state without unlocking. 10612 * @hide 10613 */ 10614 @Readable 10615 public static final String TRUSTED_SOUND = "trusted_sound"; 10616 10617 /** 10618 * URI for the low battery sound file. 10619 * @hide 10620 */ 10621 @Readable 10622 public static final String LOW_BATTERY_SOUND = "low_battery_sound"; 10623 10624 /** 10625 * Whether to play a sound for low-battery alerts. 10626 * @hide 10627 */ 10628 @Readable 10629 public static final String POWER_SOUNDS_ENABLED = "power_sounds_enabled"; 10630 10631 /** 10632 * URI for the "wireless charging started" sound. 10633 * @hide 10634 */ 10635 @Readable 10636 public static final String WIRELESS_CHARGING_STARTED_SOUND = 10637 "wireless_charging_started_sound"; 10638 10639 /** 10640 * URI for "wired charging started" sound. 10641 * @hide 10642 */ 10643 @Readable 10644 public static final String CHARGING_STARTED_SOUND = "charging_started_sound"; 10645 10646 /** 10647 * Whether to play a sound for charging events. 10648 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_SOUNDS_ENABLED} instead 10649 * @hide 10650 */ 10651 @Deprecated 10652 public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled"; 10653 10654 /** 10655 * Whether to vibrate for wireless charging events. 10656 * @deprecated Use {@link android.provider.Settings.Secure#CHARGING_VIBRATION_ENABLED} 10657 * @hide 10658 */ 10659 @Deprecated 10660 public static final String CHARGING_VIBRATION_ENABLED = "charging_vibration_enabled"; 10661 10662 /** 10663 * Whether we keep the device on while the device is plugged in. 10664 * Supported values are: 10665 * <ul> 10666 * <li>{@code 0} to never stay on while plugged in</li> 10667 * <li>{@link BatteryManager#BATTERY_PLUGGED_AC} to stay on for AC charger</li> 10668 * <li>{@link BatteryManager#BATTERY_PLUGGED_USB} to stay on for USB charger</li> 10669 * <li>{@link BatteryManager#BATTERY_PLUGGED_WIRELESS} to stay on for wireless charger</li> 10670 * </ul> 10671 * These values can be OR-ed together. 10672 */ 10673 @Readable 10674 public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; 10675 10676 /** 10677 * When the user has enable the option to have a "bug report" command 10678 * in the power menu. 10679 * @hide 10680 */ 10681 @Readable 10682 public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; 10683 10684 /** 10685 * The package name for the custom bugreport handler app. This app must be whitelisted. 10686 * This is currently used only by Power Menu short press. 10687 * 10688 * @hide 10689 */ 10690 @Readable 10691 public static final String CUSTOM_BUGREPORT_HANDLER_APP = "custom_bugreport_handler_app"; 10692 10693 /** 10694 * The user id for the custom bugreport handler app. This is currently used only by Power 10695 * Menu short press. 10696 * 10697 * @hide 10698 */ 10699 @Readable 10700 public static final String CUSTOM_BUGREPORT_HANDLER_USER = "custom_bugreport_handler_user"; 10701 10702 /** 10703 * Whether ADB over USB is enabled. 10704 */ 10705 @Readable 10706 public static final String ADB_ENABLED = "adb_enabled"; 10707 10708 /** 10709 * Whether ADB over Wifi is enabled. 10710 * @hide 10711 */ 10712 @Readable 10713 public static final String ADB_WIFI_ENABLED = "adb_wifi_enabled"; 10714 10715 /** 10716 * Whether Views are allowed to save their attribute data. 10717 * @hide 10718 */ 10719 @Readable 10720 public static final String DEBUG_VIEW_ATTRIBUTES = "debug_view_attributes"; 10721 10722 /** 10723 * Which application package is allowed to save View attribute data. 10724 * @hide 10725 */ 10726 @Readable 10727 public static final String DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE = 10728 "debug_view_attributes_application_package"; 10729 10730 /** 10731 * Whether assisted GPS should be enabled or not. 10732 * @hide 10733 */ 10734 @Readable 10735 public static final String ASSISTED_GPS_ENABLED = "assisted_gps_enabled"; 10736 10737 /** 10738 * Whether bluetooth is enabled/disabled 10739 * 0=disabled. 1=enabled. 10740 */ 10741 @Readable 10742 public static final String BLUETOOTH_ON = "bluetooth_on"; 10743 10744 /** 10745 * CDMA Cell Broadcast SMS 10746 * 0 = CDMA Cell Broadcast SMS disabled 10747 * 1 = CDMA Cell Broadcast SMS enabled 10748 * @hide 10749 */ 10750 @Readable 10751 public static final String CDMA_CELL_BROADCAST_SMS = 10752 "cdma_cell_broadcast_sms"; 10753 10754 /** 10755 * The CDMA roaming mode 0 = Home Networks, CDMA default 10756 * 1 = Roaming on Affiliated networks 10757 * 2 = Roaming on any networks 10758 * @hide 10759 */ 10760 @Readable 10761 public static final String CDMA_ROAMING_MODE = "roaming_settings"; 10762 10763 /** 10764 * The CDMA subscription mode 0 = RUIM/SIM (default) 10765 * 1 = NV 10766 * @hide 10767 */ 10768 @Readable 10769 public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode"; 10770 10771 /** 10772 * The default value for whether background data is enabled or not. 10773 * 10774 * Used by {@code NetworkPolicyManagerService}. 10775 * 10776 * @hide 10777 */ 10778 @Readable 10779 public static final String DEFAULT_RESTRICT_BACKGROUND_DATA = 10780 "default_restrict_background_data"; 10781 10782 /** Inactivity timeout to track mobile data activity. 10783 * 10784 * If set to a positive integer, it indicates the inactivity timeout value in seconds to 10785 * infer the data activity of mobile network. After a period of no activity on mobile 10786 * networks with length specified by the timeout, an {@code ACTION_DATA_ACTIVITY_CHANGE} 10787 * intent is fired to indicate a transition of network status from "active" to "idle". Any 10788 * subsequent activity on mobile networks triggers the firing of {@code 10789 * ACTION_DATA_ACTIVITY_CHANGE} intent indicating transition from "idle" to "active". 10790 * 10791 * Network activity refers to transmitting or receiving data on the network interfaces. 10792 * 10793 * Tracking is disabled if set to zero or negative value. 10794 * 10795 * @hide 10796 */ 10797 @Readable 10798 public static final String DATA_ACTIVITY_TIMEOUT_MOBILE = "data_activity_timeout_mobile"; 10799 10800 /** Timeout to tracking Wifi data activity. Same as {@code DATA_ACTIVITY_TIMEOUT_MOBILE} 10801 * but for Wifi network. 10802 * @hide 10803 */ 10804 @Readable 10805 public static final String DATA_ACTIVITY_TIMEOUT_WIFI = "data_activity_timeout_wifi"; 10806 10807 /** 10808 * Whether or not data roaming is enabled. (0 = false, 1 = true) 10809 */ 10810 @Readable 10811 public static final String DATA_ROAMING = "data_roaming"; 10812 10813 /** 10814 * The value passed to a Mobile DataConnection via bringUp which defines the 10815 * number of retries to perform when setting up the initial connection. The default 10816 * value defined in DataConnectionTrackerBase#DEFAULT_MDC_INITIAL_RETRY is currently 1. 10817 * @hide 10818 */ 10819 @Readable 10820 public static final String MDC_INITIAL_MAX_RETRY = "mdc_initial_max_retry"; 10821 10822 /** 10823 * Whether any package can be on external storage. When this is true, any 10824 * package, regardless of manifest values, is a candidate for installing 10825 * or moving onto external storage. (0 = false, 1 = true) 10826 * @hide 10827 */ 10828 @Readable 10829 public static final String FORCE_ALLOW_ON_EXTERNAL = "force_allow_on_external"; 10830 10831 /** 10832 * The default SM-DP+ configured for this device. 10833 * 10834 * <p>An SM-DP+ is used by an LPA (see {@link android.service.euicc.EuiccService}) to 10835 * download profiles. If this value is set, the LPA will query this server for any profiles 10836 * available to this device. If any are available, they may be downloaded during device 10837 * provisioning or in settings without needing the user to enter an activation code. 10838 * 10839 * @see android.service.euicc.EuiccService 10840 * @hide 10841 */ 10842 @SystemApi 10843 @Readable 10844 public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus"; 10845 10846 /** 10847 * Whether any profile has ever been downloaded onto a eUICC on the device. 10848 * 10849 * <p>Used to hide eUICC UI from users who have never made use of it and would only be 10850 * confused by seeing references to it in settings. 10851 * (0 = false, 1 = true) 10852 * @hide 10853 */ 10854 @SystemApi 10855 @Readable 10856 public static final String EUICC_PROVISIONED = "euicc_provisioned"; 10857 10858 /** 10859 * List of ISO country codes in which eUICC UI is shown. Country codes should be separated 10860 * by comma. 10861 * 10862 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 10863 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 10864 * 10865 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 10866 * support eUICC. 10867 * 10868 * @hide 10869 */ 10870 @SystemApi 10871 @Readable 10872 public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries"; 10873 10874 /** 10875 * List of ISO country codes in which eUICC UI is not shown. Country codes should be 10876 * separated by comma. 10877 * 10878 * Note: if {@link #EUICC_SUPPORTED_COUNTRIES} is empty, then {@link 10879 * #EUICC_UNSUPPORTED_COUNTRIES} is used. 10880 * 10881 * <p>Used to hide eUICC UI from users who are currently in countries where no carriers 10882 * support eUICC. 10883 * 10884 * @hide 10885 */ 10886 @SystemApi 10887 @Readable 10888 public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries"; 10889 10890 /** 10891 * Whether any activity can be resized. When this is true, any 10892 * activity, regardless of manifest values, can be resized for multi-window. 10893 * (0 = false, 1 = true) 10894 * @hide 10895 */ 10896 @Readable 10897 public static final String DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES 10898 = "force_resizable_activities"; 10899 10900 /** 10901 * Whether to enable experimental freeform support for windows. 10902 * @hide 10903 */ 10904 @Readable 10905 public static final String DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT 10906 = "enable_freeform_support"; 10907 10908 /** 10909 * Whether to enable experimental desktop mode on secondary displays. 10910 * @hide 10911 */ 10912 @Readable 10913 public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS = 10914 "force_desktop_mode_on_external_displays"; 10915 10916 /** 10917 * Whether to allow non-resizable apps to be shown in multi-window. The app will be 10918 * letterboxed if the request orientation is not met, and will be shown in size-compat 10919 * mode if the container size has changed. 10920 * @hide 10921 */ 10922 @TestApi 10923 @Readable 10924 @SuppressLint("NoSettingsProvider") 10925 public static final String DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW = 10926 "enable_non_resizable_multi_window"; 10927 10928 /** 10929 * If true, shadows drawn around the window will be rendered by the system compositor. If 10930 * false, shadows will be drawn by the client by setting an elevation on the root view and 10931 * the contents will be inset by the surface insets. 10932 * (0 = false, 1 = true) 10933 * @hide 10934 */ 10935 @Readable 10936 public static final String DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR = 10937 "render_shadows_in_compositor"; 10938 10939 /** 10940 * If true, submit buffers using blast in ViewRootImpl. 10941 * (0 = false, 1 = true) 10942 * @hide 10943 */ 10944 @Readable 10945 public static final String DEVELOPMENT_USE_BLAST_ADAPTER_VR = 10946 "use_blast_adapter_vr"; 10947 10948 /** 10949 * If true, submit buffers using blast in SurfaceView. 10950 * (0 = false, 1 = true) 10951 * @hide 10952 */ 10953 @Readable 10954 public static final String DEVELOPMENT_USE_BLAST_ADAPTER_SV = 10955 "use_blast_adapter_sv"; 10956 10957 /** 10958 * Path to the WindowManager display settings file. If unset, the default file path will 10959 * be used. 10960 * 10961 * @hide 10962 */ 10963 public static final String DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH = 10964 "wm_display_settings_path"; 10965 10966 /** 10967 * Whether user has enabled development settings. 10968 */ 10969 @Readable 10970 public static final String DEVELOPMENT_SETTINGS_ENABLED = "development_settings_enabled"; 10971 10972 /** 10973 * Whether the device has been provisioned (0 = false, 1 = true). 10974 * <p>On a multiuser device with a separate system user, the screen may be locked 10975 * as soon as this is set to true and further activities cannot be launched on the 10976 * system user unless they are marked to show over keyguard. 10977 */ 10978 @Readable 10979 public static final String DEVICE_PROVISIONED = "device_provisioned"; 10980 10981 /** 10982 * Indicates whether mobile data should be allowed while the device is being provisioned. 10983 * This allows the provisioning process to turn off mobile data before the user 10984 * has an opportunity to set things up, preventing other processes from burning 10985 * precious bytes before wifi is setup. 10986 * <p> 10987 * Type: int (0 for false, 1 for true) 10988 * 10989 * @hide 10990 */ 10991 @SystemApi 10992 @Readable 10993 public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = 10994 "device_provisioning_mobile_data"; 10995 10996 /** 10997 * The saved value for WindowManagerService.setForcedDisplaySize(). 10998 * Two integers separated by a comma. If unset, then use the real display size. 10999 * @hide 11000 */ 11001 @Readable 11002 public static final String DISPLAY_SIZE_FORCED = "display_size_forced"; 11003 11004 /** 11005 * The saved value for WindowManagerService.setForcedDisplayScalingMode(). 11006 * 0 or unset if scaling is automatic, 1 if scaling is disabled. 11007 * @hide 11008 */ 11009 @Readable 11010 public static final String DISPLAY_SCALING_FORCE = "display_scaling_force"; 11011 11012 /** 11013 * The maximum size, in bytes, of a download that the download manager will transfer over 11014 * a non-wifi connection. 11015 * @hide 11016 */ 11017 @Readable 11018 public static final String DOWNLOAD_MAX_BYTES_OVER_MOBILE = 11019 "download_manager_max_bytes_over_mobile"; 11020 11021 /** 11022 * The recommended maximum size, in bytes, of a download that the download manager should 11023 * transfer over a non-wifi connection. Over this size, the use will be warned, but will 11024 * have the option to start the download over the mobile connection anyway. 11025 * @hide 11026 */ 11027 @Readable 11028 public static final String DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE = 11029 "download_manager_recommended_max_bytes_over_mobile"; 11030 11031 /** 11032 * @deprecated Use {@link android.provider.Settings.Secure#INSTALL_NON_MARKET_APPS} instead 11033 */ 11034 @Deprecated 11035 public static final String INSTALL_NON_MARKET_APPS = Secure.INSTALL_NON_MARKET_APPS; 11036 11037 /** 11038 * Whether HDMI control shall be enabled. If disabled, no CEC/MHL command will be 11039 * sent or processed. (0 = false, 1 = true) 11040 * @hide 11041 */ 11042 @Readable 11043 public static final String HDMI_CONTROL_ENABLED = "hdmi_control_enabled"; 11044 11045 /** 11046 * Controls whether volume control commands via HDMI CEC are enabled. (0 = false, 1 = 11047 * true). 11048 * 11049 * <p>Effects on different device types: 11050 * <table> 11051 * <tr><th>HDMI CEC device type</th><th>0: disabled</th><th>1: enabled</th></tr> 11052 * <tr> 11053 * <td>TV (type: 0)</td> 11054 * <td>Per CEC specification.</td> 11055 * <td>TV changes system volume. TV no longer reacts to incoming volume changes 11056 * via {@code <User Control Pressed>}. TV no longer handles {@code <Report Audio 11057 * Status>}.</td> 11058 * </tr> 11059 * <tr> 11060 * <td>Playback device (type: 4)</td> 11061 * <td>Device sends volume commands to TV/Audio system via {@code <User Control 11062 * Pressed>}</td> 11063 * <td>Device does not send volume commands via {@code <User Control Pressed>}.</td> 11064 * </tr> 11065 * <tr> 11066 * <td>Audio device (type: 5)</td> 11067 * <td>Full "System Audio Control" capabilities.</td> 11068 * <td>Audio device no longer reacts to incoming {@code <User Control Pressed>} 11069 * volume commands. Audio device no longer reports volume changes via {@code 11070 * <Report Audio Status>}.</td> 11071 * </tr> 11072 * </table> 11073 * 11074 * <p> Due to the resulting behavior, usage on TV and Audio devices is discouraged. 11075 * 11076 * @hide 11077 * @see android.hardware.hdmi.HdmiControlManager#setHdmiCecVolumeControlEnabled(boolean) 11078 */ 11079 @Readable 11080 public static final String HDMI_CONTROL_VOLUME_CONTROL_ENABLED = 11081 "hdmi_control_volume_control_enabled"; 11082 11083 /** 11084 * Whether HDMI System Audio Control feature is enabled. If enabled, TV will try to turn on 11085 * system audio mode if there's a connected CEC-enabled AV Receiver. Then audio stream will 11086 * be played on AVR instead of TV spaeker. If disabled, the system audio mode will never be 11087 * activated. 11088 * @hide 11089 */ 11090 @Readable 11091 public static final String HDMI_SYSTEM_AUDIO_CONTROL_ENABLED = 11092 "hdmi_system_audio_control_enabled"; 11093 11094 /** 11095 * Whether HDMI Routing Control feature is enabled. If enabled, the switch device will 11096 * route to the correct input source on receiving Routing Control related messages. If 11097 * disabled, you can only switch the input via controls on this device. 11098 * @hide 11099 */ 11100 @Readable 11101 public static final String HDMI_CEC_SWITCH_ENABLED = 11102 "hdmi_cec_switch_enabled"; 11103 11104 /** 11105 * Whether TV will automatically turn on upon reception of the CEC command 11106 * <Text View On> or <Image View On>. (0 = false, 1 = true) 11107 * 11108 * @hide 11109 */ 11110 @Readable 11111 public static final String HDMI_CONTROL_AUTO_WAKEUP_ENABLED = 11112 "hdmi_control_auto_wakeup_enabled"; 11113 11114 /** 11115 * Whether TV will also turn off other CEC devices when it goes to standby mode. 11116 * (0 = false, 1 = true) 11117 * 11118 * @hide 11119 */ 11120 @Readable 11121 public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = 11122 "hdmi_control_auto_device_off_enabled"; 11123 11124 /** 11125 * Property to decide which devices the playback device can send a <Standby> message to 11126 * upon going to sleep. It additionally controls whether a playback device attempts to turn 11127 * on the connected Audio system when waking up. Supported values are: 11128 * <ul> 11129 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_TV} Upon going to sleep, device 11130 * sends {@code <Standby>} to TV only. Upon waking up, device does not turn on the Audio 11131 * system via {@code <System Audio Mode Request>}.</li> 11132 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_BROADCAST} Upon going to sleep, 11133 * device sends {@code <Standby>} to all devices in the network. Upon waking up, device 11134 * attempts to turn on the Audio system via {@code <System Audio Mode Request>}.</li> 11135 * <li>{@link HdmiControlManager#POWER_CONTROL_MODE_NONE} Upon going to sleep, device 11136 * does not send any {@code <Standby>} message. Upon waking up, device does not turn on the 11137 * Audio system via {@code <System Audio Mode Request>}.</li> 11138 * </ul> 11139 * 11140 * @hide 11141 */ 11142 public static final String HDMI_CONTROL_SEND_STANDBY_ON_SLEEP = 11143 "hdmi_control_send_standby_on_sleep"; 11144 11145 /** 11146 * Whether or not media is shown automatically when bypassing as a heads up. 11147 * @hide 11148 */ 11149 @Readable 11150 public static final String SHOW_MEDIA_ON_QUICK_SETTINGS = 11151 "qs_media_controls"; 11152 11153 /** 11154 * The interval in milliseconds at which location requests will be throttled when they are 11155 * coming from the background. 11156 * 11157 * @hide 11158 */ 11159 @Readable 11160 public static final String LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS = 11161 "location_background_throttle_interval_ms"; 11162 11163 /** 11164 * Most frequent location update interval in milliseconds that proximity alert is allowed 11165 * to request. 11166 * @hide 11167 */ 11168 @Readable 11169 public static final String LOCATION_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS = 11170 "location_background_throttle_proximity_alert_interval_ms"; 11171 11172 /** 11173 * Packages that are whitelisted for background throttling (throttling will not be applied). 11174 * @hide 11175 */ 11176 @Readable 11177 public static final String LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST = 11178 "location_background_throttle_package_whitelist"; 11179 11180 /** 11181 * Packages that are whitelisted for ignoring location settings (may retrieve location even 11182 * when user location settings are off), for emergency purposes. 11183 * @deprecated No longer used from Android 12+ 11184 * @hide 11185 */ 11186 @TestApi 11187 @Readable 11188 @Deprecated 11189 public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST = 11190 "location_ignore_settings_package_whitelist"; 11191 11192 /** 11193 * Whether to throttle location when the device is in doze and still. 11194 * @hide 11195 */ 11196 public static final String LOCATION_ENABLE_STATIONARY_THROTTLE = 11197 "location_enable_stationary_throttle"; 11198 11199 /** 11200 * Whether TV will switch to MHL port when a mobile device is plugged in. 11201 * (0 = false, 1 = true) 11202 * @hide 11203 */ 11204 @Readable 11205 public static final String MHL_INPUT_SWITCHING_ENABLED = "mhl_input_switching_enabled"; 11206 11207 /** 11208 * Whether TV will charge the mobile device connected at MHL port. (0 = false, 1 = true) 11209 * @hide 11210 */ 11211 @Readable 11212 public static final String MHL_POWER_CHARGE_ENABLED = "mhl_power_charge_enabled"; 11213 11214 /** 11215 * Whether mobile data connections are allowed by the user. See 11216 * ConnectivityManager for more info. 11217 * @hide 11218 */ 11219 @UnsupportedAppUsage 11220 @Readable 11221 public static final String MOBILE_DATA = "mobile_data"; 11222 11223 /** 11224 * Whether the mobile data connection should remain active even when higher 11225 * priority networks like WiFi are active, to help make network switching faster. 11226 * 11227 * See ConnectivityService for more info. 11228 * 11229 * (0 = disabled, 1 = enabled) 11230 * @hide 11231 */ 11232 @Readable 11233 public static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on"; 11234 11235 /** 11236 * Whether the wifi data connection should remain active even when higher 11237 * priority networks like Ethernet are active, to keep both networks. 11238 * In the case where higher priority networks are connected, wifi will be 11239 * unused unless an application explicitly requests to use it. 11240 * 11241 * See ConnectivityService for more info. 11242 * 11243 * (0 = disabled, 1 = enabled) 11244 * @hide 11245 */ 11246 @Readable 11247 public static final String WIFI_ALWAYS_REQUESTED = "wifi_always_requested"; 11248 11249 /** 11250 * Size of the event buffer for IP connectivity metrics. 11251 * @hide 11252 */ 11253 @Readable 11254 public static final String CONNECTIVITY_METRICS_BUFFER_SIZE = 11255 "connectivity_metrics_buffer_size"; 11256 11257 /** {@hide} */ 11258 @Readable 11259 public static final String NETSTATS_ENABLED = "netstats_enabled"; 11260 /** {@hide} */ 11261 @Readable 11262 public static final String NETSTATS_POLL_INTERVAL = "netstats_poll_interval"; 11263 /** 11264 * @deprecated 11265 * {@hide} 11266 */ 11267 @Deprecated 11268 @Readable 11269 public static final String NETSTATS_TIME_CACHE_MAX_AGE = "netstats_time_cache_max_age"; 11270 /** {@hide} */ 11271 @Readable 11272 public static final String NETSTATS_GLOBAL_ALERT_BYTES = "netstats_global_alert_bytes"; 11273 /** {@hide} */ 11274 @Readable 11275 public static final String NETSTATS_SAMPLE_ENABLED = "netstats_sample_enabled"; 11276 /** {@hide} */ 11277 @Readable 11278 public static final String NETSTATS_AUGMENT_ENABLED = "netstats_augment_enabled"; 11279 /** {@hide} */ 11280 @Readable 11281 public static final String NETSTATS_COMBINE_SUBTYPE_ENABLED = 11282 "netstats_combine_subtype_enabled"; 11283 11284 /** {@hide} */ 11285 @Readable 11286 public static final String NETSTATS_DEV_BUCKET_DURATION = "netstats_dev_bucket_duration"; 11287 /** {@hide} */ 11288 @Readable 11289 public static final String NETSTATS_DEV_PERSIST_BYTES = "netstats_dev_persist_bytes"; 11290 /** {@hide} */ 11291 @Readable 11292 public static final String NETSTATS_DEV_ROTATE_AGE = "netstats_dev_rotate_age"; 11293 /** {@hide} */ 11294 @Readable 11295 public static final String NETSTATS_DEV_DELETE_AGE = "netstats_dev_delete_age"; 11296 11297 /** {@hide} */ 11298 @Readable 11299 public static final String NETSTATS_UID_BUCKET_DURATION = "netstats_uid_bucket_duration"; 11300 /** {@hide} */ 11301 @Readable 11302 public static final String NETSTATS_UID_PERSIST_BYTES = "netstats_uid_persist_bytes"; 11303 /** {@hide} */ 11304 @Readable 11305 public static final String NETSTATS_UID_ROTATE_AGE = "netstats_uid_rotate_age"; 11306 /** {@hide} */ 11307 @Readable 11308 public static final String NETSTATS_UID_DELETE_AGE = "netstats_uid_delete_age"; 11309 11310 /** {@hide} */ 11311 @Readable 11312 public static final String NETSTATS_UID_TAG_BUCKET_DURATION = 11313 "netstats_uid_tag_bucket_duration"; 11314 /** {@hide} */ 11315 @Readable 11316 public static final String NETSTATS_UID_TAG_PERSIST_BYTES = 11317 "netstats_uid_tag_persist_bytes"; 11318 /** {@hide} */ 11319 @Readable 11320 public static final String NETSTATS_UID_TAG_ROTATE_AGE = "netstats_uid_tag_rotate_age"; 11321 /** {@hide} */ 11322 @Readable 11323 public static final String NETSTATS_UID_TAG_DELETE_AGE = "netstats_uid_tag_delete_age"; 11324 11325 /** {@hide} */ 11326 @Readable 11327 public static final String NETPOLICY_QUOTA_ENABLED = "netpolicy_quota_enabled"; 11328 /** {@hide} */ 11329 @Readable 11330 public static final String NETPOLICY_QUOTA_UNLIMITED = "netpolicy_quota_unlimited"; 11331 /** {@hide} */ 11332 @Readable 11333 public static final String NETPOLICY_QUOTA_LIMITED = "netpolicy_quota_limited"; 11334 /** {@hide} */ 11335 @Readable 11336 public static final String NETPOLICY_QUOTA_FRAC_JOBS = "netpolicy_quota_frac_jobs"; 11337 /** {@hide} */ 11338 @Readable 11339 public static final String NETPOLICY_QUOTA_FRAC_MULTIPATH = 11340 "netpolicy_quota_frac_multipath"; 11341 11342 /** {@hide} */ 11343 @Readable 11344 public static final String NETPOLICY_OVERRIDE_ENABLED = "netpolicy_override_enabled"; 11345 11346 /** 11347 * User preference for which network(s) should be used. Only the 11348 * connectivity service should touch this. 11349 */ 11350 @Readable 11351 public static final String NETWORK_PREFERENCE = "network_preference"; 11352 11353 /** 11354 * Which package name to use for network scoring. If null, or if the package is not a valid 11355 * scorer app, external network scores will neither be requested nor accepted. 11356 * @hide 11357 */ 11358 @Readable 11359 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 11360 public static final String NETWORK_SCORER_APP = "network_scorer_app"; 11361 11362 /** 11363 * Whether night display forced auto mode is available. 11364 * 0 = unavailable, 1 = available. 11365 * @hide 11366 */ 11367 @Readable 11368 public static final String NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = 11369 "night_display_forced_auto_mode_available"; 11370 11371 /** 11372 * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment 11373 * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been 11374 * exceeded. 11375 * @hide 11376 */ 11377 @Readable 11378 public static final String NITZ_UPDATE_DIFF = "nitz_update_diff"; 11379 11380 /** 11381 * The length of time in milli-seconds that automatic small adjustments to 11382 * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded. 11383 * @hide 11384 */ 11385 @Readable 11386 public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing"; 11387 11388 /** Preferred NTP server. {@hide} */ 11389 @Readable 11390 public static final String NTP_SERVER = "ntp_server"; 11391 /** Timeout in milliseconds to wait for NTP server. {@hide} */ 11392 @Readable 11393 public static final String NTP_TIMEOUT = "ntp_timeout"; 11394 11395 /** {@hide} */ 11396 @Readable 11397 public static final String STORAGE_BENCHMARK_INTERVAL = "storage_benchmark_interval"; 11398 11399 /** 11400 * Whether or not Settings should enable psd API. 11401 * {@hide} 11402 */ 11403 @Readable 11404 public static final String SETTINGS_USE_PSD_API = "settings_use_psd_api"; 11405 11406 /** 11407 * Whether or not Settings should enable external provider API. 11408 * {@hide} 11409 */ 11410 @Readable 11411 public static final String SETTINGS_USE_EXTERNAL_PROVIDER_API = 11412 "settings_use_external_provider_api"; 11413 11414 /** 11415 * Sample validity in seconds to configure for the system DNS resolver. 11416 * {@hide} 11417 */ 11418 @Readable 11419 public static final String DNS_RESOLVER_SAMPLE_VALIDITY_SECONDS = 11420 "dns_resolver_sample_validity_seconds"; 11421 11422 /** 11423 * Success threshold in percent for use with the system DNS resolver. 11424 * {@hide} 11425 */ 11426 @Readable 11427 public static final String DNS_RESOLVER_SUCCESS_THRESHOLD_PERCENT = 11428 "dns_resolver_success_threshold_percent"; 11429 11430 /** 11431 * Minimum number of samples needed for statistics to be considered meaningful in the 11432 * system DNS resolver. 11433 * {@hide} 11434 */ 11435 @Readable 11436 public static final String DNS_RESOLVER_MIN_SAMPLES = "dns_resolver_min_samples"; 11437 11438 /** 11439 * Maximum number taken into account for statistics purposes in the system DNS resolver. 11440 * {@hide} 11441 */ 11442 @Readable 11443 public static final String DNS_RESOLVER_MAX_SAMPLES = "dns_resolver_max_samples"; 11444 11445 /** 11446 * Whether to disable the automatic scheduling of system updates. 11447 * 1 = system updates won't be automatically scheduled (will always 11448 * present notification instead). 11449 * 0 = system updates will be automatically scheduled. (default) 11450 * @hide 11451 */ 11452 @SystemApi 11453 @Readable 11454 public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update"; 11455 11456 /** Timeout for package verification. 11457 * @hide */ 11458 @Readable 11459 public static final String PACKAGE_VERIFIER_TIMEOUT = "verifier_timeout"; 11460 11461 /** Timeout for app integrity verification. 11462 * @hide */ 11463 @Readable 11464 public static final String APP_INTEGRITY_VERIFICATION_TIMEOUT = 11465 "app_integrity_verification_timeout"; 11466 11467 /** Default response code for package verification. 11468 * @hide */ 11469 @Readable 11470 public static final String PACKAGE_VERIFIER_DEFAULT_RESPONSE = "verifier_default_response"; 11471 11472 /** 11473 * Show package verification setting in the Settings app. 11474 * 1 = show (default) 11475 * 0 = hide 11476 * @hide 11477 */ 11478 @Readable 11479 public static final String PACKAGE_VERIFIER_SETTING_VISIBLE = "verifier_setting_visible"; 11480 11481 /** 11482 * Run package verification on apps installed through ADB/ADT/USB 11483 * 1 = perform package verification on ADB installs (default) 11484 * 0 = bypass package verification on ADB installs 11485 * @hide 11486 */ 11487 @Readable 11488 public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs"; 11489 11490 /** 11491 * Run integrity checks for integrity rule providers. 11492 * 0 = bypass integrity verification on installs from rule providers (default) 11493 * 1 = perform integrity verification on installs from rule providers 11494 * @hide 11495 */ 11496 @Readable 11497 public static final String INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER = 11498 "verify_integrity_for_rule_provider"; 11499 11500 /** 11501 * Time since last fstrim (milliseconds) after which we force one to happen 11502 * during device startup. If unset, the default is 3 days. 11503 * @hide 11504 */ 11505 @Readable 11506 public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval"; 11507 11508 /** 11509 * The interval in milliseconds at which to check packet counts on the 11510 * mobile data interface when screen is on, to detect possible data 11511 * connection problems. 11512 * @hide 11513 */ 11514 @Readable 11515 public static final String PDP_WATCHDOG_POLL_INTERVAL_MS = 11516 "pdp_watchdog_poll_interval_ms"; 11517 11518 /** 11519 * The interval in milliseconds at which to check packet counts on the 11520 * mobile data interface when screen is off, to detect possible data 11521 * connection problems. 11522 * @hide 11523 */ 11524 @Readable 11525 public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS = 11526 "pdp_watchdog_long_poll_interval_ms"; 11527 11528 /** 11529 * The interval in milliseconds at which to check packet counts on the 11530 * mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} 11531 * outgoing packets has been reached without incoming packets. 11532 * @hide 11533 */ 11534 @Readable 11535 public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS = 11536 "pdp_watchdog_error_poll_interval_ms"; 11537 11538 /** 11539 * The number of outgoing packets sent without seeing an incoming packet 11540 * that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT} 11541 * device is logged to the event log 11542 * @hide 11543 */ 11544 @Readable 11545 public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT = 11546 "pdp_watchdog_trigger_packet_count"; 11547 11548 /** 11549 * The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS}) 11550 * after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before 11551 * attempting data connection recovery. 11552 * @hide 11553 */ 11554 @Readable 11555 public static final String PDP_WATCHDOG_ERROR_POLL_COUNT = 11556 "pdp_watchdog_error_poll_count"; 11557 11558 /** 11559 * The number of failed PDP reset attempts before moving to something more 11560 * drastic: re-registering to the network. 11561 * @hide 11562 */ 11563 @Readable 11564 public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT = 11565 "pdp_watchdog_max_pdp_reset_fail_count"; 11566 11567 /** 11568 * URL to open browser on to allow user to manage a prepay account 11569 * @hide 11570 */ 11571 @Readable 11572 public static final String SETUP_PREPAID_DATA_SERVICE_URL = 11573 "setup_prepaid_data_service_url"; 11574 11575 /** 11576 * URL to attempt a GET on to see if this is a prepay device 11577 * @hide 11578 */ 11579 @Readable 11580 public static final String SETUP_PREPAID_DETECTION_TARGET_URL = 11581 "setup_prepaid_detection_target_url"; 11582 11583 /** 11584 * Host to check for a redirect to after an attempt to GET 11585 * SETUP_PREPAID_DETECTION_TARGET_URL. (If we redirected there, 11586 * this is a prepaid device with zero balance.) 11587 * @hide 11588 */ 11589 @Readable 11590 public static final String SETUP_PREPAID_DETECTION_REDIR_HOST = 11591 "setup_prepaid_detection_redir_host"; 11592 11593 /** 11594 * The interval in milliseconds at which to check the number of SMS sent out without asking 11595 * for use permit, to limit the un-authorized SMS usage. 11596 * 11597 * @hide 11598 */ 11599 @Readable 11600 public static final String SMS_OUTGOING_CHECK_INTERVAL_MS = 11601 "sms_outgoing_check_interval_ms"; 11602 11603 /** 11604 * The number of outgoing SMS sent without asking for user permit (of {@link 11605 * #SMS_OUTGOING_CHECK_INTERVAL_MS} 11606 * 11607 * @hide 11608 */ 11609 @Readable 11610 public static final String SMS_OUTGOING_CHECK_MAX_COUNT = 11611 "sms_outgoing_check_max_count"; 11612 11613 /** 11614 * Used to disable SMS short code confirmation - defaults to true. 11615 * True indcates we will do the check, etc. Set to false to disable. 11616 * @see com.android.internal.telephony.SmsUsageMonitor 11617 * @hide 11618 */ 11619 @Readable 11620 public static final String SMS_SHORT_CODE_CONFIRMATION = "sms_short_code_confirmation"; 11621 11622 /** 11623 * Used to select which country we use to determine premium sms codes. 11624 * One of com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_SIM, 11625 * com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_NETWORK, 11626 * or com.android.internal.telephony.SMSDispatcher.PREMIUM_RULE_USE_BOTH. 11627 * @hide 11628 */ 11629 @Readable 11630 public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule"; 11631 11632 /** 11633 * Used to select TCP's default initial receiver window size in segments - defaults to a 11634 * build config value. 11635 * @hide 11636 */ 11637 @Readable 11638 public static final String TCP_DEFAULT_INIT_RWND = "tcp_default_init_rwnd"; 11639 11640 /** 11641 * Used to disable Tethering on a device - defaults to true. 11642 * @hide 11643 */ 11644 @SystemApi 11645 @Readable 11646 public static final String TETHER_SUPPORTED = "tether_supported"; 11647 11648 /** 11649 * Used to require DUN APN on the device or not - defaults to a build config value 11650 * which defaults to false. 11651 * @hide 11652 */ 11653 @Readable 11654 public static final String TETHER_DUN_REQUIRED = "tether_dun_required"; 11655 11656 /** 11657 * Used to hold a gservices-provisioned apn value for DUN. If set, or the 11658 * corresponding build config values are set it will override the APN DB 11659 * values. 11660 * Consists of a comma separated list of strings: 11661 * "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" 11662 * note that empty fields can be omitted: "name,apn,,,,,,,,,310,260,,DUN" 11663 * @hide 11664 */ 11665 @Readable 11666 public static final String TETHER_DUN_APN = "tether_dun_apn"; 11667 11668 /** 11669 * Used to disable trying to talk to any available tethering offload HAL. 11670 * 11671 * Integer values are interpreted as boolean, and the absence of an explicit setting 11672 * is interpreted as |false|. 11673 * @hide 11674 */ 11675 @SystemApi 11676 @Readable 11677 public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled"; 11678 11679 /** 11680 * Use the old dnsmasq DHCP server for tethering instead of the framework implementation. 11681 * 11682 * Integer values are interpreted as boolean, and the absence of an explicit setting 11683 * is interpreted as |false|. 11684 * @hide 11685 */ 11686 @Readable 11687 public static final String TETHER_ENABLE_LEGACY_DHCP_SERVER = 11688 "tether_enable_legacy_dhcp_server"; 11689 11690 /** 11691 * List of certificate (hex string representation of the application's certificate - SHA-1 11692 * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for 11693 * install when a sim card with matching UICC carrier privilege rules is inserted. The 11694 * certificate is used as a key, so the certificate encoding here must be the same as the 11695 * certificate encoding used on the SIM. 11696 * 11697 * The value is "cert1:package1;cert2:package2;..." 11698 * @hide 11699 */ 11700 @SystemApi 11701 @Readable 11702 public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist"; 11703 11704 /** 11705 * Map of package name to application names. The application names cannot and will not be 11706 * localized. App names may not contain colons or semicolons. 11707 * 11708 * The value is "packageName1:appName1;packageName2:appName2;..." 11709 * @hide 11710 */ 11711 @SystemApi 11712 @Readable 11713 public static final String CARRIER_APP_NAMES = "carrier_app_names"; 11714 11715 /** 11716 * USB Mass Storage Enabled 11717 */ 11718 @Readable 11719 public static final String USB_MASS_STORAGE_ENABLED = "usb_mass_storage_enabled"; 11720 11721 /** 11722 * If this setting is set (to anything), then all references 11723 * to Gmail on the device must change to Google Mail. 11724 */ 11725 @Readable 11726 public static final String USE_GOOGLE_MAIL = "use_google_mail"; 11727 11728 /** 11729 * Whether or not switching/creating users is enabled by user. 11730 * @hide 11731 */ 11732 @Readable 11733 public static final String USER_SWITCHER_ENABLED = "user_switcher_enabled"; 11734 11735 /** 11736 * Webview Data reduction proxy key. 11737 * @hide 11738 */ 11739 @Readable 11740 public static final String WEBVIEW_DATA_REDUCTION_PROXY_KEY = 11741 "webview_data_reduction_proxy_key"; 11742 11743 /** 11744 * Name of the package used as WebView provider (if unset the provider is instead determined 11745 * by the system). 11746 * @hide 11747 */ 11748 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 11749 @Readable 11750 public static final String WEBVIEW_PROVIDER = "webview_provider"; 11751 11752 /** 11753 * Developer setting to enable WebView multiprocess rendering. 11754 * @hide 11755 */ 11756 @SystemApi 11757 @Readable 11758 public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess"; 11759 11760 /** 11761 * The maximum number of notifications shown in 24 hours when switching networks. 11762 * @hide 11763 */ 11764 @Readable 11765 public static final String NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT = 11766 "network_switch_notification_daily_limit"; 11767 11768 /** 11769 * The minimum time in milliseconds between notifications when switching networks. 11770 * @hide 11771 */ 11772 @Readable 11773 public static final String NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS = 11774 "network_switch_notification_rate_limit_millis"; 11775 11776 /** 11777 * Whether to automatically switch away from wifi networks that lose Internet access. 11778 * Only meaningful if config_networkAvoidBadWifi is set to 0, otherwise the system always 11779 * avoids such networks. Valid values are: 11780 * 11781 * 0: Don't avoid bad wifi, don't prompt the user. Get stuck on bad wifi like it's 2013. 11782 * null: Ask the user whether to switch away from bad wifi. 11783 * 1: Avoid bad wifi. 11784 * 11785 * @hide 11786 */ 11787 @Readable 11788 public static final String NETWORK_AVOID_BAD_WIFI = "network_avoid_bad_wifi"; 11789 11790 /** 11791 * User setting for ConnectivityManager.getMeteredMultipathPreference(). This value may be 11792 * overridden by the system based on device or application state. If null, the value 11793 * specified by config_networkMeteredMultipathPreference is used. 11794 * 11795 * @hide 11796 */ 11797 @Readable 11798 public static final String NETWORK_METERED_MULTIPATH_PREFERENCE = 11799 "network_metered_multipath_preference"; 11800 11801 /** 11802 * Default daily multipath budget used by ConnectivityManager.getMultipathPreference() 11803 * on metered networks. This default quota is only used if quota could not be determined 11804 * from data plan or data limit/warning set by the user. 11805 * @hide 11806 */ 11807 @Readable 11808 public static final String NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES = 11809 "network_default_daily_multipath_quota_bytes"; 11810 11811 /** 11812 * Network watchlist last report time. 11813 * @hide 11814 */ 11815 @Readable 11816 public static final String NETWORK_WATCHLIST_LAST_REPORT_TIME = 11817 "network_watchlist_last_report_time"; 11818 11819 /** 11820 * The thresholds of the wifi throughput badging (SD, HD etc.) as a comma-delimited list of 11821 * colon-delimited key-value pairs. The key is the badging enum value defined in 11822 * android.net.ScoredNetwork and the value is the minimum sustained network throughput in 11823 * kbps required for the badge. For example: "10:3000,20:5000,30:25000" 11824 * 11825 * @hide 11826 */ 11827 @SystemApi 11828 @Readable 11829 public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds"; 11830 11831 /** 11832 * Whether Wifi display is enabled/disabled 11833 * 0=disabled. 1=enabled. 11834 * @hide 11835 */ 11836 @Readable 11837 public static final String WIFI_DISPLAY_ON = "wifi_display_on"; 11838 11839 /** 11840 * Whether Wifi display certification mode is enabled/disabled 11841 * 0=disabled. 1=enabled. 11842 * @hide 11843 */ 11844 @Readable 11845 public static final String WIFI_DISPLAY_CERTIFICATION_ON = 11846 "wifi_display_certification_on"; 11847 11848 /** 11849 * WPS Configuration method used by Wifi display, this setting only 11850 * takes effect when WIFI_DISPLAY_CERTIFICATION_ON is 1 (enabled). 11851 * 11852 * Possible values are: 11853 * 11854 * WpsInfo.INVALID: use default WPS method chosen by framework 11855 * WpsInfo.PBC : use Push button 11856 * WpsInfo.KEYPAD : use Keypad 11857 * WpsInfo.DISPLAY: use Display 11858 * @hide 11859 */ 11860 @Readable 11861 public static final String WIFI_DISPLAY_WPS_CONFIG = 11862 "wifi_display_wps_config"; 11863 11864 /** 11865 * Whether to notify the user of open networks. 11866 * <p> 11867 * If not connected and the scan results have an open network, we will 11868 * put this notification up. If we attempt to connect to a network or 11869 * the open network(s) disappear, we remove the notification. When we 11870 * show the notification, we will not show it again for 11871 * {@link android.provider.Settings.Secure#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} time. 11872 * 11873 * @deprecated This feature is no longer controlled by this setting in 11874 * {@link android.os.Build.VERSION_CODES#O}. 11875 */ 11876 @Deprecated 11877 @Readable 11878 public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON = 11879 "wifi_networks_available_notification_on"; 11880 11881 /** 11882 * {@hide} 11883 */ 11884 @Readable 11885 public static final String WIMAX_NETWORKS_AVAILABLE_NOTIFICATION_ON = 11886 "wimax_networks_available_notification_on"; 11887 11888 /** 11889 * Delay (in seconds) before repeating the Wi-Fi networks available notification. 11890 * Connecting to a network will reset the timer. 11891 * @deprecated This is no longer used or set by the platform. 11892 */ 11893 @Deprecated 11894 @Readable 11895 public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY = 11896 "wifi_networks_available_repeat_delay"; 11897 11898 /** 11899 * 802.11 country code in ISO 3166 format 11900 * @hide 11901 */ 11902 @Readable 11903 public static final String WIFI_COUNTRY_CODE = "wifi_country_code"; 11904 11905 /** 11906 * The interval in milliseconds to issue wake up scans when wifi needs 11907 * to connect. This is necessary to connect to an access point when 11908 * device is on the move and the screen is off. 11909 * @hide 11910 */ 11911 @Readable 11912 public static final String WIFI_FRAMEWORK_SCAN_INTERVAL_MS = 11913 "wifi_framework_scan_interval_ms"; 11914 11915 /** 11916 * The interval in milliseconds after which Wi-Fi is considered idle. 11917 * When idle, it is possible for the device to be switched from Wi-Fi to 11918 * the mobile data network. 11919 * @hide 11920 */ 11921 @Readable 11922 public static final String WIFI_IDLE_MS = "wifi_idle_ms"; 11923 11924 /** 11925 * When the number of open networks exceeds this number, the 11926 * least-recently-used excess networks will be removed. 11927 * @deprecated This is no longer used or set by the platform. 11928 */ 11929 @Deprecated 11930 @Readable 11931 public static final String WIFI_NUM_OPEN_NETWORKS_KEPT = "wifi_num_open_networks_kept"; 11932 11933 /** 11934 * Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this. 11935 */ 11936 @Readable 11937 public static final String WIFI_ON = "wifi_on"; 11938 11939 /** 11940 * Setting to allow scans to be enabled even wifi is turned off for connectivity. 11941 * @hide 11942 * @deprecated To be removed. Use {@link WifiManager#setScanAlwaysAvailable(boolean)} for 11943 * setting the value and {@link WifiManager#isScanAlwaysAvailable()} for query. 11944 */ 11945 @Deprecated 11946 @Readable 11947 public static final String WIFI_SCAN_ALWAYS_AVAILABLE = 11948 "wifi_scan_always_enabled"; 11949 11950 /** 11951 * Indicate whether factory reset request is pending. 11952 * 11953 * Type: int (0 for false, 1 for true) 11954 * @hide 11955 * @deprecated To be removed. 11956 */ 11957 @Deprecated 11958 @Readable 11959 public static final String WIFI_P2P_PENDING_FACTORY_RESET = 11960 "wifi_p2p_pending_factory_reset"; 11961 11962 /** 11963 * Whether soft AP will shut down after a timeout period when no devices are connected. 11964 * 11965 * Type: int (0 for false, 1 for true) 11966 * @hide 11967 * @deprecated To be removed. Use {@link SoftApConfiguration.Builder# 11968 * setAutoShutdownEnabled(boolean)} for setting the value and {@link SoftApConfiguration# 11969 * isAutoShutdownEnabled()} for query. 11970 */ 11971 @Deprecated 11972 @Readable 11973 public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled"; 11974 11975 /** 11976 * Value to specify if Wi-Fi Wakeup feature is enabled. 11977 * 11978 * Type: int (0 for false, 1 for true) 11979 * @hide 11980 * @deprecated Use {@link WifiManager#setAutoWakeupEnabled(boolean)} for setting the value 11981 * and {@link WifiManager#isAutoWakeupEnabled()} for query. 11982 */ 11983 @Deprecated 11984 @SystemApi 11985 @Readable 11986 public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled"; 11987 11988 /** 11989 * Value to specify if wifi settings migration is complete or not. 11990 * Note: This should only be used from within {@link android.net.wifi.WifiMigration} class. 11991 * 11992 * Type: int (0 for false, 1 for true) 11993 * @hide 11994 */ 11995 @Readable 11996 public static final String WIFI_MIGRATION_COMPLETED = "wifi_migration_completed"; 11997 11998 /** 11999 * Whether UWB should be enabled. 12000 * @hide 12001 */ 12002 public static final String UWB_ENABLED = "uwb_enabled"; 12003 12004 /** 12005 * Value to specify whether network quality scores and badging should be shown in the UI. 12006 * 12007 * Type: int (0 for false, 1 for true) 12008 * @hide 12009 */ 12010 @Readable 12011 public static final String NETWORK_SCORING_UI_ENABLED = "network_scoring_ui_enabled"; 12012 12013 /** 12014 * Value to specify how long in milliseconds to retain seen score cache curves to be used 12015 * when generating SSID only bases score curves. 12016 * 12017 * Type: long 12018 * @hide 12019 */ 12020 @Readable 12021 public static final String SPEED_LABEL_CACHE_EVICTION_AGE_MILLIS = 12022 "speed_label_cache_eviction_age_millis"; 12023 12024 /** 12025 * Value to specify if network recommendations from 12026 * {@link com.android.server.NetworkScoreService} are enabled. 12027 * 12028 * Type: int 12029 * Valid values: 12030 * -1 = Forced off 12031 * 0 = Disabled 12032 * 1 = Enabled 12033 * 12034 * Most readers of this setting should simply check if value == 1 to determine the 12035 * enabled state. 12036 * @hide 12037 * @deprecated To be removed. 12038 */ 12039 @Deprecated 12040 @Readable 12041 public static final String NETWORK_RECOMMENDATIONS_ENABLED = 12042 "network_recommendations_enabled"; 12043 12044 /** 12045 * Which package name to use for network recommendations. If null, network recommendations 12046 * will neither be requested nor accepted. 12047 * 12048 * Use {@link NetworkScoreManager#getActiveScorerPackage()} to read this value and 12049 * {@link NetworkScoreManager#setActiveScorer(String)} to write it. 12050 * 12051 * Type: string - package name 12052 * @hide 12053 */ 12054 @Readable 12055 public static final String NETWORK_RECOMMENDATIONS_PACKAGE = 12056 "network_recommendations_package"; 12057 12058 /** 12059 * The package name of the application that connect and secures high quality open wifi 12060 * networks automatically. 12061 * 12062 * Type: string package name or null if the feature is either not provided or disabled. 12063 * @hide 12064 */ 12065 @TestApi 12066 @Readable 12067 public static final String USE_OPEN_WIFI_PACKAGE = "use_open_wifi_package"; 12068 12069 /** 12070 * The expiration time in milliseconds for the {@link android.net.WifiKey} request cache in 12071 * {@link com.android.server.wifi.RecommendedNetworkEvaluator}. 12072 * 12073 * Type: long 12074 * @hide 12075 */ 12076 @Readable 12077 public static final String RECOMMENDED_NETWORK_EVALUATOR_CACHE_EXPIRY_MS = 12078 "recommended_network_evaluator_cache_expiry_ms"; 12079 12080 /** 12081 * Whether wifi scan throttle is enabled or not. 12082 * 12083 * Type: int (0 for false, 1 for true) 12084 * @hide 12085 * @deprecated Use {@link WifiManager#setScanThrottleEnabled(boolean)} for setting the value 12086 * and {@link WifiManager#isScanThrottleEnabled()} for query. 12087 */ 12088 @Deprecated 12089 @Readable 12090 public static final String WIFI_SCAN_THROTTLE_ENABLED = "wifi_scan_throttle_enabled"; 12091 12092 /** 12093 * Settings to allow BLE scans to be enabled even when Bluetooth is turned off for 12094 * connectivity. 12095 * @hide 12096 */ 12097 @Readable 12098 public static final String BLE_SCAN_ALWAYS_AVAILABLE = "ble_scan_always_enabled"; 12099 12100 /** 12101 * The length in milliseconds of a BLE scan window in a low-power scan mode. 12102 * @hide 12103 */ 12104 @Readable 12105 public static final String BLE_SCAN_LOW_POWER_WINDOW_MS = "ble_scan_low_power_window_ms"; 12106 12107 /** 12108 * The length in milliseconds of a BLE scan window in a balanced scan mode. 12109 * @hide 12110 */ 12111 @Readable 12112 public static final String BLE_SCAN_BALANCED_WINDOW_MS = "ble_scan_balanced_window_ms"; 12113 12114 /** 12115 * The length in milliseconds of a BLE scan window in a low-latency scan mode. 12116 * @hide 12117 */ 12118 @Readable 12119 public static final String BLE_SCAN_LOW_LATENCY_WINDOW_MS = 12120 "ble_scan_low_latency_window_ms"; 12121 12122 /** 12123 * The length in milliseconds of a BLE scan interval in a low-power scan mode. 12124 * @hide 12125 */ 12126 @Readable 12127 public static final String BLE_SCAN_LOW_POWER_INTERVAL_MS = 12128 "ble_scan_low_power_interval_ms"; 12129 12130 /** 12131 * The length in milliseconds of a BLE scan interval in a balanced scan mode. 12132 * @hide 12133 */ 12134 @Readable 12135 public static final String BLE_SCAN_BALANCED_INTERVAL_MS = 12136 "ble_scan_balanced_interval_ms"; 12137 12138 /** 12139 * The length in milliseconds of a BLE scan interval in a low-latency scan mode. 12140 * @hide 12141 */ 12142 @Readable 12143 public static final String BLE_SCAN_LOW_LATENCY_INTERVAL_MS = 12144 "ble_scan_low_latency_interval_ms"; 12145 12146 /** 12147 * The mode that BLE scanning clients will be moved to when in the background. 12148 * @hide 12149 */ 12150 @Readable 12151 public static final String BLE_SCAN_BACKGROUND_MODE = "ble_scan_background_mode"; 12152 12153 /** 12154 * The interval in milliseconds to scan as used by the wifi supplicant 12155 * @hide 12156 */ 12157 @Readable 12158 public static final String WIFI_SUPPLICANT_SCAN_INTERVAL_MS = 12159 "wifi_supplicant_scan_interval_ms"; 12160 12161 /** 12162 * whether frameworks handles wifi auto-join 12163 * @hide 12164 */ 12165 @Readable 12166 public static final String WIFI_ENHANCED_AUTO_JOIN = 12167 "wifi_enhanced_auto_join"; 12168 12169 /** 12170 * whether settings show RSSI 12171 * @hide 12172 */ 12173 @Readable 12174 public static final String WIFI_NETWORK_SHOW_RSSI = 12175 "wifi_network_show_rssi"; 12176 12177 /** 12178 * The interval in milliseconds to scan at supplicant when p2p is connected 12179 * @hide 12180 */ 12181 @Readable 12182 public static final String WIFI_SCAN_INTERVAL_WHEN_P2P_CONNECTED_MS = 12183 "wifi_scan_interval_p2p_connected_ms"; 12184 12185 /** 12186 * Whether the Wi-Fi watchdog is enabled. 12187 */ 12188 @Readable 12189 public static final String WIFI_WATCHDOG_ON = "wifi_watchdog_on"; 12190 12191 /** 12192 * Setting to turn off poor network avoidance on Wi-Fi. Feature is enabled by default and 12193 * the setting needs to be set to 0 to disable it. 12194 * @hide 12195 */ 12196 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 12197 @Readable 12198 public static final String WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED = 12199 "wifi_watchdog_poor_network_test_enabled"; 12200 12201 /** 12202 * Setting to enable verbose logging in Wi-Fi; disabled by default, and setting to 1 12203 * will enable it. In the future, additional values may be supported. 12204 * @hide 12205 * @deprecated Use {@link WifiManager#setVerboseLoggingEnabled(boolean)} for setting the 12206 * value and {@link WifiManager#isVerboseLoggingEnabled()} for query. 12207 */ 12208 @Deprecated 12209 @Readable 12210 public static final String WIFI_VERBOSE_LOGGING_ENABLED = 12211 "wifi_verbose_logging_enabled"; 12212 12213 /** 12214 * Setting to enable connected MAC randomization in Wi-Fi; disabled by default, and 12215 * setting to 1 will enable it. In the future, additional values may be supported. 12216 * @deprecated MAC randomization is now a per-network setting 12217 * @hide 12218 */ 12219 @Deprecated 12220 @Readable 12221 public static final String WIFI_CONNECTED_MAC_RANDOMIZATION_ENABLED = 12222 "wifi_connected_mac_randomization_enabled"; 12223 12224 /** 12225 * Parameters to adjust the performance of framework wifi scoring methods. 12226 * <p> 12227 * Encoded as a comma-separated key=value list, for example: 12228 * "rssi5=-80:-77:-70:-57,rssi2=-83:-80:-73:-60,horizon=15" 12229 * This is intended for experimenting with new parameter values, 12230 * and is normally unset or empty. The example does not include all 12231 * parameters that may be honored. 12232 * Default values are provided by code or device configurations. 12233 * Errors in the parameters will cause the entire setting to be ignored. 12234 * @hide 12235 * @deprecated This is no longer used or set by the platform. 12236 */ 12237 @Deprecated 12238 @Readable 12239 public static final String WIFI_SCORE_PARAMS = 12240 "wifi_score_params"; 12241 12242 /** 12243 * The maximum number of times we will retry a connection to an access 12244 * point for which we have failed in acquiring an IP address from DHCP. 12245 * A value of N means that we will make N+1 connection attempts in all. 12246 */ 12247 @Readable 12248 public static final String WIFI_MAX_DHCP_RETRY_COUNT = "wifi_max_dhcp_retry_count"; 12249 12250 /** 12251 * Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile 12252 * data connectivity to be established after a disconnect from Wi-Fi. 12253 */ 12254 @Readable 12255 public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS = 12256 "wifi_mobile_data_transition_wakelock_timeout_ms"; 12257 12258 /** 12259 * This setting controls whether WiFi configurations created by a Device Owner app 12260 * should be locked down (that is, be editable or removable only by the Device Owner App, 12261 * not even by Settings app). 12262 * This setting takes integer values. Non-zero values mean DO created configurations 12263 * are locked down. Value of zero means they are not. Default value in the absence of 12264 * actual value to this setting is 0. 12265 */ 12266 @Readable 12267 public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN = 12268 "wifi_device_owner_configs_lockdown"; 12269 12270 /** 12271 * The operational wifi frequency band 12272 * Set to one of {@link WifiManager#WIFI_FREQUENCY_BAND_AUTO}, 12273 * {@link WifiManager#WIFI_FREQUENCY_BAND_5GHZ} or 12274 * {@link WifiManager#WIFI_FREQUENCY_BAND_2GHZ} 12275 * 12276 * @hide 12277 */ 12278 @Readable 12279 public static final String WIFI_FREQUENCY_BAND = "wifi_frequency_band"; 12280 12281 /** 12282 * The Wi-Fi peer-to-peer device name 12283 * @hide 12284 * @deprecated Use {@link WifiP2pManager#setDeviceName(WifiP2pManager.Channel, String, 12285 * WifiP2pManager.ActionListener)} for setting the value and 12286 * {@link android.net.wifi.p2p.WifiP2pDevice#deviceName} for query. 12287 */ 12288 @Deprecated 12289 @Readable 12290 public static final String WIFI_P2P_DEVICE_NAME = "wifi_p2p_device_name"; 12291 12292 /** 12293 * Timeout for ephemeral networks when all known BSSIDs go out of range. We will disconnect 12294 * from an ephemeral network if there is no BSSID for that network with a non-null score that 12295 * has been seen in this time period. 12296 * 12297 * If this is less than or equal to zero, we use a more conservative behavior and only check 12298 * for a non-null score from the currently connected or target BSSID. 12299 * @hide 12300 */ 12301 @Readable 12302 public static final String WIFI_EPHEMERAL_OUT_OF_RANGE_TIMEOUT_MS = 12303 "wifi_ephemeral_out_of_range_timeout_ms"; 12304 12305 /** 12306 * The number of milliseconds to delay when checking for data stalls during 12307 * non-aggressive detection. (screen is turned off.) 12308 * @hide 12309 */ 12310 @Readable 12311 public static final String DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS = 12312 "data_stall_alarm_non_aggressive_delay_in_ms"; 12313 12314 /** 12315 * The number of milliseconds to delay when checking for data stalls during 12316 * aggressive detection. (screen on or suspected data stall) 12317 * @hide 12318 */ 12319 @Readable 12320 public static final String DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS = 12321 "data_stall_alarm_aggressive_delay_in_ms"; 12322 12323 /** 12324 * The number of milliseconds to allow the provisioning apn to remain active 12325 * @hide 12326 */ 12327 @Readable 12328 public static final String PROVISIONING_APN_ALARM_DELAY_IN_MS = 12329 "provisioning_apn_alarm_delay_in_ms"; 12330 12331 /** 12332 * The interval in milliseconds at which to check gprs registration 12333 * after the first registration mismatch of gprs and voice service, 12334 * to detect possible data network registration problems. 12335 * 12336 * @hide 12337 */ 12338 @Readable 12339 public static final String GPRS_REGISTER_CHECK_PERIOD_MS = 12340 "gprs_register_check_period_ms"; 12341 12342 /** 12343 * Nonzero causes Log.wtf() to crash. 12344 * @hide 12345 */ 12346 @Readable 12347 public static final String WTF_IS_FATAL = "wtf_is_fatal"; 12348 12349 /** 12350 * Ringer mode. This is used internally, changing this value will not 12351 * change the ringer mode. See AudioManager. 12352 */ 12353 @Readable 12354 public static final String MODE_RINGER = "mode_ringer"; 12355 12356 /** 12357 * Overlay display devices setting. 12358 * The associated value is a specially formatted string that describes the 12359 * size and density of simulated secondary display devices. 12360 * <p> 12361 * Format: 12362 * <pre> 12363 * [display1];[display2];... 12364 * </pre> 12365 * with each display specified as: 12366 * <pre> 12367 * [mode1]|[mode2]|...,[flag1],[flag2],... 12368 * </pre> 12369 * with each mode specified as: 12370 * <pre> 12371 * [width]x[height]/[densityDpi] 12372 * </pre> 12373 * Supported flags: 12374 * <ul> 12375 * <li><pre>secure</pre>: creates a secure display</li> 12376 * <li><pre>own_content_only</pre>: only shows this display's own content</li> 12377 * <li><pre>should_show_system_decorations</pre>: supports system decorations</li> 12378 * </ul> 12379 * </p><p> 12380 * Example: 12381 * <ul> 12382 * <li><code>1280x720/213</code>: make one overlay that is 1280x720 at 213dpi.</li> 12383 * <li><code>1920x1080/320,secure;1280x720/213</code>: make two overlays, the first at 12384 * 1080p and secure; the second at 720p.</li> 12385 * <li><code>1920x1080/320|3840x2160/640</code>: make one overlay that is 1920x1080 at 12386 * 213dpi by default, but can also be upscaled to 3840x2160 at 640dpi by the system if the 12387 * display device allows.</li> 12388 * <li>If the value is empty, then no overlay display devices are created.</li> 12389 * </ul></p> 12390 * 12391 * @hide 12392 */ 12393 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 12394 @TestApi 12395 @Readable 12396 public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices"; 12397 12398 /** 12399 * Threshold values for the duration and level of a discharge cycle, 12400 * under which we log discharge cycle info. 12401 * 12402 * @hide 12403 */ 12404 @Readable 12405 public static final String 12406 BATTERY_DISCHARGE_DURATION_THRESHOLD = "battery_discharge_duration_threshold"; 12407 12408 /** @hide */ 12409 @Readable 12410 public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold"; 12411 12412 /** 12413 * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR 12414 * intents on application crashes and ANRs. If this is disabled, the 12415 * crash/ANR dialog will never display the "Report" button. 12416 * <p> 12417 * Type: int (0 = disallow, 1 = allow) 12418 * 12419 * @hide 12420 */ 12421 @Readable 12422 public static final String SEND_ACTION_APP_ERROR = "send_action_app_error"; 12423 12424 /** 12425 * Maximum age of entries kept by {@link DropBoxManager}. 12426 * 12427 * @hide 12428 */ 12429 @Readable 12430 public static final String DROPBOX_AGE_SECONDS = "dropbox_age_seconds"; 12431 12432 /** 12433 * Maximum number of entry files which {@link DropBoxManager} will keep 12434 * around. 12435 * 12436 * @hide 12437 */ 12438 @Readable 12439 public static final String DROPBOX_MAX_FILES = "dropbox_max_files"; 12440 12441 /** 12442 * Maximum amount of disk space used by {@link DropBoxManager} no matter 12443 * what. 12444 * 12445 * @hide 12446 */ 12447 @Readable 12448 public static final String DROPBOX_QUOTA_KB = "dropbox_quota_kb"; 12449 12450 /** 12451 * Percent of free disk (excluding reserve) which {@link DropBoxManager} 12452 * will use. 12453 * 12454 * @hide 12455 */ 12456 @Readable 12457 public static final String DROPBOX_QUOTA_PERCENT = "dropbox_quota_percent"; 12458 12459 /** 12460 * Percent of total disk which {@link DropBoxManager} will never dip 12461 * into. 12462 * 12463 * @hide 12464 */ 12465 @Readable 12466 public static final String DROPBOX_RESERVE_PERCENT = "dropbox_reserve_percent"; 12467 12468 /** 12469 * Prefix for per-tag dropbox disable/enable settings. 12470 * 12471 * @hide 12472 */ 12473 @Readable 12474 public static final String DROPBOX_TAG_PREFIX = "dropbox:"; 12475 12476 /** 12477 * Lines of logcat to include with system crash/ANR/etc. reports, as a 12478 * prefix of the dropbox tag of the report type. For example, 12479 * "logcat_for_system_server_anr" controls the lines of logcat captured 12480 * with system server ANR reports. 0 to disable. 12481 * 12482 * @hide 12483 */ 12484 @Readable 12485 public static final String ERROR_LOGCAT_PREFIX = "logcat_for_"; 12486 12487 /** 12488 * Maximum number of bytes of a system crash/ANR/etc. report that 12489 * ActivityManagerService should send to DropBox, as a prefix of the 12490 * dropbox tag of the report type. For example, 12491 * "max_error_bytes_for_system_server_anr" controls the maximum 12492 * number of bytes captured with system server ANR reports. 12493 * <p> 12494 * Type: int (max size in bytes) 12495 * 12496 * @hide 12497 */ 12498 @Readable 12499 public static final String MAX_ERROR_BYTES_PREFIX = "max_error_bytes_for_"; 12500 12501 /** 12502 * The interval in minutes after which the amount of free storage left 12503 * on the device is logged to the event log 12504 * 12505 * @hide 12506 */ 12507 @Readable 12508 public static final String SYS_FREE_STORAGE_LOG_INTERVAL = "sys_free_storage_log_interval"; 12509 12510 /** 12511 * Threshold for the amount of change in disk free space required to 12512 * report the amount of free space. Used to prevent spamming the logs 12513 * when the disk free space isn't changing frequently. 12514 * 12515 * @hide 12516 */ 12517 @Readable 12518 public static final String 12519 DISK_FREE_CHANGE_REPORTING_THRESHOLD = "disk_free_change_reporting_threshold"; 12520 12521 /** 12522 * Minimum percentage of free storage on the device that is used to 12523 * determine if the device is running low on storage. The default is 10. 12524 * <p> 12525 * Say this value is set to 10, the device is considered running low on 12526 * storage if 90% or more of the device storage is filled up. 12527 * 12528 * @hide 12529 */ 12530 @Readable 12531 public static final String 12532 SYS_STORAGE_THRESHOLD_PERCENTAGE = "sys_storage_threshold_percentage"; 12533 12534 /** 12535 * Maximum byte size of the low storage threshold. This is to ensure 12536 * that {@link #SYS_STORAGE_THRESHOLD_PERCENTAGE} does not result in an 12537 * overly large threshold for large storage devices. Currently this must 12538 * be less than 2GB. This default is 500MB. 12539 * 12540 * @hide 12541 */ 12542 @Readable 12543 public static final String 12544 SYS_STORAGE_THRESHOLD_MAX_BYTES = "sys_storage_threshold_max_bytes"; 12545 12546 /** 12547 * Minimum bytes of free storage on the device before the data partition 12548 * is considered full. By default, 1 MB is reserved to avoid system-wide 12549 * SQLite disk full exceptions. 12550 * 12551 * @hide 12552 */ 12553 @Readable 12554 public static final String 12555 SYS_STORAGE_FULL_THRESHOLD_BYTES = "sys_storage_full_threshold_bytes"; 12556 12557 /** 12558 * Minimum percentage of storage on the device that is reserved for 12559 * cached data. 12560 * 12561 * @hide 12562 */ 12563 @Readable 12564 public static final String 12565 SYS_STORAGE_CACHE_PERCENTAGE = "sys_storage_cache_percentage"; 12566 12567 /** 12568 * Maximum bytes of storage on the device that is reserved for cached 12569 * data. 12570 * 12571 * @hide 12572 */ 12573 @Readable 12574 public static final String 12575 SYS_STORAGE_CACHE_MAX_BYTES = "sys_storage_cache_max_bytes"; 12576 12577 /** 12578 * The maximum reconnect delay for short network outages or when the 12579 * network is suspended due to phone use. 12580 * 12581 * @hide 12582 */ 12583 @Readable 12584 public static final String 12585 SYNC_MAX_RETRY_DELAY_IN_SECONDS = "sync_max_retry_delay_in_seconds"; 12586 12587 /** 12588 * The number of milliseconds to delay before sending out 12589 * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. 12590 * 12591 * @hide 12592 */ 12593 @Readable 12594 public static final String CONNECTIVITY_CHANGE_DELAY = "connectivity_change_delay"; 12595 12596 12597 /** 12598 * Network sampling interval, in seconds. We'll generate link information 12599 * about bytes/packets sent and error rates based on data sampled in this interval 12600 * 12601 * @hide 12602 */ 12603 @Readable 12604 public static final String CONNECTIVITY_SAMPLING_INTERVAL_IN_SECONDS = 12605 "connectivity_sampling_interval_in_seconds"; 12606 12607 /** 12608 * The series of successively longer delays used in retrying to download PAC file. 12609 * Last delay is used between successful PAC downloads. 12610 * 12611 * @hide 12612 */ 12613 @Readable 12614 public static final String PAC_CHANGE_DELAY = "pac_change_delay"; 12615 12616 /** 12617 * Don't attempt to detect captive portals. 12618 * 12619 * @hide 12620 */ 12621 public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; 12622 12623 /** 12624 * When detecting a captive portal, display a notification that 12625 * prompts the user to sign in. 12626 * 12627 * @hide 12628 */ 12629 public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; 12630 12631 /** 12632 * When detecting a captive portal, immediately disconnect from the 12633 * network and do not reconnect to that network in the future. 12634 * 12635 * @hide 12636 */ 12637 public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; 12638 12639 /** 12640 * What to do when connecting a network that presents a captive portal. 12641 * Must be one of the CAPTIVE_PORTAL_MODE_* constants above. 12642 * 12643 * The default for this setting is CAPTIVE_PORTAL_MODE_PROMPT. 12644 * @hide 12645 */ 12646 @Readable 12647 public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode"; 12648 12649 /** 12650 * Setting to turn off captive portal detection. Feature is enabled by 12651 * default and the setting needs to be set to 0 to disable it. 12652 * 12653 * @deprecated use CAPTIVE_PORTAL_MODE_IGNORE to disable captive portal detection 12654 * @hide 12655 */ 12656 @Deprecated 12657 @Readable 12658 public static final String 12659 CAPTIVE_PORTAL_DETECTION_ENABLED = "captive_portal_detection_enabled"; 12660 12661 /** 12662 * The server used for captive portal detection upon a new conection. A 12663 * 204 response code from the server is used for validation. 12664 * TODO: remove this deprecated symbol. 12665 * 12666 * @hide 12667 */ 12668 @Readable 12669 public static final String CAPTIVE_PORTAL_SERVER = "captive_portal_server"; 12670 12671 /** 12672 * The URL used for HTTPS captive portal detection upon a new connection. 12673 * A 204 response code from the server is used for validation. 12674 * 12675 * @hide 12676 */ 12677 @Readable 12678 public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; 12679 12680 /** 12681 * The URL used for HTTP captive portal detection upon a new connection. 12682 * A 204 response code from the server is used for validation. 12683 * 12684 * @hide 12685 */ 12686 @Readable 12687 public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url"; 12688 12689 /** 12690 * The URL used for fallback HTTP captive portal detection when previous HTTP 12691 * and HTTPS captive portal detection attemps did not return a conclusive answer. 12692 * 12693 * @hide 12694 */ 12695 @Readable 12696 public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; 12697 12698 /** 12699 * A comma separated list of URLs used for captive portal detection in addition to the 12700 * fallback HTTP url associated with the CAPTIVE_PORTAL_FALLBACK_URL settings. 12701 * 12702 * @hide 12703 */ 12704 @Readable 12705 public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = 12706 "captive_portal_other_fallback_urls"; 12707 12708 /** 12709 * A list of captive portal detection specifications used in addition to the fallback URLs. 12710 * Each spec has the format url@@/@@statusCodeRegex@@/@@contentRegex. Specs are separated 12711 * by "@@,@@". 12712 * @hide 12713 */ 12714 @Readable 12715 public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = 12716 "captive_portal_fallback_probe_specs"; 12717 12718 /** 12719 * Whether to use HTTPS for network validation. This is enabled by default and the setting 12720 * needs to be set to 0 to disable it. This setting is a misnomer because captive portals 12721 * don't actually use HTTPS, but it's consistent with the other settings. 12722 * 12723 * @hide 12724 */ 12725 @Readable 12726 public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https"; 12727 12728 /** 12729 * Which User-Agent string to use in the header of the captive portal detection probes. 12730 * The User-Agent field is unset when this setting has no value (HttpUrlConnection default). 12731 * 12732 * @hide 12733 */ 12734 @Readable 12735 public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent"; 12736 12737 /** 12738 * Whether to try cellular data recovery when a bad network is reported. 12739 * 12740 * @hide 12741 */ 12742 @Readable 12743 public static final String DATA_STALL_RECOVERY_ON_BAD_NETWORK = 12744 "data_stall_recovery_on_bad_network"; 12745 12746 /** 12747 * Minumim duration in millisecodns between cellular data recovery attempts 12748 * 12749 * @hide 12750 */ 12751 @Readable 12752 public static final String MIN_DURATION_BETWEEN_RECOVERY_STEPS_IN_MS = 12753 "min_duration_between_recovery_steps"; 12754 /** 12755 * Whether network service discovery is enabled. 12756 * 12757 * @hide 12758 */ 12759 @Readable 12760 public static final String NSD_ON = "nsd_on"; 12761 12762 /** 12763 * Let user pick default install location. 12764 * 12765 * @hide 12766 */ 12767 @Readable 12768 public static final String SET_INSTALL_LOCATION = "set_install_location"; 12769 12770 /** 12771 * Default install location value. 12772 * 0 = auto, let system decide 12773 * 1 = internal 12774 * 2 = sdcard 12775 * @hide 12776 */ 12777 @Readable 12778 public static final String DEFAULT_INSTALL_LOCATION = "default_install_location"; 12779 12780 /** 12781 * ms during which to consume extra events related to Inet connection 12782 * condition after a transtion to fully-connected 12783 * 12784 * @hide 12785 */ 12786 @Readable 12787 public static final String 12788 INET_CONDITION_DEBOUNCE_UP_DELAY = "inet_condition_debounce_up_delay"; 12789 12790 /** 12791 * ms during which to consume extra events related to Inet connection 12792 * condtion after a transtion to partly-connected 12793 * 12794 * @hide 12795 */ 12796 @Readable 12797 public static final String 12798 INET_CONDITION_DEBOUNCE_DOWN_DELAY = "inet_condition_debounce_down_delay"; 12799 12800 /** {@hide} */ 12801 @Readable 12802 public static final String 12803 READ_EXTERNAL_STORAGE_ENFORCED_DEFAULT = "read_external_storage_enforced_default"; 12804 12805 /** 12806 * Host name and port for global http proxy. Uses ':' seperator for 12807 * between host and port. 12808 */ 12809 @Readable 12810 public static final String HTTP_PROXY = "http_proxy"; 12811 12812 /** 12813 * Host name for global http proxy. Set via ConnectivityManager. 12814 * 12815 * @hide 12816 */ 12817 @Readable 12818 public static final String GLOBAL_HTTP_PROXY_HOST = "global_http_proxy_host"; 12819 12820 /** 12821 * Integer host port for global http proxy. Set via ConnectivityManager. 12822 * 12823 * @hide 12824 */ 12825 @Readable 12826 public static final String GLOBAL_HTTP_PROXY_PORT = "global_http_proxy_port"; 12827 12828 /** 12829 * Exclusion list for global proxy. This string contains a list of 12830 * comma-separated domains where the global proxy does not apply. 12831 * Domains should be listed in a comma- separated list. Example of 12832 * acceptable formats: ".domain1.com,my.domain2.com" Use 12833 * ConnectivityManager to set/get. 12834 * 12835 * @hide 12836 */ 12837 @Readable 12838 public static final String 12839 GLOBAL_HTTP_PROXY_EXCLUSION_LIST = "global_http_proxy_exclusion_list"; 12840 12841 /** 12842 * The location PAC File for the proxy. 12843 * @hide 12844 */ 12845 @Readable 12846 public static final String 12847 GLOBAL_HTTP_PROXY_PAC = "global_proxy_pac_url"; 12848 12849 /** 12850 * Enables the UI setting to allow the user to specify the global HTTP 12851 * proxy and associated exclusion list. 12852 * 12853 * @hide 12854 */ 12855 @Readable 12856 public static final String SET_GLOBAL_HTTP_PROXY = "set_global_http_proxy"; 12857 12858 /** 12859 * Setting for default DNS in case nobody suggests one 12860 * 12861 * @hide 12862 */ 12863 @Readable 12864 public static final String DEFAULT_DNS_SERVER = "default_dns_server"; 12865 12866 /** 12867 * The requested Private DNS mode (string), and an accompanying specifier (string). 12868 * 12869 * Currently, the specifier holds the chosen provider name when the mode requests 12870 * a specific provider. It may be used to store the provider name even when the 12871 * mode changes so that temporarily disabling and re-enabling the specific 12872 * provider mode does not necessitate retyping the provider hostname. 12873 * 12874 * @hide 12875 */ 12876 @Readable 12877 public static final String PRIVATE_DNS_MODE = "private_dns_mode"; 12878 12879 /** 12880 * @hide 12881 */ 12882 @Readable 12883 public static final String PRIVATE_DNS_SPECIFIER = "private_dns_specifier"; 12884 12885 /** 12886 * Forced override of the default mode (hardcoded as "automatic", nee "opportunistic"). 12887 * This allows changing the default mode without effectively disabling other modes, 12888 * all of which require explicit user action to enable/configure. See also b/79719289. 12889 * 12890 * Value is a string, suitable for assignment to PRIVATE_DNS_MODE above. 12891 * 12892 * {@hide} 12893 */ 12894 @Readable 12895 public static final String PRIVATE_DNS_DEFAULT_MODE = "private_dns_default_mode"; 12896 12897 12898 /** {@hide} */ 12899 @Readable 12900 public static final String 12901 BLUETOOTH_BTSNOOP_DEFAULT_MODE = "bluetooth_btsnoop_default_mode"; 12902 /** {@hide} */ 12903 @Readable 12904 public static final String 12905 BLUETOOTH_HEADSET_PRIORITY_PREFIX = "bluetooth_headset_priority_"; 12906 /** {@hide} */ 12907 @Readable 12908 public static final String 12909 BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; 12910 /** {@hide} */ 12911 @Readable 12912 public static final String 12913 BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; 12914 /** {@hide} */ 12915 @Readable 12916 public static final String BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX = 12917 "bluetooth_a2dp_supports_optional_codecs_"; 12918 /** {@hide} */ 12919 @Readable 12920 public static final String BLUETOOTH_A2DP_OPTIONAL_CODECS_ENABLED_PREFIX = 12921 "bluetooth_a2dp_optional_codecs_enabled_"; 12922 /** {@hide} */ 12923 @Readable 12924 public static final String 12925 BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; 12926 /** {@hide} */ 12927 @Readable 12928 public static final String 12929 BLUETOOTH_MAP_PRIORITY_PREFIX = "bluetooth_map_priority_"; 12930 /** {@hide} */ 12931 @Readable 12932 public static final String 12933 BLUETOOTH_MAP_CLIENT_PRIORITY_PREFIX = "bluetooth_map_client_priority_"; 12934 /** {@hide} */ 12935 @Readable 12936 public static final String 12937 BLUETOOTH_PBAP_CLIENT_PRIORITY_PREFIX = "bluetooth_pbap_client_priority_"; 12938 /** {@hide} */ 12939 @Readable 12940 public static final String 12941 BLUETOOTH_SAP_PRIORITY_PREFIX = "bluetooth_sap_priority_"; 12942 /** {@hide} */ 12943 @Readable 12944 public static final String 12945 BLUETOOTH_PAN_PRIORITY_PREFIX = "bluetooth_pan_priority_"; 12946 /** {@hide} */ 12947 @Readable 12948 public static final String 12949 BLUETOOTH_HEARING_AID_PRIORITY_PREFIX = "bluetooth_hearing_aid_priority_"; 12950 12951 /** 12952 * Enable/disable radio bug detection 12953 * 12954 * {@hide} 12955 */ 12956 @Readable 12957 public static final String 12958 ENABLE_RADIO_BUG_DETECTION = "enable_radio_bug_detection"; 12959 12960 /** 12961 * Count threshold of RIL wakelock timeout for radio bug detection 12962 * 12963 * {@hide} 12964 */ 12965 @Readable 12966 public static final String 12967 RADIO_BUG_WAKELOCK_TIMEOUT_COUNT_THRESHOLD = 12968 "radio_bug_wakelock_timeout_count_threshold"; 12969 12970 /** 12971 * Count threshold of RIL system error for radio bug detection 12972 * 12973 * {@hide} 12974 */ 12975 @Readable 12976 public static final String 12977 RADIO_BUG_SYSTEM_ERROR_COUNT_THRESHOLD = 12978 "radio_bug_system_error_count_threshold"; 12979 12980 /** 12981 * Activity manager specific settings. 12982 * This is encoded as a key=value list, separated by commas. Ex: 12983 * 12984 * "gc_timeout=5000,max_cached_processes=24" 12985 * 12986 * The following keys are supported: 12987 * 12988 * <pre> 12989 * max_cached_processes (int) 12990 * background_settle_time (long) 12991 * fgservice_min_shown_time (long) 12992 * fgservice_min_report_time (long) 12993 * fgservice_screen_on_before_time (long) 12994 * fgservice_screen_on_after_time (long) 12995 * content_provider_retain_time (long) 12996 * gc_timeout (long) 12997 * gc_min_interval (long) 12998 * full_pss_min_interval (long) 12999 * full_pss_lowered_interval (long) 13000 * power_check_interval (long) 13001 * power_check_max_cpu_1 (int) 13002 * power_check_max_cpu_2 (int) 13003 * power_check_max_cpu_3 (int) 13004 * power_check_max_cpu_4 (int) 13005 * service_usage_interaction_time (long) 13006 * usage_stats_interaction_interval (long) 13007 * service_restart_duration (long) 13008 * service_reset_run_duration (long) 13009 * service_restart_duration_factor (int) 13010 * service_min_restart_time_between (long) 13011 * service_max_inactivity (long) 13012 * service_bg_start_timeout (long) 13013 * service_bg_activity_start_timeout (long) 13014 * process_start_async (boolean) 13015 * </pre> 13016 * 13017 * <p> 13018 * Type: string 13019 * @hide 13020 * @see com.android.server.am.ActivityManagerConstants 13021 */ 13022 @Readable 13023 public static final String ACTIVITY_MANAGER_CONSTANTS = "activity_manager_constants"; 13024 13025 /** 13026 * Feature flag to enable or disable the activity starts logging feature. 13027 * Type: int (0 for false, 1 for true) 13028 * Default: 1 13029 * @hide 13030 */ 13031 @Readable 13032 public static final String ACTIVITY_STARTS_LOGGING_ENABLED 13033 = "activity_starts_logging_enabled"; 13034 13035 /** 13036 * Feature flag to enable or disable the foreground service starts logging feature. 13037 * Type: int (0 for false, 1 for true) 13038 * Default: 1 13039 * @hide 13040 */ 13041 @Readable 13042 public static final String FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED = 13043 "foreground_service_starts_logging_enabled"; 13044 13045 /** 13046 * @hide 13047 * @see com.android.server.appbinding.AppBindingConstants 13048 */ 13049 @Readable 13050 public static final String APP_BINDING_CONSTANTS = "app_binding_constants"; 13051 13052 /** 13053 * App ops specific settings. 13054 * This is encoded as a key=value list, separated by commas. Ex: 13055 * 13056 * "state_settle_time=10000" 13057 * 13058 * The following keys are supported: 13059 * 13060 * <pre> 13061 * top_state_settle_time (long) 13062 * fg_service_state_settle_time (long) 13063 * bg_state_settle_time (long) 13064 * </pre> 13065 * 13066 * <p> 13067 * Type: string 13068 * @hide 13069 * @see com.android.server.AppOpsService.Constants 13070 */ 13071 @TestApi 13072 @Readable 13073 public static final String APP_OPS_CONSTANTS = "app_ops_constants"; 13074 13075 /** 13076 * Battery Saver specific settings 13077 * This is encoded as a key=value list, separated by commas. Ex: 13078 * 13079 * "vibration_disabled=true,adjust_brightness_factor=0.5" 13080 * 13081 * The following keys are supported: 13082 * 13083 * <pre> 13084 * advertise_is_enabled (boolean) 13085 * datasaver_disabled (boolean) 13086 * enable_night_mode (boolean) 13087 * launch_boost_disabled (boolean) 13088 * vibration_disabled (boolean) 13089 * animation_disabled (boolean) 13090 * soundtrigger_disabled (boolean) 13091 * fullbackup_deferred (boolean) 13092 * keyvaluebackup_deferred (boolean) 13093 * firewall_disabled (boolean) 13094 * gps_mode (int) 13095 * adjust_brightness_disabled (boolean) 13096 * adjust_brightness_factor (float) 13097 * force_all_apps_standby (boolean) 13098 * force_background_check (boolean) 13099 * optional_sensors_disabled (boolean) 13100 * aod_disabled (boolean) 13101 * quick_doze_enabled (boolean) 13102 * </pre> 13103 * @hide 13104 * @see com.android.server.power.batterysaver.BatterySaverPolicy 13105 */ 13106 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 13107 @TestApi 13108 @Readable 13109 public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; 13110 13111 /** 13112 * Battery Saver device specific settings 13113 * This is encoded as a key=value list, separated by commas. 13114 * 13115 * The following keys are supported: 13116 * 13117 * <pre> 13118 * cpufreq-i (list of "core-number:frequency" pairs concatenated with /) 13119 * cpufreq-n (list of "core-number:frequency" pairs concatenated with /) 13120 * </pre> 13121 * 13122 * See {@link com.android.server.power.batterysaver.BatterySaverPolicy} for the details. 13123 * 13124 * @hide 13125 */ 13126 @Readable 13127 public static final String BATTERY_SAVER_DEVICE_SPECIFIC_CONSTANTS = 13128 "battery_saver_device_specific_constants"; 13129 13130 /** 13131 * Battery tip specific settings 13132 * This is encoded as a key=value list, separated by commas. Ex: 13133 * 13134 * "battery_tip_enabled=true,summary_enabled=true,high_usage_enabled=true," 13135 * "high_usage_app_count=3,reduced_battery_enabled=false,reduced_battery_percent=50," 13136 * "high_usage_battery_draining=25,high_usage_period_ms=3000" 13137 * 13138 * The following keys are supported: 13139 * 13140 * <pre> 13141 * battery_tip_enabled (boolean) 13142 * summary_enabled (boolean) 13143 * battery_saver_tip_enabled (boolean) 13144 * high_usage_enabled (boolean) 13145 * high_usage_app_count (int) 13146 * high_usage_period_ms (long) 13147 * high_usage_battery_draining (int) 13148 * app_restriction_enabled (boolean) 13149 * reduced_battery_enabled (boolean) 13150 * reduced_battery_percent (int) 13151 * low_battery_enabled (boolean) 13152 * low_battery_hour (int) 13153 * </pre> 13154 * @hide 13155 */ 13156 @Readable 13157 public static final String BATTERY_TIP_CONSTANTS = "battery_tip_constants"; 13158 13159 /** 13160 * Battery anomaly detection specific settings 13161 * This is encoded as a key=value list, separated by commas. 13162 * wakeup_blacklisted_tags is a string, encoded as a set of tags, encoded via 13163 * {@link Uri#encode(String)}, separated by colons. Ex: 13164 * 13165 * "anomaly_detection_enabled=true,wakelock_threshold=2000,wakeup_alarm_enabled=true," 13166 * "wakeup_alarm_threshold=10,wakeup_blacklisted_tags=tag1:tag2:with%2Ccomma:with%3Acolon" 13167 * 13168 * The following keys are supported: 13169 * 13170 * <pre> 13171 * anomaly_detection_enabled (boolean) 13172 * wakelock_enabled (boolean) 13173 * wakelock_threshold (long) 13174 * wakeup_alarm_enabled (boolean) 13175 * wakeup_alarm_threshold (long) 13176 * wakeup_blacklisted_tags (string) 13177 * bluetooth_scan_enabled (boolean) 13178 * bluetooth_scan_threshold (long) 13179 * </pre> 13180 * @hide 13181 */ 13182 @Readable 13183 public static final String ANOMALY_DETECTION_CONSTANTS = "anomaly_detection_constants"; 13184 13185 /** 13186 * An integer to show the version of the anomaly config. Ex: 1, which means 13187 * current version is 1. 13188 * @hide 13189 */ 13190 @Readable 13191 public static final String ANOMALY_CONFIG_VERSION = "anomaly_config_version"; 13192 13193 /** 13194 * A base64-encoded string represents anomaly stats config, used for 13195 * {@link android.app.StatsManager}. 13196 * @hide 13197 */ 13198 @Readable 13199 public static final String ANOMALY_CONFIG = "anomaly_config"; 13200 13201 /** 13202 * Always on display(AOD) specific settings 13203 * This is encoded as a key=value list, separated by commas. Ex: 13204 * 13205 * "prox_screen_off_delay=10000,screen_brightness_array=0:1:2:3:4" 13206 * 13207 * The following keys are supported: 13208 * 13209 * <pre> 13210 * screen_brightness_array (int[]) 13211 * dimming_scrim_array (int[]) 13212 * prox_screen_off_delay (long) 13213 * prox_cooldown_trigger (long) 13214 * prox_cooldown_period (long) 13215 * </pre> 13216 * @hide 13217 */ 13218 @Readable 13219 public static final String ALWAYS_ON_DISPLAY_CONSTANTS = "always_on_display_constants"; 13220 13221 /** 13222 * UidCpuPower global setting. This links the sys.uidcpupower system property. 13223 * The following values are supported: 13224 * 0 -> /proc/uid_cpupower/* are disabled 13225 * 1 -> /proc/uid_cpupower/* are enabled 13226 * Any other value defaults to enabled. 13227 * @hide 13228 */ 13229 @Readable 13230 public static final String SYS_UIDCPUPOWER = "sys_uidcpupower"; 13231 13232 /** 13233 * traced global setting. This controls weather the deamons: traced and 13234 * traced_probes run. This links the sys.traced system property. 13235 * The following values are supported: 13236 * 0 -> traced and traced_probes are disabled 13237 * 1 -> traced and traced_probes are enabled 13238 * Any other value defaults to disabled. 13239 * @hide 13240 */ 13241 @Readable 13242 public static final String SYS_TRACED = "sys_traced"; 13243 13244 /** 13245 * An integer to reduce the FPS by this factor. Only for experiments. Need to reboot the 13246 * device for this setting to take full effect. 13247 * 13248 * @hide 13249 */ 13250 @Readable 13251 public static final String FPS_DEVISOR = "fps_divisor"; 13252 13253 /** 13254 * Flag to enable or disable display panel low power mode (lpm) 13255 * false -> Display panel power saving mode is disabled. 13256 * true -> Display panel power saving mode is enabled. 13257 * 13258 * @hide 13259 */ 13260 @Readable 13261 public static final String DISPLAY_PANEL_LPM = "display_panel_lpm"; 13262 13263 /** 13264 * App time limit usage source setting. 13265 * This controls which app in a task will be considered the source of usage when 13266 * calculating app usage time limits. 13267 * 13268 * 1 -> task root app 13269 * 2 -> current app 13270 * Any other value defaults to task root app. 13271 * 13272 * Need to reboot the device for this setting to take effect. 13273 * @hide 13274 */ 13275 @Readable 13276 public static final String APP_TIME_LIMIT_USAGE_SOURCE = "app_time_limit_usage_source"; 13277 13278 /** 13279 * Enable ART bytecode verification verifications for debuggable apps. 13280 * 0 = disable, 1 = enable. 13281 * @hide 13282 */ 13283 @Readable 13284 public static final String ART_VERIFIER_VERIFY_DEBUGGABLE = 13285 "art_verifier_verify_debuggable"; 13286 13287 /** 13288 * Power manager specific settings. 13289 * This is encoded as a key=value list, separated by commas. Ex: 13290 * 13291 * "no_cached_wake_locks=1" 13292 * 13293 * The following keys are supported: 13294 * 13295 * <pre> 13296 * no_cached_wake_locks (boolean) 13297 * </pre> 13298 * 13299 * <p> 13300 * Type: string 13301 * @hide 13302 * @see com.android.server.power.PowerManagerConstants 13303 */ 13304 @Readable 13305 public static final String POWER_MANAGER_CONSTANTS = "power_manager_constants"; 13306 13307 /** 13308 * ShortcutManager specific settings. 13309 * This is encoded as a key=value list, separated by commas. Ex: 13310 * 13311 * "reset_interval_sec=86400,max_updates_per_interval=1" 13312 * 13313 * The following keys are supported: 13314 * 13315 * <pre> 13316 * reset_interval_sec (long) 13317 * max_updates_per_interval (int) 13318 * max_icon_dimension_dp (int, DP) 13319 * max_icon_dimension_dp_lowram (int, DP) 13320 * max_shortcuts (int) 13321 * icon_quality (int, 0-100) 13322 * icon_format (String) 13323 * </pre> 13324 * 13325 * <p> 13326 * Type: string 13327 * @hide 13328 * @see com.android.server.pm.ShortcutService.ConfigConstants 13329 */ 13330 @Readable 13331 public static final String SHORTCUT_MANAGER_CONSTANTS = "shortcut_manager_constants"; 13332 13333 /** 13334 * DevicePolicyManager specific settings. 13335 * This is encoded as a key=value list, separated by commas. Ex: 13336 * 13337 * <pre> 13338 * das_died_service_reconnect_backoff_sec (long) 13339 * das_died_service_reconnect_backoff_increase (float) 13340 * das_died_service_reconnect_max_backoff_sec (long) 13341 * </pre> 13342 * 13343 * <p> 13344 * Type: string 13345 * @hide 13346 * see also com.android.server.devicepolicy.DevicePolicyConstants 13347 */ 13348 @Readable 13349 public static final String DEVICE_POLICY_CONSTANTS = "device_policy_constants"; 13350 13351 /** 13352 * TextClassifier specific settings. 13353 * This is encoded as a key=value list, separated by commas. String[] types like 13354 * entity_list_default use ":" as delimiter for values. Ex: 13355 * 13356 * <pre> 13357 * classify_text_max_range_length (int) 13358 * detect_language_from_text_enabled (boolean) 13359 * entity_list_default (String[]) 13360 * entity_list_editable (String[]) 13361 * entity_list_not_editable (String[]) 13362 * generate_links_log_sample_rate (int) 13363 * generate_links_max_text_length (int) 13364 * in_app_conversation_action_types_default (String[]) 13365 * lang_id_context_settings (float[]) 13366 * lang_id_threshold_override (float) 13367 * local_textclassifier_enabled (boolean) 13368 * model_dark_launch_enabled (boolean) 13369 * notification_conversation_action_types_default (String[]) 13370 * smart_linkify_enabled (boolean) 13371 * smart_select_animation_enabled (boolean) 13372 * smart_selection_enabled (boolean) 13373 * smart_text_share_enabled (boolean) 13374 * suggest_selection_max_range_length (int) 13375 * system_textclassifier_enabled (boolean) 13376 * template_intent_factory_enabled (boolean) 13377 * translate_in_classification_enabled (boolean) 13378 * </pre> 13379 * 13380 * <p> 13381 * Type: string 13382 * @hide 13383 * see also android.view.textclassifier.TextClassificationConstants 13384 */ 13385 @Readable 13386 public static final String TEXT_CLASSIFIER_CONSTANTS = "text_classifier_constants"; 13387 13388 /** 13389 * BatteryStats specific settings. 13390 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13391 * 13392 * The following keys are supported: 13393 * <pre> 13394 * track_cpu_times_by_proc_state (boolean) 13395 * track_cpu_active_cluster_time (boolean) 13396 * read_binary_cpu_time (boolean) 13397 * proc_state_cpu_times_read_delay_ms (long) 13398 * external_stats_collection_rate_limit_ms (long) 13399 * battery_level_collection_delay_ms (long) 13400 * max_history_files (int) 13401 * max_history_buffer_kb (int) 13402 * battery_charged_delay_ms (int) 13403 * </pre> 13404 * 13405 * <p> 13406 * Type: string 13407 * @hide 13408 * see also com.android.internal.os.BatteryStatsImpl.Constants 13409 */ 13410 @Readable 13411 public static final String BATTERY_STATS_CONSTANTS = "battery_stats_constants"; 13412 13413 /** 13414 * SyncManager specific settings. 13415 * 13416 * <p> 13417 * Type: string 13418 * @hide 13419 * @see com.android.server.content.SyncManagerConstants 13420 */ 13421 @Readable 13422 public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; 13423 13424 /** 13425 * Broadcast dispatch tuning parameters specific to foreground broadcasts. 13426 * 13427 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13428 * 13429 * The following keys are supported: 13430 * <pre> 13431 * bcast_timeout (long) 13432 * bcast_slow_time (long) 13433 * bcast_deferral (long) 13434 * bcast_deferral_decay_factor (float) 13435 * bcast_deferral_floor (long) 13436 * bcast_allow_bg_activity_start_timeout (long) 13437 * </pre> 13438 * 13439 * @hide 13440 */ 13441 @Readable 13442 public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants"; 13443 13444 /** 13445 * Broadcast dispatch tuning parameters specific to background broadcasts. 13446 * 13447 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 13448 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 13449 * 13450 * @hide 13451 */ 13452 @Readable 13453 public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants"; 13454 13455 /** 13456 * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts. 13457 * 13458 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". 13459 * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. 13460 * 13461 * @hide 13462 */ 13463 @Readable 13464 public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants"; 13465 13466 /** 13467 * Whether or not App Standby feature is enabled by system. This controls throttling of apps 13468 * based on usage patterns and predictions. Platform will turn on this feature if both this 13469 * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. 13470 * Type: int (0 for false, 1 for true) 13471 * Default: 1 13472 * @hide 13473 * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED 13474 */ 13475 @SystemApi 13476 @Readable 13477 public static final String APP_STANDBY_ENABLED = "app_standby_enabled"; 13478 13479 /** 13480 * Whether or not adaptive battery feature is enabled by user. Platform will turn on this 13481 * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on. 13482 * Type: int (0 for false, 1 for true) 13483 * Default: 1 13484 * @hide 13485 * @see #APP_STANDBY_ENABLED 13486 */ 13487 @Readable 13488 public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED = 13489 "adaptive_battery_management_enabled"; 13490 13491 /** 13492 * Whether or not apps are allowed into the 13493 * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED} bucket. 13494 * Type: int (0 for false, 1 for true) 13495 * Default: {@value #DEFAULT_ENABLE_RESTRICTED_BUCKET} 13496 * 13497 * @hide 13498 */ 13499 @Readable 13500 public static final String ENABLE_RESTRICTED_BUCKET = "enable_restricted_bucket"; 13501 13502 /** 13503 * @see #ENABLE_RESTRICTED_BUCKET 13504 * @hide 13505 */ 13506 public static final int DEFAULT_ENABLE_RESTRICTED_BUCKET = 1; 13507 13508 /** 13509 * Whether or not app auto restriction is enabled. When it is enabled, settings app will 13510 * auto restrict the app if it has bad behavior (e.g. hold wakelock for long time). 13511 * 13512 * Type: boolean (0 for false, 1 for true) 13513 * Default: 1 13514 * 13515 * @hide 13516 */ 13517 @Readable 13518 public static final String APP_AUTO_RESTRICTION_ENABLED = 13519 "app_auto_restriction_enabled"; 13520 13521 /** 13522 * Feature flag to enable or disable the Forced App Standby feature. 13523 * Type: int (0 for false, 1 for true) 13524 * Default: 1 13525 * @hide 13526 */ 13527 @Readable 13528 public static final String FORCED_APP_STANDBY_ENABLED = "forced_app_standby_enabled"; 13529 13530 /** 13531 * Whether or not to enable Forced App Standby on small battery devices. 13532 * Type: int (0 for false, 1 for true) 13533 * Default: 0 13534 * @hide 13535 */ 13536 @Readable 13537 public static final String FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED 13538 = "forced_app_standby_for_small_battery_enabled"; 13539 13540 /** 13541 * Whether or not to enable the User Absent, Radios Off feature on small battery devices. 13542 * Type: int (0 for false, 1 for true) 13543 * Default: 0 13544 * @hide 13545 */ 13546 @Readable 13547 public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED 13548 = "user_absent_radios_off_for_small_battery_enabled"; 13549 13550 /** 13551 * Whether or not to enable the User Absent, Touch Off feature on small battery devices. 13552 * Type: int (0 for false, 1 for true) 13553 * Default: 0 13554 * @hide 13555 */ 13556 @Readable 13557 public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED 13558 = "user_absent_touch_off_for_small_battery_enabled"; 13559 13560 /** 13561 * Whether or not to turn on Wifi when proxy is disconnected. 13562 * Type: int (0 for false, 1 for true) 13563 * Default: 1 13564 * @hide 13565 */ 13566 @Readable 13567 public static final String WIFI_ON_WHEN_PROXY_DISCONNECTED 13568 = "wifi_on_when_proxy_disconnected"; 13569 13570 /** 13571 * Time Only Mode specific settings. 13572 * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" 13573 * 13574 * The following keys are supported: 13575 * 13576 * <pre> 13577 * enabled (boolean) 13578 * disable_home (boolean) 13579 * disable_tilt_to_wake (boolean) 13580 * disable_touch_to_wake (boolean) 13581 * </pre> 13582 * Type: string 13583 * @hide 13584 */ 13585 @Readable 13586 public static final String TIME_ONLY_MODE_CONSTANTS 13587 = "time_only_mode_constants"; 13588 13589 /** 13590 * Whether of not to send keycode sleep for ungaze when Home is the foreground activity on 13591 * watch type devices. 13592 * Type: int (0 for false, 1 for true) 13593 * Default: 0 13594 * @hide 13595 */ 13596 @Readable 13597 public static final String UNGAZE_SLEEP_ENABLED = "ungaze_sleep_enabled"; 13598 13599 /** 13600 * Whether or not Network Watchlist feature is enabled. 13601 * Type: int (0 for false, 1 for true) 13602 * Default: 0 13603 * @hide 13604 */ 13605 @Readable 13606 public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled"; 13607 13608 /** 13609 * Whether or not show hidden launcher icon apps feature is enabled. 13610 * Type: int (0 for false, 1 for true) 13611 * Default: 1 13612 * @hide 13613 */ 13614 @Readable 13615 public static final String SHOW_HIDDEN_LAUNCHER_ICON_APPS_ENABLED = 13616 "show_hidden_icon_apps_enabled"; 13617 13618 /** 13619 * Whether or not show new app installed notification is enabled. 13620 * Type: int (0 for false, 1 for true) 13621 * Default: 0 13622 * @hide 13623 */ 13624 @Readable 13625 public static final String SHOW_NEW_APP_INSTALLED_NOTIFICATION_ENABLED = 13626 "show_new_app_installed_notification_enabled"; 13627 13628 /** 13629 * Flag to keep background restricted profiles running after exiting. If disabled, 13630 * the restricted profile can be put into stopped state as soon as the user leaves it. 13631 * Type: int (0 for false, 1 for true) 13632 * 13633 * Overridden by the system based on device information. If null, the value specified 13634 * by {@code config_keepRestrictedProfilesInBackground} is used. 13635 * 13636 * @hide 13637 */ 13638 @Readable 13639 public static final String KEEP_PROFILE_IN_BACKGROUND = "keep_profile_in_background"; 13640 13641 /** 13642 * The default time in ms within which a subsequent connection from an always allowed system 13643 * is allowed to reconnect without user interaction. 13644 * 13645 * @hide 13646 */ 13647 public static final long DEFAULT_ADB_ALLOWED_CONNECTION_TIME = 604800000; 13648 13649 /** 13650 * When the user first connects their device to a system a prompt is displayed to allow 13651 * the adb connection with an option to 'Always allow' connections from this system. If the 13652 * user selects this always allow option then the connection time is stored for the system. 13653 * This setting is the time in ms within which a subsequent connection from an always 13654 * allowed system is allowed to reconnect without user interaction. 13655 * 13656 * Type: long 13657 * 13658 * @hide 13659 */ 13660 @Readable 13661 public static final String ADB_ALLOWED_CONNECTION_TIME = 13662 "adb_allowed_connection_time"; 13663 13664 /** 13665 * Scaling factor for normal window animations. 13666 * 13667 * The value is a float. Setting to 0.0f will disable window animations. 13668 */ 13669 @Readable 13670 public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale"; 13671 13672 /** 13673 * Setting to disable cross-window blurs. This includes window blur behind, (see 13674 * {@link LayoutParams#setBlurBehindRadius}) and window background blur (see 13675 * {@link Window#setBackgroundBlurRadius}). 13676 * 13677 * The value is a boolean (1 or 0). 13678 * @hide 13679 */ 13680 @TestApi 13681 @Readable 13682 @SuppressLint("NoSettingsProvider") 13683 public static final String DISABLE_WINDOW_BLURS = "disable_window_blurs"; 13684 13685 /** 13686 * Scaling factor for activity transition animations. 13687 * 13688 * The value is a float. Setting to 0.0f will disable window animations. 13689 */ 13690 @Readable 13691 public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale"; 13692 13693 /** 13694 * Scaling factor for Animator-based animations. This affects both the 13695 * start delay and duration of all such animations. 13696 * 13697 * The value is a float. Setting to 0.0f will cause animations to end immediately. 13698 * The default value is 1.0f. 13699 */ 13700 @Readable 13701 public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale"; 13702 13703 /** 13704 * Scaling factor for normal window animations. Setting to 0 will 13705 * disable window animations. 13706 * 13707 * @hide 13708 */ 13709 @Readable 13710 public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations"; 13711 13712 /** 13713 * If 0, the compatibility mode is off for all applications. 13714 * If 1, older applications run under compatibility mode. 13715 * TODO: remove this settings before code freeze (bug/1907571) 13716 * @hide 13717 */ 13718 @Readable 13719 public static final String COMPATIBILITY_MODE = "compatibility_mode"; 13720 13721 /** 13722 * CDMA only settings 13723 * Emergency Tone 0 = Off 13724 * 1 = Alert 13725 * 2 = Vibrate 13726 * @hide 13727 */ 13728 @Readable 13729 public static final String EMERGENCY_TONE = "emergency_tone"; 13730 13731 /** 13732 * CDMA only settings 13733 * Whether the auto retry is enabled. The value is 13734 * boolean (1 or 0). 13735 * @hide 13736 */ 13737 @Readable 13738 public static final String CALL_AUTO_RETRY = "call_auto_retry"; 13739 13740 /** 13741 * A setting that can be read whether the emergency affordance is currently needed. 13742 * The value is a boolean (1 or 0). 13743 * @hide 13744 */ 13745 @Readable 13746 public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; 13747 13748 /** 13749 * Whether to enable automatic system server heap dumps. This only works on userdebug or 13750 * eng builds, not on user builds. This is set by the user and overrides the config value. 13751 * 1 means enable, 0 means disable. 13752 * 13753 * @hide 13754 */ 13755 @Readable 13756 public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS = 13757 "enable_automatic_system_server_heap_dumps"; 13758 13759 /** 13760 * See RIL_PreferredNetworkType in ril.h 13761 * @hide 13762 */ 13763 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 13764 @Readable 13765 public static final String PREFERRED_NETWORK_MODE = 13766 "preferred_network_mode"; 13767 13768 /** 13769 * Name of an application package to be debugged. 13770 */ 13771 @Readable 13772 public static final String DEBUG_APP = "debug_app"; 13773 13774 /** 13775 * If 1, when launching DEBUG_APP it will wait for the debugger before 13776 * starting user code. If 0, it will run normally. 13777 */ 13778 @Readable 13779 public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger"; 13780 13781 /** 13782 * Allow GPU debug layers? 13783 * 0 = no 13784 * 1 = yes 13785 * @hide 13786 */ 13787 @Readable 13788 public static final String ENABLE_GPU_DEBUG_LAYERS = "enable_gpu_debug_layers"; 13789 13790 /** 13791 * App allowed to load GPU debug layers 13792 * @hide 13793 */ 13794 @Readable 13795 public static final String GPU_DEBUG_APP = "gpu_debug_app"; 13796 13797 /** 13798 * Package containing ANGLE libraries other than system, which are only available 13799 * to dumpable apps that opt-in. 13800 * @hide 13801 */ 13802 @Readable 13803 public static final String ANGLE_DEBUG_PACKAGE = "angle_debug_package"; 13804 13805 /** 13806 * Force all PKGs to use ANGLE, regardless of any other settings 13807 * The value is a boolean (1 or 0). 13808 * @hide 13809 */ 13810 @Readable 13811 public static final String ANGLE_GL_DRIVER_ALL_ANGLE = "angle_gl_driver_all_angle"; 13812 13813 /** 13814 * List of PKGs that have an OpenGL driver selected 13815 * @hide 13816 */ 13817 @Readable 13818 public static final String ANGLE_GL_DRIVER_SELECTION_PKGS = 13819 "angle_gl_driver_selection_pkgs"; 13820 13821 /** 13822 * List of selected OpenGL drivers, corresponding to the PKGs in GLOBAL_SETTINGS_DRIVER_PKGS 13823 * @hide 13824 */ 13825 @Readable 13826 public static final String ANGLE_GL_DRIVER_SELECTION_VALUES = 13827 "angle_gl_driver_selection_values"; 13828 13829 /** 13830 * Lists of ANGLE EGL features for debugging. 13831 * Each list of features is separated by a comma, each feature in each list is separated by 13832 * a colon. 13833 * e.g. feature1:feature2:feature3,feature1:feature3:feature5 13834 * @hide 13835 */ 13836 @Readable 13837 public static final String ANGLE_EGL_FEATURES = "angle_egl_features"; 13838 13839 /** 13840 * Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver. 13841 * The value is a boolean (1 or 0). 13842 * @hide 13843 */ 13844 @Readable 13845 public static final String SHOW_ANGLE_IN_USE_DIALOG_BOX = "show_angle_in_use_dialog_box"; 13846 13847 /** 13848 * Updatable driver global preference for all Apps. 13849 * 0 = Default 13850 * 1 = All Apps use updatable production driver 13851 * 2 = All apps use updatable prerelease driver 13852 * 3 = All Apps use system graphics driver 13853 * @hide 13854 */ 13855 @Readable 13856 public static final String UPDATABLE_DRIVER_ALL_APPS = "updatable_driver_all_apps"; 13857 13858 /** 13859 * List of Apps selected to use updatable production driver. 13860 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13861 * @hide 13862 */ 13863 @Readable 13864 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS = 13865 "updatable_driver_production_opt_in_apps"; 13866 13867 /** 13868 * List of Apps selected to use updatable prerelease driver. 13869 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13870 * @hide 13871 */ 13872 @Readable 13873 public static final String UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS = 13874 "updatable_driver_prerelease_opt_in_apps"; 13875 13876 /** 13877 * List of Apps selected not to use updatable production driver. 13878 * i.e. <pkg1>,<pkg2>,...,<pkgN> 13879 * @hide 13880 */ 13881 @Readable 13882 public static final String UPDATABLE_DRIVER_PRODUCTION_OPT_OUT_APPS = 13883 "updatable_driver_production_opt_out_apps"; 13884 13885 /** 13886 * Apps on the denylist that are forbidden to use updatable production driver. 13887 * @hide 13888 */ 13889 @Readable 13890 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLIST = 13891 "updatable_driver_production_denylist"; 13892 13893 /** 13894 * List of denylists, each denylist is a denylist for a specific version of 13895 * updatable production driver. 13896 * @hide 13897 */ 13898 @Readable 13899 public static final String UPDATABLE_DRIVER_PRODUCTION_DENYLISTS = 13900 "updatable_driver_production_denylists"; 13901 13902 /** 13903 * Apps on the allowlist that are allowed to use updatable production driver. 13904 * The string is a list of application package names, seperated by comma. 13905 * i.e. <apk1>,<apk2>,...,<apkN> 13906 * @hide 13907 */ 13908 @Readable 13909 public static final String UPDATABLE_DRIVER_PRODUCTION_ALLOWLIST = 13910 "updatable_driver_production_allowlist"; 13911 13912 /** 13913 * List of libraries in sphal accessible by updatable driver 13914 * The string is a list of library names, separated by colon. 13915 * i.e. <lib1>:<lib2>:...:<libN> 13916 * @hide 13917 */ 13918 @Readable 13919 public static final String UPDATABLE_DRIVER_SPHAL_LIBRARIES = 13920 "updatable_driver_sphal_libraries"; 13921 13922 /** 13923 * Ordered GPU debug layer list for Vulkan 13924 * i.e. <layer1>:<layer2>:...:<layerN> 13925 * @hide 13926 */ 13927 @Readable 13928 public static final String GPU_DEBUG_LAYERS = "gpu_debug_layers"; 13929 13930 /** 13931 * Ordered GPU debug layer list for GLES 13932 * i.e. <layer1>:<layer2>:...:<layerN> 13933 * @hide 13934 */ 13935 @Readable 13936 public static final String GPU_DEBUG_LAYERS_GLES = "gpu_debug_layers_gles"; 13937 13938 /** 13939 * Addition app for GPU layer discovery 13940 * @hide 13941 */ 13942 @Readable 13943 public static final String GPU_DEBUG_LAYER_APP = "gpu_debug_layer_app"; 13944 13945 /** 13946 * Control whether the process CPU usage meter should be shown. 13947 * 13948 * @deprecated This functionality is no longer available as of 13949 * {@link android.os.Build.VERSION_CODES#N_MR1}. 13950 */ 13951 @Deprecated 13952 @Readable 13953 public static final String SHOW_PROCESSES = "show_processes"; 13954 13955 /** 13956 * If 1 low power mode (aka battery saver) is enabled. 13957 * @hide 13958 */ 13959 @TestApi 13960 @Readable 13961 public static final String LOW_POWER_MODE = "low_power"; 13962 13963 /** 13964 * If 1, battery saver ({@link #LOW_POWER_MODE}) will be re-activated after the device 13965 * is unplugged from a charger or rebooted. 13966 * @hide 13967 */ 13968 @TestApi 13969 @Readable 13970 public static final String LOW_POWER_MODE_STICKY = "low_power_sticky"; 13971 13972 /** 13973 * When a device is unplugged from a changer (or is rebooted), do not re-activate battery 13974 * saver even if {@link #LOW_POWER_MODE_STICKY} is 1, if the battery level is equal to or 13975 * above this threshold. 13976 * 13977 * @hide 13978 */ 13979 @Readable 13980 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL = 13981 "low_power_sticky_auto_disable_level"; 13982 13983 /** 13984 * Whether sticky battery saver should be deactivated once the battery level has reached the 13985 * threshold specified by {@link #LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL}. 13986 * 13987 * @hide 13988 */ 13989 @Readable 13990 public static final String LOW_POWER_MODE_STICKY_AUTO_DISABLE_ENABLED = 13991 "low_power_sticky_auto_disable_enabled"; 13992 13993 /** 13994 * Battery level [1-100] at which low power mode automatically turns on. 13995 * If 0, it will not automatically turn on. For Q and newer, it will only automatically 13996 * turn on if the value is greater than 0 and the {@link #AUTOMATIC_POWER_SAVE_MODE} 13997 * setting is also set to 13998 * {@link android.os.PowerManager.AutoPowerSaveMode#POWER_SAVE_MODE_TRIGGER_PERCENTAGE}. 13999 * @see #AUTOMATIC_POWER_SAVE_MODE 14000 * @see android.os.PowerManager#getPowerSaveModeTrigger() 14001 * @hide 14002 */ 14003 @Readable 14004 public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; 14005 14006 /** 14007 * Whether battery saver is currently set to trigger based on percentage, dynamic power 14008 * savings trigger, or none. See {@link AutoPowerSaveModeTriggers} for 14009 * accepted values. 14010 * 14011 * @hide 14012 */ 14013 @TestApi 14014 @Readable 14015 public static final String AUTOMATIC_POWER_SAVE_MODE = "automatic_power_save_mode"; 14016 14017 /** 14018 * The setting that backs the disable threshold for the setPowerSavingsWarning api in 14019 * PowerManager 14020 * 14021 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 14022 * @hide 14023 */ 14024 @TestApi 14025 @Readable 14026 public static final String DYNAMIC_POWER_SAVINGS_DISABLE_THRESHOLD = 14027 "dynamic_power_savings_disable_threshold"; 14028 14029 /** 14030 * The setting which backs the setDynamicPowerSaveHint api in PowerManager. 14031 * 14032 * @see android.os.PowerManager#setDynamicPowerSaveHint(boolean, int) 14033 * @hide 14034 */ 14035 @TestApi 14036 @Readable 14037 public static final String DYNAMIC_POWER_SAVINGS_ENABLED = "dynamic_power_savings_enabled"; 14038 14039 /** 14040 * A long value indicating how much longer the system battery is estimated to last in 14041 * millis. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value 14042 * was updated. 14043 * 14044 * @deprecated Use {@link PowerManager#getBatteryDischargePrediction()} instead. 14045 * @hide 14046 */ 14047 @Deprecated 14048 @Readable 14049 public static final String TIME_REMAINING_ESTIMATE_MILLIS = 14050 "time_remaining_estimate_millis"; 14051 14052 /** 14053 * A boolean indicating whether {@link #TIME_REMAINING_ESTIMATE_MILLIS} is customized 14054 * to the device's usage or using global models. See 14055 * {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} for the last time this value was updated. 14056 * 14057 * @deprecated Use {@link PowerManager#isBatteryDischargePredictionPersonalized()} instead. 14058 * 14059 * @hide 14060 */ 14061 @Deprecated 14062 @Readable 14063 public static final String TIME_REMAINING_ESTIMATE_BASED_ON_USAGE = 14064 "time_remaining_estimate_based_on_usage"; 14065 14066 /** 14067 * A long value indicating how long the system battery takes to deplete from 100% to 0% on 14068 * average based on historical drain rates. See {@link #BATTERY_ESTIMATES_LAST_UPDATE_TIME} 14069 * for the last time this value was updated. 14070 * 14071 * @deprecated Use {@link PowerManager#getHistoricalDischargeTime()} instead. 14072 * @hide 14073 */ 14074 @Deprecated 14075 @Readable 14076 public static final String AVERAGE_TIME_TO_DISCHARGE = "average_time_to_discharge"; 14077 14078 /** 14079 * A long indicating the epoch time in milliseconds when 14080 * {@link #TIME_REMAINING_ESTIMATE_MILLIS}, {@link #TIME_REMAINING_ESTIMATE_BASED_ON_USAGE}, 14081 * and {@link #AVERAGE_TIME_TO_DISCHARGE} were last updated. 14082 * 14083 * @hide 14084 * @deprecated No longer needed due to {@link PowerManager#getBatteryDischargePrediction}. 14085 */ 14086 @Deprecated 14087 @Readable 14088 public static final String BATTERY_ESTIMATES_LAST_UPDATE_TIME = 14089 "battery_estimates_last_update_time"; 14090 14091 /** 14092 * The max value for {@link #LOW_POWER_MODE_TRIGGER_LEVEL}. If this setting is not set 14093 * or the value is 0, the default max will be used. 14094 * 14095 * @hide 14096 */ 14097 @Readable 14098 public static final String LOW_POWER_MODE_TRIGGER_LEVEL_MAX = "low_power_trigger_level_max"; 14099 14100 /** 14101 * See com.android.settingslib.fuelgauge.BatterySaverUtils. 14102 * @hide 14103 */ 14104 @Readable 14105 public static final String LOW_POWER_MODE_SUGGESTION_PARAMS = 14106 "low_power_mode_suggestion_params"; 14107 14108 /** 14109 * If not 0, the activity manager will aggressively finish activities and 14110 * processes as soon as they are no longer needed. If 0, the normal 14111 * extended lifetime is used. 14112 */ 14113 @Readable 14114 public static final String ALWAYS_FINISH_ACTIVITIES = "always_finish_activities"; 14115 14116 /** 14117 * If nonzero, all system error dialogs will be hidden. For example, the 14118 * crash and ANR dialogs will not be shown, and the system will just proceed 14119 * as if they had been accepted by the user. 14120 * @hide 14121 */ 14122 @TestApi 14123 @Readable 14124 public static final String HIDE_ERROR_DIALOGS = "hide_error_dialogs"; 14125 14126 /** 14127 * Use Dock audio output for media: 14128 * 0 = disabled 14129 * 1 = enabled 14130 * @hide 14131 */ 14132 @Readable 14133 public static final String DOCK_AUDIO_MEDIA_ENABLED = "dock_audio_media_enabled"; 14134 14135 /** 14136 * The surround sound formats AC3, DTS or IEC61937 are 14137 * available for use if they are detected. 14138 * This is the default mode. 14139 * 14140 * Note that AUTO is equivalent to ALWAYS for Android TVs and other 14141 * devices that have an S/PDIF output. This is because S/PDIF 14142 * is unidirectional and the TV cannot know if a decoder is 14143 * connected. So it assumes they are always available. 14144 * @hide 14145 */ 14146 public static final int ENCODED_SURROUND_OUTPUT_AUTO = 0; 14147 14148 /** 14149 * AC3, DTS or IEC61937 are NEVER available, even if they 14150 * are detected by the hardware. Those formats will not be 14151 * reported. 14152 * 14153 * An example use case would be an AVR reports that it is capable of 14154 * surround sound decoding but is broken. If NEVER is chosen 14155 * then apps must use PCM output instead of encoded output. 14156 * @hide 14157 */ 14158 public static final int ENCODED_SURROUND_OUTPUT_NEVER = 1; 14159 14160 /** 14161 * AC3, DTS or IEC61937 are ALWAYS available, even if they 14162 * are not detected by the hardware. Those formats will be 14163 * reported as part of the HDMI output capability. Applications 14164 * are then free to use either PCM or encoded output. 14165 * 14166 * An example use case would be a when TV was connected over 14167 * TOS-link to an AVR. But the TV could not see it because TOS-link 14168 * is unidirectional. 14169 * @hide 14170 */ 14171 public static final int ENCODED_SURROUND_OUTPUT_ALWAYS = 2; 14172 14173 /** 14174 * Surround sound formats are available according to the choice 14175 * of user, even if they are not detected by the hardware. Those 14176 * formats will be reported as part of the HDMI output capability. 14177 * Applications are then free to use either PCM or encoded output. 14178 * 14179 * An example use case would be an AVR that doesn't report a surround 14180 * format while the user knows the AVR does support it. 14181 * @hide 14182 */ 14183 public static final int ENCODED_SURROUND_OUTPUT_MANUAL = 3; 14184 14185 /** 14186 * The maximum value for surround sound output mode in Android S. 14187 * @hide 14188 */ 14189 public static final int ENCODED_SURROUND_SC_MAX = ENCODED_SURROUND_OUTPUT_MANUAL; 14190 14191 /** 14192 * Set to ENCODED_SURROUND_OUTPUT_AUTO, 14193 * ENCODED_SURROUND_OUTPUT_NEVER, 14194 * ENCODED_SURROUND_OUTPUT_ALWAYS or 14195 * ENCODED_SURROUND_OUTPUT_MANUAL 14196 * @hide 14197 */ 14198 @Readable 14199 public static final String ENCODED_SURROUND_OUTPUT = "encoded_surround_output"; 14200 14201 /** 14202 * Surround sounds formats that are enabled when ENCODED_SURROUND_OUTPUT is set to 14203 * ENCODED_SURROUND_OUTPUT_MANUAL. Encoded as comma separated list. Allowed values 14204 * are the format constants defined in AudioFormat.java. Ex: 14205 * 14206 * "5,6" 14207 * 14208 * @hide 14209 */ 14210 @Readable 14211 public static final String ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS = 14212 "encoded_surround_output_enabled_formats"; 14213 14214 /** 14215 * Persisted safe headphone volume management state by AudioService 14216 * @hide 14217 */ 14218 @Readable 14219 public static final String AUDIO_SAFE_VOLUME_STATE = "audio_safe_volume_state"; 14220 14221 /** 14222 * URL for tzinfo (time zone) updates 14223 * @hide 14224 */ 14225 @Readable 14226 public static final String TZINFO_UPDATE_CONTENT_URL = "tzinfo_content_url"; 14227 14228 /** 14229 * URL for tzinfo (time zone) update metadata 14230 * @hide 14231 */ 14232 @Readable 14233 public static final String TZINFO_UPDATE_METADATA_URL = "tzinfo_metadata_url"; 14234 14235 /** 14236 * URL for selinux (mandatory access control) updates 14237 * @hide 14238 */ 14239 @Readable 14240 public static final String SELINUX_UPDATE_CONTENT_URL = "selinux_content_url"; 14241 14242 /** 14243 * URL for selinux (mandatory access control) update metadata 14244 * @hide 14245 */ 14246 @Readable 14247 public static final String SELINUX_UPDATE_METADATA_URL = "selinux_metadata_url"; 14248 14249 /** 14250 * URL for sms short code updates 14251 * @hide 14252 */ 14253 @Readable 14254 public static final String SMS_SHORT_CODES_UPDATE_CONTENT_URL = 14255 "sms_short_codes_content_url"; 14256 14257 /** 14258 * URL for sms short code update metadata 14259 * @hide 14260 */ 14261 @Readable 14262 public static final String SMS_SHORT_CODES_UPDATE_METADATA_URL = 14263 "sms_short_codes_metadata_url"; 14264 14265 /** 14266 * URL for apn_db updates 14267 * @hide 14268 */ 14269 @Readable 14270 public static final String APN_DB_UPDATE_CONTENT_URL = "apn_db_content_url"; 14271 14272 /** 14273 * URL for apn_db update metadata 14274 * @hide 14275 */ 14276 @Readable 14277 public static final String APN_DB_UPDATE_METADATA_URL = "apn_db_metadata_url"; 14278 14279 /** 14280 * URL for cert pinlist updates 14281 * @hide 14282 */ 14283 @Readable 14284 public static final String CERT_PIN_UPDATE_CONTENT_URL = "cert_pin_content_url"; 14285 14286 /** 14287 * URL for cert pinlist updates 14288 * @hide 14289 */ 14290 @Readable 14291 public static final String CERT_PIN_UPDATE_METADATA_URL = "cert_pin_metadata_url"; 14292 14293 /** 14294 * URL for intent firewall updates 14295 * @hide 14296 */ 14297 @Readable 14298 public static final String INTENT_FIREWALL_UPDATE_CONTENT_URL = 14299 "intent_firewall_content_url"; 14300 14301 /** 14302 * URL for intent firewall update metadata 14303 * @hide 14304 */ 14305 @Readable 14306 public static final String INTENT_FIREWALL_UPDATE_METADATA_URL = 14307 "intent_firewall_metadata_url"; 14308 14309 /** 14310 * URL for lang id model updates 14311 * @hide 14312 */ 14313 @Readable 14314 public static final String LANG_ID_UPDATE_CONTENT_URL = "lang_id_content_url"; 14315 14316 /** 14317 * URL for lang id model update metadata 14318 * @hide 14319 */ 14320 @Readable 14321 public static final String LANG_ID_UPDATE_METADATA_URL = "lang_id_metadata_url"; 14322 14323 /** 14324 * URL for smart selection model updates 14325 * @hide 14326 */ 14327 @Readable 14328 public static final String SMART_SELECTION_UPDATE_CONTENT_URL = 14329 "smart_selection_content_url"; 14330 14331 /** 14332 * URL for smart selection model update metadata 14333 * @hide 14334 */ 14335 @Readable 14336 public static final String SMART_SELECTION_UPDATE_METADATA_URL = 14337 "smart_selection_metadata_url"; 14338 14339 /** 14340 * URL for conversation actions model updates 14341 * @hide 14342 */ 14343 @Readable 14344 public static final String CONVERSATION_ACTIONS_UPDATE_CONTENT_URL = 14345 "conversation_actions_content_url"; 14346 14347 /** 14348 * URL for conversation actions model update metadata 14349 * @hide 14350 */ 14351 @Readable 14352 public static final String CONVERSATION_ACTIONS_UPDATE_METADATA_URL = 14353 "conversation_actions_metadata_url"; 14354 14355 /** 14356 * SELinux enforcement status. If 0, permissive; if 1, enforcing. 14357 * @hide 14358 */ 14359 @Readable 14360 public static final String SELINUX_STATUS = "selinux_status"; 14361 14362 /** 14363 * Developer setting to force RTL layout. 14364 * @hide 14365 */ 14366 @Readable 14367 public static final String DEVELOPMENT_FORCE_RTL = "debug.force_rtl"; 14368 14369 /** 14370 * Milliseconds after screen-off after which low battery sounds will be silenced. 14371 * 14372 * If zero, battery sounds will always play. 14373 * Defaults to @integer/def_low_battery_sound_timeout in SettingsProvider. 14374 * 14375 * @hide 14376 */ 14377 @Readable 14378 public static final String LOW_BATTERY_SOUND_TIMEOUT = "low_battery_sound_timeout"; 14379 14380 /** 14381 * Milliseconds to wait before bouncing Wi-Fi after settings is restored. Note that after 14382 * the caller is done with this, they should call {@link ContentResolver#delete} to 14383 * clean up any value that they may have written. 14384 * 14385 * @hide 14386 */ 14387 @Readable 14388 public static final String WIFI_BOUNCE_DELAY_OVERRIDE_MS = "wifi_bounce_delay_override_ms"; 14389 14390 /** 14391 * Defines global runtime overrides to window policy. 14392 * 14393 * See {@link com.android.server.wm.PolicyControl} for value format. 14394 * 14395 * @hide 14396 */ 14397 @Readable 14398 public static final String POLICY_CONTROL = "policy_control"; 14399 14400 /** 14401 * {@link android.view.DisplayCutout DisplayCutout} emulation mode. 14402 * 14403 * @hide 14404 */ 14405 @Readable 14406 public static final String EMULATE_DISPLAY_CUTOUT = "emulate_display_cutout"; 14407 14408 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_OFF = 0; 14409 /** @hide */ public static final int EMULATE_DISPLAY_CUTOUT_ON = 1; 14410 14411 /** 14412 * A colon separated list of keys for Settings Slices. 14413 * 14414 * @hide 14415 */ 14416 @Readable 14417 public static final String BLOCKED_SLICES = "blocked_slices"; 14418 14419 /** 14420 * Defines global zen mode. ZEN_MODE_OFF, ZEN_MODE_IMPORTANT_INTERRUPTIONS, 14421 * or ZEN_MODE_NO_INTERRUPTIONS. 14422 * 14423 * @hide 14424 */ 14425 @UnsupportedAppUsage 14426 @Readable 14427 public static final String ZEN_MODE = "zen_mode"; 14428 14429 /** @hide */ 14430 @UnsupportedAppUsage 14431 public static final int ZEN_MODE_OFF = 0; 14432 /** @hide */ 14433 @UnsupportedAppUsage 14434 public static final int ZEN_MODE_IMPORTANT_INTERRUPTIONS = 1; 14435 /** @hide */ 14436 @UnsupportedAppUsage 14437 public static final int ZEN_MODE_NO_INTERRUPTIONS = 2; 14438 /** @hide */ 14439 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14440 public static final int ZEN_MODE_ALARMS = 3; 14441 14442 /** 14443 * A comma-separated list of HDR formats that have been disabled by the user. 14444 * <p> 14445 * If present, these formats will not be reported to apps, even if the display supports 14446 * them. This list is treated as empty if the ARE_USER_DISABLED_HDR_FORMATS_ALLOWED setting 14447 * is '1'. 14448 * </p> 14449 * @hide 14450 */ 14451 @TestApi 14452 @Readable 14453 @SuppressLint("NoSettingsProvider") 14454 public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats"; 14455 14456 /** 14457 * Whether or not user-disabled HDR formats are allowed. 14458 * <p> 14459 * The value is boolean (1 or 0). The value '1' means the user preference for disabling a 14460 * format is ignored, and the disabled formats are still reported to apps (if supported 14461 * by the display). The value '0' means the user-disabled formats are not reported to 14462 * apps, even if the display supports them. 14463 * </p><p> 14464 * The list of formats disabled by the user are contained in the 14465 * USER_DISABLED_HDR_FORMATS setting. This list is treated as empty when the value of 14466 * this setting is '1'. 14467 * </p> 14468 * @hide 14469 */ 14470 @TestApi 14471 @Readable 14472 @SuppressLint("NoSettingsProvider") 14473 public static final String ARE_USER_DISABLED_HDR_FORMATS_ALLOWED = 14474 "are_user_disabled_hdr_formats_allowed"; 14475 14476 /** 14477 * Whether or not syncs (bulk set operations) for {@link DeviceConfig} are disabled 14478 * currently. The value is boolean (1 or 0). The value '1' means that {@link 14479 * DeviceConfig#setProperties(DeviceConfig.Properties)} will return {@code false}. 14480 * 14481 * @hide 14482 */ 14483 public static final String DEVICE_CONFIG_SYNC_DISABLED = "device_config_sync_disabled"; 14484 zenModeToString(int mode)14485 /** @hide */ public static String zenModeToString(int mode) { 14486 if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS"; 14487 if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS"; 14488 if (mode == ZEN_MODE_NO_INTERRUPTIONS) return "ZEN_MODE_NO_INTERRUPTIONS"; 14489 return "ZEN_MODE_OFF"; 14490 } 14491 isValidZenMode(int value)14492 /** @hide */ public static boolean isValidZenMode(int value) { 14493 switch (value) { 14494 case Global.ZEN_MODE_OFF: 14495 case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: 14496 case Global.ZEN_MODE_ALARMS: 14497 case Global.ZEN_MODE_NO_INTERRUPTIONS: 14498 return true; 14499 default: 14500 return false; 14501 } 14502 } 14503 14504 /** 14505 * Value of the ringer before entering zen mode. 14506 * 14507 * @hide 14508 */ 14509 @Readable 14510 public static final String ZEN_MODE_RINGER_LEVEL = "zen_mode_ringer_level"; 14511 14512 /** 14513 * Opaque value, changes when persisted zen mode configuration changes. 14514 * 14515 * @hide 14516 */ 14517 @UnsupportedAppUsage 14518 @Readable 14519 public static final String ZEN_MODE_CONFIG_ETAG = "zen_mode_config_etag"; 14520 14521 /** 14522 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION} instead 14523 * @hide 14524 */ 14525 @Deprecated 14526 public static final String ZEN_DURATION = "zen_duration"; 14527 14528 /** 14529 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_PROMPT} instead 14530 * @hide 14531 */ 14532 @Deprecated 14533 public static final int ZEN_DURATION_PROMPT = -1; 14534 14535 /** 14536 * @deprecated Use {@link android.provider.Settings.Secure#ZEN_DURATION_FOREVER} instead 14537 * @hide 14538 */ 14539 @Deprecated 14540 public static final int ZEN_DURATION_FOREVER = 0; 14541 14542 /** 14543 * Defines global heads up toggle. One of HEADS_UP_OFF, HEADS_UP_ON. 14544 * 14545 * @hide 14546 */ 14547 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14548 @Readable 14549 public static final String HEADS_UP_NOTIFICATIONS_ENABLED = 14550 "heads_up_notifications_enabled"; 14551 14552 /** @hide */ 14553 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14554 public static final int HEADS_UP_OFF = 0; 14555 /** @hide */ 14556 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 14557 public static final int HEADS_UP_ON = 1; 14558 14559 /** 14560 * The name of the device 14561 */ 14562 @Readable 14563 public static final String DEVICE_NAME = "device_name"; 14564 14565 /** 14566 * Whether the NetworkScoringService has been first initialized. 14567 * <p> 14568 * Type: int (0 for false, 1 for true) 14569 * @hide 14570 */ 14571 @Readable 14572 public static final String NETWORK_SCORING_PROVISIONED = "network_scoring_provisioned"; 14573 14574 /** 14575 * Indicates whether the user wants to be prompted for password to decrypt the device on 14576 * boot. This only matters if the storage is encrypted. 14577 * <p> 14578 * Type: int (0 for false, 1 for true) 14579 * 14580 * @hide 14581 */ 14582 @SystemApi 14583 @Readable 14584 public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; 14585 14586 /** 14587 * Whether the Volte is enabled. If this setting is not set then we use the Carrier Config 14588 * value 14589 * {@link android.telephony.CarrierConfigManager#KEY_ENHANCED_4G_LTE_ON_BY_DEFAULT_BOOL}. 14590 * <p> 14591 * Type: int (0 for false, 1 for true) 14592 * @hide 14593 * @deprecated Use 14594 * {@link android.provider.Telephony.SimInfo#COLUMN_ENHANCED_4G_MODE_ENABLED} instead. 14595 */ 14596 @Deprecated 14597 @Readable 14598 public static final String ENHANCED_4G_MODE_ENABLED = 14599 Telephony.SimInfo.COLUMN_ENHANCED_4G_MODE_ENABLED; 14600 14601 /** 14602 * Whether VT (Video Telephony over IMS) is enabled 14603 * <p> 14604 * Type: int (0 for false, 1 for true) 14605 * 14606 * @hide 14607 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_VT_IMS_ENABLED} instead. 14608 */ 14609 @Deprecated 14610 @Readable 14611 public static final String VT_IMS_ENABLED = Telephony.SimInfo.COLUMN_VT_IMS_ENABLED; 14612 14613 /** 14614 * Whether WFC is enabled 14615 * <p> 14616 * Type: int (0 for false, 1 for true) 14617 * 14618 * @hide 14619 * @deprecated Use 14620 * {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ENABLED} instead. 14621 */ 14622 @Deprecated 14623 @Readable 14624 public static final String WFC_IMS_ENABLED = Telephony.SimInfo.COLUMN_WFC_IMS_ENABLED; 14625 14626 /** 14627 * WFC mode on home/non-roaming network. 14628 * <p> 14629 * Type: int - 2=Wi-Fi preferred, 1=Cellular preferred, 0=Wi-Fi only 14630 * 14631 * @hide 14632 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_MODE} instead. 14633 */ 14634 @Deprecated 14635 @Readable 14636 public static final String WFC_IMS_MODE = Telephony.SimInfo.COLUMN_WFC_IMS_MODE; 14637 14638 /** 14639 * WFC mode on roaming network. 14640 * <p> 14641 * Type: int - see {@link #WFC_IMS_MODE} for values 14642 * 14643 * @hide 14644 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_MODE} 14645 * instead. 14646 */ 14647 @Deprecated 14648 @Readable 14649 public static final String WFC_IMS_ROAMING_MODE = 14650 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_MODE; 14651 14652 /** 14653 * Whether WFC roaming is enabled 14654 * <p> 14655 * Type: int (0 for false, 1 for true) 14656 * 14657 * @hide 14658 * @deprecated Use {@link android.provider.Telephony.SimInfo#COLUMN_WFC_IMS_ROAMING_ENABLED} 14659 * instead 14660 */ 14661 @Deprecated 14662 @Readable 14663 public static final String WFC_IMS_ROAMING_ENABLED = 14664 Telephony.SimInfo.COLUMN_WFC_IMS_ROAMING_ENABLED; 14665 14666 /** 14667 * Whether user can enable/disable LTE as a preferred network. A carrier might control 14668 * this via gservices, OMA-DM, carrier app, etc. 14669 * <p> 14670 * Type: int (0 for false, 1 for true) 14671 * @hide 14672 */ 14673 @Readable 14674 public static final String LTE_SERVICE_FORCED = "lte_service_forced"; 14675 14676 14677 /** 14678 * Specifies the behaviour the lid triggers when closed 14679 * <p> 14680 * See WindowManagerPolicy.WindowManagerFuncs 14681 * @hide 14682 */ 14683 @Readable 14684 public static final String LID_BEHAVIOR = "lid_behavior"; 14685 14686 /** 14687 * Ephemeral app cookie max size in bytes. 14688 * <p> 14689 * Type: int 14690 * @hide 14691 */ 14692 @Readable 14693 public static final String EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 14694 "ephemeral_cookie_max_size_bytes"; 14695 14696 /** 14697 * Toggle to enable/disable the entire ephemeral feature. By default, ephemeral is 14698 * enabled. Set to zero to disable. 14699 * <p> 14700 * Type: int (0 for false, 1 for true) 14701 * 14702 * @hide 14703 */ 14704 @Readable 14705 public static final String ENABLE_EPHEMERAL_FEATURE = "enable_ephemeral_feature"; 14706 14707 /** 14708 * Toggle to enable/disable dexopt for instant applications. The default is for dexopt 14709 * to be disabled. 14710 * <p> 14711 * Type: int (0 to disable, 1 to enable) 14712 * 14713 * @hide 14714 */ 14715 @Readable 14716 public static final String INSTANT_APP_DEXOPT_ENABLED = "instant_app_dexopt_enabled"; 14717 14718 /** 14719 * The min period for caching installed instant apps in milliseconds. 14720 * <p> 14721 * Type: long 14722 * @hide 14723 */ 14724 @Readable 14725 public static final String INSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 14726 "installed_instant_app_min_cache_period"; 14727 14728 /** 14729 * The max period for caching installed instant apps in milliseconds. 14730 * <p> 14731 * Type: long 14732 * @hide 14733 */ 14734 @Readable 14735 public static final String INSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 14736 "installed_instant_app_max_cache_period"; 14737 14738 /** 14739 * The min period for caching uninstalled instant apps in milliseconds. 14740 * <p> 14741 * Type: long 14742 * @hide 14743 */ 14744 @Readable 14745 public static final String UNINSTALLED_INSTANT_APP_MIN_CACHE_PERIOD = 14746 "uninstalled_instant_app_min_cache_period"; 14747 14748 /** 14749 * The max period for caching uninstalled instant apps in milliseconds. 14750 * <p> 14751 * Type: long 14752 * @hide 14753 */ 14754 @Readable 14755 public static final String UNINSTALLED_INSTANT_APP_MAX_CACHE_PERIOD = 14756 "uninstalled_instant_app_max_cache_period"; 14757 14758 /** 14759 * The min period for caching unused static shared libs in milliseconds. 14760 * <p> 14761 * Type: long 14762 * @hide 14763 */ 14764 @Readable 14765 public static final String UNUSED_STATIC_SHARED_LIB_MIN_CACHE_PERIOD = 14766 "unused_static_shared_lib_min_cache_period"; 14767 14768 /** 14769 * Allows switching users when system user is locked. 14770 * <p> 14771 * Type: int 14772 * @hide 14773 */ 14774 @Readable 14775 public static final String ALLOW_USER_SWITCHING_WHEN_SYSTEM_USER_LOCKED = 14776 "allow_user_switching_when_system_user_locked"; 14777 14778 /** 14779 * Boot count since the device starts running API level 24. 14780 * <p> 14781 * Type: int 14782 */ 14783 @Readable 14784 public static final String BOOT_COUNT = "boot_count"; 14785 14786 /** 14787 * Whether the safe boot is disallowed. 14788 * 14789 * <p>This setting should have the identical value as the corresponding user restriction. 14790 * The purpose of the setting is to make the restriction available in early boot stages 14791 * before the user restrictions are loaded. 14792 * @hide 14793 */ 14794 @Readable 14795 public static final String SAFE_BOOT_DISALLOWED = "safe_boot_disallowed"; 14796 14797 /** 14798 * Indicates whether this device is currently in retail demo mode. If true, the device 14799 * usage is severely limited. 14800 * <p> 14801 * Type: int (0 for false, 1 for true) 14802 * 14803 * @hide 14804 */ 14805 @SystemApi 14806 @Readable 14807 public static final String DEVICE_DEMO_MODE = "device_demo_mode"; 14808 14809 /** 14810 * Indicates the maximum time that an app is blocked for the network rules to get updated. 14811 * 14812 * Type: long 14813 * 14814 * @hide 14815 */ 14816 @Readable 14817 public static final String NETWORK_ACCESS_TIMEOUT_MS = "network_access_timeout_ms"; 14818 14819 /** 14820 * The reason for the settings database being downgraded. This is only for 14821 * troubleshooting purposes and its value should not be interpreted in any way. 14822 * 14823 * Type: string 14824 * 14825 * @hide 14826 */ 14827 @Readable 14828 public static final String DATABASE_DOWNGRADE_REASON = "database_downgrade_reason"; 14829 14830 /** 14831 * The build id of when the settings database was first created (or re-created due it 14832 * being missing). 14833 * 14834 * Type: string 14835 * 14836 * @hide 14837 */ 14838 @Readable 14839 public static final String DATABASE_CREATION_BUILDID = "database_creation_buildid"; 14840 14841 /** 14842 * Flag to toggle journal mode WAL on or off for the contacts database. WAL is enabled by 14843 * default. Set to 0 to disable. 14844 * 14845 * @hide 14846 */ 14847 @Readable 14848 public static final String CONTACTS_DATABASE_WAL_ENABLED = "contacts_database_wal_enabled"; 14849 14850 /** 14851 * Flag to enable the link to location permissions in location setting. Set to 0 to disable. 14852 * 14853 * @hide 14854 */ 14855 @Readable 14856 public static final String LOCATION_SETTINGS_LINK_TO_PERMISSIONS_ENABLED = 14857 "location_settings_link_to_permissions_enabled"; 14858 14859 /** 14860 * Flag to set the waiting time for removing invisible euicc profiles inside System > 14861 * Settings. 14862 * Type: long 14863 * 14864 * @hide 14865 */ 14866 @Readable 14867 public static final String EUICC_REMOVING_INVISIBLE_PROFILES_TIMEOUT_MILLIS = 14868 "euicc_removing_invisible_profiles_timeout_millis"; 14869 14870 /** 14871 * Flag to set the waiting time for euicc factory reset inside System > Settings 14872 * Type: long 14873 * 14874 * @hide 14875 */ 14876 @Readable 14877 public static final String EUICC_FACTORY_RESET_TIMEOUT_MILLIS = 14878 "euicc_factory_reset_timeout_millis"; 14879 14880 /** 14881 * Flag to set the waiting time for euicc slot switch. 14882 * Type: long 14883 * 14884 * @hide 14885 */ 14886 public static final String EUICC_SWITCH_SLOT_TIMEOUT_MILLIS = 14887 "euicc_switch_slot_timeout_millis"; 14888 14889 /** 14890 * Flag to set the waiting time for enabling multi SIM slot. 14891 * Type: long 14892 * 14893 * @hide 14894 */ 14895 public static final String ENABLE_MULTI_SLOT_TIMEOUT_MILLIS = 14896 "enable_multi_slot_timeout_millis"; 14897 14898 /** 14899 * Flag to set the timeout for when to refresh the storage settings cached data. 14900 * Type: long 14901 * 14902 * @hide 14903 */ 14904 @Readable 14905 public static final String STORAGE_SETTINGS_CLOBBER_THRESHOLD = 14906 "storage_settings_clobber_threshold"; 14907 14908 /** 14909 * If set to 1, SettingsProvider's restoreAnyVersion="true" attribute will be ignored 14910 * and restoring to lower version of platform API will be skipped. 14911 * 14912 * @hide 14913 */ 14914 @Readable 14915 public static final String OVERRIDE_SETTINGS_PROVIDER_RESTORE_ANY_VERSION = 14916 "override_settings_provider_restore_any_version"; 14917 /** 14918 * Flag to toggle whether system services report attribution chains when they attribute 14919 * battery use via a {@code WorkSource}. 14920 * 14921 * Type: int (0 to disable, 1 to enable) 14922 * 14923 * @hide 14924 */ 14925 @Readable 14926 public static final String CHAINED_BATTERY_ATTRIBUTION_ENABLED = 14927 "chained_battery_attribution_enabled"; 14928 14929 /** 14930 * Toggle to enable/disable the incremental ADB installation by default. 14931 * If not set, default adb installations are incremental; set to zero to use full ones. 14932 * Note: only ADB uses it, no usages in the Framework code. 14933 * <p> 14934 * Type: int (0 to disable, 1 to enable) 14935 * 14936 * @hide 14937 */ 14938 @Readable 14939 public static final String ENABLE_ADB_INCREMENTAL_INSTALL_DEFAULT = 14940 "enable_adb_incremental_install_default"; 14941 14942 /** 14943 * The packages whitelisted to be run in autofill compatibility mode. The list 14944 * of packages is {@code ":"} colon delimited, and each entry has the name of the 14945 * package and an optional list of url bar resource ids (the list is delimited by 14946 * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited). 14947 * 14948 * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where 14949 * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 } 14950 * have 2 ids {@code url_foo} and {@code url_bas}) would be 14951 * {@code p1[url_bar]:p2:p3[url_foo,url_bas]} 14952 * 14953 * @hide 14954 */ 14955 @SystemApi 14956 @Readable 14957 public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = 14958 "autofill_compat_mode_allowed_packages"; 14959 14960 /** 14961 * Level of autofill logging. 14962 * 14963 * <p>Valid values are 14964 * {@link android.view.autofill.AutofillManager#NO_LOGGING}, 14965 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_DEBUG}, or 14966 * {@link android.view.autofill.AutofillManager#FLAG_ADD_CLIENT_VERBOSE}. 14967 * 14968 * @hide 14969 */ 14970 @Readable 14971 public static final String AUTOFILL_LOGGING_LEVEL = "autofill_logging_level"; 14972 14973 /** 14974 * Maximum number of partitions that can be allowed in an autofill session. 14975 * 14976 * @hide 14977 */ 14978 @Readable 14979 public static final String AUTOFILL_MAX_PARTITIONS_SIZE = "autofill_max_partitions_size"; 14980 14981 /** 14982 * Maximum number of visible datasets in the Autofill dataset picker UI, or {@code 0} to use 14983 * the default value from resources. 14984 * 14985 * @hide 14986 */ 14987 @Readable 14988 public static final String AUTOFILL_MAX_VISIBLE_DATASETS = "autofill_max_visible_datasets"; 14989 14990 /** 14991 * Exemptions to the hidden API blacklist. 14992 * 14993 * @hide 14994 */ 14995 @TestApi 14996 @Readable 14997 public static final String HIDDEN_API_BLACKLIST_EXEMPTIONS = 14998 "hidden_api_blacklist_exemptions"; 14999 15000 /** 15001 * Hidden API enforcement policy for apps. 15002 * 15003 * Values correspond to @{@link 15004 * android.content.pm.ApplicationInfo.HiddenApiEnforcementPolicy} 15005 * 15006 * @hide 15007 */ 15008 @TestApi 15009 @Readable 15010 public static final String HIDDEN_API_POLICY = "hidden_api_policy"; 15011 15012 /** 15013 * Flag for forcing {@link com.android.server.compat.OverrideValidatorImpl} 15014 * to consider this a non-debuggable build. 15015 * 15016 * @hide 15017 */ 15018 public static final String FORCE_NON_DEBUGGABLE_FINAL_BUILD_FOR_COMPAT = 15019 "force_non_debuggable_final_build_for_compat"; 15020 15021 15022 /** 15023 * Current version of signed configuration applied. 15024 * 15025 * @hide 15026 */ 15027 @Readable 15028 public static final String SIGNED_CONFIG_VERSION = "signed_config_version"; 15029 15030 /** 15031 * Timeout for a single {@link android.media.soundtrigger.SoundTriggerDetectionService} 15032 * operation (in ms). 15033 * 15034 * @hide 15035 */ 15036 @Readable 15037 public static final String SOUND_TRIGGER_DETECTION_SERVICE_OP_TIMEOUT = 15038 "sound_trigger_detection_service_op_timeout"; 15039 15040 /** 15041 * Maximum number of {@link android.media.soundtrigger.SoundTriggerDetectionService} 15042 * operations per day. 15043 * 15044 * @hide 15045 */ 15046 @Readable 15047 public static final String MAX_SOUND_TRIGGER_DETECTION_SERVICE_OPS_PER_DAY = 15048 "max_sound_trigger_detection_service_ops_per_day"; 15049 15050 /** 15051 * Indicates whether aware is available in the current location. 15052 * @hide 15053 */ 15054 @Readable 15055 public static final String AWARE_ALLOWED = "aware_allowed"; 15056 15057 /** 15058 * Overrides internal R.integer.config_longPressOnPowerBehavior. 15059 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 15060 * Used by PhoneWindowManager. 15061 * @hide 15062 */ 15063 @Readable 15064 public static final String POWER_BUTTON_LONG_PRESS = 15065 "power_button_long_press"; 15066 15067 /** 15068 * Override internal R.integer.config_longPressOnPowerDurationMs. It determines the length 15069 * of power button press to be considered a long press in milliseconds. 15070 * Used by PhoneWindowManager. 15071 * @hide 15072 */ 15073 @Readable 15074 public static final String POWER_BUTTON_LONG_PRESS_DURATION_MS = 15075 "power_button_long_press_duration_ms"; 15076 15077 /** 15078 * Overrides internal R.integer.config_veryLongPressOnPowerBehavior. 15079 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 15080 * Used by PhoneWindowManager. 15081 * @hide 15082 */ 15083 @Readable 15084 public static final String POWER_BUTTON_VERY_LONG_PRESS = 15085 "power_button_very_long_press"; 15086 15087 /** 15088 * Overrides internal R.integer.config_keyChordPowerVolumeUp. 15089 * Allowable values detailed in frameworks/base/core/res/res/values/config.xml. 15090 * Used by PhoneWindowManager. 15091 * @hide 15092 */ 15093 @Readable 15094 public static final String KEY_CHORD_POWER_VOLUME_UP = 15095 "key_chord_power_volume_up"; 15096 15097 /** 15098 * Keyguard should be on the left hand side of the screen, for wide screen layouts. 15099 * 15100 * @hide 15101 */ 15102 public static final int ONE_HANDED_KEYGUARD_SIDE_LEFT = 0; 15103 15104 /** 15105 * Keyguard should be on the right hand side of the screen, for wide screen layouts. 15106 * 15107 * @hide 15108 */ 15109 public static final int ONE_HANDED_KEYGUARD_SIDE_RIGHT = 1; 15110 /** 15111 * In one handed mode, which side the keyguard should be on. Allowable values are one of 15112 * the ONE_HANDED_KEYGUARD_SIDE_* constants. 15113 * 15114 * @hide 15115 */ 15116 public static final String ONE_HANDED_KEYGUARD_SIDE = "one_handed_keyguard_side"; 15117 15118 /** 15119 * Keys we no longer back up under the current schema, but want to continue to 15120 * process when restoring historical backup datasets. 15121 * 15122 * All settings in {@link LEGACY_RESTORE_SETTINGS} array *must* have a non-null validator, 15123 * otherwise they won't be restored. 15124 * 15125 * @hide 15126 */ 15127 public static final String[] LEGACY_RESTORE_SETTINGS = { 15128 }; 15129 15130 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 15131 private static final ContentProviderHolder sProviderHolder = 15132 new ContentProviderHolder(CONTENT_URI); 15133 15134 // Populated lazily, guarded by class object: 15135 @UnsupportedAppUsage 15136 private static final NameValueCache sNameValueCache = new NameValueCache( 15137 CONTENT_URI, 15138 CALL_METHOD_GET_GLOBAL, 15139 CALL_METHOD_PUT_GLOBAL, 15140 sProviderHolder, 15141 Global.class); 15142 15143 // Certain settings have been moved from global to the per-user secure namespace 15144 @UnsupportedAppUsage 15145 private static final HashSet<String> MOVED_TO_SECURE; 15146 static { 15147 MOVED_TO_SECURE = new HashSet<>(8); 15148 MOVED_TO_SECURE.add(Global.INSTALL_NON_MARKET_APPS); 15149 MOVED_TO_SECURE.add(Global.ZEN_DURATION); 15150 MOVED_TO_SECURE.add(Global.SHOW_ZEN_UPGRADE_NOTIFICATION); 15151 MOVED_TO_SECURE.add(Global.SHOW_ZEN_SETTINGS_SUGGESTION); 15152 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_UPDATED); 15153 MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED); 15154 MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED); 15155 MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED); 15156 MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES); 15157 } 15158 15159 /** @hide */ getMovedToSecureSettings(Set<String> outKeySet)15160 public static void getMovedToSecureSettings(Set<String> outKeySet) { 15161 outKeySet.addAll(MOVED_TO_SECURE); 15162 } 15163 15164 /** @hide */ clearProviderForTest()15165 public static void clearProviderForTest() { 15166 sProviderHolder.clearProviderForTest(); 15167 sNameValueCache.clearGenerationTrackerForTest(); 15168 } 15169 15170 /** @hide */ getPublicSettings(Set<String> allKeys, Set<String> readableKeys, ArrayMap<String, Integer> readableKeysWithMaxTargetSdk)15171 public static void getPublicSettings(Set<String> allKeys, Set<String> readableKeys, 15172 ArrayMap<String, Integer> readableKeysWithMaxTargetSdk) { 15173 getPublicSettingsForClass(Global.class, allKeys, readableKeys, 15174 readableKeysWithMaxTargetSdk); 15175 } 15176 15177 /** 15178 * Look up a name in the database. 15179 * @param resolver to access the database with 15180 * @param name to look up in the table 15181 * @return the corresponding value, or null if not present 15182 */ getString(ContentResolver resolver, String name)15183 public static String getString(ContentResolver resolver, String name) { 15184 return getStringForUser(resolver, name, resolver.getUserId()); 15185 } 15186 15187 /** @hide */ 15188 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) getStringForUser(ContentResolver resolver, String name, int userHandle)15189 public static String getStringForUser(ContentResolver resolver, String name, 15190 int userHandle) { 15191 if (MOVED_TO_SECURE.contains(name)) { 15192 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 15193 + " to android.provider.Settings.Secure, returning read-only value."); 15194 return Secure.getStringForUser(resolver, name, userHandle); 15195 } 15196 return sNameValueCache.getStringForUser(resolver, name, userHandle); 15197 } 15198 15199 /** 15200 * Store a name/value pair into the database. 15201 * @param resolver to access the database with 15202 * @param name to store 15203 * @param value to associate with the name 15204 * @return true if the value was set, false on database errors 15205 */ putString(ContentResolver resolver, String name, String value)15206 public static boolean putString(ContentResolver resolver, 15207 String name, String value) { 15208 return putStringForUser(resolver, name, value, null, false, resolver.getUserId(), 15209 DEFAULT_OVERRIDEABLE_BY_RESTORE); 15210 } 15211 15212 /** 15213 * Store a name/value pair into the database. 15214 * 15215 * @param resolver to access the database with 15216 * @param name to store 15217 * @param value to associate with the name 15218 * @param tag to associated with the setting. 15219 * @param makeDefault whether to make the value the default one. 15220 * @param overrideableByRestore whether restore can override this value 15221 * @return true if the value was set, false on database errors 15222 * 15223 * @hide 15224 */ 15225 @RequiresPermission(Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, boolean overrideableByRestore)15226 public static boolean putString(@NonNull ContentResolver resolver, 15227 @NonNull String name, @Nullable String value, @Nullable String tag, 15228 boolean makeDefault, boolean overrideableByRestore) { 15229 return putStringForUser(resolver, name, value, tag, makeDefault, 15230 resolver.getUserId(), overrideableByRestore); 15231 } 15232 15233 /** 15234 * Store a name/value pair into the database. 15235 * <p> 15236 * The method takes an optional tag to associate with the setting 15237 * which can be used to clear only settings made by your package and 15238 * associated with this tag by passing the tag to {@link 15239 * #resetToDefaults(ContentResolver, String)}. Anyone can override 15240 * the current tag. Also if another package changes the setting 15241 * then the tag will be set to the one specified in the set call 15242 * which can be null. Also any of the settings setters that do not 15243 * take a tag as an argument effectively clears the tag. 15244 * </p><p> 15245 * For example, if you set settings A and B with tags T1 and T2 and 15246 * another app changes setting A (potentially to the same value), it 15247 * can assign to it a tag T3 (note that now the package that changed 15248 * the setting is not yours). Now if you reset your changes for T1 and 15249 * T2 only setting B will be reset and A not (as it was changed by 15250 * another package) but since A did not change you are in the desired 15251 * initial state. Now if the other app changes the value of A (assuming 15252 * you registered an observer in the beginning) you would detect that 15253 * the setting was changed by another app and handle this appropriately 15254 * (ignore, set back to some value, etc). 15255 * </p><p> 15256 * Also the method takes an argument whether to make the value the 15257 * default for this setting. If the system already specified a default 15258 * value, then the one passed in here will <strong>not</strong> 15259 * be set as the default. 15260 * </p> 15261 * 15262 * @param resolver to access the database with. 15263 * @param name to store. 15264 * @param value to associate with the name. 15265 * @param tag to associated with the setting. 15266 * @param makeDefault whether to make the value the default one. 15267 * @return true if the value was set, false on database errors. 15268 * 15269 * @see #resetToDefaults(ContentResolver, String) 15270 * 15271 * @hide 15272 */ 15273 @SystemApi 15274 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) putString(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault)15275 public static boolean putString(@NonNull ContentResolver resolver, 15276 @NonNull String name, @Nullable String value, @Nullable String tag, 15277 boolean makeDefault) { 15278 return putStringForUser(resolver, name, value, tag, makeDefault, 15279 resolver.getUserId(), DEFAULT_OVERRIDEABLE_BY_RESTORE); 15280 } 15281 15282 /** 15283 * Reset the settings to their defaults. This would reset <strong>only</strong> 15284 * settings set by the caller's package. Think of it of a way to undo your own 15285 * changes to the secure settings. Passing in the optional tag will reset only 15286 * settings changed by your package and associated with this tag. 15287 * 15288 * @param resolver Handle to the content resolver. 15289 * @param tag Optional tag which should be associated with the settings to reset. 15290 * 15291 * @see #putString(ContentResolver, String, String, String, boolean) 15292 * 15293 * @hide 15294 */ 15295 @SystemApi 15296 @RequiresPermission(Manifest.permission.WRITE_SECURE_SETTINGS) resetToDefaults(@onNull ContentResolver resolver, @Nullable String tag)15297 public static void resetToDefaults(@NonNull ContentResolver resolver, 15298 @Nullable String tag) { 15299 resetToDefaultsAsUser(resolver, tag, RESET_MODE_PACKAGE_DEFAULTS, 15300 resolver.getUserId()); 15301 } 15302 15303 /** 15304 * Reset the settings to their defaults for a given user with a specific mode. The 15305 * optional tag argument is valid only for {@link #RESET_MODE_PACKAGE_DEFAULTS} 15306 * allowing resetting the settings made by a package and associated with the tag. 15307 * 15308 * @param resolver Handle to the content resolver. 15309 * @param tag Optional tag which should be associated with the settings to reset. 15310 * @param mode The reset mode. 15311 * @param userHandle The user for which to reset to defaults. 15312 * 15313 * @see #RESET_MODE_PACKAGE_DEFAULTS 15314 * @see #RESET_MODE_UNTRUSTED_DEFAULTS 15315 * @see #RESET_MODE_UNTRUSTED_CHANGES 15316 * @see #RESET_MODE_TRUSTED_DEFAULTS 15317 * 15318 * @hide 15319 */ resetToDefaultsAsUser(@onNull ContentResolver resolver, @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle)15320 public static void resetToDefaultsAsUser(@NonNull ContentResolver resolver, 15321 @Nullable String tag, @ResetMode int mode, @IntRange(from = 0) int userHandle) { 15322 try { 15323 Bundle arg = new Bundle(); 15324 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 15325 if (tag != null) { 15326 arg.putString(CALL_METHOD_TAG_KEY, tag); 15327 } 15328 arg.putInt(CALL_METHOD_RESET_MODE_KEY, mode); 15329 IContentProvider cp = sProviderHolder.getProvider(resolver); 15330 cp.call(resolver.getAttributionSource(), 15331 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_GLOBAL, null, arg); 15332 } catch (RemoteException e) { 15333 Log.w(TAG, "Can't reset do defaults for " + CONTENT_URI, e); 15334 } 15335 } 15336 15337 /** @hide */ 15338 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) putStringForUser(ContentResolver resolver, String name, String value, int userHandle)15339 public static boolean putStringForUser(ContentResolver resolver, 15340 String name, String value, int userHandle) { 15341 return putStringForUser(resolver, name, value, null, false, userHandle, 15342 DEFAULT_OVERRIDEABLE_BY_RESTORE); 15343 } 15344 15345 /** @hide */ putStringForUser(@onNull ContentResolver resolver, @NonNull String name, @Nullable String value, @Nullable String tag, boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore)15346 public static boolean putStringForUser(@NonNull ContentResolver resolver, 15347 @NonNull String name, @Nullable String value, @Nullable String tag, 15348 boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore) { 15349 if (LOCAL_LOGV) { 15350 Log.v(TAG, "Global.putString(name=" + name + ", value=" + value 15351 + " for " + userHandle); 15352 } 15353 // Global and Secure have the same access policy so we can forward writes 15354 if (MOVED_TO_SECURE.contains(name)) { 15355 Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Global" 15356 + " to android.provider.Settings.Secure, value is unchanged."); 15357 return Secure.putStringForUser(resolver, name, value, tag, 15358 makeDefault, userHandle, overrideableByRestore); 15359 } 15360 return sNameValueCache.putStringForUser(resolver, name, value, tag, 15361 makeDefault, userHandle, overrideableByRestore); 15362 } 15363 15364 /** 15365 * Construct the content URI for a particular name/value pair, 15366 * useful for monitoring changes with a ContentObserver. 15367 * @param name to look up in the table 15368 * @return the corresponding content URI, or null if not present 15369 */ getUriFor(String name)15370 public static Uri getUriFor(String name) { 15371 return getUriFor(CONTENT_URI, name); 15372 } 15373 15374 /** 15375 * Convenience function for retrieving a single secure settings value 15376 * as an integer. Note that internally setting values are always 15377 * stored as strings; this function converts the string to an integer 15378 * for you. The default value will be returned if the setting is 15379 * not defined or not an integer. 15380 * 15381 * @param cr The ContentResolver to access. 15382 * @param name The name of the setting to retrieve. 15383 * @param def Value to return if the setting is not defined. 15384 * 15385 * @return The setting's current value, or 'def' if it is not defined 15386 * or not a valid integer. 15387 */ getInt(ContentResolver cr, String name, int def)15388 public static int getInt(ContentResolver cr, String name, int def) { 15389 String v = getString(cr, name); 15390 try { 15391 return v != null ? Integer.parseInt(v) : def; 15392 } catch (NumberFormatException e) { 15393 return def; 15394 } 15395 } 15396 15397 /** 15398 * Convenience function for retrieving a single secure settings value 15399 * as an integer. Note that internally setting values are always 15400 * stored as strings; this function converts the string to an integer 15401 * for you. 15402 * <p> 15403 * This version does not take a default value. If the setting has not 15404 * been set, or the string value is not a number, 15405 * it throws {@link SettingNotFoundException}. 15406 * 15407 * @param cr The ContentResolver to access. 15408 * @param name The name of the setting to retrieve. 15409 * 15410 * @throws SettingNotFoundException Thrown if a setting by the given 15411 * name can't be found or the setting value is not an integer. 15412 * 15413 * @return The setting's current value. 15414 */ getInt(ContentResolver cr, String name)15415 public static int getInt(ContentResolver cr, String name) 15416 throws SettingNotFoundException { 15417 String v = getString(cr, name); 15418 try { 15419 return Integer.parseInt(v); 15420 } catch (NumberFormatException e) { 15421 throw new SettingNotFoundException(name); 15422 } 15423 } 15424 15425 /** 15426 * Convenience function for updating a single settings value as an 15427 * integer. This will either create a new entry in the table if the 15428 * given name does not exist, or modify the value of the existing row 15429 * with that name. Note that internally setting values are always 15430 * stored as strings, so this function converts the given value to a 15431 * string before storing it. 15432 * 15433 * @param cr The ContentResolver to access. 15434 * @param name The name of the setting to modify. 15435 * @param value The new value for the setting. 15436 * @return true if the value was set, false on database errors 15437 */ putInt(ContentResolver cr, String name, int value)15438 public static boolean putInt(ContentResolver cr, String name, int value) { 15439 return putString(cr, name, Integer.toString(value)); 15440 } 15441 15442 /** 15443 * Convenience function for retrieving a single secure settings value 15444 * as a {@code long}. Note that internally setting values are always 15445 * stored as strings; this function converts the string to a {@code long} 15446 * for you. The default value will be returned if the setting is 15447 * not defined or not a {@code long}. 15448 * 15449 * @param cr The ContentResolver to access. 15450 * @param name The name of the setting to retrieve. 15451 * @param def Value to return if the setting is not defined. 15452 * 15453 * @return The setting's current value, or 'def' if it is not defined 15454 * or not a valid {@code long}. 15455 */ getLong(ContentResolver cr, String name, long def)15456 public static long getLong(ContentResolver cr, String name, long def) { 15457 String valString = getString(cr, name); 15458 long value; 15459 try { 15460 value = valString != null ? Long.parseLong(valString) : def; 15461 } catch (NumberFormatException e) { 15462 value = def; 15463 } 15464 return value; 15465 } 15466 15467 /** 15468 * Convenience function for retrieving a single secure settings value 15469 * as a {@code long}. Note that internally setting values are always 15470 * stored as strings; this function converts the string to a {@code long} 15471 * for you. 15472 * <p> 15473 * This version does not take a default value. If the setting has not 15474 * been set, or the string value is not a number, 15475 * it throws {@link SettingNotFoundException}. 15476 * 15477 * @param cr The ContentResolver to access. 15478 * @param name The name of the setting to retrieve. 15479 * 15480 * @return The setting's current value. 15481 * @throws SettingNotFoundException Thrown if a setting by the given 15482 * name can't be found or the setting value is not an integer. 15483 */ getLong(ContentResolver cr, String name)15484 public static long getLong(ContentResolver cr, String name) 15485 throws SettingNotFoundException { 15486 String valString = getString(cr, name); 15487 try { 15488 return Long.parseLong(valString); 15489 } catch (NumberFormatException e) { 15490 throw new SettingNotFoundException(name); 15491 } 15492 } 15493 15494 /** 15495 * Convenience function for updating a secure settings value as a long 15496 * integer. This will either create a new entry in the table if the 15497 * given name does not exist, or modify the value of the existing row 15498 * with that name. Note that internally setting values are always 15499 * stored as strings, so this function converts the given value to a 15500 * string before storing it. 15501 * 15502 * @param cr The ContentResolver to access. 15503 * @param name The name of the setting to modify. 15504 * @param value The new value for the setting. 15505 * @return true if the value was set, false on database errors 15506 */ putLong(ContentResolver cr, String name, long value)15507 public static boolean putLong(ContentResolver cr, String name, long value) { 15508 return putString(cr, name, Long.toString(value)); 15509 } 15510 15511 /** 15512 * Convenience function for retrieving a single secure settings value 15513 * as a floating point number. Note that internally setting values are 15514 * always stored as strings; this function converts the string to an 15515 * float for you. The default value will be returned if the setting 15516 * is not defined or not a valid float. 15517 * 15518 * @param cr The ContentResolver to access. 15519 * @param name The name of the setting to retrieve. 15520 * @param def Value to return if the setting is not defined. 15521 * 15522 * @return The setting's current value, or 'def' if it is not defined 15523 * or not a valid float. 15524 */ getFloat(ContentResolver cr, String name, float def)15525 public static float getFloat(ContentResolver cr, String name, float def) { 15526 String v = getString(cr, name); 15527 try { 15528 return v != null ? Float.parseFloat(v) : def; 15529 } catch (NumberFormatException e) { 15530 return def; 15531 } 15532 } 15533 15534 /** 15535 * Convenience function for retrieving a single secure settings value 15536 * as a float. Note that internally setting values are always 15537 * stored as strings; this function converts the string to a float 15538 * for you. 15539 * <p> 15540 * This version does not take a default value. If the setting has not 15541 * been set, or the string value is not a number, 15542 * it throws {@link SettingNotFoundException}. 15543 * 15544 * @param cr The ContentResolver to access. 15545 * @param name The name of the setting to retrieve. 15546 * 15547 * @throws SettingNotFoundException Thrown if a setting by the given 15548 * name can't be found or the setting value is not a float. 15549 * 15550 * @return The setting's current value. 15551 */ getFloat(ContentResolver cr, String name)15552 public static float getFloat(ContentResolver cr, String name) 15553 throws SettingNotFoundException { 15554 String v = getString(cr, name); 15555 if (v == null) { 15556 throw new SettingNotFoundException(name); 15557 } 15558 try { 15559 return Float.parseFloat(v); 15560 } catch (NumberFormatException e) { 15561 throw new SettingNotFoundException(name); 15562 } 15563 } 15564 15565 /** 15566 * Convenience function for updating a single settings value as a 15567 * floating point number. This will either create a new entry in the 15568 * table if the given name does not exist, or modify the value of the 15569 * existing row with that name. Note that internally setting values 15570 * are always stored as strings, so this function converts the given 15571 * value to a string before storing it. 15572 * 15573 * @param cr The ContentResolver to access. 15574 * @param name The name of the setting to modify. 15575 * @param value The new value for the setting. 15576 * @return true if the value was set, false on database errors 15577 */ putFloat(ContentResolver cr, String name, float value)15578 public static boolean putFloat(ContentResolver cr, String name, float value) { 15579 return putString(cr, name, Float.toString(value)); 15580 } 15581 15582 /** 15583 * Subscription Id to be used for voice call on a multi sim device. 15584 * @hide 15585 */ 15586 @Readable 15587 public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; 15588 15589 /** 15590 * Used to provide option to user to select subscription during dial. 15591 * The supported values are 0 = disable or 1 = enable prompt. 15592 * @hide 15593 */ 15594 @UnsupportedAppUsage 15595 @Readable 15596 public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; 15597 15598 /** 15599 * Subscription Id to be used for data call on a multi sim device. 15600 * @hide 15601 */ 15602 @Readable 15603 public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; 15604 15605 /** 15606 * Subscription Id to be used for SMS on a multi sim device. 15607 * @hide 15608 */ 15609 @Readable 15610 public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; 15611 15612 /** 15613 * Used to provide option to user to select subscription during send SMS. 15614 * The value 1 - enable, 0 - disable 15615 * @hide 15616 */ 15617 @Readable 15618 public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; 15619 15620 /** User preferred subscriptions setting. 15621 * This holds the details of the user selected subscription from the card and 15622 * the activation status. Each settings string have the comma separated values 15623 * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index 15624 * @hide 15625 */ 15626 @UnsupportedAppUsage 15627 @Readable 15628 public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", 15629 "user_preferred_sub2","user_preferred_sub3"}; 15630 15631 /** 15632 * Which subscription is enabled for a physical slot. 15633 * @hide 15634 */ 15635 @Readable 15636 public static final String ENABLED_SUBSCRIPTION_FOR_SLOT = "enabled_subscription_for_slot"; 15637 15638 /** 15639 * Whether corresponding logical modem is enabled for a physical slot. 15640 * The value 1 - enable, 0 - disable 15641 * @hide 15642 */ 15643 @Readable 15644 public static final String MODEM_STACK_ENABLED_FOR_SLOT = "modem_stack_enabled_for_slot"; 15645 15646 /** 15647 * Whether to enable new contacts aggregator or not. 15648 * The value 1 - enable, 0 - disable 15649 * @hide 15650 */ 15651 @Readable 15652 public static final String NEW_CONTACT_AGGREGATOR = "new_contact_aggregator"; 15653 15654 /** 15655 * Whether to enable contacts metadata syncing or not 15656 * The value 1 - enable, 0 - disable 15657 * 15658 * @removed 15659 */ 15660 @Deprecated 15661 @Readable 15662 public static final String CONTACT_METADATA_SYNC = "contact_metadata_sync"; 15663 15664 /** 15665 * Whether to enable contacts metadata syncing or not 15666 * The value 1 - enable, 0 - disable 15667 */ 15668 @Readable 15669 public static final String CONTACT_METADATA_SYNC_ENABLED = "contact_metadata_sync_enabled"; 15670 15671 /** 15672 * Whether to enable cellular on boot. 15673 * The value 1 - enable, 0 - disable 15674 * @hide 15675 */ 15676 @Readable 15677 public static final String ENABLE_CELLULAR_ON_BOOT = "enable_cellular_on_boot"; 15678 15679 /** 15680 * The maximum allowed notification enqueue rate in Hertz. 15681 * 15682 * Should be a float, and includes updates only. 15683 * @hide 15684 */ 15685 @Readable 15686 public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate"; 15687 15688 /** 15689 * Displays toasts when an app posts a notification that does not specify a valid channel. 15690 * 15691 * The value 1 - enable, 0 - disable 15692 * @hide 15693 */ 15694 @Readable 15695 public static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS = 15696 "show_notification_channel_warnings"; 15697 15698 /** 15699 * Whether cell is enabled/disabled 15700 * @hide 15701 */ 15702 @Readable 15703 public static final String CELL_ON = "cell_on"; 15704 15705 /** 15706 * Global settings which can be accessed by instant apps. 15707 * @hide 15708 */ 15709 public static final Set<String> INSTANT_APP_SETTINGS = new ArraySet<>(); 15710 static { 15711 INSTANT_APP_SETTINGS.add(WAIT_FOR_DEBUGGER); 15712 INSTANT_APP_SETTINGS.add(DEVICE_PROVISIONED); 15713 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES); 15714 INSTANT_APP_SETTINGS.add(DEVELOPMENT_FORCE_RTL); 15715 INSTANT_APP_SETTINGS.add(EPHEMERAL_COOKIE_MAX_SIZE_BYTES); 15716 INSTANT_APP_SETTINGS.add(AIRPLANE_MODE_ON); 15717 INSTANT_APP_SETTINGS.add(WINDOW_ANIMATION_SCALE); 15718 INSTANT_APP_SETTINGS.add(TRANSITION_ANIMATION_SCALE); 15719 INSTANT_APP_SETTINGS.add(ANIMATOR_DURATION_SCALE); 15720 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES); 15721 INSTANT_APP_SETTINGS.add(DEBUG_VIEW_ATTRIBUTES_APPLICATION_PACKAGE); 15722 INSTANT_APP_SETTINGS.add(WTF_IS_FATAL); 15723 INSTANT_APP_SETTINGS.add(SEND_ACTION_APP_ERROR); 15724 INSTANT_APP_SETTINGS.add(ZEN_MODE); 15725 } 15726 15727 /** 15728 * Whether to show the high temperature warning notification. 15729 * @hide 15730 */ 15731 @Readable 15732 public static final String SHOW_TEMPERATURE_WARNING = "show_temperature_warning"; 15733 15734 /** 15735 * Whether to show the usb high temperature alarm notification. 15736 * @hide 15737 */ 15738 @Readable 15739 public static final String SHOW_USB_TEMPERATURE_ALARM = "show_usb_temperature_alarm"; 15740 15741 /** 15742 * Temperature at which the high temperature warning notification should be shown. 15743 * @hide 15744 */ 15745 @Readable 15746 public static final String WARNING_TEMPERATURE = "warning_temperature"; 15747 15748 /** 15749 * Whether the diskstats logging task is enabled/disabled. 15750 * @hide 15751 */ 15752 @Readable 15753 public static final String ENABLE_DISKSTATS_LOGGING = "enable_diskstats_logging"; 15754 15755 /** 15756 * Whether the cache quota calculation task is enabled/disabled. 15757 * @hide 15758 */ 15759 @Readable 15760 public static final String ENABLE_CACHE_QUOTA_CALCULATION = 15761 "enable_cache_quota_calculation"; 15762 15763 /** 15764 * Whether the Deletion Helper no threshold toggle is available. 15765 * @hide 15766 */ 15767 @Readable 15768 public static final String ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE = 15769 "enable_deletion_helper_no_threshold_toggle"; 15770 15771 /** 15772 * The list of snooze options for notifications 15773 * This is encoded as a key=value list, separated by commas. Ex: 15774 * 15775 * "default=60,options_array=15:30:60:120" 15776 * 15777 * The following keys are supported: 15778 * 15779 * <pre> 15780 * default (int) 15781 * options_array (int[]) 15782 * </pre> 15783 * 15784 * All delays in integer minutes. Array order is respected. 15785 * Options will be used in order up to the maximum allowed by the UI. 15786 * @hide 15787 */ 15788 @Readable 15789 public static final String NOTIFICATION_SNOOZE_OPTIONS = 15790 "notification_snooze_options"; 15791 15792 /** 15793 * When enabled, notifications the notification assistant service has modified will show an 15794 * indicator. When tapped, this indicator will describe the adjustment made and solicit 15795 * feedback. This flag will also add a "automatic" option to the long press menu. 15796 * 15797 * The value 1 - enable, 0 - disable 15798 * @hide 15799 */ 15800 public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled"; 15801 15802 /** 15803 * Settings key for the ratio of notification dismissals to notification views - one of the 15804 * criteria for showing the notification blocking helper. 15805 * 15806 * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive 15807 * the blocking helper will be). 15808 * 15809 * @hide 15810 */ 15811 @Readable 15812 public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT = 15813 "blocking_helper_dismiss_to_view_ratio"; 15814 15815 /** 15816 * Settings key for the longest streak of dismissals - one of the criteria for showing the 15817 * notification blocking helper. 15818 * 15819 * <p>The value is an integer greater than 0. 15820 * 15821 * @hide 15822 */ 15823 @Readable 15824 public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit"; 15825 15826 /** 15827 * Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated 15828 * by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF 15829 * 15830 * Supported keys:<br/> 15831 * <li> 15832 * <ul> {@code legacy_compatibility_wal_enabled} : A {code boolean} flag that determines 15833 * whether or not "compatibility WAL" mode is enabled by default. This is a legacy flag 15834 * and is honoured on Android Q and higher. This flag will be removed in a future release. 15835 * </ul> 15836 * <ul> {@code wal_syncmode} : A {@code String} representing the synchronization mode to use 15837 * when WAL is enabled, either via {@code legacy_compatibility_wal_enabled} or using the 15838 * obsolete {@code compatibility_wal_supported} flag. 15839 * </ul> 15840 * <ul> {@code truncate_size} : A {@code int} flag that specifies the truncate size of the 15841 * WAL journal. 15842 * </ul> 15843 * <ul> {@code compatibility_wal_supported} : A {code boolean} flag that specifies whether 15844 * the legacy "compatibility WAL" mode is enabled by default. This flag is obsolete and is 15845 * only supported on Android Pie. 15846 * </ul> 15847 * </li> 15848 * 15849 * @hide 15850 */ 15851 @Readable 15852 public static final String SQLITE_COMPATIBILITY_WAL_FLAGS = 15853 "sqlite_compatibility_wal_flags"; 15854 15855 /** 15856 * Enable GNSS Raw Measurements Full Tracking? 15857 * 0 = no 15858 * 1 = yes 15859 * @hide 15860 */ 15861 @Readable 15862 public static final String ENABLE_GNSS_RAW_MEAS_FULL_TRACKING = 15863 "enable_gnss_raw_meas_full_tracking"; 15864 15865 /** 15866 * Whether the notification should be ongoing (persistent) when a carrier app install is 15867 * required. 15868 * 15869 * The value is a boolean (1 or 0). 15870 * @hide 15871 */ 15872 @SystemApi 15873 @Readable 15874 public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = 15875 "install_carrier_app_notification_persistent"; 15876 15877 /** 15878 * The amount of time (ms) to hide the install carrier app notification after the user has 15879 * ignored it. After this time passes, the notification will be shown again 15880 * 15881 * The value is a long 15882 * @hide 15883 */ 15884 @SystemApi 15885 @Readable 15886 public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = 15887 "install_carrier_app_notification_sleep_millis"; 15888 15889 /** 15890 * Whether we've enabled zram on this device. Takes effect on 15891 * reboot. The value "1" enables zram; "0" disables it, and 15892 * everything else is unspecified. 15893 * @hide 15894 */ 15895 @Readable 15896 public static final String ZRAM_ENABLED = 15897 "zram_enabled"; 15898 15899 /** 15900 * Whether the app freezer is enabled on this device. 15901 * The value of "enabled" enables the app freezer, "disabled" disables it and 15902 * "device_default" will let the system decide whether to enable the freezer or not 15903 * @hide 15904 */ 15905 @Readable 15906 public static final String CACHED_APPS_FREEZER_ENABLED = "cached_apps_freezer"; 15907 15908 /** 15909 * Configuration flags for smart replies in notifications. 15910 * This is encoded as a key=value list, separated by commas. Ex: 15911 * 15912 * "enabled=1,max_squeeze_remeasure_count=3" 15913 * 15914 * The following keys are supported: 15915 * 15916 * <pre> 15917 * enabled (boolean) 15918 * requires_targeting_p (boolean) 15919 * max_squeeze_remeasure_attempts (int) 15920 * edit_choices_before_sending (boolean) 15921 * show_in_heads_up (boolean) 15922 * min_num_system_generated_replies (int) 15923 * max_num_actions (int) 15924 * </pre> 15925 * @see com.android.systemui.statusbar.policy.SmartReplyConstants 15926 * @hide 15927 */ 15928 @Readable 15929 public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS = 15930 "smart_replies_in_notifications_flags"; 15931 15932 /** 15933 * Configuration flags for the automatic generation of smart replies and smart actions in 15934 * notifications. This is encoded as a key=value list, separated by commas. Ex: 15935 * "generate_replies=false,generate_actions=true". 15936 * 15937 * The following keys are supported: 15938 * 15939 * <pre> 15940 * generate_replies (boolean) 15941 * generate_actions (boolean) 15942 * </pre> 15943 * @hide 15944 */ 15945 @Readable 15946 public static final String SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS = 15947 "smart_suggestions_in_notifications_flags"; 15948 15949 /** 15950 * If nonzero, crashes in foreground processes will bring up a dialog. 15951 * Otherwise, the process will be silently killed. 15952 * @hide 15953 */ 15954 @TestApi 15955 @Readable 15956 @SuppressLint("NoSettingsProvider") 15957 public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog"; 15958 15959 /** 15960 * If nonzero, crash dialogs will show an option to restart the app. 15961 * @hide 15962 */ 15963 @Readable 15964 public static final String SHOW_RESTART_IN_CRASH_DIALOG = "show_restart_in_crash_dialog"; 15965 15966 /** 15967 * If nonzero, crash dialogs will show an option to mute all future crash dialogs for 15968 * this app. 15969 * @hide 15970 */ 15971 @Readable 15972 public static final String SHOW_MUTE_IN_CRASH_DIALOG = "show_mute_in_crash_dialog"; 15973 15974 15975 /** 15976 * If nonzero, will show the zen upgrade notification when the user toggles DND on/off. 15977 * @hide 15978 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_UPGRADE_NOTIFICATION} 15979 */ 15980 @Deprecated 15981 public static final String SHOW_ZEN_UPGRADE_NOTIFICATION = "show_zen_upgrade_notification"; 15982 15983 /** 15984 * If nonzero, will show the zen update settings suggestion. 15985 * @hide 15986 * @deprecated - Use {@link android.provider.Settings.Secure#SHOW_ZEN_SETTINGS_SUGGESTION} 15987 */ 15988 @Deprecated 15989 public static final String SHOW_ZEN_SETTINGS_SUGGESTION = "show_zen_settings_suggestion"; 15990 15991 /** 15992 * If nonzero, zen has not been updated to reflect new changes. 15993 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_UPDATED} 15994 * @hide 15995 */ 15996 @Deprecated 15997 public static final String ZEN_SETTINGS_UPDATED = "zen_settings_updated"; 15998 15999 /** 16000 * If nonzero, zen setting suggestion has been viewed by user 16001 * @hide 16002 * @deprecated - Use {@link android.provider.Settings.Secure#ZEN_SETTINGS_SUGGESTION_VIEWED} 16003 */ 16004 @Deprecated 16005 public static final String ZEN_SETTINGS_SUGGESTION_VIEWED = 16006 "zen_settings_suggestion_viewed"; 16007 16008 /** 16009 * Backup and restore agent timeout parameters. 16010 * These parameters are represented by a comma-delimited key-value list. 16011 * 16012 * The following strings are supported as keys: 16013 * <pre> 16014 * kv_backup_agent_timeout_millis (long) 16015 * full_backup_agent_timeout_millis (long) 16016 * shared_backup_agent_timeout_millis (long) 16017 * restore_agent_timeout_millis (long) 16018 * restore_agent_finished_timeout_millis (long) 16019 * </pre> 16020 * 16021 * They map to milliseconds represented as longs. 16022 * 16023 * Ex: "kv_backup_agent_timeout_millis=30000,full_backup_agent_timeout_millis=300000" 16024 * 16025 * @hide 16026 */ 16027 @Readable 16028 public static final String BACKUP_AGENT_TIMEOUT_PARAMETERS = 16029 "backup_agent_timeout_parameters"; 16030 16031 /** 16032 * Blocklist of GNSS satellites. 16033 * 16034 * This is a list of integers separated by commas to represent pairs of (constellation, 16035 * svid). Thus, the number of integers should be even. 16036 * 16037 * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are 16038 * blocklisted. Note that svid=0 denotes all svids in the constellation are blocklisted. 16039 * 16040 * @hide 16041 */ 16042 public static final String GNSS_SATELLITE_BLOCKLIST = "gnss_satellite_blocklist"; 16043 16044 /** 16045 * Duration of updates in millisecond for GNSS location request from HAL to framework. 16046 * 16047 * If zero, the GNSS location request feature is disabled. 16048 * 16049 * The value is a non-negative long. 16050 * 16051 * @hide 16052 */ 16053 @Readable 16054 public static final String GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS = 16055 "gnss_hal_location_request_duration_millis"; 16056 16057 /** 16058 * Binder call stats settings. 16059 * 16060 * The following strings are supported as keys: 16061 * <pre> 16062 * enabled (boolean) 16063 * detailed_tracking (boolean) 16064 * upload_data (boolean) 16065 * sampling_interval (int) 16066 * </pre> 16067 * 16068 * @hide 16069 */ 16070 @Readable 16071 public static final String BINDER_CALLS_STATS = "binder_calls_stats"; 16072 16073 /** 16074 * Looper stats settings. 16075 * 16076 * The following strings are supported as keys: 16077 * <pre> 16078 * enabled (boolean) 16079 * sampling_interval (int) 16080 * </pre> 16081 * 16082 * @hide 16083 */ 16084 @Readable 16085 public static final String LOOPER_STATS = "looper_stats"; 16086 16087 /** 16088 * Settings for collecting statistics on CPU usage per thread 16089 * 16090 * The following strings are supported as keys: 16091 * <pre> 16092 * num_buckets (int) 16093 * collected_uids (string) 16094 * minimum_total_cpu_usage_millis (int) 16095 * </pre> 16096 * 16097 * @hide 16098 */ 16099 @Readable 16100 public static final String KERNEL_CPU_THREAD_READER = "kernel_cpu_thread_reader"; 16101 16102 /** 16103 * Whether we've enabled native flags health check on this device. Takes effect on 16104 * reboot. The value "1" enables native flags health check; otherwise it's disabled. 16105 * @hide 16106 */ 16107 @Readable 16108 public static final String NATIVE_FLAGS_HEALTH_CHECK_ENABLED = 16109 "native_flags_health_check_enabled"; 16110 16111 /** 16112 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the mode 16113 * in which the historical registry operates. 16114 * 16115 * @hide 16116 */ 16117 @Readable 16118 public static final String APPOP_HISTORY_MODE = "mode"; 16119 16120 /** 16121 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls how long 16122 * is the interval between snapshots in the base case i.e. the most recent 16123 * part of the history. 16124 * 16125 * @hide 16126 */ 16127 @Readable 16128 public static final String APPOP_HISTORY_BASE_INTERVAL_MILLIS = "baseIntervalMillis"; 16129 16130 /** 16131 * Parameter for {@link #APPOP_HISTORY_PARAMETERS} that controls the base 16132 * for the logarithmic step when building app op history. 16133 * 16134 * @hide 16135 */ 16136 @Readable 16137 public static final String APPOP_HISTORY_INTERVAL_MULTIPLIER = "intervalMultiplier"; 16138 16139 /** 16140 * Appop history parameters. These parameters are represented by 16141 * a comma-delimited key-value list. 16142 * 16143 * The following strings are supported as keys: 16144 * <pre> 16145 * mode (int) 16146 * baseIntervalMillis (long) 16147 * intervalMultiplier (int) 16148 * </pre> 16149 * 16150 * Ex: "mode=HISTORICAL_MODE_ENABLED_ACTIVE,baseIntervalMillis=1000,intervalMultiplier=10" 16151 * 16152 * @see #APPOP_HISTORY_MODE 16153 * @see #APPOP_HISTORY_BASE_INTERVAL_MILLIS 16154 * @see #APPOP_HISTORY_INTERVAL_MULTIPLIER 16155 * 16156 * @hide 16157 */ 16158 @Readable 16159 public static final String APPOP_HISTORY_PARAMETERS = 16160 "appop_history_parameters"; 16161 16162 /** 16163 * Auto revoke parameters. These parameters are represented by 16164 * a comma-delimited key-value list. 16165 * 16166 * <pre> 16167 * enabledForPreRApps (bolean) 16168 * unusedThresholdMs (long) 16169 * checkFrequencyMs (long) 16170 * </pre> 16171 * 16172 * Ex: "enabledForPreRApps=false,unusedThresholdMs=7776000000,checkFrequencyMs=1296000000" 16173 * 16174 * @hide 16175 */ 16176 @Readable 16177 public static final String AUTO_REVOKE_PARAMETERS = 16178 "auto_revoke_parameters"; 16179 16180 /** 16181 * Delay for sending ACTION_CHARGING after device is plugged in. 16182 * This is used as an override for constants defined in BatteryStatsImpl for 16183 * ease of experimentation. 16184 * 16185 * @see com.android.internal.os.BatteryStatsImpl.Constants.KEY_BATTERY_CHARGED_DELAY_MS 16186 * @hide 16187 */ 16188 @Readable 16189 public static final String BATTERY_CHARGING_STATE_UPDATE_DELAY = 16190 "battery_charging_state_update_delay"; 16191 16192 /** 16193 * A serialized string of params that will be loaded into a text classifier action model. 16194 * 16195 * @hide 16196 */ 16197 @Readable 16198 public static final String TEXT_CLASSIFIER_ACTION_MODEL_PARAMS = 16199 "text_classifier_action_model_params"; 16200 16201 /** 16202 * The amount of time to suppress "power-off" from the power button after the device has 16203 * woken due to a gesture (lifting the phone). Since users have learned to hit the power 16204 * button immediately when lifting their device, it can cause the device to turn off if a 16205 * gesture has just woken the device. This value tells us the milliseconds to wait after 16206 * a gesture before "power-off" via power-button is functional again. A value of 0 is no 16207 * delay, and reverts to the old behavior. 16208 * 16209 * @hide 16210 */ 16211 @Readable 16212 public static final String POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE = 16213 "power_button_suppression_delay_after_gesture_wake"; 16214 16215 /** 16216 * The usage amount of advanced battery. The value is 0~100. 16217 * 16218 * @hide 16219 */ 16220 @Readable 16221 public static final String ADVANCED_BATTERY_USAGE_AMOUNT = "advanced_battery_usage_amount"; 16222 16223 /** 16224 * For 5G NSA capable devices, determines whether NR tracking indications are on 16225 * when the screen is off. 16226 * 16227 * Values are: 16228 * 0: off - All 5G NSA tracking indications are off when the screen is off. 16229 * 1: extended - All 5G NSA tracking indications are on when the screen is off as long as 16230 * the device is camped on 5G NSA (5G icon is showing in status bar). 16231 * If the device is not camped on 5G NSA, tracking indications are off. 16232 * 2: always on - All 5G NSA tracking indications are on whether the screen is on or off. 16233 * @hide 16234 */ 16235 @Readable 16236 public static final String NR_NSA_TRACKING_SCREEN_OFF_MODE = 16237 "nr_nsa_tracking_screen_off_mode"; 16238 16239 /** 16240 * Whether to show People Space. 16241 * Values are: 16242 * 0: Disabled (default) 16243 * 1: Enabled 16244 * @hide 16245 */ 16246 public static final String SHOW_PEOPLE_SPACE = "show_people_space"; 16247 16248 /** 16249 * Which types of conversation(s) to show in People Space. 16250 * Values are: 16251 * 0: Single user-selected conversation (default) 16252 * 1: Priority conversations only 16253 * 2: All conversations 16254 * @hide 16255 */ 16256 public static final String PEOPLE_SPACE_CONVERSATION_TYPE = 16257 "people_space_conversation_type"; 16258 16259 /** 16260 * Whether to show new notification dismissal. 16261 * Values are: 16262 * 0: Disabled 16263 * 1: Enabled 16264 * @hide 16265 */ 16266 public static final String SHOW_NEW_NOTIF_DISMISS = "show_new_notif_dismiss"; 16267 16268 /** 16269 * Block untrusted touches mode. 16270 * 16271 * Can be one of: 16272 * <ul> 16273 * <li>0 = {@link BlockUntrustedTouchesMode#DISABLED}: Feature is off. 16274 * <li>1 = {@link BlockUntrustedTouchesMode#PERMISSIVE}: Untrusted touches are flagged 16275 * but not blocked 16276 * <li>2 = {@link BlockUntrustedTouchesMode#BLOCK}: Untrusted touches are blocked 16277 * </ul> 16278 * 16279 * @hide 16280 */ 16281 @Readable 16282 public static final String BLOCK_UNTRUSTED_TOUCHES_MODE = "block_untrusted_touches"; 16283 16284 /** 16285 * The maximum allowed obscuring opacity by UID to propagate touches. 16286 * 16287 * For certain window types (eg. SAWs), the decision of honoring {@link LayoutParams 16288 * #FLAG_NOT_TOUCHABLE} or not depends on the combined obscuring opacity of the windows 16289 * above the touch-consuming window. 16290 * 16291 * For a certain UID: 16292 * <ul> 16293 * <li>If it's the same as the UID of the touch-consuming window, allow it to propagate 16294 * the touch. 16295 * <li>Otherwise take all its windows of eligible window types above the touch-consuming 16296 * window, compute their combined obscuring opacity considering that {@code 16297 * opacity(A, B) = 1 - (1 - opacity(A))*(1 - opacity(B))}. If the computed value is 16298 * lesser than or equal to this setting and there are no other windows preventing the 16299 * touch, allow the UID to propagate the touch. 16300 * </ul> 16301 * 16302 * @see android.hardware.input.InputManager#getMaximumObscuringOpacityForTouch() 16303 * @see android.hardware.input.InputManager#setMaximumObscuringOpacityForTouch(float) 16304 * 16305 * @hide 16306 */ 16307 @Readable 16308 public static final String MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH = 16309 "maximum_obscuring_opacity_for_touch"; 16310 16311 /** 16312 * Used to enable / disable the Restricted Networking Mode in which network access is 16313 * restricted to apps holding the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission. 16314 * 16315 * Values are: 16316 * 0: disabled 16317 * 1: enabled 16318 * @hide 16319 */ 16320 public static final String RESTRICTED_NETWORKING_MODE = "restricted_networking_mode"; 16321 } 16322 16323 /** 16324 * Configuration system settings, containing settings which are applied identically for all 16325 * defined users. Only Android can read these and only a specific configuration service can 16326 * write these. 16327 * 16328 * @hide 16329 */ 16330 public static final class Config extends NameValueTable { 16331 16332 /** 16333 * The modes that can be used when disabling syncs to the 'config' settings. 16334 * @hide 16335 */ 16336 @IntDef(prefix = "DISABLE_SYNC_MODE_", 16337 value = { SYNC_DISABLED_MODE_NONE, SYNC_DISABLED_MODE_PERSISTENT, 16338 SYNC_DISABLED_MODE_UNTIL_REBOOT }) 16339 @Retention(RetentionPolicy.SOURCE) 16340 @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE}) 16341 public @interface SyncDisabledMode {} 16342 16343 /** 16344 * Sync is not not disabled. 16345 * 16346 * @hide 16347 */ 16348 public static final int SYNC_DISABLED_MODE_NONE = 0; 16349 16350 /** 16351 * Disabling of Config bulk update / syncing is persistent, i.e. it survives a device 16352 * reboot. 16353 * @hide 16354 */ 16355 public static final int SYNC_DISABLED_MODE_PERSISTENT = 1; 16356 16357 /** 16358 * Disabling of Config bulk update / syncing is not persistent, i.e. it will not survive a 16359 * device reboot. 16360 * @hide 16361 */ 16362 public static final int SYNC_DISABLED_MODE_UNTIL_REBOOT = 2; 16363 16364 private static final ContentProviderHolder sProviderHolder = 16365 new ContentProviderHolder(DeviceConfig.CONTENT_URI); 16366 16367 // Populated lazily, guarded by class object: 16368 private static final NameValueCache sNameValueCache = new NameValueCache( 16369 DeviceConfig.CONTENT_URI, 16370 CALL_METHOD_GET_CONFIG, 16371 CALL_METHOD_PUT_CONFIG, 16372 CALL_METHOD_LIST_CONFIG, 16373 CALL_METHOD_SET_ALL_CONFIG, 16374 sProviderHolder, 16375 Config.class); 16376 16377 /** 16378 * Look up a name in the database. 16379 * @param resolver to access the database with 16380 * @param name to look up in the table 16381 * @return the corresponding value, or null if not present 16382 * 16383 * @hide 16384 */ 16385 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getString(ContentResolver resolver, String name)16386 static String getString(ContentResolver resolver, String name) { 16387 return sNameValueCache.getStringForUser(resolver, name, resolver.getUserId()); 16388 } 16389 16390 /** 16391 * Look up a list of names in the database, within the specified namespace. 16392 * 16393 * @param resolver to access the database with 16394 * @param namespace to which the names belong 16395 * @param names to look up in the table 16396 * @return a non null, but possibly empty, map from name to value for any of the names that 16397 * were found during lookup. 16398 * 16399 * @hide 16400 */ 16401 @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG) getStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull List<String> names)16402 public static Map<String, String> getStrings(@NonNull ContentResolver resolver, 16403 @NonNull String namespace, @NonNull List<String> names) { 16404 List<String> compositeNames = new ArrayList<>(names.size()); 16405 for (String name : names) { 16406 compositeNames.add(createCompositeName(namespace, name)); 16407 } 16408 16409 String prefix = createPrefix(namespace); 16410 ArrayMap<String, String> rawKeyValues = sNameValueCache.getStringsForPrefix( 16411 resolver, prefix, compositeNames); 16412 int size = rawKeyValues.size(); 16413 int substringLength = prefix.length(); 16414 ArrayMap<String, String> keyValues = new ArrayMap<>(size); 16415 for (int i = 0; i < size; ++i) { 16416 keyValues.put(rawKeyValues.keyAt(i).substring(substringLength), 16417 rawKeyValues.valueAt(i)); 16418 } 16419 return keyValues; 16420 } 16421 16422 /** 16423 * Store a name/value pair into the database within the specified namespace. 16424 * <p> 16425 * Also the method takes an argument whether to make the value the default for this setting. 16426 * If the system already specified a default value, then the one passed in here will 16427 * <strong>not</strong> be set as the default. 16428 * </p> 16429 * 16430 * @param resolver to access the database with. 16431 * @param namespace to store the name/value pair in. 16432 * @param name to store. 16433 * @param value to associate with the name. 16434 * @param makeDefault whether to make the value the default one. 16435 * @return true if the value was set, false on database errors. 16436 * 16437 * @see #resetToDefaults(ContentResolver, int, String) 16438 * 16439 * @hide 16440 */ 16441 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) putString(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull String name, @Nullable String value, boolean makeDefault)16442 static boolean putString(@NonNull ContentResolver resolver, @NonNull String namespace, 16443 @NonNull String name, @Nullable String value, boolean makeDefault) { 16444 return sNameValueCache.putStringForUser(resolver, createCompositeName(namespace, name), 16445 value, null, makeDefault, resolver.getUserId(), 16446 DEFAULT_OVERRIDEABLE_BY_RESTORE); 16447 } 16448 16449 /** 16450 * Clear all name/value pairs for the provided namespace and save new name/value pairs in 16451 * their place. 16452 * 16453 * @param resolver to access the database with. 16454 * @param namespace to which the names should be set. 16455 * @param keyValues map of key names (without the prefix) to values. 16456 * @return true if the name/value pairs were set, false if setting was blocked 16457 * 16458 * @hide 16459 */ 16460 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) setStrings(@onNull ContentResolver resolver, @NonNull String namespace, @NonNull Map<String, String> keyValues)16461 public static boolean setStrings(@NonNull ContentResolver resolver, 16462 @NonNull String namespace, @NonNull Map<String, String> keyValues) 16463 throws DeviceConfig.BadConfigException { 16464 HashMap<String, String> compositeKeyValueMap = new HashMap<>(keyValues.keySet().size()); 16465 for (Map.Entry<String, String> entry : keyValues.entrySet()) { 16466 compositeKeyValueMap.put( 16467 createCompositeName(namespace, entry.getKey()), entry.getValue()); 16468 } 16469 int result = sNameValueCache.setStringsForPrefix( 16470 resolver, createPrefix(namespace), compositeKeyValueMap); 16471 if (result == SET_ALL_RESULT_SUCCESS) { 16472 return true; 16473 } else if (result == SET_ALL_RESULT_DISABLED) { 16474 return false; 16475 } 16476 // If can't set given configuration that means it's bad 16477 throw new DeviceConfig.BadConfigException(); 16478 } 16479 16480 /** 16481 * Reset the values to their defaults. 16482 * <p> 16483 * The method accepts an optional prefix parameter. If provided, only pairs with a name that 16484 * starts with the exact prefix will be reset. Otherwise all will be reset. 16485 * 16486 * @param resolver Handle to the content resolver. 16487 * @param resetMode The reset mode to use. 16488 * @param namespace Optionally, to limit which which namespace is reset. 16489 * 16490 * @see #putString(ContentResolver, String, String, String, boolean) 16491 * 16492 * @hide 16493 */ 16494 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) resetToDefaults(@onNull ContentResolver resolver, @ResetMode int resetMode, @Nullable String namespace)16495 static void resetToDefaults(@NonNull ContentResolver resolver, @ResetMode int resetMode, 16496 @Nullable String namespace) { 16497 try { 16498 Bundle arg = new Bundle(); 16499 arg.putInt(CALL_METHOD_USER_KEY, resolver.getUserId()); 16500 arg.putInt(CALL_METHOD_RESET_MODE_KEY, resetMode); 16501 if (namespace != null) { 16502 arg.putString(Settings.CALL_METHOD_PREFIX_KEY, createPrefix(namespace)); 16503 } 16504 IContentProvider cp = sProviderHolder.getProvider(resolver); 16505 cp.call(resolver.getAttributionSource(), 16506 sProviderHolder.mUri.getAuthority(), CALL_METHOD_RESET_CONFIG, null, arg); 16507 } catch (RemoteException e) { 16508 Log.w(TAG, "Can't reset to defaults for " + DeviceConfig.CONTENT_URI, e); 16509 } 16510 } 16511 16512 /** 16513 * Bridge method between {@link DeviceConfig#setSyncDisabled(int)} and the 16514 * {@link com.android.providers.settings.SettingsProvider} implementation. 16515 * 16516 * @hide 16517 */ 16518 @SuppressLint("AndroidFrameworkRequiresPermission") 16519 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) setSyncDisabled( @onNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode)16520 static void setSyncDisabled( 16521 @NonNull ContentResolver resolver, @SyncDisabledMode int disableSyncMode) { 16522 try { 16523 Bundle args = new Bundle(); 16524 args.putInt(CALL_METHOD_SYNC_DISABLED_MODE_KEY, disableSyncMode); 16525 IContentProvider cp = sProviderHolder.getProvider(resolver); 16526 cp.call(resolver.getAttributionSource(), 16527 sProviderHolder.mUri.getAuthority(), CALL_METHOD_SET_SYNC_DISABLED_CONFIG, 16528 null, args); 16529 } catch (RemoteException e) { 16530 Log.w(TAG, "Can't set sync disabled " + DeviceConfig.CONTENT_URI, e); 16531 } 16532 } 16533 16534 /** 16535 * Bridge method between {@link DeviceConfig#isSyncDisabled()} and the 16536 * {@link com.android.providers.settings.SettingsProvider} implementation. 16537 * 16538 * @hide 16539 */ 16540 @SuppressLint("AndroidFrameworkRequiresPermission") 16541 @RequiresPermission(Manifest.permission.WRITE_DEVICE_CONFIG) isSyncDisabled(@onNull ContentResolver resolver)16542 static boolean isSyncDisabled(@NonNull ContentResolver resolver) { 16543 try { 16544 Bundle args = Bundle.EMPTY; 16545 IContentProvider cp = sProviderHolder.getProvider(resolver); 16546 Bundle bundle = cp.call(resolver.getAttributionSource(), 16547 sProviderHolder.mUri.getAuthority(), CALL_METHOD_IS_SYNC_DISABLED_CONFIG, 16548 null, args); 16549 return bundle.getBoolean(KEY_CONFIG_IS_SYNC_DISABLED_RETURN); 16550 } catch (RemoteException e) { 16551 Log.w(TAG, "Can't query sync disabled " + DeviceConfig.CONTENT_URI, e); 16552 } 16553 return false; 16554 } 16555 16556 /** 16557 * Register callback for monitoring Config table. 16558 * 16559 * @param resolver Handle to the content resolver. 16560 * @param callback callback to register 16561 * 16562 * @hide 16563 */ 16564 @RequiresPermission(Manifest.permission.MONITOR_DEVICE_CONFIG_ACCESS) registerMonitorCallback(@onNull ContentResolver resolver, @NonNull RemoteCallback callback)16565 public static void registerMonitorCallback(@NonNull ContentResolver resolver, 16566 @NonNull RemoteCallback callback) { 16567 registerMonitorCallbackAsUser(resolver, resolver.getUserId(), callback); 16568 } 16569 registerMonitorCallbackAsUser( @onNull ContentResolver resolver, @UserIdInt int userHandle, @NonNull RemoteCallback callback)16570 private static void registerMonitorCallbackAsUser( 16571 @NonNull ContentResolver resolver, @UserIdInt int userHandle, 16572 @NonNull RemoteCallback callback) { 16573 try { 16574 Bundle arg = new Bundle(); 16575 arg.putInt(CALL_METHOD_USER_KEY, userHandle); 16576 arg.putParcelable(CALL_METHOD_MONITOR_CALLBACK_KEY, callback); 16577 IContentProvider cp = sProviderHolder.getProvider(resolver); 16578 cp.call(resolver.getAttributionSource(), 16579 sProviderHolder.mUri.getAuthority(), 16580 CALL_METHOD_REGISTER_MONITOR_CALLBACK_CONFIG, null, arg); 16581 } catch (RemoteException e) { 16582 Log.w(TAG, "Can't register config monitor callback", e); 16583 } 16584 } 16585 16586 /** @hide */ clearProviderForTest()16587 public static void clearProviderForTest() { 16588 sProviderHolder.clearProviderForTest(); 16589 sNameValueCache.clearGenerationTrackerForTest(); 16590 } 16591 createCompositeName(@onNull String namespace, @NonNull String name)16592 private static String createCompositeName(@NonNull String namespace, @NonNull String name) { 16593 Preconditions.checkNotNull(namespace); 16594 Preconditions.checkNotNull(name); 16595 return createPrefix(namespace) + name; 16596 } 16597 createPrefix(@onNull String namespace)16598 private static String createPrefix(@NonNull String namespace) { 16599 Preconditions.checkNotNull(namespace); 16600 return namespace + "/"; 16601 } 16602 } 16603 16604 /** 16605 * User-defined bookmarks and shortcuts. The target of each bookmark is an 16606 * Intent URL, allowing it to be either a web page or a particular 16607 * application activity. 16608 * 16609 * @hide 16610 */ 16611 public static final class Bookmarks implements BaseColumns 16612 { 16613 private static final String TAG = "Bookmarks"; 16614 16615 /** 16616 * The content:// style URL for this table 16617 */ 16618 @UnsupportedAppUsage 16619 public static final Uri CONTENT_URI = 16620 Uri.parse("content://" + AUTHORITY + "/bookmarks"); 16621 16622 /** 16623 * The row ID. 16624 * <p>Type: INTEGER</p> 16625 */ 16626 public static final String ID = "_id"; 16627 16628 /** 16629 * Descriptive name of the bookmark that can be displayed to the user. 16630 * If this is empty, the title should be resolved at display time (use 16631 * {@link #getTitle(Context, Cursor)} any time you want to display the 16632 * title of a bookmark.) 16633 * <P> 16634 * Type: TEXT 16635 * </P> 16636 */ 16637 public static final String TITLE = "title"; 16638 16639 /** 16640 * Arbitrary string (displayed to the user) that allows bookmarks to be 16641 * organized into categories. There are some special names for 16642 * standard folders, which all start with '@'. The label displayed for 16643 * the folder changes with the locale (via {@link #getLabelForFolder}) but 16644 * the folder name does not change so you can consistently query for 16645 * the folder regardless of the current locale. 16646 * 16647 * <P>Type: TEXT</P> 16648 * 16649 */ 16650 public static final String FOLDER = "folder"; 16651 16652 /** 16653 * The Intent URL of the bookmark, describing what it points to. This 16654 * value is given to {@link android.content.Intent#getIntent} to create 16655 * an Intent that can be launched. 16656 * <P>Type: TEXT</P> 16657 */ 16658 public static final String INTENT = "intent"; 16659 16660 /** 16661 * Optional shortcut character associated with this bookmark. 16662 * <P>Type: INTEGER</P> 16663 */ 16664 public static final String SHORTCUT = "shortcut"; 16665 16666 /** 16667 * The order in which the bookmark should be displayed 16668 * <P>Type: INTEGER</P> 16669 */ 16670 public static final String ORDERING = "ordering"; 16671 16672 private static final String[] sIntentProjection = { INTENT }; 16673 private static final String[] sShortcutProjection = { ID, SHORTCUT }; 16674 private static final String sShortcutSelection = SHORTCUT + "=?"; 16675 16676 /** 16677 * Convenience function to retrieve the bookmarked Intent for a 16678 * particular shortcut key. 16679 * 16680 * @param cr The ContentResolver to query. 16681 * @param shortcut The shortcut key. 16682 * 16683 * @return Intent The bookmarked URL, or null if there is no bookmark 16684 * matching the given shortcut. 16685 */ getIntentForShortcut(ContentResolver cr, char shortcut)16686 public static Intent getIntentForShortcut(ContentResolver cr, char shortcut) 16687 { 16688 Intent intent = null; 16689 16690 Cursor c = cr.query(CONTENT_URI, 16691 sIntentProjection, sShortcutSelection, 16692 new String[] { String.valueOf((int) shortcut) }, ORDERING); 16693 // Keep trying until we find a valid shortcut 16694 try { 16695 while (intent == null && c.moveToNext()) { 16696 try { 16697 String intentURI = c.getString(c.getColumnIndexOrThrow(INTENT)); 16698 intent = Intent.parseUri(intentURI, 0); 16699 } catch (java.net.URISyntaxException e) { 16700 // The stored URL is bad... ignore it. 16701 } catch (IllegalArgumentException e) { 16702 // Column not found 16703 Log.w(TAG, "Intent column not found", e); 16704 } 16705 } 16706 } finally { 16707 if (c != null) c.close(); 16708 } 16709 16710 return intent; 16711 } 16712 16713 /** 16714 * Add a new bookmark to the system. 16715 * 16716 * @param cr The ContentResolver to query. 16717 * @param intent The desired target of the bookmark. 16718 * @param title Bookmark title that is shown to the user; null if none 16719 * or it should be resolved to the intent's title. 16720 * @param folder Folder in which to place the bookmark; null if none. 16721 * @param shortcut Shortcut that will invoke the bookmark; 0 if none. If 16722 * this is non-zero and there is an existing bookmark entry 16723 * with this same shortcut, then that existing shortcut is 16724 * cleared (the bookmark is not removed). 16725 * @return The unique content URL for the new bookmark entry. 16726 */ 16727 @UnsupportedAppUsage add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)16728 public static Uri add(ContentResolver cr, 16729 Intent intent, 16730 String title, 16731 String folder, 16732 char shortcut, 16733 int ordering) 16734 { 16735 // If a shortcut is supplied, and it is already defined for 16736 // another bookmark, then remove the old definition. 16737 if (shortcut != 0) { 16738 cr.delete(CONTENT_URI, sShortcutSelection, 16739 new String[] { String.valueOf((int) shortcut) }); 16740 } 16741 16742 ContentValues values = new ContentValues(); 16743 if (title != null) values.put(TITLE, title); 16744 if (folder != null) values.put(FOLDER, folder); 16745 values.put(INTENT, intent.toUri(0)); 16746 if (shortcut != 0) values.put(SHORTCUT, (int) shortcut); 16747 values.put(ORDERING, ordering); 16748 return cr.insert(CONTENT_URI, values); 16749 } 16750 16751 /** 16752 * Return the folder name as it should be displayed to the user. This 16753 * takes care of localizing special folders. 16754 * 16755 * @param r Resources object for current locale; only need access to 16756 * system resources. 16757 * @param folder The value found in the {@link #FOLDER} column. 16758 * 16759 * @return CharSequence The label for this folder that should be shown 16760 * to the user. 16761 */ getLabelForFolder(Resources r, String folder)16762 public static CharSequence getLabelForFolder(Resources r, String folder) { 16763 return folder; 16764 } 16765 16766 /** 16767 * Return the title as it should be displayed to the user. This takes 16768 * care of localizing bookmarks that point to activities. 16769 * 16770 * @param context A context. 16771 * @param cursor A cursor pointing to the row whose title should be 16772 * returned. The cursor must contain at least the {@link #TITLE} 16773 * and {@link #INTENT} columns. 16774 * @return A title that is localized and can be displayed to the user, 16775 * or the empty string if one could not be found. 16776 */ getTitle(Context context, Cursor cursor)16777 public static CharSequence getTitle(Context context, Cursor cursor) { 16778 int titleColumn = cursor.getColumnIndex(TITLE); 16779 int intentColumn = cursor.getColumnIndex(INTENT); 16780 if (titleColumn == -1 || intentColumn == -1) { 16781 throw new IllegalArgumentException( 16782 "The cursor must contain the TITLE and INTENT columns."); 16783 } 16784 16785 String title = cursor.getString(titleColumn); 16786 if (!TextUtils.isEmpty(title)) { 16787 return title; 16788 } 16789 16790 String intentUri = cursor.getString(intentColumn); 16791 if (TextUtils.isEmpty(intentUri)) { 16792 return ""; 16793 } 16794 16795 Intent intent; 16796 try { 16797 intent = Intent.parseUri(intentUri, 0); 16798 } catch (URISyntaxException e) { 16799 return ""; 16800 } 16801 16802 PackageManager packageManager = context.getPackageManager(); 16803 ResolveInfo info = packageManager.resolveActivity(intent, 0); 16804 return info != null ? info.loadLabel(packageManager) : ""; 16805 } 16806 } 16807 16808 /** 16809 * <p> 16810 * A Settings panel is floating UI that contains a fixed subset of settings to address a 16811 * particular user problem. For example, the 16812 * {@link #ACTION_INTERNET_CONNECTIVITY Internet Panel} surfaces settings related to 16813 * connecting to the internet. 16814 * <p> 16815 * Settings panels appear above the calling app to address the problem without 16816 * the user needing to open Settings and thus leave their current screen. 16817 */ 16818 public static final class Panel { Panel()16819 private Panel() { 16820 } 16821 16822 /** 16823 * Activity Action: Show a settings dialog containing settings to enable internet 16824 * connection. 16825 * <p> 16826 * Input: Nothing. 16827 * <p> 16828 * Output: Nothing. 16829 */ 16830 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16831 public static final String ACTION_INTERNET_CONNECTIVITY = 16832 "android.settings.panel.action.INTERNET_CONNECTIVITY"; 16833 16834 /** 16835 * Activity Action: Show a settings dialog containing NFC-related settings. 16836 * <p> 16837 * Input: Nothing. 16838 * <p> 16839 * Output: Nothing. 16840 */ 16841 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16842 public static final String ACTION_NFC = 16843 "android.settings.panel.action.NFC"; 16844 16845 /** 16846 * Activity Action: Show a settings dialog containing controls for Wifi. 16847 * <p> 16848 * Input: Nothing. 16849 * <p> 16850 * Output: Nothing. 16851 */ 16852 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16853 public static final String ACTION_WIFI = 16854 "android.settings.panel.action.WIFI"; 16855 16856 /** 16857 * Activity Action: Show a settings dialog containing all volume streams. 16858 * <p> 16859 * Input: Nothing. 16860 * <p> 16861 * Output: Nothing. 16862 */ 16863 @SdkConstant(SdkConstant.SdkConstantType.ACTIVITY_INTENT_ACTION) 16864 public static final String ACTION_VOLUME = 16865 "android.settings.panel.action.VOLUME"; 16866 } 16867 16868 /** 16869 * Activity Action: Show setting page to process the addition of Wi-Fi networks to the user's 16870 * saved network list. The app should send a new intent with an extra that holds a maximum 16871 * of five {@link android.net.wifi.WifiNetworkSuggestion} that specify credentials for the 16872 * networks to be added to the user's database. The Intent should be sent via the 16873 * {@link android.app.Activity#startActivityForResult(Intent, int)} API. 16874 * <p> 16875 * Note: The app sending the Intent to add the credentials doesn't get any ownership over the 16876 * newly added network(s). For the Wi-Fi stack, these networks will look like the user 16877 * manually added them from the Settings UI. 16878 * <p> 16879 * Input: The app should put parcelable array list of 16880 * {@link android.net.wifi.WifiNetworkSuggestion} into the {@link #EXTRA_WIFI_NETWORK_LIST} 16881 * extra. 16882 * <p> 16883 * Output: After {@link android.app.Activity#startActivityForResult(Intent, int)}, the 16884 * callback {@link android.app.Activity#onActivityResult(int, int, Intent)} will have a 16885 * result code {@link android.app.Activity#RESULT_OK} to indicate user pressed the save 16886 * button to save the networks or {@link android.app.Activity#RESULT_CANCELED} to indicate 16887 * that the user rejected the request. Additionally, an integer array list, stored in 16888 * {@link #EXTRA_WIFI_NETWORK_RESULT_LIST}, will indicate the process result of each network. 16889 */ 16890 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16891 public static final String ACTION_WIFI_ADD_NETWORKS = 16892 "android.settings.WIFI_ADD_NETWORKS"; 16893 16894 /** 16895 * A bundle extra of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the list 16896 * of the {@link android.net.wifi.WifiNetworkSuggestion} elements. The maximum count of the 16897 * {@link android.net.wifi.WifiNetworkSuggestion} elements in the list will be five. 16898 * <p> 16899 * For example: 16900 * To provide credentials for one open and one WPA2 networks: 16901 * 16902 * <pre>{@code 16903 * final WifiNetworkSuggestion suggestion1 = 16904 * new WifiNetworkSuggestion.Builder() 16905 * .setSsid("test111111") 16906 * .build(); 16907 * final WifiNetworkSuggestion suggestion2 = 16908 * new WifiNetworkSuggestion.Builder() 16909 * .setSsid("test222222") 16910 * .setWpa2Passphrase("test123456") 16911 * .build(); 16912 * final List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>; 16913 * suggestionsList.add(suggestion1); 16914 * suggestionsList.add(suggestion2); 16915 * Bundle bundle = new Bundle(); 16916 * bundle.putParcelableArrayList(Settings.EXTRA_WIFI_NETWORK_LIST,(ArrayList<? extends 16917 * Parcelable>) suggestionsList); 16918 * final Intent intent = new Intent(Settings.ACTION_WIFI_ADD_NETWORKS); 16919 * intent.putExtras(bundle); 16920 * startActivityForResult(intent, 0); 16921 * }</pre> 16922 */ 16923 public static final String EXTRA_WIFI_NETWORK_LIST = 16924 "android.provider.extra.WIFI_NETWORK_LIST"; 16925 16926 /** 16927 * A bundle extra of the result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that 16928 * indicates the action result of the saved {@link android.net.wifi.WifiNetworkSuggestion}. 16929 * Its value is a list of integers, and all the elements will be 1:1 mapping to the elements 16930 * in {@link #EXTRA_WIFI_NETWORK_LIST}, if user press cancel to cancel the add networks 16931 * request, then its value will be null. 16932 * <p> 16933 * Note: The integer value will be one of the {@link #ADD_WIFI_RESULT_SUCCESS}, 16934 * {@link #ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED}, or {@link #ADD_WIFI_RESULT_ALREADY_EXISTS}}. 16935 */ 16936 public static final String EXTRA_WIFI_NETWORK_RESULT_LIST = 16937 "android.provider.extra.WIFI_NETWORK_RESULT_LIST"; 16938 16939 /** @hide */ 16940 @Retention(RetentionPolicy.SOURCE) 16941 @IntDef(prefix = {"ADD_WIFI_RESULT_"}, value = { 16942 ADD_WIFI_RESULT_SUCCESS, 16943 ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED, 16944 ADD_WIFI_RESULT_ALREADY_EXISTS 16945 }) 16946 public @interface AddWifiResult { 16947 } 16948 16949 /** 16950 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving or updating the 16951 * corresponding Wi-Fi network was successful. 16952 */ 16953 public static final int ADD_WIFI_RESULT_SUCCESS = 0; 16954 16955 /** 16956 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that saving the corresponding 16957 * Wi-Fi network failed. 16958 */ 16959 public static final int ADD_WIFI_RESULT_ADD_OR_UPDATE_FAILED = 1; 16960 16961 /** 16962 * A result of {@link #ACTION_WIFI_ADD_NETWORKS} intent action that indicates the Wi-Fi network 16963 * already exists. 16964 */ 16965 public static final int ADD_WIFI_RESULT_ALREADY_EXISTS = 2; 16966 16967 /** 16968 * Activity Action: Allows user to select current bug report handler. 16969 * <p> 16970 * Input: Nothing. 16971 * <p> 16972 * Output: Nothing. 16973 * 16974 * @hide 16975 */ 16976 @SystemApi 16977 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 16978 public static final String ACTION_BUGREPORT_HANDLER_SETTINGS = 16979 "android.settings.BUGREPORT_HANDLER_SETTINGS"; 16980 16981 private static final String[] PM_WRITE_SETTINGS = { 16982 android.Manifest.permission.WRITE_SETTINGS 16983 }; 16984 private static final String[] PM_CHANGE_NETWORK_STATE = { 16985 android.Manifest.permission.CHANGE_NETWORK_STATE, 16986 android.Manifest.permission.WRITE_SETTINGS 16987 }; 16988 private static final String[] PM_SYSTEM_ALERT_WINDOW = { 16989 android.Manifest.permission.SYSTEM_ALERT_WINDOW 16990 }; 16991 16992 /** 16993 * Activity Action: Show screen for controlling which apps have access to manage external 16994 * storage. 16995 * <p> 16996 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 16997 * <p> 16998 * If you want to control a specific app's access to manage external storage, use 16999 * {@link #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION} instead. 17000 * <p> 17001 * Output: Nothing. 17002 * @see #ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION 17003 */ 17004 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 17005 public static final String ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION = 17006 "android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION"; 17007 17008 /** 17009 * Activity Action: Show screen for controlling if the app specified in the data URI of the 17010 * intent can manage external storage. 17011 * <p> 17012 * Launching the corresponding activity requires the permission 17013 * {@link Manifest.permission#MANAGE_EXTERNAL_STORAGE}. 17014 * <p> 17015 * In some cases, a matching Activity may not exist, so ensure you safeguard against this. 17016 * <p> 17017 * Input: The Intent's data URI MUST specify the application package name whose ability of 17018 * managing external storage you want to control. 17019 * For example "package:com.my.app". 17020 * <p> 17021 * Output: Nothing. 17022 * @see #ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION 17023 */ 17024 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 17025 public static final String ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION = 17026 "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"; 17027 17028 /** 17029 * Activity Action: For system or preinstalled apps to show their {@link Activity} embedded 17030 * in Settings app on large screen devices. 17031 * <p> 17032 * Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI} must be included to 17033 * specify the intent for the activity which will be embedded in Settings app. 17034 * It's an intent URI string from {@code intent.toUri(Intent.URI_INTENT_SCHEME)}. 17035 * 17036 * Input: {@link #EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY} must be included to 17037 * specify a key that indicates the menu item which will be highlighted on settings home menu. 17038 * <p> 17039 * Output: Nothing. 17040 */ 17041 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 17042 public static final String ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY = 17043 "android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY"; 17044 17045 /** 17046 * Activity Extra: Specify the intent for the {@link Activity} which will be embedded in 17047 * Settings app. It's an intent URI string from 17048 * {@code intent.toUri(Intent.URI_INTENT_SCHEME)}. 17049 * <p> 17050 * This must be passed as an extra field to 17051 * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}. 17052 */ 17053 public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI = 17054 "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI"; 17055 17056 /** 17057 * Activity Extra: Specify a key that indicates the menu item which should be highlighted on 17058 * settings home menu. 17059 * <p> 17060 * This must be passed as an extra field to 17061 * {@link #ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY}. 17062 */ 17063 public static final String EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY = 17064 "android.provider.extra.SETTINGS_EMBEDDED_DEEP_LINK_HIGHLIGHT_MENU_KEY"; 17065 17066 /** 17067 * Performs a strict and comprehensive check of whether a calling package is allowed to 17068 * write/modify system settings, as the condition differs for pre-M, M+, and 17069 * privileged/preinstalled apps. If the provided uid does not match the 17070 * callingPackage, a negative result will be returned. 17071 * @hide 17072 */ 17073 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) isCallingPackageAllowedToWriteSettings(Context context, int uid, String callingPackage, boolean throwException)17074 public static boolean isCallingPackageAllowedToWriteSettings(Context context, int uid, 17075 String callingPackage, boolean throwException) { 17076 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 17077 callingPackage, null /*attribution not needed when not making note */, 17078 throwException, AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, 17079 false); 17080 } 17081 17082 /** 17083 * @deprecated Use {@link #checkAndNoteWriteSettingsOperation(Context, int, String, String, 17084 * boolean)} instead. 17085 * 17086 * @hide 17087 */ 17088 @Deprecated 17089 @SystemApi checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, boolean throwException)17090 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, 17091 @NonNull String callingPackage, boolean throwException) { 17092 return checkAndNoteWriteSettingsOperation(context, uid, callingPackage, null, 17093 throwException); 17094 } 17095 17096 /** 17097 * Performs a strict and comprehensive check of whether a calling package is allowed to 17098 * write/modify system settings, as the condition differs for pre-M, M+, and 17099 * privileged/preinstalled apps. If the provided uid does not match the 17100 * callingPackage, a negative result will be returned. The caller is expected to have 17101 * the WRITE_SETTINGS permission declared. 17102 * 17103 * Note: if the check is successful, the operation of this app will be updated to the 17104 * current time. 17105 * @hide 17106 */ 17107 @SystemApi checkAndNoteWriteSettingsOperation(@onNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException)17108 public static boolean checkAndNoteWriteSettingsOperation(@NonNull Context context, int uid, 17109 @NonNull String callingPackage, @Nullable String callingAttributionTag, 17110 boolean throwException) { 17111 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 17112 callingPackage, callingAttributionTag, throwException, 17113 AppOpsManager.OP_WRITE_SETTINGS, PM_WRITE_SETTINGS, true); 17114 } 17115 17116 /** 17117 * Performs a strict and comprehensive check of whether a calling package is allowed to 17118 * draw on top of other apps, as the conditions differs for pre-M, M+, and 17119 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 17120 * a negative result will be returned. 17121 * @hide 17122 */ 17123 @UnsupportedAppUsage isCallingPackageAllowedToDrawOverlays(Context context, int uid, String callingPackage, boolean throwException)17124 public static boolean isCallingPackageAllowedToDrawOverlays(Context context, int uid, 17125 String callingPackage, boolean throwException) { 17126 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 17127 callingPackage, null /*attribution not needed when not making note */, 17128 throwException, AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, 17129 false); 17130 } 17131 17132 /** 17133 * Performs a strict and comprehensive check of whether a calling package is allowed to 17134 * draw on top of other apps, as the conditions differs for pre-M, M+, and 17135 * privileged/preinstalled apps. If the provided uid does not match the callingPackage, 17136 * a negative result will be returned. 17137 * 17138 * Note: if the check is successful, the operation of this app will be updated to the 17139 * current time. 17140 * @hide 17141 */ checkAndNoteDrawOverlaysOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException)17142 public static boolean checkAndNoteDrawOverlaysOperation(Context context, int uid, 17143 String callingPackage, String callingAttributionTag, boolean throwException) { 17144 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 17145 callingPackage, callingAttributionTag, throwException, 17146 AppOpsManager.OP_SYSTEM_ALERT_WINDOW, PM_SYSTEM_ALERT_WINDOW, true); 17147 } 17148 17149 /** 17150 * @deprecated Use {@link #isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context, 17151 * int, String, String, boolean, int, String[], boolean)} instead. 17152 * 17153 * @hide 17154 */ 17155 @Deprecated 17156 @UnsupportedAppUsage isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)17157 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 17158 int uid, String callingPackage, boolean throwException, int appOpsOpCode, 17159 String[] permissions, boolean makeNote) { 17160 return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid, 17161 callingPackage, null, throwException, appOpsOpCode, permissions, makeNote); 17162 } 17163 17164 /** 17165 * Helper method to perform a general and comprehensive check of whether an operation that is 17166 * protected by appops can be performed by a caller or not. e.g. OP_SYSTEM_ALERT_WINDOW and 17167 * OP_WRITE_SETTINGS 17168 * @hide 17169 */ isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, int uid, String callingPackage, String callingAttributionTag, boolean throwException, int appOpsOpCode, String[] permissions, boolean makeNote)17170 public static boolean isCallingPackageAllowedToPerformAppOpsProtectedOperation(Context context, 17171 int uid, String callingPackage, String callingAttributionTag, boolean throwException, 17172 int appOpsOpCode, String[] permissions, boolean makeNote) { 17173 if (callingPackage == null) { 17174 return false; 17175 } 17176 17177 AppOpsManager appOpsMgr = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); 17178 int mode = AppOpsManager.MODE_DEFAULT; 17179 if (makeNote) { 17180 mode = appOpsMgr.noteOpNoThrow(appOpsOpCode, uid, callingPackage, callingAttributionTag, 17181 null); 17182 } else { 17183 mode = appOpsMgr.checkOpNoThrow(appOpsOpCode, uid, callingPackage); 17184 } 17185 17186 switch (mode) { 17187 case AppOpsManager.MODE_ALLOWED: 17188 return true; 17189 17190 case AppOpsManager.MODE_DEFAULT: 17191 // this is the default operating mode after an app's installation 17192 // In this case we will check all associated static permission to see 17193 // if it is granted during install time. 17194 for (String permission : permissions) { 17195 if (context.checkCallingOrSelfPermission(permission) == PackageManager 17196 .PERMISSION_GRANTED) { 17197 // if either of the permissions are granted, we will allow it 17198 return true; 17199 } 17200 } 17201 17202 default: 17203 // this is for all other cases trickled down here... 17204 if (!throwException) { 17205 return false; 17206 } 17207 } 17208 17209 // prepare string to throw SecurityException 17210 StringBuilder exceptionMessage = new StringBuilder(); 17211 exceptionMessage.append(callingPackage); 17212 exceptionMessage.append(" was not granted "); 17213 if (permissions.length > 1) { 17214 exceptionMessage.append(" either of these permissions: "); 17215 } else { 17216 exceptionMessage.append(" this permission: "); 17217 } 17218 for (int i = 0; i < permissions.length; i++) { 17219 exceptionMessage.append(permissions[i]); 17220 exceptionMessage.append((i == permissions.length - 1) ? "." : ", "); 17221 } 17222 17223 throw new SecurityException(exceptionMessage.toString()); 17224 } 17225 17226 /** 17227 * Retrieves a correponding package name for a given uid. It will query all 17228 * packages that are associated with the given uid, but it will return only 17229 * the zeroth result. 17230 * Note: If package could not be found, a null is returned. 17231 * @hide 17232 */ getPackageNameForUid(Context context, int uid)17233 public static String getPackageNameForUid(Context context, int uid) { 17234 String[] packages = context.getPackageManager().getPackagesForUid(uid); 17235 if (packages == null) { 17236 return null; 17237 } 17238 return packages[0]; 17239 } 17240 } 17241